Changeset 458 for code/branches/FICN/src/audio
- Timestamp:
- Dec 11, 2007, 11:29:16 PM (17 years ago)
- Location:
- code/branches/FICN/src/audio
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/audio/AudioManager.cc
r430 r458 7 7 AudioManager::AudioManager() 8 8 { 9 9 ambientPath = "audio/ambient"; 10 10 11 alutInit(NULL, 0); 12 13 14 11 alutInit(NULL, 0); 15 12 16 13 17 14 } 18 15 19 16 AudioManager::~AudioManager() 20 17 { 21 18 for (unsigned int i=0;i<=bgSounds.size();i++) 22 19 { 23 bgSounds[i].release(); 20 bgSounds[i].release(); 24 21 } 25 22 alutExit(); … … 46 43 { 47 44 std::cout << "Stopped playing background sound"<<std::endl; 48 } 45 } 49 46 50 47 void AudioManager::ambientAdd(std::string file) 51 48 { 52 std::string path = ambientPath + "/" + file + ".ogg"; 49 std::string path = ambientPath + "/" + file + ".ogg"; 53 50 AudioStream tmp(path); 54 51 tmp.open(); 55 52 if (tmp.isLoaded()) 56 53 { 57 bgSounds.push_back(tmp); 54 bgSounds.push_back(tmp); 58 55 std::cout << "Added background sound "<<file<<std::endl; 59 56 } 60 57 } 61 58 62 59 void AudioManager::update() 63 60 { … … 77 74 if (!playing) 78 75 { 79 if (currentBgSound < bgSounds.size()-1) 80 { 81 currentBgSound++; 82 } 83 else 84 { 85 currentBgSound=0; 86 } 76 // if (currentBgSound < bgSounds.size()-1) 77 // { 78 // currentBgSound++; 79 // } 80 // else 81 // { 82 // currentBgSound=0; 83 // } 84 // switch to next sound in list/array 85 currentBgSound = ++currentBgSound % bgSounds.size(); 86 87 87 if (!bgSounds[currentBgSound].isLoaded()) 88 88 { … … 96 96 } 97 97 } 98 98 99 99 void AudioManager::setPos(std::vector<float> newPosition) 100 100 { 101 101 102 102 } 103 103 104 104 void AudioManager::setSpeed(std::vector<float> newSpeed) 105 105 { 106 106 107 107 } 108 108 109 109 void AudioManager::setOri(std::vector<float> at, std::vector<float> up) 110 110 { 111 111 112 112 } 113 113 } -
code/branches/FICN/src/audio/CMakeLists.txt
r419 r458 1 1 PROJECT(Orxonox) 2 2 3 SET(SRC_FILES 3 SET(SRC_FILES 4 4 AudioIncludes.h 5 5 AudioManager.cc … … 8 8 AudioStream.cc 9 9 ) 10 SET(INC_FILES 10 SET(INC_FILES 11 11 AudioManager.h 12 12 AudioBuffer.h … … 15 15 ) 16 16 17 INCLUDE_DIRECTORIES(..) 17 18 18 19 ADD_LIBRARY(audio ${SRC_FILES} ${INC_FILES})
Note: See TracChangeset
for help on using the changeset viewer.