/[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 1345 by iliev, Thu Sep 13 21:46:25 2007 UTC revision 1353 by iliev, Mon Sep 17 23:15:25 2007 UTC
# Line 155  void LSCPServer::DbInstrumentsEventHandl Line 155  void LSCPServer::DbInstrumentsEventHandl
155    
156  void LSCPServer::DbInstrumentsEventHandler::DirectoryNameChanged(String Dir, String NewName) {  void LSCPServer::DbInstrumentsEventHandler::DirectoryNameChanged(String Dir, String NewName) {
157      Dir = "'" + InstrumentsDb::toEscapedPath(Dir) + "'";      Dir = "'" + InstrumentsDb::toEscapedPath(Dir) + "'";
158      NewName = "'" + InstrumentsDb::toEscapedName(NewName) + "'";      NewName = "'" + InstrumentsDb::toEscapedPath(NewName) + "'";
159      LSCPServer::SendLSCPNotify(LSCPEvent(LSCPEvent::event_db_instr_dir_info, "NAME", Dir, NewName));      LSCPServer::SendLSCPNotify(LSCPEvent(LSCPEvent::event_db_instr_dir_info, "NAME", Dir, NewName));
160  }  }
161    
# Line 169  void LSCPServer::DbInstrumentsEventHandl Line 169  void LSCPServer::DbInstrumentsEventHandl
169    
170  void LSCPServer::DbInstrumentsEventHandler::InstrumentNameChanged(String Instr, String NewName) {  void LSCPServer::DbInstrumentsEventHandler::InstrumentNameChanged(String Instr, String NewName) {
171      Instr = "'" + InstrumentsDb::toEscapedPath(Instr) + "'";      Instr = "'" + InstrumentsDb::toEscapedPath(Instr) + "'";
172      NewName = "'" + InstrumentsDb::toEscapedName(NewName) + "'";      NewName = "'" + InstrumentsDb::toEscapedPath(NewName) + "'";
173      LSCPServer::SendLSCPNotify(LSCPEvent(LSCPEvent::event_db_instr_info, "NAME", Instr, NewName));      LSCPServer::SendLSCPNotify(LSCPEvent(LSCPEvent::event_db_instr_info, "NAME", Instr, NewName));
174  }  }
175    
# Line 2354  String LSCPServer::GetDbInstrumentDirect Line 2354  String LSCPServer::GetDbInstrumentDirect
2354    
2355          for (int i = 0; i < dirs->size(); i++) {          for (int i = 0; i < dirs->size(); i++) {
2356              if (list != "") list += ",";              if (list != "") list += ",";
2357                list += "'" + InstrumentsDb::toEscapedPath(dirs->at(i)) + "'";
             if (Recursive) list += "'" + InstrumentsDb::toEscapedPath(dirs->at(i)) + "'";  
             else list += "'" + InstrumentsDb::toEscapedName(dirs->at(i)) + "'";  
2358          }          }
2359    
2360          result.Add(list);          result.Add(list);
# Line 2533  String LSCPServer::GetDbInstruments(Stri Line 2531  String LSCPServer::GetDbInstruments(Stri
2531    
2532          for (int i = 0; i < instrs->size(); i++) {          for (int i = 0; i < instrs->size(); i++) {
2533              if (list != "") list += ",";              if (list != "") list += ",";
2534                list += "'" + InstrumentsDb::toEscapedPath(instrs->at(i)) + "'";
             if (Recursive) list += "'" + InstrumentsDb::toEscapedPath(instrs->at(i)) + "'";  
             else list += "'" + InstrumentsDb::toEscapedName(instrs->at(i)) + "'";  
2535          }          }
2536    
2537          result.Add(list);          result.Add(list);
# Line 2746  String LSCPServer::FindDbInstruments(Str Line 2742  String LSCPServer::FindDbInstruments(Str
2742      } catch (Exception e) {      } catch (Exception e) {
2743           result.Error(e);           result.Error(e);
2744      }      }
2745    #else
2746        result.Error(String(DOESNT_HAVE_SQLITE3), 0);
2747    #endif
2748        return result.Produce();
2749    }
2750    
2751    String LSCPServer::FormatInstrumentsDb() {
2752        dmsg(2,("LSCPServer: FormatInstrumentsDb()\n"));
2753        LSCPResultSet result;
2754    #if HAVE_SQLITE3
2755        try {
2756            InstrumentsDb::GetInstrumentsDb()->Format();
2757        } catch (Exception e) {
2758             result.Error(e);
2759        }
2760  #else  #else
2761      result.Error(String(DOESNT_HAVE_SQLITE3), 0);      result.Error(String(DOESNT_HAVE_SQLITE3), 0);
2762  #endif  #endif

Legend:
Removed from v.1345  
changed lines
  Added in v.1353

  ViewVC Help
Powered by ViewVC