Miam-Player  0.8.0
A nice music player
SqlDatabase Class Reference

The SqlDatabase class uses SQLite to store few but useful tables for tracks, playlists, etc. More...

#include <sqldatabase.h>

Inheritance diagram for SqlDatabase:

Public Slots

void load (Settings::RequestSqlModel requestedModel=Settings::RSM_Hierarchical)
void rebuild ()
void rebuild (const QStringList &oldLocations, const QStringList &newLocations)


void aboutToLoad ()
void aboutToResyncRemoteSources ()
void coverWasUpdated (const QFileInfo &)
void loaded ()
void progressChanged (const int &)
void nodeExtracted (GenericDAO *node)
void tracksExtracted (const QList< TrackDAO > &)
void artistsExtracted (const QList< ArtistDAO > &)
void albumsExtracted (const QList< AlbumDAO > &)
void aboutToUpdateNode (GenericDAO *node)
void aboutToCleanView ()

Public Member Functions

MusicSearchEnginemusicSearchEngine () const
bool insertIntoTableArtists (ArtistDAO *artist)
bool insertIntoTableAlbums (uint artistId, AlbumDAO *album)
uint insertIntoTablePlaylists (const PlaylistDAO &playlist, const std::list< TrackDAO > &tracks, bool isOverwriting)
bool insertIntoTablePlaylistTracks (uint playlistId, const std::list< TrackDAO > &tracks, bool isOverwriting=false)
bool insertIntoTableTracks (const TrackDAO &track)
bool insertIntoTableTracks (const std::list< TrackDAO > &tracks)
bool removePlaylist (uint playlistId)
void removePlaylistsFromHost (const QString &host)
void removeRecordsFromHost (const QString &host)
CoverselectCoverFromURI (const QString &uri)
QList< TrackDAOselectPlaylistTracks (uint playlistID)
PlaylistDAO selectPlaylist (uint playlistId)
QList< PlaylistDAOselectPlaylists ()
ArtistDAOselectArtist (uint artistId)
AlbumDAOselectAlbumFromArtist (ArtistDAO *artistDAO, uint albumId)
TrackDAO selectTrackByURI (const QString &uri)
bool playlistHasBackgroundImage (uint playlistID)
bool updateTablePlaylist (const PlaylistDAO &playlist)
void updateTablePlaylistWithBackgroundImage (uint playlistID, const QString &backgroundImagePath)
void updateTableAlbumWithCoverImage (const QString &coverPath, const QString &album, const QString &artist)
void updateTracks (const QStringList &oldPaths, const QStringList &newPaths)
QString normalizeField (const QString &s) const
void setPragmas ()

Static Public Member Functions

static SqlDatabaseinstance ()

Detailed Description

The SqlDatabase class uses SQLite to store few but useful tables for tracks, playlists, etc.

Matthieu Bachelier

Member Function Documentation

void SqlDatabase::aboutToCleanView ( )
void SqlDatabase::aboutToLoad ( )
void SqlDatabase::aboutToResyncRemoteSources ( )
void SqlDatabase::aboutToUpdateNode ( GenericDAO node)
void SqlDatabase::albumsExtracted ( const QList< AlbumDAO > &  )
void SqlDatabase::artistsExtracted ( const QList< ArtistDAO > &  )
void SqlDatabase::coverWasUpdated ( const QFileInfo &  )
bool SqlDatabase::insertIntoTableAlbums ( uint  artistId,
AlbumDAO album 
bool SqlDatabase::insertIntoTableArtists ( ArtistDAO artist)
uint SqlDatabase::insertIntoTablePlaylists ( const PlaylistDAO playlist,
const std::list< TrackDAO > &  tracks,
bool  isOverwriting 
bool SqlDatabase::insertIntoTablePlaylistTracks ( uint  playlistId,
const std::list< TrackDAO > &  tracks,
bool  isOverwriting = false 
bool SqlDatabase::insertIntoTableTracks ( const TrackDAO track)
bool SqlDatabase::insertIntoTableTracks ( const std::list< TrackDAO > &  tracks)
SqlDatabase * SqlDatabase::instance ( )

Singleton pattern to be able to easily use settings everywhere in the app.

void SqlDatabase::load ( Settings::RequestSqlModel  requestedModel = Settings::RSM_Hierarchical)

Load an existing database file or recreate it, if not found.

void SqlDatabase::loaded ( )
MusicSearchEngine * SqlDatabase::musicSearchEngine ( ) const
void SqlDatabase::nodeExtracted ( GenericDAO node)
QString SqlDatabase::normalizeField ( const QString &  s) const
bool SqlDatabase::playlistHasBackgroundImage ( uint  playlistID)
void SqlDatabase::progressChanged ( const int &  )
void SqlDatabase::rebuild ( )

Delete and rescan local tracks.

void SqlDatabase::rebuild ( const QStringList &  oldLocations,
const QStringList &  newLocations 
bool SqlDatabase::removePlaylist ( uint  playlistId)

XXX: CASCADE not working?

void SqlDatabase::removePlaylistsFromHost ( const QString &  host)
void SqlDatabase::removeRecordsFromHost ( const QString &  host)
AlbumDAO * SqlDatabase::selectAlbumFromArtist ( ArtistDAO artistDAO,
uint  albumId 
ArtistDAO * SqlDatabase::selectArtist ( uint  artistId)
Cover * SqlDatabase::selectCoverFromURI ( const QString &  uri)
PlaylistDAO SqlDatabase::selectPlaylist ( uint  playlistId)
QList< PlaylistDAO > SqlDatabase::selectPlaylists ( )
QList< TrackDAO > SqlDatabase::selectPlaylistTracks ( uint  playlistID)
TrackDAO SqlDatabase::selectTrackByURI ( const QString &  uri)
void SqlDatabase::setPragmas ( )
void SqlDatabase::tracksExtracted ( const QList< TrackDAO > &  )
void SqlDatabase::updateTableAlbumWithCoverImage ( const QString &  coverPath,
const QString &  album,
const QString &  artist 
bool SqlDatabase::updateTablePlaylist ( const PlaylistDAO playlist)
void SqlDatabase::updateTablePlaylistWithBackgroundImage ( uint  playlistID,
const QString &  backgroundImagePath 
void SqlDatabase::updateTracks ( const QStringList &  oldPaths,
const QStringList &  newPaths 

Update a list of tracks. If track name has changed, it will be removed from Library then added right after.

Update a list of tracks. If track name has changed, will be removed from Library then added right after.

The documentation for this class was generated from the following files: