Changeset 708 for code/branches/FICN/src/audio
- Timestamp:
- Dec 28, 2007, 10:30:29 PM (17 years ago)
- Location:
- code/branches/FICN/src/audio
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/audio/AudioBuffer.cc
r702 r708 30 30 namespace audio 31 31 { 32 AudioBuffer::AudioBuffer( std::string fileName)32 AudioBuffer::AudioBuffer(orxonox::String fileName) 33 33 { 34 34 // Load wav data into buffers. -
code/branches/FICN/src/audio/AudioBuffer.h
r673 r708 9 9 { 10 10 public: 11 AudioBuffer( std::string fileName);11 AudioBuffer(orxonox::String fileName); 12 12 ~AudioBuffer(); 13 13 private: … … 15 15 ALuint buffer; 16 16 // Identifier 17 std::string name;17 orxonox::String name; 18 18 // True if AL was able to load data 19 19 ALboolean loaded; -
code/branches/FICN/src/audio/AudioIncludes.h
r677 r708 1 1 #include <iostream> 2 #include <string>3 2 #include <vector> 4 3 … … 11 10 #include <vorbis/vorbisfile.h> 12 11 13 #include "../orxonox/core/Error.h" 12 #include "orxonox/core/Error.h" 13 #include "misc/String.h" -
code/branches/FICN/src/audio/AudioManager.cc
r666 r708 27 27 28 28 #include "AudioManager.h" 29 #include " ../orxonox/core/Debug.h"29 #include "orxonox/core/Debug.h" 30 30 31 31 namespace audio … … 72 72 } 73 73 74 void AudioManager::ambientAdd( std::string file)74 void AudioManager::ambientAdd(orxonox::String file) 75 75 { 76 std::string path = ambientPath + "/" + file + ".ogg";76 orxonox::String path = ambientPath + "/" + file + ".ogg"; 77 77 AudioStream tmp(path); 78 78 tmp.open(); -
code/branches/FICN/src/audio/AudioManager.h
r673 r708 37 37 void update(); 38 38 39 void ambientAdd( std::string file);39 void ambientAdd(orxonox::String file); 40 40 void ambientStart(); 41 41 void ambientStop(); … … 49 49 50 50 51 std::string ambientPath;51 orxonox::String ambientPath; 52 52 53 53 // Vector containing all audio files -
code/branches/FICN/src/audio/AudioStream.cc
r677 r708 28 28 29 29 #include "AudioStream.h" 30 #include " ../orxonox/core/Debug.h"30 #include "orxonox/core/Debug.h" 31 31 32 32 namespace audio 33 33 { 34 AudioStream::AudioStream( std::string path)34 AudioStream::AudioStream(orxonox::String path) 35 35 { 36 36 this->path = path; … … 40 40 void AudioStream::open() 41 41 { 42 int result; 43 44 45 if(!(oggFile = fopen(path.c_str(), "rb"))) 42 //int result; 43 errno_t result; 44 45 46 if(fopen_s(&oggFile, path.c_str(), "rb")) 46 47 { 47 48 orxonox::Error("Could not open Ogg file "+path); 48 49 return; 49 50 } 50 51 if((result = ov_open(oggFile, &oggStream, NULL, 0)) < 0) 51 else 52 { 53 COUT(4) << "Opened Ogg file" << path << std::endl; 54 } 55 56 /*if((result = ov_open(oggFile, &oggStream, NULL, 0)) < 0) 52 57 { 53 58 fclose(oggFile); 54 59 orxonox::Error("Could not open Ogg stream. " + errorString(result)); 55 60 return; 56 } 61 }*/ 57 62 58 63 loaded = true; … … 254 259 255 260 256 std::string AudioStream::errorString(int code)261 orxonox::String AudioStream::errorString(int code) 257 262 { 258 263 switch(code) 259 264 { 260 265 case OV_EREAD: 261 return std::string("Read from media.");266 return orxonox::String("Read from media."); 262 267 case OV_ENOTVORBIS: 263 return std::string("Not Vorbis data.");268 return orxonox::String("Not Vorbis data."); 264 269 case OV_EVERSION: 265 return std::string("Vorbis version mismatch.");270 return orxonox::String("Vorbis version mismatch."); 266 271 case OV_EBADHEADER: 267 return std::string("Invalid Vorbis header.");272 return orxonox::String("Invalid Vorbis header."); 268 273 case OV_EFAULT: 269 return std::string("Internal logic fault (bug or heap/stack corruption.");274 return orxonox::String("Internal logic fault (bug or heap/stack corruption."); 270 275 default: 271 return std::string("Unknown Ogg error.");276 return orxonox::String("Unknown Ogg error."); 272 277 } 273 278 } -
code/branches/FICN/src/audio/AudioStream.h
r677 r708 11 11 { 12 12 public: 13 AudioStream( std::string path);13 AudioStream(orxonox::String path); 14 14 void open(); 15 15 void release(); … … 24 24 void empty(); 25 25 void check(); 26 std::string errorString(int code);26 orxonox::String errorString(int code); 27 27 28 28 private: 29 std::string path;29 orxonox::String path; 30 30 31 31 FILE* oggFile;
Note: See TracChangeset
for help on using the changeset viewer.