Mixxx

TrackDAO Class Reference

#include <trackdao.h>

Inheritance diagram for TrackDAO:
Collaboration diagram for TrackDAO:

List of all members.

Public Slots

void saveTrack (TrackPointer pTrack)
void saveDirtyTracks ()
void clearCache ()

Signals

void trackDirty (int trackId)
void trackClean (int trackId)
void trackChanged (int trackId)
void tracksAdded (QSet< int > trackIds)
void tracksRemoved (QSet< int > trackIds)

Public Member Functions

 TrackDAO (QSqlDatabase &database, CueDAO &cueDao, PlaylistDAO &playlistDao, CrateDAO &crateDao, ConfigObject< ConfigValue > *pConfig=NULL)
virtual ~TrackDAO ()
void finish ()
void setDatabase (QSqlDatabase &database)
void initialize ()
int getTrackId (QString absoluteFilePath)
bool trackExistsInDatabase (QString absoluteFilePath)
QString getTrackLocation (int id)
int addTrack (QString absoluteFilePath, bool unremove)
int addTrack (QFileInfo &fileInfo, bool unremove)
void addTracks (QList< TrackInfoObject * > tracksToAdd, bool unremove)
void removeTrack (int id)
void removeTracks (QList< int > ids)
void unremoveTrack (int trackId)
TrackPointer getTrack (int id, bool cacheOnly=false) const
bool isDirty (int trackId)
void markTrackLocationAsVerified (QString location)
void markTracksInDirectoryAsVerified (QString directory)
void invalidateTrackLocationsInLibrary (QString libraryPath)
void markUnverifiedTracksAsDeleted ()
void markTrackLocationsAsDeleted (QString directory)
void detectMovedFiles ()

Detailed Description

Definition at line 57 of file trackdao.h.


Constructor & Destructor Documentation

TrackDAO::TrackDAO ( QSqlDatabase &  database,
CueDAO cueDao,
PlaylistDAO playlistDao,
CrateDAO crateDao,
ConfigObject< ConfigValue > *  pConfig = NULL 
)

The 'config object' is necessary because users decide ID3 tags get synchronized on track metadata change

Definition at line 21 of file trackdao.cpp.

TrackDAO::~TrackDAO ( ) [virtual]

Definition at line 45 of file trackdao.cpp.


Member Function Documentation

int TrackDAO::addTrack ( QString  absoluteFilePath,
bool  unremove 
)

Definition at line 455 of file trackdao.cpp.

Here is the caller graph for this function:

int TrackDAO::addTrack ( QFileInfo &  fileInfo,
bool  unremove 
)

Definition at line 443 of file trackdao.cpp.

Here is the call graph for this function:

void TrackDAO::addTracks ( QList< TrackInfoObject * >  tracksToAdd,
bool  unremove 
)

Definition at line 302 of file trackdao.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void TrackDAO::clearCache ( ) [slot]

Definition at line 975 of file trackdao.cpp.

Here is the caller graph for this function:

void TrackDAO::detectMovedFiles ( )

Look for moved files. Look for files that have been marked as "deleted on disk" and see if another "file" with the same name and filesize exists in the track_locations table. That means the file has moved instead of being deleted outright, and so we can salvage your existing metadata that you have in your DB (like cue points, etc.).

Definition at line 905 of file trackdao.cpp.

Here is the caller graph for this function:

void TrackDAO::finish ( )

Definition at line 34 of file trackdao.cpp.

Here is the caller graph for this function:

TrackPointer TrackDAO::getTrack ( int  id,
bool  cacheOnly = false 
) const

Definition at line 667 of file trackdao.cpp.

Here is the caller graph for this function:

int TrackDAO::getTrackId ( QString  absoluteFilePath)

Retrieve the track id for the track that's located at "location" on disk.

Returns:
the track id for the track located at location, or -1 if the track is not in the database.

Definition at line 57 of file trackdao.cpp.

Here is the caller graph for this function:

QString TrackDAO::getTrackLocation ( int  trackId)

Some code (eg. drag and drop) needs to just get a track's location, and it's not worth retrieving a whole TrackInfoObject.

Definition at line 79 of file trackdao.cpp.

void TrackDAO::initialize ( ) [virtual]

Implements DAO.

Definition at line 49 of file trackdao.cpp.

Here is the caller graph for this function:

void TrackDAO::invalidateTrackLocationsInLibrary ( QString  libraryPath)

Mark all the tracks whose paths begin with libraryPath as invalid. That means we'll need to later check that those tracks actually (still) exist as part of the library scanning procedure.

Definition at line 825 of file trackdao.cpp.

Here is the caller graph for this function:

bool TrackDAO::isDirty ( int  trackId)

Definition at line 149 of file trackdao.cpp.

void TrackDAO::markTrackLocationAsVerified ( QString  location)

Definition at line 842 of file trackdao.cpp.

Here is the caller graph for this function:

void TrackDAO::markTrackLocationsAsDeleted ( QString  directory)

Definition at line 888 of file trackdao.cpp.

Here is the caller graph for this function:

void TrackDAO::markTracksInDirectoryAsVerified ( QString  directory)

Definition at line 858 of file trackdao.cpp.

Here is the caller graph for this function:

void TrackDAO::markUnverifiedTracksAsDeleted ( )

Definition at line 873 of file trackdao.cpp.

Here is the caller graph for this function:

void TrackDAO::removeTrack ( int  id)

Removes a track from the library track collection.

Definition at line 468 of file trackdao.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void TrackDAO::removeTracks ( QList< int >  ids)

Definition at line 490 of file trackdao.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void TrackDAO::saveDirtyTracks ( ) [slot]

Definition at line 213 of file trackdao.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void TrackDAO::saveTrack ( TrackPointer  pTrack) [slot]

Definition at line 105 of file trackdao.cpp.

Here is the caller graph for this function:

void TrackDAO::setDatabase ( QSqlDatabase &  database) [inline]

Definition at line 68 of file trackdao.h.

Here is the caller graph for this function:

void TrackDAO::trackChanged ( int  trackId) [signal]
void TrackDAO::trackClean ( int  trackId) [signal]
void TrackDAO::trackDirty ( int  trackId) [signal]
bool TrackDAO::trackExistsInDatabase ( QString  absoluteFilePath)

Check if a track exists in the library table already.

Parameters:
file_locationThe full path to the track on disk, including the filename.
Returns:
true if the track is found in the library table, false otherwise.

Definition at line 101 of file trackdao.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void TrackDAO::tracksAdded ( QSet< int >  trackIds) [signal]

Here is the caller graph for this function:

void TrackDAO::tracksRemoved ( QSet< int >  trackIds) [signal]

Here is the caller graph for this function:

void TrackDAO::unremoveTrack ( int  trackId)

Definition at line 519 of file trackdao.cpp.

Here is the call graph for this function:


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines