]> git.tdb.fi Git - libs/al.git/blobdiff - source/sound.cpp
Whitespace and member ordering adjustments
[libs/al.git] / source / sound.cpp
index c4a00efdedec278fa91c931b08e4054b12a487fe..fe2de5eb5c4b85faa6c05c25e64a0d30d44f775d 100644 (file)
@@ -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