#include <database.h>
Public Member Functions | |
| void | reset () |
| void | updateCache (SongSelectorLogic *selector) |
| Song * | find (QString song_filename) |
| const vector< Song * > & | getAllSongs () |
| Song * | file_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 |
| DataBase::DataBase | ( | ) |
References init().
| DataBase::~DataBase | ( | ) | [virtual] |
References clear().
| void DataBase::add | ( | Song * | song | ) | [virtual] |
References all, Fatal(), file2song, and flush_cache().
Referenced by SongSelectorLogic::acceptNewSong(), and addNewSongs().
| 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 | |||
| ) |
References bpmdj_allocate, Song::distance(), entries, ITERATE_OVER, updateCache(), and vectorIterator< K >::val().
Referenced by SongSelectorLogic::queueRandom().
| Song* DataBase::file_to_song | ( | QString | file | ) | [inline] |
Will return the Song* object based on the mp3 filename
References file2song.
Referenced by SongSelectorLogic::updateItemList().
| void DataBase::flush_cache | ( | ) | [inline] |
Referenced by add(), and SongSelectorLogic::importSongs().
| const vector<Song*>& DataBase::getAllSongs | ( | ) | [inline] |
References all.
Referenced by History::clear_history(), SongSelectorLogic::doSpectrumPca(), SongSelectorLogic::selectAlbumItem(), and SongSelectorLogic::startExistenceCheck().
| map<QString,Song*> DataBase::getFileTreeCopy | ( | ) | [inline] |
References file2song.
Referenced by MusicScanner::MusicScanner().
| int DataBase::getSelection | ( | SongSelectorLogic * | selector, | |
| QSong * | target, | |||
| int | nr | |||
| ) |
References SongHeap::add(), assert(), ITERATE_OVER, Config::limit_indistance, main_song, SongHeap::maximum, updateCache(), and vectorIterator< K >::val().
Referenced by SongSelectorLogic::updateItemList().
| void DataBase::init | ( | ) | [protected, virtual] |
References all, and file2song.
Referenced by DataBase(), and reset().
| void DataBase::updateCache | ( | SongSelectorLogic * | selector | ) |
References all, ITERATE_OVER, and vectorIterator< K >::val().
Referenced by closestSongs(), getSelection(), and SongSelectorLogic::SongSelectorLogic().
vector<Song*> DataBase::all [protected] |
Referenced by add(), clear(), getAllSongs(), init(), and updateCache().
map<QString,Song*> DataBase::file2song [protected] |
Referenced by add(), file_to_song(), find(), getFileTreeCopy(), and init().
1.6.2