173 |
} |
} |
174 |
|
|
175 |
/* |
/* |
176 |
|
These methods can be overloaded by different plugin types to map |
177 |
|
file names to/from file names to be used in the state text, making |
178 |
|
it possible for state to be self-contained and/or movable. |
179 |
|
*/ |
180 |
|
|
181 |
|
String Plugin::PathToState(const String& string) { |
182 |
|
return string; |
183 |
|
} |
184 |
|
|
185 |
|
String Plugin::PathFromState(const String& string) { |
186 |
|
return string; |
187 |
|
} |
188 |
|
|
189 |
|
/* |
190 |
The sampler state is stored in a text base format, designed to |
The sampler state is stored in a text base format, designed to |
191 |
be easy to parse with the istream >> operator. Values are |
be easy to parse with the istream >> operator. Values are |
192 |
separated by spaces or newlines. All string values that may |
separated by spaces or newlines. All string values that may |
232 |
int(iter->first.midi_bank_lsb)) << ' ' << |
int(iter->first.midi_bank_lsb)) << ' ' << |
233 |
int(iter->first.midi_prog) << ' ' << |
int(iter->first.midi_prog) << ' ' << |
234 |
iter->second.EngineName << ' ' << |
iter->second.EngineName << ' ' << |
235 |
iter->second.InstrumentFile << '\n' << |
PathToState(iter->second.InstrumentFile) << '\n' << |
236 |
MIDIMAPPING << ' ' << |
MIDIMAPPING << ' ' << |
237 |
iter->second.InstrumentIndex << ' ' << |
iter->second.InstrumentIndex << ' ' << |
238 |
iter->second.Volume << ' ' << |
iter->second.Volume << ' ' << |
254 |
String filename = engine_channel->InstrumentFileName(); |
String filename = engine_channel->InstrumentFileName(); |
255 |
s << channel->GetMidiInputChannel() << ' ' << |
s << channel->GetMidiInputChannel() << ' ' << |
256 |
engine_channel->Volume() << ' ' << |
engine_channel->Volume() << ' ' << |
257 |
filename << '\n' << |
PathToState(filename) << '\n' << |
258 |
engine_channel->InstrumentIndex() << ' ' << |
engine_channel->InstrumentIndex() << ' ' << |
259 |
engine_channel->GetSolo() << ' ' << |
engine_channel->GetSolo() << ' ' << |
260 |
(engine_channel->GetMute() == 1) << ' ' << |
(engine_channel->GetMute() == 1) << ' ' << |
350 |
} |
} |
351 |
if (!filename.empty() && index != -1) { |
if (!filename.empty() && index != -1) { |
352 |
InstrumentManager::instrument_id_t id; |
InstrumentManager::instrument_id_t id; |
353 |
id.FileName = filename; |
id.FileName = PathFromState(filename); |
354 |
id.Index = index; |
id.Index = index; |
355 |
InstrumentManager::LoadInstrumentInBackground(id, engine_channel); |
InstrumentManager::LoadInstrumentInBackground(id, engine_channel); |
356 |
} |
} |