Freeciv-3.3
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/**********************************************************************/
33{
34 self->initialized = FALSE;
35}
36
37/**********************************************************************/
40static void none_audio_stop(void)
41{
42}
43
44/**********************************************************************/
47static void none_audio_wait(void)
48{
49}
50
51/**********************************************************************/
54static 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/**********************************************************************/
67static void none_audio_pause(void)
68{
69}
70
71/**********************************************************************/
74static void none_audio_resume(void)
75{
76}
77
78/**********************************************************************/
81static bool none_audio_init(struct audio_plugin *self)
82{
83 self->initialized = TRUE;
84
85 return TRUE;
86}
87
88/**********************************************************************/
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;
106}
void audio_add_plugin(struct audio_plugin *p)
Definition audio.c:136
void(* audio_finished_callback)(void)
Definition audio.h:28
static void none_audio_resume(void)
Definition audio_none.c:74
static void none_audio_stop(void)
Definition audio_none.c:40
static void none_audio_pause(void)
Definition audio_none.c:67
static void none_audio_wait(void)
Definition audio_none.c:47
void audio_none_init(void)
Definition audio_none.c:91
static void none_audio_shutdown(struct audio_plugin *self)
Definition audio_none.c:32
static bool none_audio_init(struct audio_plugin *self)
Definition audio_none.c:81
static bool none_audio_play(const char *const tag, const char *const fullpath, bool repeat, audio_finished_callback cb)
Definition audio_none.c:54
static struct ai_type * self
Definition classicai.c:46
char * incite_cost
Definition comments.c:76
void sound_bell(void)
Definition gui_main.c:2086
char name[MAX_LEN_NAME]
Definition ai.h:51
#define sz_strlcpy(dest, src)
Definition support.h:195
#define TRUE
Definition support.h:46
#define FALSE
Definition support.h:47