root/juggler/branches/2.2/modules/sonix/snx/SoundImplementation.cpp

Revision 20852, 3.0 kB (checked in by patrick, 1 year ago)

Removed commented out code that has no obvious value.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 /****************** <SNX heading BEGIN do not edit this line> *****************
2  *
3  * sonix
4  *
5  * Original Authors:
6  *   Kevin Meinert, Carolina Cruz-Neira
7  *
8  ****************** <SNX heading END do not edit this line> ******************/
9
10 /*************** <auto-copyright.pl BEGIN do not edit this line> **************
11  *
12  * VR Juggler is (C) Copyright 1998-2007 by Iowa State University
13  *
14  * Original Authors:
15  *   Allen Bierbaum, Christopher Just,
16  *   Patrick Hartling, Kevin Meinert,
17  *   Carolina Cruz-Neira, Albert Baker
18  *
19  * This library is free software; you can redistribute it and/or
20  * modify it under the terms of the GNU Library General Public
21  * License as published by the Free Software Foundation; either
22  * version 2 of the License, or (at your option) any later version.
23  *
24  * This library is distributed in the hope that it will be useful,
25  * but WITHOUT ANY WARRANTY; without even the implied warranty of
26  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
27  * Library General Public License for more details.
28  *
29  * You should have received a copy of the GNU Library General Public
30  * License along with this library; if not, write to the
31  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
32  * Boston, MA 02111-1307, USA.
33  *
34  *************** <auto-copyright.pl END do not edit this line> ***************/
35
36 #include <snx/snxConfig.h>
37
38 #include <gmtl/Math.h>
39 #include <gmtl/Vec.h>
40 #include <gmtl/MatrixOps.h>
41 #include <gmtl/VecOps.h>
42 #include <gmtl/Xforms.h>
43 #include <vpr/Util/Assert.h>
44
45 #include <snx/SoundImplementation.h>
46
47
48 namespace snx
49 {
50
51 void SoundImplementation::copy( const SoundImplementation& si )
52 {
53    // copy over the current state
54    mName = si.mName;
55    mSounds = si.mSounds;
56    mListenerPos = si.mListenerPos;
57    mSoundAPIInfo = si.mSoundAPIInfo;
58 }
59
60 void SoundImplementation::configure( const std::string& alias, const snx::SoundInfo& description )
61 {
62    this->unbind( alias );
63    snx::SoundInfo temp = mSounds[alias];
64    mSounds[alias] = description; // TODO: put is_playing within the SoundInfo.
65
66    // restore fields that should be preserved on a reconfigure...
67    mSounds[alias].triggerOnNextBind = temp.triggerOnNextBind;
68    //std::cout<<"DEBUG: triggerOnNextBind = "<<mSounds[alias].triggerOnNextBind<<"\n"<<std::flush;
69
70    if (this->isStarted())
71    {
72       this->bind( alias );
73    }
74 }
75
76 void SoundImplementation::remove(const std::string& alias)
77 {
78    if (this->isStarted())
79    {
80       this->unbind( alias );
81    }
82    mSounds.erase( alias );
83 }
84
85 void SoundImplementation::bindAll()
86 {
87    std::map< std::string, snx::SoundInfo >::iterator it;
88    for( it = mSounds.begin(); it != mSounds.end(); ++it)
89    {
90       //std::cout<<"DEBUG: loading alias: "<<(*it).first<<"\n"<<std::flush;
91       this->bind( (*it).first );
92    }
93 }   
94
95 void SoundImplementation::unbindAll()
96 {
97    std::map< std::string, snx::SoundInfo >::iterator it;
98    for( it = mSounds.begin(); it != mSounds.end(); ++it)
99    {
100       //std::cout<<"DEBUG: loading alias: "<<(*it).first<<"\n"<<std::flush;
101       this->unbind( (*it).first );
102    }
103 }
104
105 } // End of snx namespace
106
Note: See TracBrowser for help on using the browser.