/[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 411 by schoenebeck, Sat Feb 26 02:01:14 2005 UTC revision 475 by schoenebeck, Thu Mar 17 23:56:56 2005 UTC
# Line 68  LSCPServer::LSCPServer(Sampler* pSampler Line 68  LSCPServer::LSCPServer(Sampler* pSampler
68      LSCPEvent::RegisterEvent(LSCPEvent::event_buffer_fill, "BUFFER_FILL");      LSCPEvent::RegisterEvent(LSCPEvent::event_buffer_fill, "BUFFER_FILL");
69      LSCPEvent::RegisterEvent(LSCPEvent::event_info, "INFO");      LSCPEvent::RegisterEvent(LSCPEvent::event_info, "INFO");
70      LSCPEvent::RegisterEvent(LSCPEvent::event_misc, "MISCELLANEOUS");      LSCPEvent::RegisterEvent(LSCPEvent::event_misc, "MISCELLANEOUS");
71        hSocket = -1;
72    }
73    
74    LSCPServer::~LSCPServer() {
75        if (hSocket >= 0) close(hSocket);
76  }  }
77    
78  /**  /**
# Line 85  int LSCPServer::WaitUntilInitialized(lon Line 90  int LSCPServer::WaitUntilInitialized(lon
90  }  }
91    
92  int LSCPServer::Main() {  int LSCPServer::Main() {
93      int hSocket = socket(AF_INET, SOCK_STREAM, 0);      hSocket = socket(AF_INET, SOCK_STREAM, 0);
94      if (hSocket < 0) {      if (hSocket < 0) {
95          std::cerr << "LSCPServer: Could not create server socket." << std::endl;          std::cerr << "LSCPServer: Could not create server socket." << std::endl;
96          //return -1;          //return -1;
# Line 168  int LSCPServer::Main() { Line 173  int LSCPServer::Main() {
173                                  int dummy; // just a temporary hack to fulfill the restart() function prototype                                  int dummy; // just a temporary hack to fulfill the restart() function prototype
174                                  restart(NULL, dummy); // restart the 'scanner'                                  restart(NULL, dummy); // restart the 'scanner'
175                                  currentSocket = (*iter).hSession;  //a hack                                  currentSocket = (*iter).hSession;  //a hack
176                                    dmsg(2,("LSCPServer: [%s]\n",bufferedCommands[currentSocket].c_str()));
177                                  if ((*iter).bVerbose) { // if echo mode enabled                                  if ((*iter).bVerbose) { // if echo mode enabled
178                                      AnswerClient(bufferedCommands[currentSocket]);                                      AnswerClient(bufferedCommands[currentSocket]);
179                                  }                                  }
# Line 481  String LSCPServer::LoadInstrument(String Line 487  String LSCPServer::LoadInstrument(String
487  String LSCPServer::SetEngineType(String EngineName, uint uiSamplerChannel) {  String LSCPServer::SetEngineType(String EngineName, uint uiSamplerChannel) {
488      dmsg(2,("LSCPServer: LoadEngine(EngineName=%s,SamplerChannel=%d)\n", EngineName.c_str(), uiSamplerChannel));      dmsg(2,("LSCPServer: LoadEngine(EngineName=%s,SamplerChannel=%d)\n", EngineName.c_str(), uiSamplerChannel));
489      LSCPResultSet result;      LSCPResultSet result;
490      try {              try {
491          SamplerChannel* pSamplerChannel = pSampler->GetSamplerChannel(uiSamplerChannel);          SamplerChannel* pSamplerChannel = pSampler->GetSamplerChannel(uiSamplerChannel);
492          if (!pSamplerChannel) throw LinuxSamplerException("Invalid sampler channel number " + ToString(uiSamplerChannel));          if (!pSamplerChannel) throw LinuxSamplerException("Invalid sampler channel number " + ToString(uiSamplerChannel));
493          LockRTNotify();          LockRTNotify();
# Line 593  String LSCPServer::GetChannelInfo(uint u Line 599  String LSCPServer::GetChannelInfo(uint u
599          int AudioOutputChannels = 0;          int AudioOutputChannels = 0;
600          String AudioRouting;          String AudioRouting;
601    
602          if (pEngineChannel) {                                        if (pEngineChannel) {
603              EngineName          = pEngineChannel->GetEngine()->EngineName();              EngineName          = pEngineChannel->EngineName();
604              AudioOutputChannels = pEngineChannel->Channels();              AudioOutputChannels = pEngineChannel->Channels();
605              Volume              = pEngineChannel->Volume();              Volume              = pEngineChannel->Volume();
606              InstrumentStatus    = pEngineChannel->InstrumentStatus();              InstrumentStatus    = pEngineChannel->InstrumentStatus();

Legend:
Removed from v.411  
changed lines
  Added in v.475

  ViewVC Help
Powered by ViewVC