2012-06-19 22:44:40 +00:00
|
|
|
/* RetroArch - A frontend for libretro.
|
2014-01-01 00:50:59 +00:00
|
|
|
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
2017-01-22 12:40:32 +00:00
|
|
|
* Copyright (C) 2011-2017 - Daniel De Matteis
|
2017-12-12 07:55:31 +00:00
|
|
|
*
|
2012-06-19 22:44:40 +00:00
|
|
|
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
|
|
|
* of the GNU General Public License as published by the Free Software Found-
|
|
|
|
* ation, either version 3 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
|
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE. See the GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with RetroArch.
|
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2015-11-23 18:40:09 +00:00
|
|
|
#include "../audio_driver.h"
|
2015-11-23 18:44:44 +00:00
|
|
|
#include "../../verbosity.h"
|
2012-06-19 22:44:40 +00:00
|
|
|
|
2017-01-09 12:09:14 +00:00
|
|
|
static void *null_audio_init(const char *device, unsigned rate, unsigned latency,
|
2017-01-11 06:25:42 +00:00
|
|
|
unsigned block_frames,
|
2017-01-09 12:09:14 +00:00
|
|
|
unsigned *new_rate)
|
2012-06-19 22:44:40 +00:00
|
|
|
{
|
2015-11-23 18:42:31 +00:00
|
|
|
RARCH_ERR("Using the null audio driver. RetroArch will be silent.");
|
|
|
|
|
2012-06-19 22:44:40 +00:00
|
|
|
(void)device;
|
|
|
|
(void)rate;
|
|
|
|
(void)latency;
|
2017-01-09 12:09:14 +00:00
|
|
|
(void)new_rate;
|
2012-06-19 22:44:40 +00:00
|
|
|
return (void*)-1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void null_audio_free(void *data)
|
|
|
|
{
|
|
|
|
(void)data;
|
|
|
|
}
|
|
|
|
|
2017-04-20 08:15:11 +00:00
|
|
|
static ssize_t null_audio_write(void *data, const void *buf, size_t size)
|
2012-06-19 22:44:40 +00:00
|
|
|
{
|
|
|
|
(void)data;
|
|
|
|
(void)buf;
|
|
|
|
|
|
|
|
return size;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool null_audio_stop(void *data)
|
|
|
|
{
|
|
|
|
(void)data;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2014-10-01 19:42:19 +00:00
|
|
|
static bool null_audio_alive(void *data)
|
|
|
|
{
|
|
|
|
(void)data;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2017-01-22 17:05:07 +00:00
|
|
|
static bool null_audio_start(void *data, bool is_shutdown)
|
2012-06-19 22:44:40 +00:00
|
|
|
{
|
|
|
|
(void)data;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void null_audio_set_nonblock_state(void *data, bool state)
|
|
|
|
{
|
|
|
|
(void)data;
|
|
|
|
(void)state;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool null_audio_use_float(void *data)
|
|
|
|
{
|
|
|
|
(void)data;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2015-03-24 07:05:19 +00:00
|
|
|
static size_t null_audio_write_avail(void *data)
|
|
|
|
{
|
|
|
|
(void)data;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2014-09-11 05:06:20 +00:00
|
|
|
audio_driver_t audio_null = {
|
2012-06-19 22:44:40 +00:00
|
|
|
null_audio_init,
|
|
|
|
null_audio_write,
|
|
|
|
null_audio_stop,
|
|
|
|
null_audio_start,
|
2014-10-01 19:42:19 +00:00
|
|
|
null_audio_alive,
|
2012-06-19 22:44:40 +00:00
|
|
|
null_audio_set_nonblock_state,
|
|
|
|
null_audio_free,
|
|
|
|
null_audio_use_float,
|
|
|
|
"null",
|
2016-04-26 15:55:20 +00:00
|
|
|
NULL,
|
|
|
|
NULL,
|
2015-03-24 07:05:19 +00:00
|
|
|
null_audio_write_avail,
|
2014-09-09 19:44:39 +00:00
|
|
|
NULL
|
2012-06-19 22:44:40 +00:00
|
|
|
};
|