Feature #1780 ยป 0047-Add-audio_is_dummy_plugin.patch
| client/audio.c | ||
|---|---|---|
|
sz_strlcat(buffer, "]");
|
||
|
return buffer;
|
||
|
}
|
||
|
/**********************************************************************//**
|
||
|
Is the currently active plugin dummy one?
|
||
|
**************************************************************************/
|
||
|
bool audio_is_dummy_plugin(void)
|
||
|
{
|
||
|
return plugins[selected_plugin].dummy;
|
||
|
}
|
||
| client/audio.h | ||
|---|---|---|
|
char name[MAX_AUDIO_NAME_LEN];
|
||
|
char descr[MAX_AUDIO_DESCR_LEN];
|
||
|
bool initialized;
|
||
|
bool dummy;
|
||
|
bool (*init) (struct audio_plugin *self);
|
||
|
void (*shutdown) (struct audio_plugin *self);
|
||
|
void (*stop) (void);
|
||
| ... | ... | |
|
bool audio_select_plugin(const char *const name);
|
||
|
const char *audio_get_all_plugin_names(void);
|
||
|
bool audio_is_dummy_plugin(void);
|
||
|
#ifdef __cplusplus
|
||
|
}
|
||
|
#endif /* __cplusplus */
|
||
| client/audio_none.c | ||
|---|---|---|
|
sz_strlcpy(self.name, "none");
|
||
|
sz_strlcpy(self.descr, "/dev/null plugin");
|
||
|
self.initialized = FALSE;
|
||
|
self.dummy = TRUE;
|
||
|
self.init = none_audio_init;
|
||
|
self.shutdown = none_audio_shutdown;
|
||
|
self.stop = none_audio_stop;
|
||
| client/audio_sdl.c | ||
|---|---|---|
|
sz_strlcpy(self.name, "sdl");
|
||
|
sz_strlcpy(self.descr, "Simple DirectMedia Library (SDL) mixer plugin");
|
||
|
self.initialized = FALSE;
|
||
|
self.dummy = FALSE;
|
||
|
self.init = sdl_audio_init;
|
||
|
self.shutdown = sdl_audio_shutdown;
|
||
|
self.stop = sdl_audio_stop;
|
||