Homepage Demos Overview Downloads Tutorials Reference
Credits

PlaySoundControl.h

Go to the documentation of this file.
00001 //-*-c++-*-
00002 #ifndef INCLUDED_PlaySoundControl_h_
00003 #define INCLUDED_PlaySoundControl_h_
00004 
00005 #include "FileBrowserControl.h"
00006 #include "SoundPlay/SoundManager.h"
00007 
00008 //! Upon activation, loads a position from a file name read from cin (stored in ms/data/motion...)
00009 class PlaySoundControl : public FileBrowserControl {
00010  public:
00011   //! Constructor
00012   PlaySoundControl(const std::string& n)
00013     : FileBrowserControl(n,"Plays a sound from a user specified sound file",config->sound.root)
00014   {
00015     setFilter("*.wav");
00016   }
00017   //! Destructor
00018   virtual ~PlaySoundControl() {}
00019 
00020 protected:
00021   //!does the actual loading of the MotionSequence
00022   virtual ControlBase* selectedFile(const std::string& f) {
00023     sndman->StopPlay();
00024     if(sndman)
00025       sndman->PlayFile(f.c_str());
00026     return this;
00027   }
00028 };
00029 
00030 /*! @file
00031  * @brief Defines PlaySoundControl, which when activated, plays a sound selected from the memory stick
00032  * @author ejt (Creator)
00033  *
00034  * $Author: ejt $
00035  * $Name: tekkotsu-2_1 $
00036  * $Revision: 1.6 $
00037  * $State: Rel $
00038  * $Date: 2003/09/25 15:26:11 $
00039  */
00040 
00041 #endif

Tekkotsu v2.1
Generated Tue Mar 16 23:19:14 2004 by Doxygen 1.3.5