27 |
|
|
28 |
namespace LinuxSampler { |
namespace LinuxSampler { |
29 |
|
|
|
REGISTER_MIDI_INPUT_DRIVER(MidiInputDeviceAlsa); |
|
|
|
|
|
/* Common parameters */ |
|
|
REGISTER_MIDI_INPUT_DRIVER_PARAMETER(MidiInputDeviceAlsa, ParameterActive); |
|
|
REGISTER_MIDI_INPUT_DRIVER_PARAMETER(MidiInputDeviceAlsa, ParameterPorts); |
|
|
|
|
|
|
|
|
|
|
30 |
// *************** ParameterName *************** |
// *************** ParameterName *************** |
31 |
// * |
// * |
32 |
|
|
144 |
// *************** MidiInputDeviceAlsa *************** |
// *************** MidiInputDeviceAlsa *************** |
145 |
// * |
// * |
146 |
|
|
147 |
MidiInputDeviceAlsa::MidiInputDeviceAlsa(std::map<String,DeviceCreationParameter*> Parameters) : MidiInputDevice(Parameters), Thread(true, 1, -1) { |
MidiInputDeviceAlsa::MidiInputDeviceAlsa(std::map<String,DeviceCreationParameter*> Parameters) : MidiInputDevice(Parameters), Thread(true, true, 1, -1) { |
148 |
if (snd_seq_open(&hAlsaSeq, "default", SND_SEQ_OPEN_INPUT, 0) < 0) { |
if (snd_seq_open(&hAlsaSeq, "default", SND_SEQ_OPEN_INPUT, 0) < 0) { |
149 |
throw MidiInputException("Error opening ALSA sequencer"); |
throw MidiInputException("Error opening ALSA sequencer"); |
150 |
} |
} |
185 |
} |
} |
186 |
|
|
187 |
String MidiInputDeviceAlsa::Version() { |
String MidiInputDeviceAlsa::Version() { |
188 |
String s = "$Revision: 1.10 $"; |
String s = "$Revision: 1.13 $"; |
189 |
return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword |
return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword |
190 |
} |
} |
191 |
|
|
227 |
case SND_SEQ_EVENT_NOTEOFF: |
case SND_SEQ_EVENT_NOTEOFF: |
228 |
pMidiInputPort->DispatchNoteOff(ev->data.note.note, ev->data.note.velocity, ev->data.control.channel); |
pMidiInputPort->DispatchNoteOff(ev->data.note.note, ev->data.note.velocity, ev->data.control.channel); |
229 |
break; |
break; |
230 |
|
|
231 |
|
case SND_SEQ_EVENT_SYSEX: |
232 |
|
pMidiInputPort->DispatchSysex(ev->data.ext.ptr, ev->data.ext.len); |
233 |
|
break; |
234 |
} |
} |
235 |
snd_seq_free_event(ev); |
snd_seq_free_event(ev); |
236 |
} while (snd_seq_event_input_pending(hAlsaSeq, 0) > 0); |
} while (snd_seq_event_input_pending(hAlsaSeq, 0) > 0); |