Marsyas  0.6.0-alpha
/usr/src/RPM/BUILD/marsyas-0.6.0/src/marsyas/sched/EvValUpd.h
Go to the documentation of this file.
00001 /*
00002 ** Copyright (C) 1998-2005 George Tzanetakis <gtzan@cs.uvic.ca>
00003 **
00004 ** This program is free software; you can redistribute it and/or modify
00005 ** it under the terms of the GNU General Public License as published by
00006 ** the Free Software Foundation; either version 2 of the License, or
00007 ** (at your option) any later version.
00008 **
00009 ** This program is distributed in the hope that it will be useful,
00010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 ** GNU General Public License for more details.
00013 **
00014 ** You should have received a copy of the GNU General Public License
00015 ** along with this program; if not, write to the Free Software
00016 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00017 */
00018 
00019 
00020 #ifndef MARSYAS_EV_VALUPD_H
00021 #define MARSYAS_EV_VALUPD_H
00022 
00023 #include <marsyas/sched/EvEvent.h>
00024 #include <marsyas/sched/TmControlValue.h>
00025 #include <marsyas/system/MarControl.h>
00026 
00027 #include <string>
00028 #include <iostream>
00029 
00030 namespace Marsyas
00031 {
00040 class MarSystem; // forward declaration
00041 
00042 class marsyas_EXPORT EvValUpd : public EvEvent {
00043 protected:
00044   MarSystem* target_;
00045   std::string cname_;
00046   MarControlPtr value_;
00047 
00048 public:
00049   // Constructors
00050   EvValUpd(std::string cname, MarControlPtr);
00051   EvValUpd(MarSystem*, std::string cname, MarControlPtr);
00052   EvValUpd(EvValUpd& e);
00053   virtual ~EvValUpd();
00054 
00055   // Set/Get methods
00056   std::string getCName() const {return cname_;};
00057   MarControlPtr getValue() const {return value_;};
00058   MarSystem* getTarget() const {return target_;};
00059 
00060   void setCName(std::string cname) {cname_=cname;};
00061   void setValue(MarControlPtr value) {value_=value;};
00062   void setTarget(MarSystem* ms) {target_=ms;};
00063   void set(MarSystem* ms, std::string cname, MarControlPtr);
00064   void updctrl(std::string cname, TmControlValue value);
00065 
00066   // Event dispatch
00067   void dispatch();
00068 
00069   virtual EvValUpd* clone();
00070 
00071   // the usual stream IO
00072   friend std::ostream& operator<<(std::ostream&, EvEvent&);
00073   friend std::istream& operator>>(std::istream&, EvEvent&);
00074 };
00075 
00076 }//namespace Marsyas
00077 
00078 #endif