Last change
on this file since 9803 was
9803,
checked in by bensch, 18 years ago
|
Ported SoundBuffer to match the Data-Paradigm
|
File size:
1.3 KB
|
Rev | Line | |
---|
[4744] | 1 | /* |
---|
[1853] | 2 | orxonox - the future of 3D-vertical-scrollers |
---|
| 3 | |
---|
| 4 | Copyright (C) 2004 orx |
---|
| 5 | |
---|
| 6 | This program is free software; you can redistribute it and/or modify |
---|
| 7 | it under the terms of the GNU General Public License as published by |
---|
| 8 | the Free Software Foundation; either version 2, or (at your option) |
---|
| 9 | any later version. |
---|
[1855] | 10 | |
---|
| 11 | ### File Specific: |
---|
[5386] | 12 | main-programmer: Benjamin Grauer |
---|
[1855] | 13 | co-programmer: ... |
---|
[1853] | 14 | */ |
---|
| 15 | |
---|
[5386] | 16 | #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_SOUND |
---|
[1853] | 17 | |
---|
[5386] | 18 | #include "sound_buffer.h" |
---|
[1853] | 19 | |
---|
[5386] | 20 | #include "sound_engine.h" |
---|
| 21 | |
---|
[6836] | 22 | #include "sdlincl.h" |
---|
| 23 | #include <cassert> |
---|
[8362] | 24 | #include "debug.h" |
---|
[8969] | 25 | #include "sys/stat.h" |
---|
| 26 | #include "helper_functions.h" |
---|
[8362] | 27 | |
---|
[8293] | 28 | #ifdef HAVE_SDL_SDL_H |
---|
| 29 | #include <SDL/SDL.h> |
---|
| 30 | #include <SDL/SDL_endian.h> |
---|
| 31 | #else |
---|
| 32 | #include <SDL.h> |
---|
| 33 | #include <SDL_endian.h> |
---|
| 34 | #endif |
---|
[7460] | 35 | namespace OrxSound |
---|
[3365] | 36 | { |
---|
[9715] | 37 | ObjectListDefinition(SoundBuffer); |
---|
[7460] | 38 | ////////////////// |
---|
| 39 | /* SOUND-BUFFER */ |
---|
| 40 | ////////////////// |
---|
[9803] | 41 | SoundBuffer::SoundBuffer() |
---|
| 42 | : data(new SoundBufferData) |
---|
| 43 | { |
---|
| 44 | this->registerObject(this, SoundBuffer::_objectList); |
---|
| 45 | } |
---|
[7460] | 46 | /** |
---|
[9803] | 47 | * @brief Creates a Soundbuffer out of an inputfile |
---|
[7460] | 48 | * @param fileName The name of the File |
---|
| 49 | */ |
---|
| 50 | SoundBuffer::SoundBuffer(const std::string& fileName) |
---|
[9803] | 51 | : data(new SoundBufferData) |
---|
[7460] | 52 | { |
---|
[9686] | 53 | this->registerObject(this, SoundBuffer::_objectList); |
---|
[7460] | 54 | this->setName(fileName); |
---|
[4320] | 55 | |
---|
[9803] | 56 | this->load(fileName); |
---|
[7460] | 57 | } |
---|
[3543] | 58 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.