00001 /****************** <SNX heading BEGIN do not edit this line> ***************** 00002 * 00003 * sonix 00004 * 00005 * Original Authors: 00006 * Kevin Meinert, Carolina Cruz-Neira 00007 * 00008 * ----------------------------------------------------------------- 00009 * File: $RCSfile: SoundImplementation.cpp,v $ 00010 * Date modified: $Date: 2003/03/05 16:32:40 $ 00011 * Version: $Revision: 1.3 $ 00012 * ----------------------------------------------------------------- 00013 * 00014 ****************** <SNX heading END do not edit this line> ******************/ 00015 00016 /*************** <auto-copyright.pl BEGIN do not edit this line> ************** 00017 * 00018 * VR Juggler is (C) Copyright 1998-2003 by Iowa State University 00019 * 00020 * Original Authors: 00021 * Allen Bierbaum, Christopher Just, 00022 * Patrick Hartling, Kevin Meinert, 00023 * Carolina Cruz-Neira, Albert Baker 00024 * 00025 * This library is free software; you can redistribute it and/or 00026 * modify it under the terms of the GNU Library General Public 00027 * License as published by the Free Software Foundation; either 00028 * version 2 of the License, or (at your option) any later version. 00029 * 00030 * This library is distributed in the hope that it will be useful, 00031 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00032 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00033 * Library General Public License for more details. 00034 * 00035 * You should have received a copy of the GNU Library General Public 00036 * License along with this library; if not, write to the 00037 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00038 * Boston, MA 02111-1307, USA. 00039 * 00040 *************** <auto-copyright.pl END do not edit this line> ***************/ 00041 00042 #include <gmtl/Math.h> 00043 #include <gmtl/Vec.h> 00044 #include <gmtl/MatrixOps.h> 00045 #include <gmtl/VecOps.h> 00046 #include <gmtl/Xforms.h> 00047 00048 #include <snx/SoundImplementation.h> 00049 00050 00051 namespace snx 00052 { 00053 00054 void SoundImplementation::copy( const SoundImplementation& si ) 00055 { 00056 // copy over the current state 00057 mName = si.mName; 00058 mSounds = si.mSounds; 00059 mListenerPos = si.mListenerPos; 00060 mSoundAPIInfo = si.mSoundAPIInfo; 00061 } 00062 00063 void SoundImplementation::configure( const std::string& alias, const snx::SoundInfo& description ) 00064 { 00065 this->unbind( alias ); 00066 snx::SoundInfo temp = mSounds[alias]; 00067 mSounds[alias] = description; // TODO: put is_playing within the SoundInfo. 00068 00069 // restore fields that should be preserved on a reconfigure... 00070 mSounds[alias].triggerOnNextBind = temp.triggerOnNextBind; 00071 //std::cout<<"DEBUG: triggerOnNextBind = "<<mSounds[alias].triggerOnNextBind<<"\n"<<std::flush; 00072 00073 if (this->isStarted()) 00074 { 00075 this->bind( alias ); 00076 } 00077 } 00078 00079 void SoundImplementation::remove(const std::string& alias) 00080 { 00081 if (this->isStarted()) 00082 { 00083 this->unbind( alias ); 00084 } 00085 mSounds.erase( alias ); 00086 } 00087 00088 void SoundImplementation::bindAll() 00089 { 00090 std::map< std::string, snx::SoundInfo >::iterator it; 00091 for( it = mSounds.begin(); it != mSounds.end(); ++it) 00092 { 00093 //std::cout<<"DEBUG: loading alias: "<<(*it).first<<"\n"<<std::flush; 00094 this->bind( (*it).first ); 00095 } 00096 } 00097 00098 void SoundImplementation::unbindAll() 00099 { 00100 std::map< std::string, snx::SoundInfo >::iterator it; 00101 for( it = mSounds.begin(); it != mSounds.end(); ++it) 00102 { 00103 //std::cout<<"DEBUG: loading alias: "<<(*it).first<<"\n"<<std::flush; 00104 this->unbind( (*it).first ); 00105 } 00106 /* 00107 std::map< std::string, AlSoundInfo >::iterator it; 00108 for( it = mBindLookup.begin(); it != mBindLookup.end(); ++it) 00109 { 00110 this->unbind( (*it).first ); 00111 } 00112 00113 assert( mBindLookup.size() == 0 && "unbindAll failed" ); 00114 */ 00115 } 00116 00117 } // End of snx namespace
1.2.14 written by Dimitri van Heesch,
© 1997-2002