Home | nevrax.com |
|
listener_user.hGo to the documentation of this file.00001 00007 /* Copyright, 2001 Nevrax Ltd. 00008 * 00009 * This file is part of NEVRAX NEL. 00010 * NEVRAX NEL is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2, or (at your option) 00013 * any later version. 00014 00015 * NEVRAX NEL is distributed in the hope that it will be useful, but 00016 * WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 * General Public License for more details. 00019 00020 * You should have received a copy of the GNU General Public License 00021 * along with NEVRAX NEL; see the file COPYING. If not, write to the 00022 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, 00023 * MA 02111-1307, USA. 00024 */ 00025 00026 #ifndef NL_LISTENER_USER_H 00027 #define NL_LISTENER_USER_H 00028 00029 #include "nel/misc/types_nl.h" 00030 #include "nel/sound/u_listener.h" 00031 #include "driver/sound_driver.h" 00032 #include "driver/listener.h" 00033 00034 00035 // This namespace contains the sound classes 00036 namespace NLSOUND { 00037 00038 00049 class CListenerUser : public UListener 00050 { 00051 public: 00052 00054 CListenerUser() : _DrvListener (NULL) {} 00056 void init( ISoundDriver *sd ) { nlassert( sd ); _DrvListener = sd->createListener(); } 00058 virtual ~CListenerUser() { if ( _DrvListener!=NULL ) delete _DrvListener; } 00059 00060 00062 00063 00064 virtual void setPos( const NLMISC::CVector& pos ); 00068 virtual void getPos( NLMISC::CVector& pos ) const { _DrvListener->getPos( pos ); } 00070 virtual void setVelocity( const NLMISC::CVector& vel ) { _DrvListener->setVelocity( vel ); } 00072 virtual void getVelocity( NLMISC::CVector& vel ) const { _DrvListener->getVelocity( vel ); } 00074 virtual void setOrientation( const NLMISC::CVector& front, 00075 const NLMISC::CVector& up ) { _DrvListener->setOrientation( front, up ); } 00077 virtual void getOrientation( NLMISC::CVector& front, 00078 NLMISC::CVector& up ) const { _DrvListener->getOrientation( front, up ); } 00085 virtual void setGain( float gain ) { _DrvListener->setGain( gain ); } 00087 virtual float getGain() const { return _DrvListener->getGain(); } 00089 00090 00092 IListener *getListener() { return _DrvListener; } 00093 00094 private: 00095 00097 IListener *_DrvListener; 00098 }; 00099 00100 00101 } // NLSOUND 00102 00103 00104 #endif // NL_LISTENER_USER_H 00105 00106 /* End of listener_user.h */ |