Freeciv-3.1: /fast/freeciv/nightly/S3_1/client/audio_none.c Source File

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/**********************************************************************/
30 static void none_audio_shutdown(struct audio_plugin *self)
31{
32 self->initialized = FALSE;
33}
34
35/**********************************************************************/
38 static void none_audio_stop(void)
39{
40}
41
42/**********************************************************************/
45 static void none_audio_wait(void)
46{
47}
48
49/**********************************************************************/
52 static 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/**********************************************************************/
65 static bool none_audio_init(struct audio_plugin *self)
66{
67 self->initialized = TRUE;
68
69 return TRUE;
70}
71
72/**********************************************************************/
75 void audio_none_init(void)
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;
87 audio_add_plugin(&self);
88}
audio_add_plugin
void audio_add_plugin(struct audio_plugin *p)
Definition audio.c:135
audio.h
audio_finished_callback
void(* audio_finished_callback)(void)
Definition audio.h:27
none_audio_stop
static void none_audio_stop(void)
Definition audio_none.c:38
none_audio_wait
static void none_audio_wait(void)
Definition audio_none.c:45
audio_none_init
void audio_none_init(void)
Definition audio_none.c:75
none_audio_shutdown
static void none_audio_shutdown(struct audio_plugin *self)
Definition audio_none.c:30
none_audio_init
static bool none_audio_init(struct audio_plugin *self)
Definition audio_none.c:65
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:52
audio_none.h
self
static struct ai_type * self
Definition classicai.c:46
sound_bell
void sound_bell(void)
Definition gui_main.c:1890
gui_main_g.h
ai_type::name
char name[MAX_LEN_NAME]
Definition ai.h:51
audio_plugin
Definition audio.h:29
support.h
sz_strlcpy
#define sz_strlcpy(dest, src)
Definition support.h:161
TRUE
#define TRUE
Definition support.h:46
FALSE
#define FALSE
Definition support.h:47