From: Mikko Rasa Date: Sun, 18 Nov 2012 13:25:46 +0000 (+0200) Subject: Whitespace and member ordering adjustments X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=5fe0e3678c36352b7c75c1dcc16ab67debe7e678;p=libs%2Fal.git Whitespace and member ordering adjustments --- 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: