Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

ISoundImplementation.h

Go to the documentation of this file.
00001 
00002 /****************** <SNX heading BEGIN do not edit this line> *****************
00003  *
00004  * sonix
00005  *
00006  * Original Authors:
00007  *   Kevin Meinert
00008  *
00009  * -----------------------------------------------------------------
00010  * File:          $RCSfile: ISoundImplementation.h,v $
00011  * Date modified: $Date: 2003/12/06 03:19:21 $
00012  * Version:       $Revision: 1.8 $
00013  * -----------------------------------------------------------------
00014  *
00015  ****************** <SNX heading END do not edit this line> ******************/
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 #ifndef SNXSOUNDIMPLEMENTATION_INTERFACE_H
00043 #define SNXSOUNDIMPLEMENTATION_INTERFACE_H
00044 
00045 #include <snx/snxConfig.h>
00046 
00047 #include <string>
00048 #include <gmtl/Matrix.h>
00049 #include <vpr/vpr.h>
00050 
00051 #include "snx/SoundInfo.h"
00052 #include "snx/SoundAPIInfo.h"
00053 
00054 namespace snx
00055 {
00056 
00057 class ISoundImplementation
00058 {
00059 public:
00062    ISoundImplementation() {}
00063 
00067    virtual void clone( ISoundImplementation* &newCopy ) = 0; 
00068    
00072    virtual ~ISoundImplementation() {}
00073 
00074 public:
00075 
00082    virtual void trigger( const std::string & alias, const int & repeat = 1 ) = 0;
00083 
00087    virtual bool isPlaying( const std::string& alias ) = 0;
00088    
00094    virtual void setRetriggerable( const std::string& alias, bool onOff ) = 0;
00095    
00099    virtual bool isRetriggerable( const std::string& alias ) = 0;
00100 
00105    virtual void stop( const std::string& alias ) = 0;
00106 
00110    virtual void pause( const std::string& alias ) = 0;
00111 
00115    virtual void unpause( const std::string& alias ) = 0;
00116 
00118    virtual bool isPaused( const std::string& alias ) = 0;
00119    
00126    virtual void setAmbient( const std::string& alias, bool ambient = false ) = 0;
00127    
00132    virtual bool isAmbient( const std::string& alias ) = 0;
00133 
00135    virtual void setPitchBend( const std::string& alias, float amount ) = 0;
00136    
00138    virtual void setVolume( const std::string& alias, float amount ) = 0;
00139    
00143    virtual void setCutoff( const std::string& alias, float amount ) = 0;
00144    
00148    virtual void setPosition( const std::string& alias, float x, float y, float z ) = 0;
00149 
00155    virtual void getPosition( const std::string& alias, float& x, float& y, float& z ) = 0;
00156 
00160    virtual void setListenerPosition( const gmtl::Matrix44f& mat ) = 0;
00161 
00165    virtual void getListenerPosition( gmtl::Matrix44f& mat ) = 0;
00166 
00173    virtual int startAPI() = 0;
00174 
00179    virtual bool isStarted() const = 0;   
00180    
00186    virtual void shutdownAPI() = 0;
00187 
00188    /*
00189     * configure/reconfigure the sound API global settings
00190     */
00191    virtual void configure( const snx::SoundAPIInfo& sai ) = 0;
00192 
00201    virtual void configure( const std::string& alias, const snx::SoundInfo& description ) = 0;
00202 
00207    virtual void remove(const std::string& alias) = 0;
00208 
00213    virtual void step( const float& timeElapsed ) = 0;
00214 
00219    virtual void clear() = 0;
00220 
00225    virtual void bindAll() = 0;
00226 
00231    virtual void unbindAll() = 0;
00232 
00237    virtual void bind( const std::string& alias ) = 0;
00238 
00243    virtual void unbind( const std::string& alias ) = 0;
00244 
00245    virtual snx::SoundInfo& lookup( const std::string& alias ) = 0;
00246 
00247    virtual void setName( const std::string& name ) = 0;
00248    
00249    virtual std::string& name() = 0;
00250 
00251 #ifdef VPR_OS_Win32
00252 
00257    void operator delete(void* p)
00258    {
00259       if ( NULL != p )
00260       {
00261          ISoundImplementation* sound_ptr = static_cast<ISoundImplementation*>(p);
00262          sound_ptr->destroy();
00263       }
00264    }
00265 #endif
00266 
00267 protected:
00273    virtual void destroy() = 0;
00274 };
00275 
00276 } // end namespace
00277 
00278 #endif //SNXSOUNDIMPLEMENTATION_INTERFACE_H

Generated on Sun May 2 14:39:26 2004 for Juggler Sonix by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002