/[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 1808 by persson, Sun Dec 14 15:43:18 2008 UTC revision 1835 by iliev, Mon Feb 16 17:56:50 2009 UTC
# Line 24  Line 24 
24  #include <algorithm>  #include <algorithm>
25  #include <string>  #include <string>
26    
27    #include "../common/File.h"
28  #include "lscpserver.h"  #include "lscpserver.h"
29  #include "lscpresultset.h"  #include "lscpresultset.h"
30  #include "lscpevent.h"  #include "lscpevent.h"
# Line 334  void LSCPServer::DbInstrumentsEventHandl Line 335  void LSCPServer::DbInstrumentsEventHandl
335  }  }
336  #endif // HAVE_SQLITE3  #endif // HAVE_SQLITE3
337    
338    void LSCPServer::RemoveListeners() {
339        pSampler->RemoveChannelCountListener(&eventHandler);
340        pSampler->RemoveAudioDeviceCountListener(&eventHandler);
341        pSampler->RemoveMidiDeviceCountListener(&eventHandler);
342        pSampler->RemoveVoiceCountListener(&eventHandler);
343        pSampler->RemoveStreamCountListener(&eventHandler);
344        pSampler->RemoveBufferFillListener(&eventHandler);
345        pSampler->RemoveTotalStreamCountListener(&eventHandler);
346        pSampler->RemoveTotalVoiceCountListener(&eventHandler);
347        pSampler->RemoveFxSendCountListener(&eventHandler);
348        MidiInstrumentMapper::RemoveMidiInstrumentCountListener(&eventHandler);
349        MidiInstrumentMapper::RemoveMidiInstrumentInfoListener(&eventHandler);
350        MidiInstrumentMapper::RemoveMidiInstrumentMapCountListener(&eventHandler);
351        MidiInstrumentMapper::RemoveMidiInstrumentMapInfoListener(&eventHandler);
352    #if HAVE_SQLITE3
353        InstrumentsDb::GetInstrumentsDb()->RemoveInstrumentsDbListener(&dbInstrumentsEventHandler);
354    #endif
355    }
356    
357  /**  /**
358   * Blocks the calling thread until the LSCP Server is initialized and   * Blocks the calling thread until the LSCP Server is initialized and
# Line 1259  String LSCPServer::GetMidiInputDriverInf Line 1278  String LSCPServer::GetMidiInputDriverInf
1278              for (;iter != parameters.end(); iter++) {              for (;iter != parameters.end(); iter++) {
1279                  if (s != "") s += ",";                  if (s != "") s += ",";
1280                  s += iter->first;                  s += iter->first;
1281                    delete iter->second;
1282              }              }
1283              result.Add("PARAMETERS", s);              result.Add("PARAMETERS", s);
1284          }          }
# Line 1283  String LSCPServer::GetAudioOutputDriverI Line 1303  String LSCPServer::GetAudioOutputDriverI
1303              for (;iter != parameters.end(); iter++) {              for (;iter != parameters.end(); iter++) {
1304                  if (s != "") s += ",";                  if (s != "") s += ",";
1305                  s += iter->first;                  s += iter->first;
1306                    delete iter->second;
1307              }              }
1308              result.Add("PARAMETERS", s);              result.Add("PARAMETERS", s);
1309          }          }
# Line 1313  String LSCPServer::GetMidiInputDriverPar Line 1334  String LSCPServer::GetMidiInputDriverPar
1334          if (oRangeMin)      result.Add("RANGE_MIN",     *oRangeMin);          if (oRangeMin)      result.Add("RANGE_MIN",     *oRangeMin);
1335          if (oRangeMax)      result.Add("RANGE_MAX",     *oRangeMax);          if (oRangeMax)      result.Add("RANGE_MAX",     *oRangeMax);
1336          if (oPossibilities) result.Add("POSSIBILITIES", *oPossibilities);          if (oPossibilities) result.Add("POSSIBILITIES", *oPossibilities);
1337            delete pParameter;
1338      }      }
1339      catch (Exception e) {      catch (Exception e) {
1340          result.Error(e);          result.Error(e);
# Line 1340  String LSCPServer::GetAudioOutputDriverP Line 1362  String LSCPServer::GetAudioOutputDriverP
1362          if (oRangeMin)      result.Add("RANGE_MIN",     *oRangeMin);          if (oRangeMin)      result.Add("RANGE_MIN",     *oRangeMin);
1363          if (oRangeMax)      result.Add("RANGE_MAX",     *oRangeMax);          if (oRangeMax)      result.Add("RANGE_MAX",     *oRangeMax);
1364          if (oPossibilities) result.Add("POSSIBILITIES", *oPossibilities);          if (oPossibilities) result.Add("POSSIBILITIES", *oPossibilities);
1365            delete pParameter;
1366      }      }
1367      catch (Exception e) {      catch (Exception e) {
1368          result.Error(e);          result.Error(e);
# Line 2800  void LSCPServer::VerifyFile(String Filen Line 2823  void LSCPServer::VerifyFile(String Filen
2823          throw Exception("Directory is specified");          throw Exception("Directory is specified");
2824      }      }
2825      #else      #else
2826      struct stat statBuf;      File f(Filename);
2827      int res = stat(Filename.c_str(), &statBuf);      if(!f.Exist()) throw Exception(f.GetErrorMsg());
2828      if (res) {      if (f.IsDirectory()) throw Exception("Directory is specified");
         std::stringstream ss;  
         ss << "Fail to stat `" << Filename << "`: " << strerror(errno);  
         throw Exception(ss.str());  
     }  
   
     if (S_ISDIR(statBuf.st_mode)) {  
         throw Exception("Directory is specified");  
     }  
2829      #endif      #endif
2830  }  }
2831    

Legend:
Removed from v.1808  
changed lines
  Added in v.1835

  ViewVC Help
Powered by ViewVC