From 5fe0e3678c36352b7c75c1dcc16ab67debe7e678 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 18 Nov 2012 15:25:46 +0200 Subject: [PATCH] Whitespace and member ordering adjustments --- source/sound.cpp | 30 +++++++++++++++--------------- source/sound.h | 5 +++-- source/source.h | 2 +- source/streamer.h | 2 +- 4 files changed, 20 insertions(+), 19 deletions(-) diff --git a/source/sound.cpp b/source/sound.cpp index c4a00ef..fe2de5e 100644 --- a/source/sound.cpp +++ b/source/sound.cpp @@ -103,6 +103,21 @@ void Sound::open_memory(const void *d, unsigned len) open_common(); } +void Sound::open_common() +{ + delete data; + data = 0; + + vorbis_info *info = ov_info(&ovfile, -1); + freq = info->rate; + switch(info->channels) + { + case 1: format = MONO16; break; + case 2: format = STEREO16; break; + default: throw runtime_error("Unsupported number of channels"); + } +} + void Sound::load_data() { if(data) @@ -176,20 +191,5 @@ const char *Sound::get_data() const return data; } -void Sound::open_common() -{ - delete data; - data = 0; - - vorbis_info *info = ov_info(&ovfile, -1); - freq = info->rate; - switch(info->channels) - { - case 1: format = MONO16; break; - case 2: format = STEREO16; break; - default: throw runtime_error("Unsupported number of channels"); - } -} - } // namespace AL } // namespace Msp diff --git a/source/sound.h b/source/sound.h index bbc64e2..60bdf45 100644 --- a/source/sound.h +++ b/source/sound.h @@ -29,6 +29,9 @@ public: void open_file(const std::string &); void open_memory(const void *, unsigned); +private: + void open_common(); +public: void load_data(); void load_file(const std::string &); void load_memory(const void *, unsigned); @@ -41,8 +44,6 @@ public: unsigned get_frequency() const { return freq; } unsigned get_size() const { return size; } const char *get_data() const; -private: - void open_common(); }; } // namespace AL diff --git a/source/source.h b/source/source.h index 8e1e947..761e791 100644 --- a/source/source.h +++ b/source/source.h @@ -34,8 +34,8 @@ public: void set_position(float, float, float); void set_velocity(float, float, float); void set_gain(float); - void set_rolloff_factor(float); + void set_buffer(const Buffer &); void queue_buffers(const std::vector &); void queue_buffer(const Buffer &); diff --git a/source/streamer.h b/source/streamer.h index ff15bc4..7843e9e 100644 --- a/source/streamer.h +++ b/source/streamer.h @@ -19,7 +19,7 @@ class Streamer { private: Source &src; - Sound *snd; + Sound *snd; std::list buffers; public: -- 2.45.2