Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
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 "Sound/SoundManager.h"
00007 
00008 //! Upon activation, loads plays a selected sound stored in ms/data/sound)
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     if(sndman) {
00024       sndman->stopPlay();
00025       sndman->playFile(f.c_str());
00026     }
00027     return this;
00028   }
00029 };
00030 
00031 /*! @file
00032  * @brief Defines PlaySoundControl, which when activated, plays a sound file
00033  * @author ejt (Creator)
00034  */
00035 
00036 #endif

Tekkotsu v5.1CVS
Generated Mon May 9 04:58:47 2016 by Doxygen 1.6.3