/[svn]/linuxsampler/trunk/src/engines/sfz/EngineChannel.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/sfz/EngineChannel.cpp

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

revision 3081 by schoenebeck, Sun Apr 10 18:22:23 2016 UTC revision 3082 by schoenebeck, Mon Jan 9 18:39:35 2017 UTC
# Line 94  namespace LinuxSampler { namespace sfz { Line 94  namespace LinuxSampler { namespace sfz {
94              // keep the dimension regions and samples that are in use              // keep the dimension regions and samples that are in use
95              pInstrumentManager->HandBackInstrument(cmd.pInstrument, this, cmd.pRegionsInUse);              pInstrumentManager->HandBackInstrument(cmd.pInstrument, this, cmd.pRegionsInUse);
96          }          }
97            if (cmd.pScript) {
98                // give old instrument script back to instrument resource manager
99                cmd.pScript->resetAll();
100            }
101          cmd.pRegionsInUse->clear();          cmd.pRegionsInUse->clear();
102    
103          // delete all key groups          // delete all key groups
# Line 110  namespace LinuxSampler { namespace sfz { Line 114  namespace LinuxSampler { namespace sfz {
114              if (!newInstrument) {              if (!newInstrument) {
115                  throw InstrumentManagerException("resource was not created");                  throw InstrumentManagerException("resource was not created");
116              }              }
117    
118                if (newInstrument->scripts.size() > 1) {
119                    std::cerr << "WARNING: Executing more than one real-time instrument script slot is not implemented yet!\n";
120                }
121                ::sfz::Script* script = (!newInstrument->scripts.empty()) ? &newInstrument->scripts[0] : NULL;
122                if (script) {
123                    String sourceCode = script->GetSourceCode();
124                    LoadInstrumentScript(sourceCode);
125                }
126          }          }
127          catch (InstrumentManagerException e) {          catch (InstrumentManagerException e) {
128              InstrumentStat = -3;              InstrumentStat = -3;
# Line 146  namespace LinuxSampler { namespace sfz { Line 159  namespace LinuxSampler { namespace sfz {
159          InstrumentIdxName = newInstrument->GetName();          InstrumentIdxName = newInstrument->GetName();
160          InstrumentStat = 100;          InstrumentStat = 100;
161    
162          ChangeInstrument(newInstrument);          {
163                InstrumentChangeCmd< ::sfz::Region, ::sfz::Instrument>& cmd =
164                    ChangeInstrument(newInstrument);
165                if (cmd.pScript) {
166                    // give old instrument script back to instrument resource manager
167                    cmd.pScript->resetAll();
168                }
169            }
170    
171          StatusChanged(true);          StatusChanged(true);
172      }      }

Legend:
Removed from v.3081  
changed lines
  Added in v.3082

  ViewVC Help
Powered by ViewVC