1 |
/*************************************************************************** |
/*************************************************************************** |
2 |
* * |
* * |
3 |
* Copyright (C) 2008 - 2009 Andreas Persson * |
* Copyright (C) 2008 - 2011 Andreas Persson * |
4 |
* * |
* * |
5 |
* This program is free software; you can redistribute it and/or modify * |
* This program is free software; you can redistribute it and/or modify * |
6 |
* 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 * |
248 |
engine_channel->OutputChannel(1) << ' ' << |
engine_channel->OutputChannel(1) << ' ' << |
249 |
(engine_channel->UsesNoMidiInstrumentMap() ? -2 : |
(engine_channel->UsesNoMidiInstrumentMap() ? -2 : |
250 |
(engine_channel->UsesDefaultMidiInstrumentMap() ? -1 : |
(engine_channel->UsesDefaultMidiInstrumentMap() ? -1 : |
251 |
engine_channel->GetMidiInstrumentMap())) << '\n'; |
engine_channel->GetMidiInstrumentMap())) << ' ' << |
252 |
|
engine_channel->EngineName() << '\n'; |
253 |
|
|
254 |
for (int i = 0 ; i < engine_channel->GetFxSendCount() ; i++) { |
for (int i = 0 ; i < engine_channel->GetFxSendCount() ; i++) { |
255 |
FxSend* fxsend = engine_channel->GetFxSend(i); |
FxSend* fxsend = engine_channel->GetFxSend(i); |
303 |
bool mute; |
bool mute; |
304 |
s >> index >> solo >> mute; |
s >> index >> solo >> mute; |
305 |
|
|
306 |
|
int left = -1; |
307 |
|
int right; |
308 |
|
int oldMapId; |
309 |
|
String engineType = "gig"; |
310 |
|
if (s.get() == ' ') { |
311 |
|
s >> left >> right >> oldMapId; |
312 |
|
if (s.get() == ' ') { |
313 |
|
s >> engineType; |
314 |
|
// skip rest of line |
315 |
|
s.ignore(std::numeric_limits<int>::max(), '\n'); |
316 |
|
} |
317 |
|
} |
318 |
SamplerChannel* channel = global->pSampler->AddSamplerChannel(); |
SamplerChannel* channel = global->pSampler->AddSamplerChannel(); |
319 |
channel->SetEngineType("gig"); |
channel->SetEngineType(engineType); |
320 |
channel->SetAudioOutputDevice(pAudioDevice); |
channel->SetAudioOutputDevice(pAudioDevice); |
321 |
channel->SetMidiInputDevice(pMidiDevice); |
channel->SetMidiInputDevice(pMidiDevice); |
322 |
channel->SetMidiInputChannel(midi_chan_t(midiChannel)); |
channel->SetMidiInputChannel(midi_chan_t(midiChannel)); |
323 |
|
|
324 |
engine_channel = channel->GetEngineChannel(); |
engine_channel = channel->GetEngineChannel(); |
325 |
engine_channel->Volume(volume); |
engine_channel->Volume(volume); |
326 |
if (s.get() == ' ') { |
|
327 |
int left; |
if (left != -1) { |
|
int right; |
|
|
int oldMapId; |
|
|
s >> left >> right >> oldMapId; |
|
328 |
engine_channel->SetOutputChannel(0, left); |
engine_channel->SetOutputChannel(0, left); |
329 |
engine_channel->SetOutputChannel(1, right); |
engine_channel->SetOutputChannel(1, right); |
330 |
|
|
333 |
} else if (oldMapId >= 0) { |
} else if (oldMapId >= 0) { |
334 |
engine_channel->SetMidiInstrumentMap(oldToNewId[oldMapId]); |
engine_channel->SetMidiInstrumentMap(oldToNewId[oldMapId]); |
335 |
} |
} |
|
// skip rest of line |
|
|
s.ignore(std::numeric_limits<int>::max(), '\n'); |
|
336 |
} |
} |
337 |
if (!filename.empty() && index != -1) { |
if (!filename.empty() && index != -1) { |
338 |
InstrumentManager::instrument_id_t id; |
InstrumentManager::instrument_id_t id; |