Freeciv-3.1
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#include "support.h"
21
22#include "audio.h"
23#include "gui_main_g.h"
24
25#include "audio_none.h"
26
27/**********************************************************************/
31{
32 self->initialized = FALSE;
33}
34
35/**********************************************************************/
38static void none_audio_stop(void)
39{
40}
41
42/**********************************************************************/
45static void none_audio_wait(void)
46{
47}
48
49/**********************************************************************/
52static bool none_audio_play(const char *const tag, const char *const fullpath,
53 bool repeat, audio_finished_callback cb)
54{
55 if (strcmp(tag, "e_turn_bell") == 0) {
56 sound_bell();
57 return TRUE;
58 }
59 return FALSE;
60}
61
62/**********************************************************************/
65static bool none_audio_init(struct audio_plugin *self)
66{
67 self->initialized = TRUE;
68
69 return TRUE;
70}
71
72/**********************************************************************/
76{
77 struct audio_plugin self;
78
79 sz_strlcpy(self.name, "none");
80 sz_strlcpy(self.descr, "/dev/null plugin");
81 self.initialized = FALSE;
82 self.init = none_audio_init;
83 self.shutdown = none_audio_shutdown;
84 self.stop = none_audio_stop;
85 self.wait = none_audio_wait;
86 self.play = none_audio_play;
88}
void audio_add_plugin(struct audio_plugin *p)
Definition audio.c:135
void(* audio_finished_callback)(void)
Definition audio.h:27
static void none_audio_stop(void)
Definition audio_none.c:38
static void none_audio_wait(void)
Definition audio_none.c:45
void audio_none_init(void)
Definition audio_none.c:75
static void none_audio_shutdown(struct audio_plugin *self)
Definition audio_none.c:30
static bool none_audio_init(struct audio_plugin *self)
Definition audio_none.c:65
static bool none_audio_play(const char *const tag, const char *const fullpath, bool repeat, audio_finished_callback cb)
Definition audio_none.c:52
static struct ai_type * self
Definition classicai.c:46
void sound_bell(void)
Definition gui_main.c:1891
char name[MAX_LEN_NAME]
Definition ai.h:51
#define sz_strlcpy(dest, src)
Definition support.h:167
#define TRUE
Definition support.h:46
#define FALSE
Definition support.h:47