[Gcblue-commits] gcb_wx/src/common tcOggStreamer.cpp,1.19,1.20
Status: Alpha
Brought to you by:
ddcforge
From: Dewitt C. <ddc...@us...> - 2006-08-27 21:28:58
|
Update of /cvsroot/gcblue/gcb_wx/src/common In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv21970/src/common Modified Files: tcOggStreamer.cpp Log Message: Added attributes (hidden and permanent) to AI tasks so that automation tasks can be hidden and not distract player Index: tcOggStreamer.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/tcOggStreamer.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** tcOggStreamer.cpp 23 Mar 2006 01:11:01 -0000 1.19 --- tcOggStreamer.cpp 27 Aug 2006 21:28:54 -0000 1.20 *************** *** 54,57 **** --- 54,58 ---- { wxASSERT(source.valid()); + if (!source.valid()) return; source->seek(seekTime); *************** *** 68,71 **** --- 69,73 ---- wxASSERT(source.valid()); + if (!source.valid()) return; source->setGain(volume); *************** *** 78,81 **** --- 80,84 ---- { wxASSERT(source.valid()); + if (!source.valid()) return; source->stop(); *************** *** 95,98 **** --- 98,102 ---- { wxASSERT(source.valid()); + if (!source.valid()) return; paused = false; *************** *** 124,127 **** --- 128,132 ---- { wxASSERT(source.valid()); + if (!source.valid()) return false; return (source->getState() == openalpp::Paused); *************** *** 132,135 **** --- 137,141 ---- { wxASSERT(source.valid()); + if (!source.valid()) return false; return (source->getState() == openalpp::Playing); *************** *** 139,142 **** --- 145,149 ---- { wxASSERT(source.valid()); + if (!source.valid()) return true; return (source->getState() == openalpp::Stopped); *************** *** 145,148 **** --- 152,158 ---- void tcOggStreamer::Update() { + wxASSERT(source.valid()); + if (!source.valid()) return; + if (queuedSong.size() == 0) return; *************** *** 179,185 **** initializingStream(false) { ! source = new openalpp::Source; ! source->setAmbient(); ! source->setGain(volume); } --- 189,231 ---- initializingStream(false) { ! try ! { ! source = new openalpp::Source; ! } ! catch (openalpp::MemoryError e) ! { ! fprintf(stderr, "tcOggStreamer::tcOggStreamer: openalpp::MemoryError: %s\n", e.what()); ! wxMessageBox(e.what(), "Memory Error", wxICON_ERROR); ! } ! catch (openalpp::NameError e) ! { ! fprintf(stderr, "tcOggStreamer::tcOggStreamer: openalpp::NameError: %s\n", e.what()); ! wxMessageBox(e.what(), "Name Error", wxICON_ERROR); ! } ! catch (openalpp::FatalError e) ! { ! fprintf(stderr, "tcOggStreamer::tcOggStreamer: openalpp::FatalError: %s\n", e.what()); ! wxMessageBox(e.what(), "Fatal Error", wxICON_ERROR); ! } ! catch (openalpp::Error e) ! { ! fprintf(stderr, "tcOggStreamer::tcOggStreamer: openalpp::Error: %s\n", e.what()); ! wxMessageBox(e.what(), "General openAL++ Error", wxICON_ERROR); ! } ! catch (std::exception e) ! { ! fprintf(stderr, "tcOggStreamer::tcOggStreamer: std::exception: %s\n", e.what()); ! wxMessageBox(e.what(), "Exception", wxICON_ERROR); ! } ! ! if (source.valid()) ! { ! source->setAmbient(); ! source->setGain(volume); ! } ! else ! { ! fprintf(stderr, "OGG init error: music will be disabled!\n"); ! } } |