/[svn]/linuxsampler/trunk/src/db/InstrumentsDb.h
ViewVC logotype

Diff of /linuxsampler/trunk/src/db/InstrumentsDb.h

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

revision 1349 by iliev, Thu Sep 13 21:46:25 2007 UTC revision 1350 by iliev, Sun Sep 16 23:06:10 2007 UTC
# Line 56  namespace LinuxSampler { Line 56  namespace LinuxSampler {
56                      /**                      /**
57                       * Invoked when the number of instrument directories                       * Invoked when the number of instrument directories
58                       * in a specific directory has changed.                       * in a specific directory has changed.
59                       * @param Dir The absolute pathname of the directory in                       * @param Dir The absolute pathname of the directory
60                       * which the number of directories is changed.                       * in which the number of directories is changed.
61                         * All slashes in the directory names are replaced with '\0'.
62                       */                       */
63                      virtual void DirectoryCountChanged(String Dir) = 0;                      virtual void DirectoryCountChanged(String Dir) = 0;
64    
# Line 66  namespace LinuxSampler { Line 67  namespace LinuxSampler {
67                       * are changed.                       * are changed.
68                       * @param Dir The absolute pathname of the directory                       * @param Dir The absolute pathname of the directory
69                       * whose settings are changed.                       * whose settings are changed.
70                         * All slashes in the directory names are replaced with '\0'.
71                       */                       */
72                      virtual void DirectoryInfoChanged(String Dir) = 0;                      virtual void DirectoryInfoChanged(String Dir) = 0;
73    
74                      /**                      /**
75                       * Invoked when an instrument directory is renamed.                       * Invoked when an instrument directory is renamed.
76                       * @param Dir The old absolute pathname of the directory.                       * @param Dir The old absolute pathname of the directory.
77                         * All slashes in the directory names are replaced with '\0'.
78                       * @param NewName The new name of the directory.                       * @param NewName The new name of the directory.
79                         * All slashes in the name are replaced with '\0'.
80                       */                       */
81                      virtual void DirectoryNameChanged(String Dir, String NewName) = 0;                      virtual void DirectoryNameChanged(String Dir, String NewName) = 0;
82    
83                      /**                      /**
84                       * Invoked when the number of instruments                       * Invoked when the number of instruments
85                       * in a specific directory has changed.                       * in a specific directory has changed.
86                       * @param Dir The absolute pathname of the directory in                       * @param Dir The absolute pathname of the directory
87                       * which the number of instruments is changed.                       * in which the number of instruments is changed.
88                         * All slashes in the directory names are replaced with '\0'.
89                       */                       */
90                      virtual void InstrumentCountChanged(String Dir) = 0;                      virtual void InstrumentCountChanged(String Dir) = 0;
91    
92                      /**                      /**
93                       * Invoked when the settings of an instrument are changed.                       * Invoked when the settings of an instrument are changed.
94                       * @param Instr The absolute pathname of the instrument                       * @param Instr The absolute pathname of the
95                       * whose settings are changed.                       * instrument whose settings are changed.
96                         * All slashes in the directory/instrument names are replaced with '\0'.
97                       */                       */
98                      virtual void InstrumentInfoChanged(String Instr) = 0;                      virtual void InstrumentInfoChanged(String Instr) = 0;
99    
100                      /**                      /**
101                       * Invoked when an instrument is renamed.                       * Invoked when an instrument is renamed.
102                       * @param Instr The old absolute pathname of the instrument.                       * @param Instr The old absolute pathname of the instrument.
103                         * All slashes in the directory/instrument names are replaced with '\0'.
104                       * @param NewName The new name of the directory.                       * @param NewName The new name of the directory.
105                         * All slashes in the name are replaced with '\0'.
106                       */                       */
107                      virtual void InstrumentNameChanged(String Instr, String NewName) = 0;                      virtual void InstrumentNameChanged(String Instr, String NewName) = 0;
108    
# Line 252  namespace LinuxSampler { Line 260  namespace LinuxSampler {
260               * Finds all directories that match the search query.               * Finds all directories that match the search query.
261               * @param Dir The absolute path name of the database               * @param Dir The absolute path name of the database
262               * directory to search in.               * directory to search in.
263                 * All slashes in the directory names should be replaced with '\0'.
264               * @throws Exception - if database error occurs, or               * @throws Exception - if database error occurs, or
265               * if the specified path name is invalid.               * if the specified path name is invalid.
266               * @returns The absolute path names of all directories               * @returns The absolute path names of all directories
# Line 265  namespace LinuxSampler { Line 274  namespace LinuxSampler {
274               * @param DbDir The absolute path name of a directory in the               * @param DbDir The absolute path name of a directory in the
275               * instruments database in which only the new instruments               * instruments database in which only the new instruments
276               * (that are not already in the database) will be added.               * (that are not already in the database) will be added.
277                 * All slashes in the directory names should be replaced with '\0'.
278               * @param FilePath The absolute path name of a file or               * @param FilePath The absolute path name of a file or
279               * directory in the file system. In case a directory is               * directory in the file system. In case a directory is
280               * supplied, all supported instruments in the specified directory               * supplied, all supported instruments in the specified directory
# Line 289  namespace LinuxSampler { Line 299  namespace LinuxSampler {
299               * @param DbDir The absolute path name of a directory in the               * @param DbDir The absolute path name of a directory in the
300               * instruments database in which only the new instruments               * instruments database in which only the new instruments
301               * (that are not already in the database) will be added.               * (that are not already in the database) will be added.
302                 * All slashes in the directory names should be replaced with '\0'.
303               * @param FilePath The absolute path name of the instrument file.               * @param FilePath The absolute path name of the instrument file.
304               * @param Index The index of the instrument (in the given               * @param Index The index of the instrument (in the given
305               * instrument file) to add. If -1 is specified, all instruments in               * instrument file) to add. If -1 is specified, all instruments in
# Line 316  namespace LinuxSampler { Line 327  namespace LinuxSampler {
327               * @param DbDir The absolute path name of a directory in the               * @param DbDir The absolute path name of a directory in the
328               * instruments database in which only the new instruments               * instruments database in which only the new instruments
329               * (that are not already in the database) will be added.               * (that are not already in the database) will be added.
330                 * All slashes in the directory names should be replaced with '\0'.
331               * @param FsDir The absolute path name of an existing               * @param FsDir The absolute path name of an existing
332               * directory in the file system.               * directory in the file system.
333               * @param bBackground Determines whether               * @param bBackground Determines whether
# Line 329  namespace LinuxSampler { Line 341  namespace LinuxSampler {
341              /**              /**
342               * Gets the number of instruments in the specified directory.               * Gets the number of instruments in the specified directory.
343               * @param Dir The absolute path name of the directory.               * @param Dir The absolute path name of the directory.
344                 * All slashes in the directory names should be replaced with '\0'.
345               * @param Recursive If true, the number of all instruments               * @param Recursive If true, the number of all instruments
346               * in the specified subtree will be returned.               * in the specified subtree will be returned.
347               * @throws Exception - if database error occurs, or               * @throws Exception - if database error occurs, or
# Line 340  namespace LinuxSampler { Line 353  namespace LinuxSampler {
353              /**              /**
354               * Gets the list of instruments in the specified directory.               * Gets the list of instruments in the specified directory.
355               * @param Dir The absolute path name of the directory.               * @param Dir The absolute path name of the directory.
356                 * All slashes in the directory names should be replaced with '\0'.
357               * @param Recursive If true, all instruments               * @param Recursive If true, all instruments
358               * in the specified subtree will be returned.               * in the specified subtree will be returned.
359               * @throws Exception - if database error occurs, or               * @throws Exception - if database error occurs, or
# Line 350  namespace LinuxSampler { Line 364  namespace LinuxSampler {
364              /**              /**
365               * Removes the specified instrument from the database.               * Removes the specified instrument from the database.
366               * @param Instr The absolute path name of the instrument to remove.               * @param Instr The absolute path name of the instrument to remove.
367                 * All slashes in the directory/instrument names should be replaced with '\0'.
368               * @throws Exception - If the specified instrument does not exist,               * @throws Exception - If the specified instrument does not exist,
369               * or database error occurs.               * or database error occurs.
370               */               */
# Line 358  namespace LinuxSampler { Line 373  namespace LinuxSampler {
373              /**              /**
374               * Gets information about the specified instrument.               * Gets information about the specified instrument.
375               * @param Instr The absolute path name of the instrument.               * @param Instr The absolute path name of the instrument.
376                 * All slashes in the directory/instrument names should be replaced with '\0'.
377               * @throws Exception - if database error occurs, or if               * @throws Exception - if database error occurs, or if
378               * the specified instrument is not found.               * the specified instrument is not found.
379               */               */
# Line 366  namespace LinuxSampler { Line 382  namespace LinuxSampler {
382              /**              /**
383               * Renames the specified instrument.               * Renames the specified instrument.
384               * @param Instr The absolute path name of the instrument to rename.               * @param Instr The absolute path name of the instrument to rename.
385                 * All slashes in the directory/instrument names should be replaced with '\0'.
386               * @param Name The new name for the instrument.               * @param Name The new name for the instrument.
387               * @throws Exception - In case the given instrument does not exists,               * @throws Exception - In case the given instrument does not exists,
388               * or the specified name is not a valid name, or if an instrument               * or the specified name is not a valid name, or if an instrument
# Line 377  namespace LinuxSampler { Line 394  namespace LinuxSampler {
394              /**              /**
395               * Moves the specified instrument into the specified directory.               * Moves the specified instrument into the specified directory.
396               * @param Instr The absolute path name of the instrument to move.               * @param Instr The absolute path name of the instrument to move.
397                 * All slashes in the directory/instrument names should be replaced with '\0'.
398               * @param Dst The directory where the instrument will be moved to.               * @param Dst The directory where the instrument will be moved to.
399               * @throws Exception - In case the given directory or instrument               * @throws Exception - In case the given directory or instrument
400               * does not exist, or if an instrument with name equal to the name               * does not exist, or if an instrument with name equal to the name
# Line 410  namespace LinuxSampler { Line 428  namespace LinuxSampler {
428               * Finds all instruments that match the search query.               * Finds all instruments that match the search query.
429               * @param Dir The absolute path name of the database               * @param Dir The absolute path name of the database
430               * directory to search in.               * directory to search in.
431                 * All slashes in the directory names should be replaced with '\0'.
432               * @throws Exception - if database error occurs, or               * @throws Exception - if database error occurs, or
433               * if the specified path name is invalid.               * if the specified path name is invalid.
434               * @returns The absolute path names of all instruments               * @returns The absolute path names of all instruments
# Line 418  namespace LinuxSampler { Line 437  namespace LinuxSampler {
437              StringListPtr FindInstruments(String Dir, SearchQuery* pQuery, bool Recursive);              StringListPtr FindInstruments(String Dir, SearchQuery* pQuery, bool Recursive);
438    
439              /**              /**
440               * All '\0' chars in the string are replaced with "\/";               * All '\0' chars in the string are replaced with "\x2f";
441               * ', ", \ are escaped with backslash and               * ', ", \ are escaped with backslash and
442               * <CR> and <LF> are replaced with \r and \n.               * <CR> and <LF> are replaced with \r and \n.
443               */               */
# Line 429  namespace LinuxSampler { Line 448  namespace LinuxSampler {
448               * <CR> and <LF> are replaced with \r and \n.               * <CR> and <LF> are replaced with \r and \n.
449               */               */
450              static String toEscapedText(String text);              static String toEscapedText(String text);
   
             /**  
              *  All '\0' chars in the string are replaced with '/';  
              * The characthers ', ", \ are escaped with backslash and  
              * <CR> and <LF> are replaced with \r and \n.  
              */  
             static String toEscapedName(String AbstractName);  
451                            
452              /**              /**
453               * Closes the database connection if opened and deletes               * Closes the database connection if opened and deletes
# Line 638  namespace LinuxSampler { Line 650  namespace LinuxSampler {
650               * Copies the specified instrument into the specified directory.               * Copies the specified instrument into the specified directory.
651               * @param InstrId The ID of the instrument to copy.               * @param InstrId The ID of the instrument to copy.
652               * @param InstrName The name of the instrument to copy.               * @param InstrName The name of the instrument to copy.
653                 * All slashes in the instrument name should be replaced with '\0'.
654               * @param DstDirId The ID of the directory where the               * @param DstDirId The ID of the directory where the
655               * instrument will be copied to.               * instrument will be copied to.
656               * @param DstDir The name of the directory where the               * @param DstDir The name of the directory where the
# Line 653  namespace LinuxSampler { Line 666  namespace LinuxSampler {
666               * @param DbDir The absolute path name of a directory in the               * @param DbDir The absolute path name of a directory in the
667               * instruments database in which only the new instruments               * instruments database in which only the new instruments
668               * (that are not already in the database) will be added.               * (that are not already in the database) will be added.
669                 * All slashes in the directory names should be replaced with '\0'.
670               * @param FsDir The absolute path name of a directory in the file               * @param FsDir The absolute path name of a directory in the file
671               * system.               * system.
672               * @param pProgress The progress used to monitor the scan process.               * @param pProgress The progress used to monitor the scan process.
# Line 668  namespace LinuxSampler { Line 682  namespace LinuxSampler {
682               * @param DbDir The absolute path name of a directory in the               * @param DbDir The absolute path name of a directory in the
683               * instruments database in which only the new instruments               * instruments database in which only the new instruments
684               * (that are not already in the database) will be added.               * (that are not already in the database) will be added.
685                 * All slashes in the directory names should be replaced with '\0'.
686               * @param FsDir The absolute path name of an existing               * @param FsDir The absolute path name of an existing
687               * directory in the file system.               * directory in the file system.
688               * @param Flat If true, the respective subdirectory structure will               * @param Flat If true, the respective subdirectory structure will
# Line 684  namespace LinuxSampler { Line 699  namespace LinuxSampler {
699               * @param DbDir The absolute path name of a directory in the               * @param DbDir The absolute path name of a directory in the
700               * instruments database in which only the new instruments               * instruments database in which only the new instruments
701               * (that are not already in the database) will be added.               * (that are not already in the database) will be added.
702                 * All slashes in the directory names should be replaced with '\0'.
703               * @param File The absolute path name of a file in the file system.               * @param File The absolute path name of a file in the file system.
704               * @param Index The index of the instrument (in the given               * @param Index The index of the instrument (in the given
705               * instrument file) to add. If -1 is specified, all instruments in               * instrument file) to add. If -1 is specified, all instruments in
# Line 699  namespace LinuxSampler { Line 715  namespace LinuxSampler {
715               * in the instruments database.               * in the instruments database.
716               * @param DbDir The instruments database directory               * @param DbDir The instruments database directory
717               * in which the instrument will be added.               * in which the instrument will be added.
718                 * All slashes in the directory names should be replaced with '\0'.
719               * @param File The absolute path name of the instrument file.               * @param File The absolute path name of the instrument file.
720               * @param Index The index of the instrument (in the given               * @param Index The index of the instrument (in the given
721               * instrument file) to add. If -1 is specified, all instruments in               * instrument file) to add. If -1 is specified, all instruments in
# Line 711  namespace LinuxSampler { Line 728  namespace LinuxSampler {
728    
729              /**              /**
730               * Adds the specified GIG instrument.               * Adds the specified GIG instrument.
731                 * @param DbDir The instruments database directory
732                 * in which the instrument will be added.
733                 * All slashes in the directory names should be replaced with '\0'.
734               * @throws Exception if the operation failed.               * @throws Exception if the operation failed.
735               */               */
736              void AddGigInstrument(sqlite3_stmt* pStmt, String DbDir, int DirId, String File, ::gig::Instrument* pInstrument, int Index);              void AddGigInstrument(sqlite3_stmt* pStmt, String DbDir, int DirId, String File, ::gig::Instrument* pInstrument, int Index);
# Line 792  namespace LinuxSampler { Line 812  namespace LinuxSampler {
812               */               */
813              static String toAbstractName(String DbName);              static String toAbstractName(String DbName);
814    
815                static String toEscapedFsPath(String FsPath);
816    
817              void FireDirectoryCountChanged(String Dir);              void FireDirectoryCountChanged(String Dir);
818              void FireDirectoryInfoChanged(String Dir);              void FireDirectoryInfoChanged(String Dir);
819              void FireDirectoryNameChanged(String Dir, String NewName);              void FireDirectoryNameChanged(String Dir, String NewName);

Legend:
Removed from v.1349  
changed lines
  Added in v.1350

  ViewVC Help
Powered by ViewVC