CLAM-Development  1.4.0
MIDIClocker.hxx
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2001-2004 MUSIC TECHNOLOGY GROUP (MTG)
3  * UNIVERSITAT POMPEU FABRA
4  *
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  *
20  */
21 
22 #ifndef __MIDIClocker__
23 #define __MIDIClocker__
24 
25 #include "Processing.hxx"
26 #include "MIDIDevice.hxx"
27 #include "MIDIEnums.hxx"
28 
29 namespace CLAM
30 {
31 
41 {
42 public:
44 
46  DYN_ATTRIBUTE (0, public, std::string, Device);
47 
48 protected:
49  void DefaultInit(void)
50  {
51  AddDevice();
52  UpdateData();
53 
54  SetDevice("default:default");
55  }
56 };
57 
58 
62 class MIDIClocker: public Processing
63 {
64 friend class MIDIManager;
65 friend class MIDIDevice;
66 protected:
70 public:
71 
78  virtual bool ConcreteConfigure(const ProcessingConfig& c)
79  throw(ErrProcessingObj);
80 
84  const ProcessingConfig &GetConfig() const { return mConfig;}
85 
87  :mInput("input",this,&MIDIClocker::DoClock)
88  {
89  mpDevice = 0;
91  }
92 
97  :mInput("input",this,&MIDIClocker::DoClock)
98  {
99  mpDevice = 0;
100  Configure(c);
101  }
102 
105 
106  const char * GetClassName() const {return "MIDIClocker";}
107 
110  bool Do(void)
111  {
112  return true;
113  }
114 
118  void GetDeviceInfo(MIDIDevice::TInfo &) const;
119 
120  /*
121  * @param val The value received with this message
122  * @return 1 if method has been executed correctly
123  */
125  {
126  if (mpDevice) mpDevice->SetClock(val);
127  }
128 
129 protected:
130  bool ConcreteStart(void);
131 
132 };
133 
134 
135 
136 } // namespace CLAM
137 #endif
138