Tekkotsu Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
PlaySoundControl.hGo 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 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-4_0 $ 00036 * $Revision: 1.10 $ 00037 * $State: Exp $ 00038 * $Date: 2007/01/29 01:16:57 $ 00039 */ 00040 00041 #endif |
Tekkotsu v4.0 |
Generated Thu Nov 22 00:54:54 2007 by Doxygen 1.5.4 |