import "sbIMediaLibrary.idl";
Public Member Functions | |
void | setDirectory (in AString strDirectory) |
Set the directory to scan. | |
AString | getDirectory () |
Get the directory to scan. | |
void | setRecurse (in PRBool bRecurse) |
Set the scan to run recursively under the given directory. | |
PRBool | getRecurse () |
Whether or not the scan will run recursively. | |
void | setCallback (in sbIMediaScanCallback pCallback) |
Set the callback object for the scan. | |
sbIMediaScanCallback | getCallback () |
Get the callback object for the scan. | |
PRUint32 | getFileCount () |
Get the number of files found. | |
void | addFilePath (in AString strFilePath) |
USER CODE SHOULD NOT REFERENCE THIS METHOD. | |
AString | getFilePath (in PRUint32 nIndex) |
Get the N'th file from the results of the scan. | |
PRBool | isScanning () |
Whether or not the scan operation is executing. | |
void | setIsScanning (in PRBool bIsScanning) |
USER CODE SHOULD NOT REFERENCE THIS METHOD. | |
AString | getLastFileFound () |
Returns the most recent file found by the scan. | |
AString | getCurrentScanPath () |
Returns the most recent directory scanned. | |
void | setCurrentScanPath (in AString strScanPath) |
USER CODE SHOULD NOT REFERENCE THIS METHOD. |
This object is used to rapidly gather a list of all the files found under a given directory path. It runs from a separate thread.
User code may call getCurrentScanPath() and getLastFileFound() from the main thread to get a periodic snapshot of the current progress of the scan.
Execute a scan by creating a scan query, filling it out, and passing it to the sbIMediaScan interface for processing:
function ScanBeneathADirectory(aPath) { // Create the objects var aMediaScan = Components.classes["@songbirdnest.com/Songbird/MediaScan;1"] .createInstance(Components.interfaces.sbIMediaScan); var aMediaScanQuery = Components.classes["@songbirdnest.com/Songbird/MediaScanQuery;1"] .createInstance(Components.interfaces.sbIMediaScanQuery); // Setup the query aMediaScanQuery.setDirectory(aPath); aMediaScanQuery.setRecurse(true); // Execute the query aMediaScan.submitQuery(aMediaScanQuery); return aMediaScanQuery; }
Definition at line 527 of file sbIMediaLibrary.idl.
sbIMediaScanCallback sbIMediaScanQuery::getCallback | ( | ) |
Get the callback object for the scan.
AString sbIMediaScanQuery::getCurrentScanPath | ( | ) |
Returns the most recent directory scanned.
This method may be called while the scan is executing to provide a periodic snapshot of the scan results.
AString sbIMediaScanQuery::getDirectory | ( | ) |
Get the directory to scan.
PRUint32 sbIMediaScanQuery::getFileCount | ( | ) |
AString sbIMediaScanQuery::getFilePath | ( | in PRUint32 | nIndex | ) |
Get the N'th file from the results of the scan.
Don't call this while isScanning() is true.
nIndex | The index of the files array to retrieve |
AString sbIMediaScanQuery::getLastFileFound | ( | ) |
Returns the most recent file found by the scan.
This method may be called while the scan is executing to provide a periodic snapshot of the scan results.
PRBool sbIMediaScanQuery::getRecurse | ( | ) |
Whether or not the scan will run recursively.
PRBool sbIMediaScanQuery::isScanning | ( | ) |
Whether or not the scan operation is executing.
void sbIMediaScanQuery::setCallback | ( | in sbIMediaScanCallback | pCallback | ) |
Set the callback object for the scan.
pCallback | The callback object |
void sbIMediaScanQuery::setDirectory | ( | in AString | strDirectory | ) |
Set the directory to scan.
strDirectory | The directory to scan |
void sbIMediaScanQuery::setRecurse | ( | in PRBool | bRecurse | ) |
Set the scan to run recursively under the given directory.
bRecurse | If true, scan subdirectories |