/[svn]/linuxsampler/trunk/src/drivers/Plugin.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/drivers/Plugin.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2173 by persson, Sun Feb 20 14:20:22 2011 UTC revision 2174 by capela, Tue Apr 12 15:19:56 2011 UTC
# Line 173  namespace LinuxSampler { Line 173  namespace LinuxSampler {
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
# Line 218  namespace LinuxSampler { Line 232  namespace LinuxSampler {
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 << ' ' <<
# Line 240  namespace LinuxSampler { Line 254  namespace LinuxSampler {
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) << ' ' <<
# Line 336  namespace LinuxSampler { Line 350  namespace LinuxSampler {
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                  }                  }

Legend:
Removed from v.2173  
changed lines
  Added in v.2174

  ViewVC Help
Powered by ViewVC