DataBase Class Reference

#include <database.h>

List of all members.

Public Member Functions

void reset ()
void updateCache (SongSelectorLogic *selector)
Songfind (QString song_filename)
const vector< Song * > & getAllSongs ()
Songfile_to_song (QString file)
map< QString, Song * > getFileTreeCopy ()
 DataBase ()
virtual ~DataBase ()
virtual void add (Song *)
void flush_cache ()
int getSelection (SongSelectorLogic *selector, QSong *target, int nr)
void addNewSongs (SongSelectorLogic *selector, QSong *target, vector< Song * > *collection)
Song ** closestSongs (SongSelectorLogic *selector, Song *target1, float4 weight1, Song *target2, float4 weight2, SongMetriek *metriek, int maximum, int &count)

Protected Member Functions

virtual void init ()
virtual void clear ()

Protected Attributes

vector< Song * > all
map< QString, Song * > file2song

Constructor & Destructor Documentation

DataBase::DataBase (  ) 

References init().

DataBase::~DataBase (  )  [virtual]

References clear().


Member Function Documentation

void DataBase::add ( Song song  )  [virtual]
void DataBase::addNewSongs ( SongSelectorLogic selector,
QSong target,
vector< Song * > *  collection 
)

Since these come from the index reader we do not want to limit the selection to a heap since that would slow everything down. Instead we simply extend the current selection if the song satisfies all other criteria (in tempo, proper tag etc) we also do not check cache updates or the likes, this means that the filter must be applied in 2 steps. First to check the tag, then to check its distance to the main song

References add(), assert(), ITERATE_OVER, main_song, and vectorIterator< K >::val().

Referenced by SongSelectorLogic::step_reading_indices().

void DataBase::clear (  )  [protected, virtual]

References all, i, ITERATE_OVER, and vectorIterator< K >::val().

Referenced by reset(), and ~DataBase().

Song ** DataBase::closestSongs ( SongSelectorLogic selector,
Song target1,
float4  weight1,
Song target2,
float4  weight2,
SongMetriek metriek,
int  maximum,
int &  count 
)
Song* DataBase::file_to_song ( QString  file  )  [inline]

Will return the Song* object based on the mp3 filename

References file2song.

Referenced by SongSelectorLogic::updateItemList().

Song * DataBase::find ( QString  song_filename  ) 

References file2song.

void DataBase::flush_cache (  )  [inline]
const vector<Song*>& DataBase::getAllSongs (  )  [inline]
map<QString,Song*> DataBase::getFileTreeCopy (  )  [inline]

References file2song.

Referenced by MusicScanner::MusicScanner().

int DataBase::getSelection ( SongSelectorLogic selector,
QSong target,
int  nr 
)
void DataBase::init (  )  [protected, virtual]

References all, and file2song.

Referenced by DataBase(), and reset().

void DataBase::reset (  ) 

References clear(), and init().

void DataBase::updateCache ( SongSelectorLogic selector  ) 

Member Data Documentation

vector<Song*> DataBase::all [protected]
map<QString,Song*> DataBase::file2song [protected]

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

Generated by  doxygen 1.6.2