302 |
* @param Index The index of the instrument (in the given |
* @param Index The index of the instrument (in the given |
303 |
* instrument file) to add. If -1 is specified, all instruments in |
* instrument file) to add. If -1 is specified, all instruments in |
304 |
* the supplied instrument file will be added. |
* the supplied instrument file will be added. |
305 |
|
* @param insDir if true a separate directory will be created for |
306 |
|
* the gig file. |
307 |
*/ |
*/ |
308 |
AddInstrumentsFromFileJob(int JobId, String DbDir, String FilePath, int Index = -1); |
AddInstrumentsFromFileJob(int JobId, String DbDir, String FilePath, int Index = -1, bool insDir = false); |
309 |
|
|
310 |
/** |
/** |
311 |
* The entry point of the job. |
* The entry point of the job. |
318 |
String FilePath; |
String FilePath; |
319 |
int Index; |
int Index; |
320 |
ScanProgress Progress; |
ScanProgress Progress; |
321 |
|
bool insDir; |
322 |
}; |
}; |
323 |
|
|
324 |
/** |
/** |
346 |
* (that are not already in the database) will be added. |
* (that are not already in the database) will be added. |
347 |
* @param FsDir The absolute path name of a directory in the |
* @param FsDir The absolute path name of a directory in the |
348 |
* file system. |
* file system. |
349 |
|
* @param insDir If true a separate directory will be created for |
350 |
|
* each gig file |
351 |
*/ |
*/ |
352 |
AddInstrumentsJob(int JobId, ScanMode Mode, String DbDir, String FsDir); |
AddInstrumentsJob(int JobId, ScanMode Mode, String DbDir, String FsDir, bool insDir = false); |
353 |
|
|
354 |
/** |
/** |
355 |
* The entry point of the job. |
* The entry point of the job. |
362 |
String DbDir; |
String DbDir; |
363 |
String FsDir; |
String FsDir; |
364 |
ScanProgress Progress; |
ScanProgress Progress; |
365 |
|
bool insDir; |
366 |
|
|
367 |
int GetFileCount(); |
int GetFileCount(); |
368 |
}; |
}; |
372 |
/** |
/** |
373 |
* Recursively scans all subdirectories of the specified file |
* Recursively scans all subdirectories of the specified file |
374 |
* system directory and adds the supported instruments to the database. |
* system directory and adds the supported instruments to the database. |
375 |
|
* @param insDir is true this will create a directory for each gig file. |
376 |
* @param pProgress The progress used to monitor the scan process. |
* @param pProgress The progress used to monitor the scan process. |
377 |
* @throws Exception - if the specified directories are invalid. |
* @throws Exception - if the specified directories are invalid. |
378 |
*/ |
*/ |
379 |
void Scan(String DbDir, String FsDir, bool Flat, ScanProgress* pProgress = NULL); |
void Scan(String DbDir, String FsDir, bool Flat, bool insDir = false, ScanProgress* pProgress = NULL); |
380 |
|
|
381 |
virtual void DirectoryEntry(std::string Path); |
virtual void DirectoryEntry(std::string Path); |
382 |
virtual void FileEntry(std::string Path) { } |
virtual void FileEntry(std::string Path) { } |
387 |
bool Flat; |
bool Flat; |
388 |
ScanProgress* pProgress; |
ScanProgress* pProgress; |
389 |
bool HasInstrumentFiles(String Dir); |
bool HasInstrumentFiles(String Dir); |
390 |
|
bool insDir; |
391 |
}; |
}; |
392 |
|
|
393 |
class InstrumentFileCounter: public File::DirectoryWalker { |
class InstrumentFileCounter: public File::DirectoryWalker { |