1 #include "core/command.hpp"
2 #include "core/audioapi.hpp"
9 void dummy_init() throw()
11 audioapi_voice_rate(0, 0);
14 void dummy_quit() throw()
18 void dummy_enable(bool enable
) throw()
22 bool dummy_initialized()
27 void dummy_set_device(const std::string
& pdev
, const std::string
& rdev
) throw(std::bad_alloc
,
31 throw std::runtime_error("Bad sound device '" + pdev
+ "'");
33 throw std::runtime_error("Bad sound device '" + rdev
+ "'");
36 std::string
dummy_get_device(bool rec
) throw(std::bad_alloc
)
41 std::map
<std::string
, std::string
> dummy_get_devices(bool rec
) throw(std::bad_alloc
)
43 std::map
<std::string
, std::string
> ret
;
44 ret
["null"] = "NULL sound output";
48 const char* dummy_name() { return "Dummy sound plugin"; }
50 _audioapi_driver driver
= {
53 .enable
= dummy_enable
,
54 .initialized
= dummy_initialized
,
55 .set_device
= dummy_set_device
,
56 .get_device
= dummy_get_device
,
57 .get_devices
= dummy_get_devices
,
62 audioapi_driver::audioapi_driver(struct _audioapi_driver _driver
)
67 void audioapi_driver_init() throw()
72 void audioapi_driver_quit() throw()
77 void audioapi_driver_enable(bool _enable
) throw()
79 driver
.enable(_enable
);
82 bool audioapi_driver_initialized()
84 return driver
.initialized();
87 void audioapi_driver_set_device(const std::string
& pdev
, const std::string
& rdev
) throw(std::bad_alloc
,
90 driver
.set_device(pdev
, rdev
);
93 std::string
audioapi_driver_get_device(bool rec
) throw(std::bad_alloc
)
95 return driver
.get_device(rec
);
98 std::map
<std::string
, std::string
> audioapi_driver_get_devices(bool rec
) throw(std::bad_alloc
)
100 return driver
.get_devices(rec
);
103 const char* audioapi_driver_name() throw()
105 return driver
.name();