Freeciv21
Develop your civilization from humble roots to a global empire
audio_none.cpp
Go to the documentation of this file.
1
/*
2
Copyright (c) 1996-2023 Freeciv21 and Freeciv contributors. This file is
3
part of Freeciv21. Freeciv21 is free software: you can
4
^oo^ redistribute it and/or modify it under the terms of the GNU
5
(..) General Public License as published by the Free Software
6
() () Foundation, either version 3 of the License, or (at your
7
()__() option) any later version. You should have received
8
a copy of the GNU General Public License along with Freeciv21. If not,
9
see https://www.gnu.org/licenses/.
10
*/
11
12
#include "
audio_none.h
"
13
#include "
audio.h
"
14
#include "
qtg_cxxside.h
"
15
#include "
support.h
"
16
20
static
void
none_audio_shutdown
() {}
21
25
static
void
none_audio_stop
() {}
26
30
static
void
none_audio_wait
() {}
31
35
static
bool
none_audio_play
(
const
QString &tag,
const
QString &fullpath,
36
bool
repeat,
audio_finished_callback
cb)
37
{
38
if
(tag == QLatin1String(
"e_turn_bell"
)) {
39
sound_bell
();
40
return
true
;
41
}
42
return
false
;
43
}
44
48
static
bool
none_audio_init
() {
return
true
; }
49
53
void
audio_none_init
()
54
{
55
struct
audio_plugin
self
;
56
57
self
.
name
= QStringLiteral(
"none"
);
58
self
.descr = QStringLiteral(
"/dev/null plugin"
);
59
self
.init =
none_audio_init
;
60
self
.shutdown =
none_audio_shutdown
;
61
self
.stop =
none_audio_stop
;
62
self
.wait =
none_audio_wait
;
63
self
.play =
none_audio_play
;
64
self
.get_volume =
audio_get_volume
;
65
self
.set_volume =
audio_set_volume
;
66
audio_add_plugin
(&
self
);
67
}
audio_set_volume
void audio_set_volume(double volume)
Set sound volume to use.
Definition:
audio.cpp:591
audio_add_plugin
void audio_add_plugin(struct audio_plugin *p)
Add a plugin.
Definition:
audio.cpp:108
audio_get_volume
double audio_get_volume()
Get sound volume currently in use.
Definition:
audio.cpp:586
audio.h
audio_finished_callback
void(* audio_finished_callback)()
Definition:
audio.h:17
none_audio_shutdown
static void none_audio_shutdown()
Clean up.
Definition:
audio_none.cpp:20
none_audio_wait
static void none_audio_wait()
Wait.
Definition:
audio_none.cpp:30
audio_none_init
void audio_none_init()
Initialize.
Definition:
audio_none.cpp:53
none_audio_play
static bool none_audio_play(const QString &tag, const QString &fullpath, bool repeat, audio_finished_callback cb)
Play sound sample.
Definition:
audio_none.cpp:35
none_audio_stop
static void none_audio_stop()
Stop music.
Definition:
audio_none.cpp:25
none_audio_init
static bool none_audio_init()
Initialize.
Definition:
audio_none.cpp:48
audio_none.h
self
static struct ai_type * self
Definition:
classicai.cpp:40
sound_bell
void sound_bell()
Make a bell noise (beep).
Definition:
gui_main.cpp:134
qtg_cxxside.h
ai_type::name
char name[MAX_LEN_NAME]
Definition:
ai.h:43
audio_plugin
Definition:
audio.h:20
support.h
client
audio
audio_none.cpp
Generated by
1.9.1