/[svn]/linuxsampler/trunk/src/network/lscpserver.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/network/lscpserver.cpp

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

revision 121 by senkov, Sat Jun 12 07:46:02 2004 UTC revision 133 by capela, Fri Jun 18 14:29:02 2004 UTC
# Line 24  Line 24 
24  #include "lscpresultset.h"  #include "lscpresultset.h"
25    
26  #include "../engines/gig/Engine.h"  #include "../engines/gig/Engine.h"
27    #include "../audiodriver/AudioOutputDeviceFactory.h"
28    
29  LSCPServer::LSCPServer(Sampler* pSampler) : Thread(false, 0, -4) {  LSCPServer::LSCPServer(Sampler* pSampler) : Thread(false, 0, -4) {
30      this->pSampler = pSampler;      this->pSampler = pSampler;
# Line 89  void LSCPServer::AnswerClient(String Ret Line 90  void LSCPServer::AnswerClient(String Ret
90      send(hSession, ReturnMessage.c_str(), ReturnMessage.size(), 0);      send(hSession, ReturnMessage.c_str(), ReturnMessage.size(), 0);
91  }  }
92    
93    String LSCPServer::CreateAudioOutputDevice(String Driver, std::map<String,String> Parameters) {
94        dmsg(2,("LSCPServer: CreateAudioOutputDevice(Driver=%s)\n", Driver.c_str()));
95        LSCPResultSet result;
96        try {
97            AudioOutputDevice* pDevice = pSampler->CreateAudioOutputDevice(Driver, Parameters);
98            std::map<uint, AudioOutputDevice*> devices = pSampler->GetAudioOutputDevices();
99            // search for the created device to get its index
100            int index = -1;
101            std::map<uint, AudioOutputDevice*>::iterator iter = devices.begin();
102            for (; iter != devices.end(); iter++) {
103                if (iter->second == pDevice) {
104                    index = iter->first;
105                    break;
106                }
107            }
108            if (index == -1) throw LinuxSamplerException("Internal error: could not find created audio output device.");
109            result = index; // success
110        }
111        catch (LinuxSamplerException e) {
112            result.Error(e);
113        }
114        return result.Produce();
115    }
116    
117    String LSCPServer::DestroyAudioOutputDevice(uint DeviceIndex) {
118        dmsg(2,("LSCPServer: DestroyAudioOutputDevice(DeviceIndex=%d)\n", DeviceIndex));
119        LSCPResultSet result;
120        try {
121            std::map<uint, AudioOutputDevice*> devices = pSampler->GetAudioOutputDevices();
122            if (!devices[DeviceIndex]) throw LinuxSamplerException("There is no audio output device with index " + ToString(DeviceIndex) + ".");
123            AudioOutputDevice* pDevice = devices[DeviceIndex];
124            pSampler->DestroyAudioOutputDevice(pDevice);
125        }
126        catch (LinuxSamplerException e) {
127            result.Error(e);
128        }
129        return result.Produce();
130    }
131    
132  /**  /**
133   * Will be called by the parser to load an instrument.   * Will be called by the parser to load an instrument.
134   */   */
# Line 100  String LSCPServer::LoadInstrument(String Line 140  String LSCPServer::LoadInstrument(String
140          if (!pSamplerChannel) throw LinuxSamplerException("Index out of bounds");          if (!pSamplerChannel) throw LinuxSamplerException("Index out of bounds");
141          Engine* pEngine = pSamplerChannel->GetEngine();          Engine* pEngine = pSamplerChannel->GetEngine();
142          if (!pEngine) throw LinuxSamplerException("No engine loaded on channel");          if (!pEngine) throw LinuxSamplerException("No engine loaded on channel");
143          pEngine->LoadInstrument(Filename.c_str(), uiInstrument);          LSCPLoadInstrument *pLoadInstrument = new LSCPLoadInstrument(pEngine, Filename.c_str(), uiInstrument);
144            pLoadInstrument->StartThread();
145      }      }
146      catch (LinuxSamplerException e) {      catch (LinuxSamplerException e) {
147           result.Error(e);           result.Error(e);
# Line 177  String LSCPServer::GetEngineInfo(String Line 218  String LSCPServer::GetEngineInfo(String
218          if ((EngineName == "GigEngine") || (EngineName == "gig")) {          if ((EngineName == "GigEngine") || (EngineName == "gig")) {
219              Engine* pEngine = new LinuxSampler::gig::Engine;              Engine* pEngine = new LinuxSampler::gig::Engine;
220              result.Add(pEngine->Description());              result.Add(pEngine->Description());
221                result.Add(pEngine->Version());
222              delete pEngine;              delete pEngine;
223          }          }
224          else throw LinuxSamplerException("Unknown engine type");          else throw LinuxSamplerException("Unknown engine type");
# Line 198  String LSCPServer::GetChannelInfo(uint u Line 240  String LSCPServer::GetChannelInfo(uint u
240          SamplerChannel* pSamplerChannel = pSampler->GetSamplerChannel(uiSamplerChannel);          SamplerChannel* pSamplerChannel = pSampler->GetSamplerChannel(uiSamplerChannel);
241          if (!pSamplerChannel) throw LinuxSamplerException("Index out of bounds");          if (!pSamplerChannel) throw LinuxSamplerException("Index out of bounds");
242          Engine* pEngine = pSamplerChannel->GetEngine();          Engine* pEngine = pSamplerChannel->GetEngine();
243            
244          //Defaults values          //Defaults values
245          String EngineName = "NONE";          String EngineName = "NONE";
246          float Volume = 0;          float Volume = 0;
247          String InstrumentFileName = "NONE";          String InstrumentFileName = "NONE";
248          int InstrumentIndex = 0;          int InstrumentIndex = -1;
249                    int InstrumentStatus = -1;
250    
251          if (pEngine) {          if (pEngine) {
252              EngineName =  pEngine->EngineName();              EngineName =  pEngine->EngineName();
253              Volume = pEngine->Volume();              Volume = pEngine->Volume();
254              int iIdx = pEngine->InstrumentIndex();              InstrumentStatus = pEngine->InstrumentStatus();
255              if (iIdx != -1) {              InstrumentIndex = pEngine->InstrumentIndex();
256                if (InstrumentIndex != -1)
257                  InstrumentFileName = pEngine->InstrumentFileName();                  InstrumentFileName = pEngine->InstrumentFileName();
                 InstrumentIndex = iIdx;  
             }  
258          }          }
259    
260          result.Add("ENGINE_NAME", EngineName);          result.Add("ENGINE_NAME", EngineName);
# Line 225  String LSCPServer::GetChannelInfo(uint u Line 267  String LSCPServer::GetChannelInfo(uint u
267    
268          result.Add("INSTRUMENT_FILE", InstrumentFileName);          result.Add("INSTRUMENT_FILE", InstrumentFileName);
269          result.Add("INSTRUMENT_NR", InstrumentIndex);          result.Add("INSTRUMENT_NR", InstrumentIndex);
270                    result.Add("INSTRUMENT_STATUS", InstrumentStatus);
271    
272          //Some more hardcoded stuff for now to make GUI look good          //Some more hardcoded stuff for now to make GUI look good
273          result.Add("MIDI_INPUT_DEVICE", "0");          result.Add("MIDI_INPUT_DEVICE", "0");
274          result.Add("MIDI_INPUT_PORT", "0");          result.Add("MIDI_INPUT_PORT", "0");
# Line 289  String LSCPServer::GetBufferFill(fill_re Line 332  String LSCPServer::GetBufferFill(fill_re
332          if (!pSamplerChannel) throw LinuxSamplerException("Index out of bounds");          if (!pSamplerChannel) throw LinuxSamplerException("Index out of bounds");
333          Engine* pEngine = pSamplerChannel->GetEngine();          Engine* pEngine = pSamplerChannel->GetEngine();
334          if (!pEngine) throw LinuxSamplerException("No engine loaded on channel");          if (!pEngine) throw LinuxSamplerException("No engine loaded on channel");
335          if (!pEngine->DiskStreamSupported()) return "NA\r\n"; //FIXME: Update resultset class to support "NA"          if (!pEngine->DiskStreamSupported())
336          switch (ResponseType) {              result.Add("NA");
337              case fill_response_bytes:          else {
338                  result.Add(pEngine->DiskStreamBufferFillBytes());              switch (ResponseType) {
339                  break;                  case fill_response_bytes:
340              case fill_response_percentage:                      result.Add(pEngine->DiskStreamBufferFillBytes());
341                  result.Add(pEngine->DiskStreamBufferFillPercentage());                      break;
342                  break;                  case fill_response_percentage:
343              default:                      result.Add(pEngine->DiskStreamBufferFillPercentage());
344                  throw LinuxSamplerException("Unknown fill response type");                      break;
345          }                  default:
346                        throw LinuxSamplerException("Unknown fill response type");
347                }
348            }
349      }      }
350      catch (LinuxSamplerException e) {      catch (LinuxSamplerException e) {
351           result.Error(e);           result.Error(e);
# Line 307  String LSCPServer::GetBufferFill(fill_re Line 353  String LSCPServer::GetBufferFill(fill_re
353      return result.Produce();      return result.Produce();
354  }  }
355    
356  /**  String LSCPServer::GetAvailableAudioOutputDrivers() {
357   * Will be called by the parser to change the audio output type on a      dmsg(2,("LSCPServer: GetAvailableAudioOutputDrivers()\n"));
  * particular sampler channel.  
  */  
 String LSCPServer::SetAudioOutputType(AudioOutputDevice::type_t AudioOutputType, uint uiSamplerChannel) {  
     dmsg(2,("LSCPServer: SetAudioOutputType(AudioOutputType=%d, SamplerChannel=%d)\n", AudioOutputType, uiSamplerChannel));  
358      LSCPResultSet result;      LSCPResultSet result;
359      try {      try {
360          SamplerChannel* pSamplerChannel = pSampler->GetSamplerChannel(uiSamplerChannel);          String s = AudioOutputDeviceFactory::AvailableDriversAsString();
361          if (!pSamplerChannel) throw LinuxSamplerException("Index out of bounds");          result.Add(s);
         pSamplerChannel->SetAudioOutputDevice(AudioOutputType);  
362      }      }
363      catch (LinuxSamplerException e) {      catch (LinuxSamplerException e) {
364           result.Error(e);          result.Error(e);
365        }
366        return result.Produce();
367    }
368    
369    String LSCPServer::GetAudioOutputDriverInfo(String Driver) {
370        dmsg(2,("LSCPServer: GetAudioOutputDriverInfo(Driver=%s)\n",Driver.c_str()));
371        LSCPResultSet result;
372        try {
373            result.Add("DESCRIPTION", AudioOutputDeviceFactory::GetDriverDescription(Driver));
374            result.Add("VERSION",     AudioOutputDeviceFactory::GetDriverVersion(Driver));
375    
376            std::map<String,DeviceCreationParameter*> parameters = AudioOutputDeviceFactory::GetAvailableDriverParameters(Driver);
377            if (parameters.size()) { // if there are parameters defined for this driver
378                String s;
379                std::map<String,DeviceCreationParameter*>::iterator iter = parameters.begin();
380                for (;iter != parameters.end(); iter++) {
381                    if (s != "") s += ",";
382                    s += iter->first;
383                }
384                result.Add("PARAMETERS", s);
385            }
386        }
387        catch (LinuxSamplerException e) {
388            result.Error(e);
389        }
390        return result.Produce();
391    }
392    
393    String LSCPServer::GetAudioOutputDriverParameterInfo(String Driver, String Parameter, std::map<String,String> DependencyList) {
394        dmsg(2,("LSCPServer: GetAudioOutputDriverParameterInfo(Driver=%s,Parameter=%s)\n",Driver.c_str(),Parameter.c_str()));
395        LSCPResultSet result;
396        try {
397            DeviceCreationParameter* pParameter = AudioOutputDeviceFactory::GetDriverParameter(Driver, Parameter);
398            result.Add("TYPE",         pParameter->Type());
399            result.Add("DESCRIPTION",  pParameter->Description());
400            result.Add("MANDATORY",    pParameter->Mandatory());
401            result.Add("FIX",          pParameter->Fix());
402            result.Add("MULTIPLICITY", pParameter->Multiplicity());
403            if (pParameter->Depends())       result.Add("DEPENDS",       pParameter->Depends());
404            if (pParameter->Default())       result.Add("DEFAULT",       pParameter->Default());
405            if (pParameter->RangeMin())      result.Add("RANGE_MIN",     pParameter->RangeMin());
406            if (pParameter->RangeMax())      result.Add("RANGE_MAX",     pParameter->RangeMax());
407            if (pParameter->Possibilities()) result.Add("POSSIBILITIES", pParameter->Possibilities());
408        }
409        catch (LinuxSamplerException e) {
410            result.Error(e);
411        }
412        return result.Produce();
413    }
414    
415    String LSCPServer::GetAudioOutputDeviceCount() {
416        dmsg(2,("LSCPServer: GetAudioOutputDeviceCount()\n"));
417        LSCPResultSet result;
418        try {
419            uint count = pSampler->AudioOutputDevices();
420            result = count; // success
421        }
422        catch (LinuxSamplerException e) {
423            result.Error(e);
424        }
425        return result.Produce();
426    }
427    
428    String LSCPServer::GetAudioOutputDevices() {
429        dmsg(2,("LSCPServer: GetAudioOutputDevices()\n"));
430        LSCPResultSet result;
431        try {
432            String s;
433            std::map<uint, AudioOutputDevice*> devices = pSampler->GetAudioOutputDevices();
434            std::map<uint, AudioOutputDevice*>::iterator iter = devices.begin();
435            for (; iter != devices.end(); iter++) {
436                if (s != "") s += ",";
437                s += ToString(iter->first);
438            }
439            result.Add(s);
440        }
441        catch (LinuxSamplerException e) {
442            result.Error(e);
443        }
444        return result.Produce();
445    }
446    
447    String LSCPServer::GetAudioOutputDeviceInfo(uint DeviceIndex) {
448        dmsg(2,("LSCPServer: GetAudioOutputDeviceInfo(DeviceIndex=%d)\n",DeviceIndex));
449        LSCPResultSet result;
450        try {
451            std::map<uint,AudioOutputDevice*> devices = pSampler->GetAudioOutputDevices();
452            if (!devices[DeviceIndex]) throw LinuxSamplerException("There is no audio output device with index " + ToString(DeviceIndex) + ".");
453            AudioOutputDevice* pDevice = devices[DeviceIndex];
454            std::map<String,DeviceCreationParameter*> parameters = pDevice->DeviceParameters();
455            std::map<String,DeviceCreationParameter*>::iterator iter = parameters.begin();
456            for (; iter != parameters.end(); iter++) {
457                result.Add(iter->first, iter->second->Value());
458            }
459        }
460        catch (LinuxSamplerException e) {
461            result.Error(e);
462        }
463        return result.Produce();
464    }
465    
466    String LSCPServer::GetAudioOutputChannelInfo(uint DeviceId, uint ChannelId) {
467        dmsg(2,("LSCPServer: GetAudioOutputChannelInfo(DeviceId=%d,ChannelId)\n",DeviceId,ChannelId));
468        LSCPResultSet result;
469        try {
470            // get audio output device
471            std::map<uint,AudioOutputDevice*> devices = pSampler->GetAudioOutputDevices();
472            if (!devices[DeviceId]) throw LinuxSamplerException("There is no audio output device with index " + ToString(DeviceId) + ".");
473            AudioOutputDevice* pDevice = devices[DeviceId];
474    
475            // get audio channel
476            AudioChannel* pChannel = pDevice->Channel(ChannelId);
477            if (!pChannel) throw LinuxSamplerException("Audio ouotput device does not have channel " + ToString(ChannelId) + ".");
478    
479            // return the values of all audio channel parameters
480            std::map<String,DeviceRuntimeParameter*> parameters = pChannel->ChannelParameters();
481            std::map<String,DeviceRuntimeParameter*>::iterator iter = parameters.begin();
482            for (; iter != parameters.end(); iter++) {
483                result.Add(iter->first, iter->second->Value());
484            }
485        }
486        catch (LinuxSamplerException e) {
487            result.Error(e);
488        }
489        return result.Produce();
490    }
491    
492    String LSCPServer::GetAudioOutputChannelParameterInfo(uint DeviceId, uint ChannelId, String ParameterName) {
493        dmsg(2,("LSCPServer: GetAudioOutputChannelParameterInfo(DeviceId=%d,ChannelId=%d,ParameterName=%s)\n",DeviceId,ChannelId,ParameterName.c_str()));
494        LSCPResultSet result;
495        try {
496            // get audio output device
497            std::map<uint,AudioOutputDevice*> devices = pSampler->GetAudioOutputDevices();
498            if (!devices[DeviceId]) throw LinuxSamplerException("There is no audio output device with index " + ToString(DeviceId) + ".");
499            AudioOutputDevice* pDevice = devices[DeviceId];
500    
501            // get audio channel
502            AudioChannel* pChannel = pDevice->Channel(ChannelId);
503            if (!pChannel) throw LinuxSamplerException("Audio output device does not have channel " + ToString(ChannelId) + ".");
504    
505            // get desired audio channel parameter
506            std::map<String,DeviceRuntimeParameter*> parameters = pChannel->ChannelParameters();
507            if (!parameters[ParameterName]) throw LinuxSamplerException("Audio channel does not provide a parameter '" + ParameterName + "'.");
508            DeviceRuntimeParameter* pParameter = parameters[ParameterName];
509    
510            // return all fields of this audio channel parameter
511            result.Add("TYPE",         pParameter->Type());
512            result.Add("DESCRIPTION",  pParameter->Description());
513            result.Add("FIX",          pParameter->Fix());
514            result.Add("MULTIPLICITY", pParameter->Multiplicity());
515            if (pParameter->RangeMin())      result.Add("RANGE_MIN",     pParameter->RangeMin());
516            if (pParameter->RangeMax())      result.Add("RANGE_MAX",     pParameter->RangeMax());
517            if (pParameter->Possibilities()) result.Add("POSSIBILITIES", pParameter->Possibilities());
518        }
519        catch (LinuxSamplerException e) {
520            result.Error(e);
521        }
522        return result.Produce();
523    }
524    
525    String LSCPServer::SetAudioOutputChannelParameter(uint DeviceId, uint ChannelId, String ParamKey, String ParamVal) {
526        dmsg(2,("LSCPServer: SetAudioOutputChannelParameter(DeviceId=%d,ChannelId=%d,ParamKey=%s,ParamVal=%s)\n",DeviceId,ChannelId,ParamKey.c_str(),ParamVal.c_str()));
527        LSCPResultSet result;
528        try {
529            // get audio output device
530            std::map<uint,AudioOutputDevice*> devices = pSampler->GetAudioOutputDevices();
531            if (!devices[DeviceId]) throw LinuxSamplerException("There is no audio output device with index " + ToString(DeviceId) + ".");
532            AudioOutputDevice* pDevice = devices[DeviceId];
533    
534            // get audio channel
535            AudioChannel* pChannel = pDevice->Channel(ChannelId);
536            if (!pChannel) throw LinuxSamplerException("Audio output device does not have channel " + ToString(ChannelId) + ".");
537    
538            // get desired audio channel parameter
539            std::map<String,DeviceRuntimeParameter*> parameters = pChannel->ChannelParameters();
540            if (!parameters[ParamKey]) throw LinuxSamplerException("Audio channel does not provide a parameter '" + ParamKey + "'.");
541            DeviceRuntimeParameter* pParameter = parameters[ParamKey];
542    
543            // set new channel parameter value
544            pParameter->SetValue(ParamVal);
545        }
546        catch (LinuxSamplerException e) {
547            result.Error(e);
548        }
549        return result.Produce();
550    }
551    
552    String LSCPServer::SetAudioOutputDeviceParameter(uint DeviceIndex, String ParamKey, String ParamVal) {
553        dmsg(2,("LSCPServer: SetAudioOutputDeviceParameter(DeviceIndex=%d,ParamKey=%s,ParamVal=%s)\n",DeviceIndex,ParamKey.c_str(),ParamVal.c_str()));
554        LSCPResultSet result;
555        try {
556            std::map<uint,AudioOutputDevice*> devices = pSampler->GetAudioOutputDevices();
557            if (!devices[DeviceIndex]) throw LinuxSamplerException("There is no audio output device with index " + ToString(DeviceIndex) + ".");
558            AudioOutputDevice* pDevice = devices[DeviceIndex];
559            std::map<String,DeviceCreationParameter*> parameters = pDevice->DeviceParameters();
560            if (!parameters[ParamKey]) throw LinuxSamplerException("Audio output device " + ToString(DeviceIndex) + " does not have a device parameter '" + ParamKey + "'");
561            parameters[ParamKey]->SetValue(ParamVal);
562        }
563        catch (LinuxSamplerException e) {
564            result.Error(e);
565      }      }
566      return result.Produce();      return result.Produce();
567  }  }
# Line 329  String LSCPServer::SetAudioOutputType(Au Line 570  String LSCPServer::SetAudioOutputType(Au
570   * Will be called by the parser to change the audio output channel for   * Will be called by the parser to change the audio output channel for
571   * playback on a particular sampler channel.   * playback on a particular sampler channel.
572   */   */
573  String LSCPServer::SetAudioOutputChannel(uint AudioOutputChannel, uint uiSamplerChannel) {  String LSCPServer::SetAudioOutputChannel(uint ChannelAudioOutputChannel, uint AudioOutputDeviceInputChannel, uint uiSamplerChannel) {
574      dmsg(2,("LSCPServer: SetAudioOutputChannel(AudioOutputChannel=%d, SamplerChannel=%d)\n", AudioOutputChannel, uiSamplerChannel));      dmsg(2,("LSCPServer: SetAudioOutputChannel(ChannelAudioOutputChannel=%d, AudioOutputDeviceInputChannel=%d, SamplerChannel=%d)\n",ChannelAudioOutputChannel,AudioOutputDeviceInputChannel,uiSamplerChannel));
575      return "ERR:0:Not implemented yet.\r\n"; //FIXME: Add support for this in resultset class?      return "ERR:0:Not implemented yet.\r\n"; //FIXME: Add support for this in resultset class?
576  }  }
577    
578  String LSCPServer::SetMIDIInputType(MidiInputDevice::type_t MidiInputType, uint uiSamplerChannel) {  String LSCPServer::SetMIDIInputType(String MidiInputDriver, uint uiSamplerChannel) {
579      dmsg(2,("LSCPServer: SetMIDIInputType(MidiInputType=%d, SamplerChannel=%d)\n", MidiInputType, uiSamplerChannel));      dmsg(2,("LSCPServer: SetMIDIInputType(String MidiInputDriver=%s, SamplerChannel=%d)\n",MidiInputDriver.c_str(),uiSamplerChannel));
580      LSCPResultSet result;      LSCPResultSet result;
581      try {      try {
582          SamplerChannel* pSamplerChannel = pSampler->GetSamplerChannel(uiSamplerChannel);          SamplerChannel* pSamplerChannel = pSampler->GetSamplerChannel(uiSamplerChannel);
583          if (!pSamplerChannel) throw LinuxSamplerException("Index out of bounds");          if (!pSamplerChannel) throw LinuxSamplerException("Index out of bounds");
584            // FIXME: workaround until MIDI driver configuration is implemented (using a Factory class for the MIDI input drivers then, like its already done for audio output drivers)
585            if (MidiInputDriver != "ALSA") throw LinuxSamplerException("Unknown MIDI input driver '" + MidiInputDriver + "'.");
586            MidiInputDevice::type_t MidiInputType = MidiInputDevice::type_alsa;
587          pSamplerChannel->SetMidiInputDevice(MidiInputType);          pSamplerChannel->SetMidiInputDevice(MidiInputType);
588      }      }
589      catch (LinuxSamplerException e) {      catch (LinuxSamplerException e) {
# Line 387  String LSCPServer::SetMIDIInputChannel(u Line 631  String LSCPServer::SetMIDIInputChannel(u
631      return result.Produce();      return result.Produce();
632  }  }
633    
634    String LSCPServer::SetAudioOutputDevice(uint AudioDeviceId, uint SamplerChannel) {
635        LSCPResultSet result;
636        try {
637            throw LinuxSamplerException("Command not yet implemented");
638        }
639        catch (LinuxSamplerException e) {
640             result.Error(e);
641        }
642        return result.Produce();
643    }
644    
645  /**  /**
646   * Will be called by the parser to change the global volume factor on a   * Will be called by the parser to change the global volume factor on a
647   * particular sampler channel.   * particular sampler channel.
# Line 443  String LSCPServer::UnsubscribeNotificati Line 698  String LSCPServer::UnsubscribeNotificati
698      dmsg(2,("LSCPServer: UnsubscribeNotification(SessionID=%s)\n", SessionID.c_str()));      dmsg(2,("LSCPServer: UnsubscribeNotification(SessionID=%s)\n", SessionID.c_str()));
699      return "ERR:0:Not implemented yet.\r\n";      return "ERR:0:Not implemented yet.\r\n";
700  }  }
701    
702    
703    // Instrument loader constructor.
704    LSCPLoadInstrument::LSCPLoadInstrument(Engine* pEngine, String Filename, uint uiInstrument)
705        : Thread(false, 0, -4)
706    {
707        this->pEngine = pEngine;
708        this->Filename = Filename;
709        this->uiInstrument = uiInstrument;
710    }
711    
712    // Instrument loader process.
713    int LSCPLoadInstrument::Main()
714    {
715        try {
716            pEngine->LoadInstrument(Filename.c_str(), uiInstrument);
717        }
718    
719        catch (LinuxSamplerException e) {
720            e.PrintMessage();
721        }
722    
723        // Always re-enable the engine.
724        pEngine->Enable();
725    
726        // FIXME: Shoot ourselves on the foot?
727        delete this;
728    }

Legend:
Removed from v.121  
changed lines
  Added in v.133

  ViewVC Help
Powered by ViewVC