Changeset 419 for code/branches/FICN/src
- Timestamp:
- Dec 5, 2007, 7:28:46 PM (17 years ago)
- Location:
- code/branches/FICN/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/audio/AudioManager.cc
r389 r419 5 5 AudioManager::AudioManager() 6 6 { 7 alutInit(NULL, 0); 8 9 bgSound.open("ambient3"); 10 bgSound.display(); 7 11 12 if(!bgSound.playback()) 13 { 14 std::cout << "Ogg refused to play."; 15 } 8 16 } 9 17 10 18 AudioManager::~AudioManager() 11 19 { 12 20 bgSound.release(); 21 alutExit(); 22 } 23 24 void AudioManager::update() 25 { 26 bgSound.update(); 27 if(!bgSound.playing()) 28 { 29 if(!bgSound.playback()) 30 std::cout << "Ogg abruptly stopped."; 31 else 32 std::cout << "Ogg stream was interrupted.\n"; 33 } 13 34 } 14 35 -
code/branches/FICN/src/audio/AudioManager.h
r409 r419 6 6 #include "AudioBuffer.h" 7 7 #include "AudioSource.h" 8 #include "AudioStream.h" 8 9 9 10 namespace audio … … 12 13 { 13 14 public: 15 14 16 // Init audio 15 17 AudioManager(); 18 16 19 // Kill audio and set buffers, sources and memory free 17 20 ~AudioManager(); 21 18 22 // Set listener position 19 23 void setPos(std::vector<float> newPosition); 24 20 25 // Set listener speed 21 26 void setSpeed(std::vector<float> newSpeed); 27 22 28 // Set listener orientation (first is direction 23 29 // the listener looks at, the second is the direction 24 30 // upwards the listener) 25 31 void setOri(std::vector<float> at, std::vector<float> up); 32 26 33 // Parses given xml string 27 34 void loadParams(); 35 36 // Update 37 void update(); 38 28 39 private: 29 40 41 // Backgroundsound 42 AudioStream bgSound; 30 43 31 44 // Vector containing all audio files -
code/branches/FICN/src/audio/AudioStream.cc
r411 r419 4 4 namespace audio 5 5 { 6 void AudioStream::open(st ring path)6 void AudioStream::open(std::string path) 7 7 { 8 8 int result; … … 61 61 void AudioStream::display() 62 62 { 63 cout63 std::cout 64 64 << "version " << vorbisInfo->version << "\n" 65 65 << "channels " << vorbisInfo->channels << "\n" … … 73 73 74 74 for(int i = 0; i < vorbisComment->comments; i++) 75 cout << " " << vorbisComment->user_comments[i] << "\n";76 77 cout <<endl;75 std::cout << " " << vorbisComment->user_comments[i] << "\n"; 76 77 std::cout << std::endl; 78 78 } 79 79 … … 212 212 return std::string("Invalid Vorbis header."); 213 213 case OV_EFAULT: 214 return st ring("Internal logic fault (bug or heap/stack corruption.");214 return std::string("Internal logic fault (bug or heap/stack corruption."); 215 215 default: 216 216 return std::string("Unknown Ogg error."); … … 218 218 } 219 219 } 220 -
code/branches/FICN/src/audio/CMakeLists.txt
r411 r419 6 6 AudioBuffer.cc 7 7 AudioSource.cc 8 8 AudioStream.cc 9 9 ) 10 10 SET(INC_FILES … … 12 12 AudioBuffer.h 13 13 AudioSource.h 14 AudioStream.h 14 15 ) 15 16 -
code/branches/FICN/src/orxonox/orxonox.cc
r389 r419 56 56 SpaceshipSteering* steering; 57 57 58 audio::AudioManager* auMan; 58 59 59 60 // some tests to see if enet works without includsion … … 113 114 bool frameStarted(const FrameEvent& evt) 114 115 { 116 117 auMan->update(); 118 115 119 mKeyboard->capture(); 116 120 mMouse->capture(); … … 281 285 void createScene(void) 282 286 { 283 audio::AudioManager*auMan = new audio::AudioManager();287 auMan = new audio::AudioManager(); 284 288 285 289
Note: See TracChangeset
for help on using the changeset viewer.