CLAM-Development
1.4.0
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
src
Processing
MIDIIO
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
40
class
MIDIClockerConfig
:
public
ProcessingConfig
41
{
42
public
:
43
DYNAMIC_TYPE_USING_INTERFACE
(
MIDIClockerConfig
, 1,
ProcessingConfig
);
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
:
67
MIDIClockerConfig
mConfig
;
68
MIDIDevice
*
mpDevice
;
69
FloatInControl
mInput
;
70
public
:
71
78
virtual
bool
ConcreteConfigure
(
const
ProcessingConfig
& c)
79
throw
(
ErrProcessingObj
);
80
84
const
ProcessingConfig
&
GetConfig
()
const
{
return
mConfig
;}
85
86
MIDIClocker
()
87
:
mInput
(
"input"
,this,&
MIDIClocker
::
DoClock
)
88
{
89
mpDevice
= 0;
90
Configure
(
MIDIClockerConfig
());
91
}
92
96
MIDIClocker
(
const
MIDIClockerConfig
&c)
97
:
mInput
(
"input"
,this,&
MIDIClocker
::
DoClock
)
98
{
99
mpDevice
= 0;
100
Configure
(c);
101
}
102
104
~MIDIClocker
() {
if
(
mpDevice
)
mpDevice
->
Unregister
(*
this
); }
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
*/
124
void
DoClock
(
TControlData
val)
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
Generated by
1.8.1