summaryrefslogtreecommitdiff
path: root/platform/haiku
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2017-01-16 19:19:45 +0100
committerRémi Verschelde <rverschelde@gmail.com>2017-01-16 19:19:45 +0100
commit7b059965e8df745c5b45b4ec6bfbdfe1a7397642 (patch)
treebdba6b41f51fcb4c8aa5178aebd378bdf97b93a8 /platform/haiku
parent6a3dae5be944d9e226cca7bf0bd80fb0036e8324 (diff)
Adapt platforms to AudioServer refactoring
Fixes compilation on Windows and likely other platforms (at least as far as AudioServer changes were concerned), though they were not tested.
Diffstat (limited to 'platform/haiku')
-rw-r--r--platform/haiku/audio_driver_media_kit.cpp6
-rw-r--r--platform/haiku/audio_driver_media_kit.h8
-rw-r--r--platform/haiku/os_haiku.cpp22
-rw-r--r--platform/haiku/os_haiku.h10
4 files changed, 9 insertions, 37 deletions
diff --git a/platform/haiku/audio_driver_media_kit.cpp b/platform/haiku/audio_driver_media_kit.cpp
index 2af93061f8..c6afe7a261 100644
--- a/platform/haiku/audio_driver_media_kit.cpp
+++ b/platform/haiku/audio_driver_media_kit.cpp
@@ -38,7 +38,7 @@ Error AudioDriverMediaKit::init() {
active = false;
mix_rate = 44100;
- output_format = OUTPUT_STEREO;
+ speaker_mode = SPEAKER_MODE_STEREO;
channels = 2;
int latency = GLOBAL_DEF("audio/output_latency", 25);
@@ -99,8 +99,8 @@ int AudioDriverMediaKit::get_mix_rate() const {
return mix_rate;
}
-AudioDriverSW::OutputFormat AudioDriverMediaKit::get_output_format() const {
- return output_format;
+AudioDriverSW::SpeakerMode AudioDriverMediaKit::get_speaker_mode() const {
+ return speaker_mode;
}
void AudioDriverMediaKit::lock() {
diff --git a/platform/haiku/audio_driver_media_kit.h b/platform/haiku/audio_driver_media_kit.h
index fbf6bc20de..ce760f8dd7 100644
--- a/platform/haiku/audio_driver_media_kit.h
+++ b/platform/haiku/audio_driver_media_kit.h
@@ -26,7 +26,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "servers/audio/audio_server_sw.h"
+#include "servers/audio_server.h"
#ifdef MEDIA_KIT_ENABLED
@@ -36,7 +36,7 @@
#include <kernel/image.h> // needed for image_id
#include <SoundPlayer.h>
-class AudioDriverMediaKit : public AudioDriverSW {
+class AudioDriverMediaKit : public AudioDriver {
Mutex* mutex;
BSoundPlayer* player;
@@ -45,7 +45,7 @@ class AudioDriverMediaKit : public AudioDriverSW {
static void PlayBuffer(void* cookie, void* buffer, size_t size, const media_raw_audio_format& format);
unsigned int mix_rate;
- OutputFormat output_format;
+ SpeakerMode speaker_mode;
unsigned int buffer_size;
int channels;
@@ -60,7 +60,7 @@ public:
virtual Error init();
virtual void start();
virtual int get_mix_rate() const;
- virtual OutputFormat get_output_format() const;
+ virtual SpeakerMode get_speaker_mode() const;
virtual void lock();
virtual void unlock();
virtual void finish();
diff --git a/platform/haiku/os_haiku.cpp b/platform/haiku/os_haiku.cpp
index c5d2dbde85..9f218aeff4 100644
--- a/platform/haiku/os_haiku.cpp
+++ b/platform/haiku/os_haiku.cpp
@@ -40,7 +40,7 @@
OS_Haiku::OS_Haiku() {
#ifdef MEDIA_KIT_ENABLED
- AudioDriverManagerSW::add_driver(&driver_media_kit);
+ AudioDriverManager::add_driver(&driver_media_kit);
#endif
};
@@ -143,15 +143,6 @@ void OS_Haiku::initialize(const VideoMode& p_desired, int p_video_driver, int p_
if (AudioDriverManager::get_driver(p_audio_driver)->init() != OK) {
ERR_PRINT("Initializing audio failed.");
}
-
- sample_manager = memnew(SampleManagerMallocSW);
- audio_server = memnew(AudioServerSW(sample_manager));
- audio_server->init();
-
- spatial_sound_server = memnew(SpatialSoundServerSW);
- spatial_sound_server->init();
- spatial_sound_2d_server = memnew(SpatialSound2DServerSW);
- spatial_sound_2d_server->init();
}
void OS_Haiku::finalize() {
@@ -161,17 +152,6 @@ void OS_Haiku::finalize() {
main_loop = NULL;
- spatial_sound_server->finish();
- memdelete(spatial_sound_server);
-
- spatial_sound_2d_server->finish();
- memdelete(spatial_sound_2d_server);
-
- memdelete(sample_manager);
-
- audio_server->finish();
- memdelete(audio_server);
-
visual_server->finish();
memdelete(visual_server);
memdelete(rasterizer);
diff --git a/platform/haiku/os_haiku.h b/platform/haiku/os_haiku.h
index fc873f49ad..531c7a56c3 100644
--- a/platform/haiku/os_haiku.h
+++ b/platform/haiku/os_haiku.h
@@ -34,12 +34,8 @@
#include "servers/visual/rasterizer.h"
#include "servers/physics_server.h"
#include "servers/physics_2d/physics_2d_server_sw.h"
-#include "servers/audio/audio_server_sw.h"
-#include "servers/audio/sample_manager_sw.h"
-#include "servers/spatial_sound/spatial_sound_server_sw.h"
-#include "servers/spatial_sound_2d/spatial_sound_2d_server_sw.h"
+#include "servers/audio_server.h"
#include "main/input_default.h"
-
#include "audio_driver_media_kit.h"
#include "context_gl_haiku.h"
#include "haiku_application.h"
@@ -57,10 +53,6 @@ private:
VideoMode current_video_mode;
PhysicsServer* physics_server;
Physics2DServer* physics_2d_server;
- AudioServerSW* audio_server;
- SampleManagerMallocSW* sample_manager;
- SpatialSoundServerSW* spatial_sound_server;
- SpatialSound2DServerSW* spatial_sound_2d_server;
#ifdef MEDIA_KIT_ENABLED
AudioDriverMediaKit driver_media_kit;