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
|
Line | |
---|
1 | /* |
---|
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. |
---|
10 | |
---|
11 | ### File Specific: |
---|
12 | main-programmer: Benjamin Grauer |
---|
13 | co-programmer: ... |
---|
14 | */ |
---|
15 | |
---|
16 | #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_SOUND |
---|
17 | |
---|
18 | #include "sound_buffer.h" |
---|
19 | |
---|
20 | #include "sound_engine.h" |
---|
21 | |
---|
22 | #include "sdlincl.h" |
---|
23 | #include <cassert> |
---|
24 | #include "debug.h" |
---|
25 | #include "sys/stat.h" |
---|
26 | #include "helper_functions.h" |
---|
27 | |
---|
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 |
---|
35 | namespace OrxSound |
---|
36 | { |
---|
37 | ObjectListDefinition(SoundBuffer); |
---|
38 | ////////////////// |
---|
39 | /* SOUND-BUFFER */ |
---|
40 | ////////////////// |
---|
41 | SoundBuffer::SoundBuffer() |
---|
42 | : data(new SoundBufferData) |
---|
43 | { |
---|
44 | this->registerObject(this, SoundBuffer::_objectList); |
---|
45 | } |
---|
46 | /** |
---|
47 | * @brief Creates a Soundbuffer out of an inputfile |
---|
48 | * @param fileName The name of the File |
---|
49 | */ |
---|
50 | SoundBuffer::SoundBuffer(const std::string& fileName) |
---|
51 | : data(new SoundBufferData) |
---|
52 | { |
---|
53 | this->registerObject(this, SoundBuffer::_objectList); |
---|
54 | this->setName(fileName); |
---|
55 | |
---|
56 | this->load(fileName); |
---|
57 | } |
---|
58 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.