00001 /* Presentable.h 00002 00003 Copyright (C) David C. J. Matthews 2004 dm at prolingua.co.uk 00004 00005 This program is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU General Public License 00007 as published by the Free Software Foundation; either version 2 00008 of the License, or (at your option) any later version. 00009 00010 This program is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 GNU General Public License for more details. 00014 00015 You should have received a copy of the GNU General Public License 00016 along with this program; if not, write to the Free Software 00017 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00018 Or, point your browser to http://www.gnu.org/copyleft/gpl.html 00019 00020 */ 00021 00022 00023 #if !defined(PRESENTABLE_H) 00024 #define PRESENTABLE_H 00025 00026 #include "Ingredients.h" 00027 // Dependencies 00028 #include "Root.h" 00029 #include "BaseClasses.h" 00030 #include "BaseActions.h" 00031 #include "Actions.h" 00032 00033 00034 class MHPresentable : public MHIngredient 00035 { 00036 public: 00037 MHPresentable() {} 00038 MHPresentable(const MHPresentable &ref): MHIngredient(ref) {} 00039 // No new components. 00040 00041 // Actions. 00042 virtual void Run(MHEngine *engine); 00043 virtual void Stop(MHEngine *engine); 00044 00045 // Additional actions for stream components. 00046 virtual void SetStreamRef(MHEngine *, const MHContentRef &) {} 00047 virtual void BeginPlaying(MHEngine *) {} 00048 virtual void StopPlaying(MHEngine *) {} 00049 }; 00050 00051 // Run and stop actions. 00052 class MHRun: public MHElemAction 00053 { 00054 public: 00055 MHRun(): MHElemAction(":Run") {} 00056 virtual void Perform(MHEngine *engine) { Target(engine)->Run(engine); } 00057 }; 00058 00059 class MHStop: public MHElemAction 00060 { 00061 public: 00062 MHStop(): MHElemAction(":Stop") {} 00063 virtual void Perform(MHEngine *engine) { Target(engine)->Stop(engine); } 00064 }; 00065 00066 #endif
1.6.3