00001 /* 00002 Enki - a fast 2D robot simulator 00003 Copyright (C) 1999-2008 Stephane Magnenat <stephane at magnenat dot net> 00004 Copyright (C) 2004-2005 Markus Waibel <markus dot waibel at epfl dot ch> 00005 Copyright (c) 2004-2005 Antoine Beyeler <abeyeler at ab-ware dot com> 00006 Copyright (C) 2005-2006 Laboratory of Intelligent Systems, EPFL, Lausanne 00007 Copyright (C) 2006-2008 Laboratory of Robotics Systems, EPFL, Lausanne 00008 See AUTHORS for details 00009 00010 This program is free software; the authors of any publication 00011 arising from research using this software are asked to add the 00012 following reference: 00013 Enki - a fast 2D robot simulator 00014 http://lis.epfl.ch/enki 00015 Stephane Magnenat <stephane at magnenat dot net>, 00016 Markus Waibel <markus dot waibel at epfl dot ch> 00017 Laboratory of Intelligent Systems, EPFL, Lausanne. 00018 00019 You can redistribute this program and/or modify 00020 it under the terms of the GNU General Public License as published by 00021 the Free Software Foundation; either version 2 of the License, or 00022 (at your option) any later version. 00023 00024 This program is distributed in the hope that it will be useful, 00025 but WITHOUT ANY WARRANTY; without even the implied warranty of 00026 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00027 GNU General Public License for more details. 00028 00029 You should have received a copy of the GNU General Public License 00030 along with this program; if not, write to the Free Software 00031 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00032 */ 00033 00034 #ifndef __ENKI_ACTIVESOUNDOBJECT_H 00035 #define __ENKI_ACTIVESOUNDOBJECT_H 00036 00037 #include "../Interaction.h" 00038 #include "../PhysicalEngine.h" 00039 00043 namespace Enki 00044 { 00045 00047 00048 class ActiveSoundSource: public LocalInteraction 00049 { 00050 public: 00052 unsigned noOfChannels; 00053 00055 double *pitch; 00056 00058 bool enableFlag; 00060 double elapsedTime; 00062 double activityTime; 00063 00065 ActiveSoundSource(Robot *owner, double r, unsigned channels); 00067 ~ActiveSoundSource(); 00068 // Local interaction functions 00069 virtual void init() {} 00070 virtual void objectStep(double dt, PhysicalObject *po, World *w) {} 00071 00073 void setSoundRange(double range); 00075 double getSound(unsigned channel); 00077 double getMaxSound(int* channel); 00079 void setSound(unsigned channel, double signal); 00081 void realisticSetSound(unsigned channel, double signal); 00082 }; 00083 00085 00086 class ActiveSoundObject 00087 { 00088 public: 00090 ActiveSoundSource speaker; 00091 00092 public: 00094 ActiveSoundObject(Robot *owner, double actionRange, unsigned channels); 00095 }; 00096 } 00097 00098 #endif 00099
1.5.1