1 #include "core/advdumper.hpp"
2 #include "core/audioapi.hpp"
3 #include "core/audioapi-driver.hpp"
4 #include "core/dispatch.hpp"
5 #include "core/framerate.hpp"
6 #include "core/instance.hpp"
7 #include "library/minmax.hpp"
8 #include "library/threads.hpp"
17 #define MUSIC_BUFFERS 8
18 #define MAX_VOICE_ADJUST 200
22 void dummy_init() throw()
24 lsnes_instance
.audio
->voice_rate(0, 0);
27 void dummy_quit() throw()
31 void dummy_enable(bool enable
) throw()
35 bool dummy_initialized()
40 void dummy_set_device(const std::string
& pdev
, const std::string
& rdev
) throw(std::bad_alloc
,
44 throw std::runtime_error("Bad sound device '" + pdev
+ "'");
46 throw std::runtime_error("Bad sound device '" + rdev
+ "'");
49 std::string
dummy_get_device(bool rec
) throw(std::bad_alloc
)
54 std::map
<std::string
, std::string
> dummy_get_devices(bool rec
) throw(std::bad_alloc
)
56 std::map
<std::string
, std::string
> ret
;
57 ret
["null"] = "NULL sound output";
61 const char* dummy_name() { return "Dummy sound plugin"; }
63 _audioapi_driver driver
= {
66 .enable
= dummy_enable
,
67 .initialized
= dummy_initialized
,
68 .set_device
= dummy_set_device
,
69 .get_device
= dummy_get_device
,
70 .get_devices
= dummy_get_devices
,
75 audioapi_driver::audioapi_driver(struct _audioapi_driver _driver
)
80 void audioapi_driver_init() throw()
85 void audioapi_driver_quit() throw()
90 void audioapi_driver_enable(bool _enable
) throw()
92 driver
.enable(_enable
);
95 bool audioapi_driver_initialized()
97 return driver
.initialized();
100 void audioapi_driver_set_device(const std::string
& pdev
, const std::string
& rdev
) throw(std::bad_alloc
,
103 driver
.set_device(pdev
, rdev
);
106 std::string
audioapi_driver_get_device(bool rec
) throw(std::bad_alloc
)
108 return driver
.get_device(rec
);
111 std::map
<std::string
, std::string
> audioapi_driver_get_devices(bool rec
) throw(std::bad_alloc
)
113 return driver
.get_devices(rec
);
116 const char* audioapi_driver_name() throw()
118 return driver
.name();