Freeciv-3.2: /fast/freeciv/nightly/S3_2/client/audio_none.c Source File

Freeciv-3.2

Loading...
Searching...
No Matches
audio_none.c
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 2002 - R. Falke
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13
14#ifdef HAVE_CONFIG_H
15#include <fc_config.h>
16#endif
17
18#include <string.h>
19
20/* utility */
21#include "support.h"
22
23/* client */
24#include "audio.h"
25#include "gui_main_g.h"
26
27#include "audio_none.h"
28
29/**********************************************************************/
32 static void none_audio_shutdown(struct audio_plugin *self)
33{
34 self->initialized = FALSE;
35}
36
37/**********************************************************************/
40 static void none_audio_stop(void)
41{
42}
43
44/**********************************************************************/
47 static void none_audio_wait(void)
48{
49}
50
51/**********************************************************************/
54 static bool none_audio_play(const char *const tag, const char *const fullpath,
55 bool repeat, audio_finished_callback cb)
56{
57 if (strcmp(tag, "e_turn_bell") == 0) {
58 sound_bell();
59 return TRUE;
60 }
61 return FALSE;
62}
63
64/**********************************************************************/
67 static void none_audio_pause(void)
68{
69}
70
71/**********************************************************************/
74 static void none_audio_resume(void)
75{
76}
77
78/**********************************************************************/
81 static bool none_audio_init(struct audio_plugin *self)
82{
83 self->initialized = TRUE;
84
85 return TRUE;
86}
87
88/**********************************************************************/
91 void audio_none_init(void)
92{
93 struct audio_plugin self;
94
95 sz_strlcpy(self.name, "none");
96 sz_strlcpy(self.descr, "/dev/null plugin");
97 self.initialized = FALSE;
98 self.init = none_audio_init;
99 self.shutdown = none_audio_shutdown;
100 self.stop = none_audio_stop;
101 self.wait = none_audio_wait;
102 self.play = none_audio_play;
103 self.pause = none_audio_pause;
104 self.resume = none_audio_resume;
105 audio_add_plugin(&self);
106}
audio_add_plugin
void audio_add_plugin(struct audio_plugin *p)
Definition audio.c:136
audio.h
audio_finished_callback
void(* audio_finished_callback)(void)
Definition audio.h:28
none_audio_resume
static void none_audio_resume(void)
Definition audio_none.c:74
none_audio_stop
static void none_audio_stop(void)
Definition audio_none.c:40
none_audio_pause
static void none_audio_pause(void)
Definition audio_none.c:67
none_audio_wait
static void none_audio_wait(void)
Definition audio_none.c:47
audio_none_init
void audio_none_init(void)
Definition audio_none.c:91
none_audio_shutdown
static void none_audio_shutdown(struct audio_plugin *self)
Definition audio_none.c:32
none_audio_init
static bool none_audio_init(struct audio_plugin *self)
Definition audio_none.c:81
none_audio_play
static bool none_audio_play(const char *const tag, const char *const fullpath, bool repeat, audio_finished_callback cb)
Definition audio_none.c:54
audio_none.h
self
static struct ai_type * self
Definition classicai.c:45
incite_cost
char * incite_cost
Definition comments.c:74
sound_bell
void sound_bell(void)
Definition gui_main.c:2107
gui_main_g.h
ai_type::name
char name[MAX_LEN_NAME]
Definition ai.h:51
audio_plugin
Definition audio.h:30
support.h
sz_strlcpy
#define sz_strlcpy(dest, src)
Definition support.h:189
TRUE
#define TRUE
Definition support.h:46
FALSE
#define FALSE
Definition support.h:47