3 |
* LinuxSampler - modular, streaming capable sampler * |
* LinuxSampler - modular, streaming capable sampler * |
4 |
* * |
* * |
5 |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
6 |
* Copyright (C) 2005, 2006 Christian Schoenebeck * |
* Copyright (C) 2005 - 2008 Christian Schoenebeck * |
7 |
* * |
* * |
8 |
* This program is free software; you can redistribute it and/or modify * |
* This program is free software; you can redistribute it and/or modify * |
9 |
* it under the terms of the GNU General Public License as published by * |
* it under the terms of the GNU General Public License as published by * |
34 |
#include "../DeviceParameter.h" |
#include "../DeviceParameter.h" |
35 |
#include "MidiInputPort.h" |
#include "MidiInputPort.h" |
36 |
#include "../../engines/Engine.h" |
#include "../../engines/Engine.h" |
37 |
|
#include "../../EventListeners.h" |
38 |
|
|
39 |
namespace LinuxSampler { |
namespace LinuxSampler { |
40 |
|
|
153 |
MidiInputPort* GetPort(uint iPort) throw (MidiInputException); |
MidiInputPort* GetPort(uint iPort) throw (MidiInputException); |
154 |
|
|
155 |
/** |
/** |
156 |
|
* Returns amount of MIDI ports this MIDI input device currently |
157 |
|
* provides. |
158 |
|
*/ |
159 |
|
uint PortCount(); |
160 |
|
|
161 |
|
/** |
162 |
* Return all device parameter settings. |
* Return all device parameter settings. |
163 |
*/ |
*/ |
164 |
std::map<String,DeviceCreationParameter*> DeviceParameters(); |
std::map<String,DeviceCreationParameter*> DeviceParameters(); |
165 |
|
|
166 |
|
/** |
167 |
|
* Registers the specified listener to be notified |
168 |
|
* when the number of MIDI input ports is changed. |
169 |
|
*/ |
170 |
|
void AddMidiPortCountListener(MidiPortCountListener* l); |
171 |
|
|
172 |
|
/** |
173 |
|
* Removes the specified listener, to stop being notified of |
174 |
|
* further MIDI input port count chances. |
175 |
|
*/ |
176 |
|
void RemoveMidiPortCountListener(MidiPortCountListener* l); |
177 |
|
|
178 |
protected: |
protected: |
179 |
std::map<String,DeviceCreationParameter*> Parameters; ///< All device parameters. |
std::map<String,DeviceCreationParameter*> Parameters; ///< All device parameters. |
180 |
std::map<int,MidiInputPort*> Ports; ///< All MIDI ports. |
std::map<int,MidiInputPort*> Ports; ///< All MIDI ports. |
181 |
void* pSampler; ///< Sampler instance. FIXME: should actually be of type Sampler* |
void* pSampler; ///< Sampler instance. FIXME: should actually be of type Sampler* |
182 |
|
ListenerList<MidiPortCountListener*> portCountListeners; |
183 |
|
|
184 |
/** |
/** |
185 |
* Constructor |
* Constructor |
198 |
virtual ~MidiInputDevice(); |
virtual ~MidiInputDevice(); |
199 |
|
|
200 |
/** |
/** |
201 |
|
* Notifies listeners that the amount of MIDI inpurt ports have |
202 |
|
* been changed. |
203 |
|
* @param NewCount The new number of MIDI input ports. |
204 |
|
*/ |
205 |
|
void fireMidiPortCountChanged(int NewCount); |
206 |
|
|
207 |
|
/** |
208 |
|
* Notifies listeners that the supplied MIDI input port is |
209 |
|
* going to be removed soon. |
210 |
|
* @param pPort The MIDI input port that is going to be removed. |
211 |
|
*/ |
212 |
|
void fireMidiPortToBeRemoved(MidiInputPort* pPort); |
213 |
|
|
214 |
|
/** |
215 |
|
* Notifies listeners that the supplied MIDI input port has |
216 |
|
* just been added. |
217 |
|
* @param pPort The MIDI input port that has been added. |
218 |
|
*/ |
219 |
|
void fireMidiPortAdded(MidiInputPort* pPort); |
220 |
|
|
221 |
|
/** |
222 |
* Set number of MIDI ports required by the engine |
* Set number of MIDI ports required by the engine |
223 |
* This can either do nothing, create more ports |
* This can either do nothing, create more ports |
224 |
* or destroy ports depenging on the parameter |
* or destroy ports depenging on the parameter |