#include <filescanner.h>
Definition at line 18 of file filescanner.h.
Public Member Functions | |
| FileScanner () | |
| ~FileScanner () | |
| void | SearchDir (QString &directory) |
| Scan a directory recursively for music and albumart. Inserts, updates and removes any files any files found in the database. | |
Private Member Functions | |
| void | BuildFileList (QString &directory, MusicLoadedMap &music_files, int parentid) |
| Builds a list of all the files found descending recursively into the given directory. | |
| int | GetDirectoryId (const QString &directory, const int &parentid) |
| Get an ID for the given directory from the database. If it doesn't already exist in the database, insert it. | |
| bool | HasFileChanged (const QString &filename, const QString &date_modified) |
| Check if file has been modified since given date/time. | |
| void | AddFileToDB (const QString &filename) |
| Insert file details into database. If it is an audio file, read the metadata and insert that information at the same time. | |
| void | RemoveFileFromDB (const QString &filename) |
| Removes a file from the database. | |
| void | UpdateFileInDB (const QString &filename) |
| Updates a file in the database. | |
| void | ScanMusic (MusicLoadedMap &music_files) |
| Check a list of files against musics files already in the database. | |
| void | ScanArtwork (MusicLoadedMap &music_files) |
| Check a list of files against images already in the database. | |
| void | cleanDB () |
| Clear orphaned entries from the genre, artist, album and albumart tables. | |
Private Attributes | |
| QString | m_startdir |
| IdCache | m_directoryid |
| IdCache | m_artistid |
| IdCache | m_genreid |
| IdCache | m_albumid |
| Decoder * | m_decoder |
| FileScanner::FileScanner | ( | ) |
Definition at line 20 of file filescanner.cpp.
| FileScanner::~FileScanner | ( | ) |
Definition at line 65 of file filescanner.cpp.
| void FileScanner::SearchDir | ( | QString & | directory | ) |
Scan a directory recursively for music and albumart. Inserts, updates and removes any files any files found in the database.
| directory | Directory to scan |
Definition at line 495 of file filescanner.cpp.
Referenced by MusicCallback(), preMusic(), runRipCD(), and runScan().
| void FileScanner::BuildFileList | ( | QString & | directory, | |
| MusicLoadedMap & | music_files, | |||
| int | parentid | |||
| ) | [private] |
Builds a list of all the files found descending recursively into the given directory.
| directory | Directory to begin search | |
| music_files | A pointer to the MusicLoadedMap to store the results | |
| parentid | The id of the parent directory in the music_directories table. The root directory should have an id of 0 |
Definition at line 81 of file filescanner.cpp.
Referenced by SearchDir().
| int FileScanner::GetDirectoryId | ( | const QString & | directory, | |
| const int & | parentid | |||
| ) | [private] |
Get an ID for the given directory from the database. If it doesn't already exist in the database, insert it.
| directory | Relative path to directory, from base dir | |
| parentid | The id of the parent directory in the music_directories table. The root directory should have an id of 0 |
Definition at line 151 of file filescanner.cpp.
Referenced by BuildFileList().
| bool FileScanner::HasFileChanged | ( | const QString & | filename, | |
| const QString & | date_modified | |||
| ) | [private] |
Check if file has been modified since given date/time.
| filename | File to examine | |
| date_modified | Date to use in comparison |
Definition at line 202 of file filescanner.cpp.
Referenced by ScanMusic().
| void FileScanner::AddFileToDB | ( | const QString & | filename | ) | [private] |
Insert file details into database. If it is an audio file, read the metadata and insert that information at the same time.
If it is an image file, just insert the filename and type.
| filename | Full path to file. |
Definition at line 235 of file filescanner.cpp.
Referenced by SearchDir().
| void FileScanner::RemoveFileFromDB | ( | const QString & | filename | ) | [private] |
Removes a file from the database.
| filename | Full path to file. |
Definition at line 382 of file filescanner.cpp.
Referenced by SearchDir().
| void FileScanner::UpdateFileInDB | ( | const QString & | filename | ) | [private] |
Updates a file in the database.
| filename | Full path to file. |
Definition at line 423 of file filescanner.cpp.
Referenced by SearchDir().
| void FileScanner::ScanMusic | ( | MusicLoadedMap & | music_files | ) | [private] |
Check a list of files against musics files already in the database.
| music_files | MusicLoadedMap |
Definition at line 556 of file filescanner.cpp.
Referenced by SearchDir().
| void FileScanner::ScanArtwork | ( | MusicLoadedMap & | music_files | ) | [private] |
Check a list of files against images already in the database.
| music_files | MusicLoadedMap |
Definition at line 615 of file filescanner.cpp.
Referenced by SearchDir().
| void FileScanner::cleanDB | ( | ) | [private] |
Clear orphaned entries from the genre, artist, album and albumart tables.
Definition at line 313 of file filescanner.cpp.
Referenced by SearchDir().
QString FileScanner::m_startdir [private] |
Definition at line 37 of file filescanner.h.
Referenced by AddFileToDB(), BuildFileList(), RemoveFileFromDB(), ScanArtwork(), ScanMusic(), SearchDir(), and UpdateFileInDB().
IdCache FileScanner::m_directoryid [private] |
Definition at line 38 of file filescanner.h.
Referenced by AddFileToDB(), BuildFileList(), FileScanner(), RemoveFileFromDB(), and UpdateFileInDB().
IdCache FileScanner::m_artistid [private] |
Definition at line 39 of file filescanner.h.
Referenced by AddFileToDB(), FileScanner(), and UpdateFileInDB().
IdCache FileScanner::m_genreid [private] |
Definition at line 40 of file filescanner.h.
Referenced by AddFileToDB(), FileScanner(), and UpdateFileInDB().
IdCache FileScanner::m_albumid [private] |
Definition at line 41 of file filescanner.h.
Referenced by AddFileToDB(), FileScanner(), and UpdateFileInDB().
Decoder* FileScanner::m_decoder [private] |
Definition at line 43 of file filescanner.h.
1.5.5