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 - 2014 Christian Schoenebeck * |
* Copyright (C) 2005 - 2016 Christian Schoenebeck * |
7 |
* * |
* * |
8 |
* This library is free software; you can redistribute it and/or modify * |
* This library 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 * |
175 |
pEngineChannel->Connect(pPort); |
pEngineChannel->Connect(pPort); |
176 |
} else { // no engine channel yet, remember it for future connection ... |
} else { // no engine channel yet, remember it for future connection ... |
177 |
const midi_conn_t c = { |
const midi_conn_t c = { |
178 |
pPort->GetDevice()->MidiInputDeviceID(), |
static_cast<uint>(pPort->GetDevice()->MidiInputDeviceID()), |
179 |
pPort->GetPortNumber() |
pPort->GetPortNumber() |
180 |
}; |
}; |
181 |
this->vMidiInputs.push_back(c); |
this->vMidiInputs.push_back(c); |
195 |
pEngineChannel->Disconnect(pPort); |
pEngineChannel->Disconnect(pPort); |
196 |
} else { // no engine channel yet, forget it regarding future connection ... |
} else { // no engine channel yet, forget it regarding future connection ... |
197 |
const midi_conn_t c = { |
const midi_conn_t c = { |
198 |
pPort->GetDevice()->MidiInputDeviceID(), |
static_cast<uint>(pPort->GetDevice()->MidiInputDeviceID()), |
199 |
pPort->GetPortNumber() |
pPort->GetPortNumber() |
200 |
}; |
}; |
201 |
for (int i = this->vMidiInputs.size() - 1; i >= 0; --i) { |
for (ssize_t i = this->vMidiInputs.size() - 1; i >= 0; --i) { |
202 |
if (this->vMidiInputs[i] == c) |
if (this->vMidiInputs[i] == c) |
203 |
this->vMidiInputs.erase(this->vMidiInputs.begin() + i); |
this->vMidiInputs.erase(this->vMidiInputs.begin() + i); |
204 |
// no break or return here, for safety reasons |
// no break or return here, for safety reasons |
270 |
this->vMidiInputs.clear(); |
this->vMidiInputs.clear(); |
271 |
// store the new connection (alone) |
// store the new connection (alone) |
272 |
const midi_conn_t c = { |
const midi_conn_t c = { |
273 |
pNewPort->GetDevice()->MidiInputDeviceID(), |
static_cast<uint>(pNewPort->GetDevice()->MidiInputDeviceID()), |
274 |
pNewPort->GetPortNumber() |
pNewPort->GetPortNumber() |
275 |
}; |
}; |
276 |
this->vMidiInputs.push_back(c); |
this->vMidiInputs.push_back(c); |
379 |
} |
} |
380 |
|
|
381 |
uint Sampler::SamplerChannels() { |
uint Sampler::SamplerChannels() { |
382 |
return mSamplerChannels.size(); |
return (uint) mSamplerChannels.size(); |
383 |
} |
} |
384 |
|
|
385 |
void Sampler::AddChannelCountListener(ChannelCountListener* l) { |
void Sampler::AddChannelCountListener(ChannelCountListener* l) { |
672 |
} |
} |
673 |
|
|
674 |
uint Sampler::AudioOutputDevices() { |
uint Sampler::AudioOutputDevices() { |
675 |
return AudioOutputDeviceFactory::Devices().size(); |
return (uint) AudioOutputDeviceFactory::Devices().size(); |
676 |
} |
} |
677 |
|
|
678 |
uint Sampler::MidiInputDevices() { |
uint Sampler::MidiInputDevices() { |
679 |
return MidiInputDeviceFactory::Devices().size(); |
return (uint) MidiInputDeviceFactory::Devices().size(); |
680 |
} |
} |
681 |
|
|
682 |
std::map<uint, AudioOutputDevice*> Sampler::GetAudioOutputDevices() { |
std::map<uint, AudioOutputDevice*> Sampler::GetAudioOutputDevices() { |