SongSelectorLogic Class Reference

#include <selector.h>

Collaboration diagram for SongSelectorLogic:
Collaboration graph
[legend]

List of all members.

Public Slots

virtual void updateItemList ()
virtual void startExistenceCheck ()
virtual void selectAllButTagged ()
virtual void selectAllTags ()
virtual void switchMonitorToMain ()
virtual void timerTick ()
virtual void startSong (const QModelIndex &i)
virtual void doPreferences ()
virtual void openLogDialog ()
virtual void doAbout ()
virtual void doLicense ()
virtual void searchLineEntered ()
virtual void exportPlayList ()
virtual void doSpectrumPca (bool fulldatabase=false, bool update_process_view=true)
virtual void exportTempoList ()
virtual void doBackup ()
virtual void selectionAddTags ()
virtual void selectionSetAuthor ()
virtual void selectionSetMainSong ()
virtual void selectionDelTags ()
virtual void selectionAddQueue ()
virtual void selectionEditInfo ()
virtual void selectionInsertInAlbum ()
virtual void quitButton ()
virtual void avoidNoSongs ()
virtual void avoidSongs ()
virtual void toggle_temporange ()
virtual void show_freq_shaping_dialog ()
virtual void importSongs ()
virtual void queueAnalysis ()
virtual void clearMetaData ()
virtual void toAnalyzeOrNot ()
virtual void doOnlineHelp ()
virtual void doAutoMix ()
virtual void selectionMenu (const QPoint &)
virtual void openQueueMenu ()
virtual void openStatistics ()
virtual void startRenamerOnSongs ()
virtual void startRenamerOnIndices ()
virtual void playTreeSong (QTreeWidgetItem *)
virtual void queueShiftUp ()
virtual void queueShiftDown ()
virtual void queueDelete ()
virtual void queueInsert ()
void queueInsert (int count)
virtual void queueRandom (bool)
virtual void queueRandom ()
bool rejectQueueProposal (Song *song, int position)
void filterProposedList (Song **list, int &count, int position)
virtual void queueSelectSong ()
virtual void queueCopySongs ()
virtual void queueAnker ()
virtual void savePlayHistory ()
virtual void clearPlayHistory ()
virtual void albumItemChanged (QTreeWidgetItem *, int col)
virtual void selectAlbumItem (QTreeWidgetItem *)
virtual void keyPressEvent (QKeyEvent *)
virtual bool eventFilter (QObject *, QEvent *)
virtual void sortByColumn (int col, Qt::SortOrder)
virtual void changeTagList (QTreeWidgetItem *item, int col)
virtual void playFragment (const QModelIndex &)
void fragmentCreated (FragmentCreated *fc)
void customEvent (QEvent *e)

Public Member Functions

 SongSelectorLogic (QWidget *parent=0)
virtual ~SongSelectorLogic ()
void initialize_extras ()
void acceptNewSong (Song *song)
void addTag (const QString tag)
virtual void resetCounter ()
virtual void updateProcessView (bool main_changed)
virtual void startAnotherAnalyzer (Song *finished_analyzing, int on_slot)
void start_reading_indices ()
void step_reading_indices (vector< Song * > *newsongs)
void stop_reading_indices (unsigned4 total)
void reread_and_repaint (Song *song)

Public Attributes

QSongsongList
DataBasedatabase

Constructor & Destructor Documentation

SongSelectorLogic::SongSelectorLogic ( QWidget *  parent = 0  ) 

link with the process manager

initialize fields

create menu structure

main menu

file menu

Lovely Qt4 crap with separators

help menu

before menu

view color menu

view display part

view dialog part

auto menu

selection menu

queue menu

Create player views

create analyzer views

Which tags were marked in the previous session

History

Queue

Analysis Queue

Copy the header information from the configuration file

Will fetch the tags we already know so that the database can filter incoming songs immediately

References Tags::add_tag(), addTag(), Config::analyzers, Config::ask_mix, assert(), Config::auto_popqueue, clearMetaData(), Config::color_authorplayed, Config::color_cues, Config::color_dcolor, Config::color_ondisk, Config::color_played, Config::color_range, Config::color_songs_based_on_history, Config::color_spectrum, database, doAbout(), doBackup(), doLicense(), doOnlineHelp(), doPreferences(), doSpectrumPca(), EMPTY, exportPlayList(), exportTempoList(), extensionList(), findOneStdItem(), i, importSongs(), History::init(), Config::limit_authornonplayed, Config::limit_downrange, Config::limit_indistance, Config::limit_nonplayed, Config::limit_ondisk, Config::limit_uprange, LIST_COMPOSITION, LIST_HISTOGRAM, LIST_RHYTHM, main(), OneSpace, openLogDialog(), openStatistics(), Config::play_fragments, Config::players, playFragment(), queueAnalysis(), queueAnker(), queueCopySongs(), queueDelete(), queueInsert(), queueRandom(), queueSelectSong(), queueShiftDown(), queueShiftUp(), quitButton(), selectAllButTagged(), selectAllTags(), selectionAddQueue(), selectionAddTags(), selectionDelTags(), selectionEditInfo(), selectionInsertInAlbum(), selectionMenu(), selectionSetAuthor(), selectionSetMainSong(), show_freq_shaping_dialog(), songList, sortByColumn(), startExistenceCheck(), startRenamerOnIndices(), startRenamerOnSongs(), startSong(), status, switchMonitorToMain(), tag, TAG_TRUE, TAGS_TEXT, timerTick(), toAnalyzeOrNot(), toggle_temporange(), and DataBase::updateCache().

SongSelectorLogic::~SongSelectorLogic (  )  [virtual]

References database.


Member Function Documentation

void SongSelectorLogic::acceptNewSong ( Song song  ) 

References DataBase::add(), and database.

void SongSelectorLogic::addTag ( const QString  tag  ) 

References findStdItem(), TAG_FALSE, and TAGS_TEXT.

Referenced by SongSelectorLogic().

void SongSelectorLogic::albumItemChanged ( QTreeWidgetItem *  i,
int  col 
) [virtual, slot]

We only allow editing of the rank

References Error(), Index::find_album(), TreeWidgetSong::getSong(), AlbumItem::init(), AlbumField::nr, and qtos4().

void SongSelectorLogic::avoidNoSongs (  )  [virtual, slot]

References songs_to_avoid, and updateItemList().

void SongSelectorLogic::avoidSongs (  )  [virtual, slot]
void SongSelectorLogic::changeTagList ( QTreeWidgetItem *  item,
int  col 
) [virtual, slot]
void SongSelectorLogic::clearMetaData (  )  [virtual, slot]
void SongSelectorLogic::clearPlayHistory (  )  [virtual, slot]
void SongSelectorLogic::customEvent ( QEvent *  e  )  [slot]

References BpmDjCustom, and BpmDjEvent::run().

void SongSelectorLogic::doAbout (  )  [virtual, slot]

Referenced by SongSelectorLogic().

void SongSelectorLogic::doAutoMix (  )  [virtual, slot]
void SongSelectorLogic::doBackup (  )  [virtual, slot]

References vexecute().

Referenced by SongSelectorLogic().

void SongSelectorLogic::doLicense (  )  [virtual, slot]

Referenced by SongSelectorLogic().

void SongSelectorLogic::doOnlineHelp (  )  [virtual, slot]

data location

code location

References checkDocsAt(), data, exists(), programname, and spawn().

Referenced by SongSelectorLogic().

void SongSelectorLogic::doPreferences (  )  [virtual, slot]

References Config::open_ui(), and updateItemList().

Referenced by SongSelectorLogic(), and startSong().

void SongSelectorLogic::doSpectrumPca ( bool  fulldatabase = false,
bool  update_process_view = true 
) [virtual, slot]
bool SongSelectorLogic::eventFilter ( QObject *  o,
QEvent *  e 
) [virtual, slot]
void SongSelectorLogic::exportPlayList (  )  [virtual, slot]
void SongSelectorLogic::exportTempoList (  )  [virtual, slot]
void SongSelectorLogic::filterProposedList ( Song **  list,
int &  count,
int  position 
) [slot]

References assert(), i, and rejectQueueProposal().

Referenced by queueRandom().

void SongSelectorLogic::fragmentCreated ( FragmentCreated fc  )  [slot]
void SongSelectorLogic::importSongs (  )  [virtual, slot]
void SongSelectorLogic::initialize_extras (  ) 
void SongSelectorLogic::keyPressEvent ( QKeyEvent *  e  )  [virtual, slot]

The keypress slot will check whether a delete is pressed while viewing the albumList. If so, it will delete that song from the album.

void SongSelectorLogic::openLogDialog (  )  [virtual, slot]

Referenced by SongSelectorLogic().

void SongSelectorLogic::openQueueMenu (  )  [virtual, slot]
void SongSelectorLogic::openStatistics (  )  [virtual, slot]

References database.

Referenced by SongSelectorLogic().

void SongSelectorLogic::playFragment ( const QModelIndex &  idx  )  [virtual, slot]
void SongSelectorLogic::playTreeSong ( QTreeWidgetItem *  song  )  [virtual, slot]
void SongSelectorLogic::queueAnalysis (  )  [virtual, slot]

This method queues all the selected songs in the analysis queue If no analyzer is enabled we suggest the possibility to enable one.

References ITERATE_OVER, svi, and selectedSongIterator::val().

Referenced by SongSelectorLogic().

void SongSelectorLogic::queueAnker (  )  [virtual, slot]
void SongSelectorLogic::queueCopySongs (  )  [virtual, slot]
void SongSelectorLogic::queueDelete (  )  [virtual, slot]
void SongSelectorLogic::queueInsert ( int  count  )  [slot]

First we run through the complete list to asisgn to each element a rank which is a multiple of the count. We start at count+1. This is useful if we want to insert songs directly after the main or monitor song

References ITERATE_OVER, QueuedSong::setPos(), and treeWidgetIterator< T >::val().

void SongSelectorLogic::queueInsert (  )  [virtual, slot]

References queueInsert().

Referenced by eventFilter(), and SongSelectorLogic().

void SongSelectorLogic::queueRandom (  )  [virtual, slot]
void SongSelectorLogic::queueRandom ( bool  userChoice  )  [virtual, slot]

This loop will in every iteration try to find an undefined element and then assign a value to it if there are no longer undefined elements, the loop breaks.

Run through the proposed list and remove anything duplicate depending on the users preferences

References QueuedSong::ankered(), bpmdj_deallocate, DataBase::closestSongs(), database, Song::distance(), filterProposedList(), i, ITERATE_OVER, main_song, monitor_song, SongMetriek::std, and treeWidgetIterator< T >::val().

void SongSelectorLogic::queueSelectSong (  )  [virtual, slot]

References queueRandom().

Referenced by SongSelectorLogic().

void SongSelectorLogic::queueShiftDown (  )  [virtual, slot]
void SongSelectorLogic::queueShiftUp (  )  [virtual, slot]
void SongSelectorLogic::quitButton (  )  [virtual, slot]

Referenced by SongSelectorLogic().

bool SongSelectorLogic::rejectQueueProposal ( Song song,
int  position 
) [slot]
void SongSelectorLogic::reread_and_repaint ( Song song  ) 
void SongSelectorLogic::resetCounter (  )  [virtual]
void SongSelectorLogic::savePlayHistory (  )  [virtual, slot]
void SongSelectorLogic::searchLineEntered (  )  [virtual, slot]

References updateItemList().

void SongSelectorLogic::selectAlbumItem ( QTreeWidgetItem *  i  )  [virtual, slot]
void SongSelectorLogic::selectAllButTagged (  )  [virtual, slot]
void SongSelectorLogic::selectAllTags (  )  [virtual, slot]
void SongSelectorLogic::selectionAddQueue (  )  [virtual, slot]
void SongSelectorLogic::selectionAddTags (  )  [virtual, slot]
void SongSelectorLogic::selectionDelTags (  )  [virtual, slot]
void SongSelectorLogic::selectionEditInfo (  )  [virtual, slot]
void SongSelectorLogic::selectionInsertInAlbum (  )  [virtual, slot]
void SongSelectorLogic::selectionMenu ( const QPoint &  pos  )  [virtual, slot]

Referenced by SongSelectorLogic().

void SongSelectorLogic::selectionSetAuthor (  )  [virtual, slot]
void SongSelectorLogic::selectionSetMainSong (  )  [virtual, slot]
void SongSelectorLogic::show_freq_shaping_dialog (  )  [virtual, slot]

Referenced by SongSelectorLogic().

void SongSelectorLogic::sortByColumn ( int  col,
Qt::SortOrder  so 
) [virtual, slot]

References songList, and QSong::sort().

Referenced by SongSelectorLogic().

void SongSelectorLogic::start_reading_indices (  ) 

Will start the indexreader active object, which will go through all the index files in the index directory and read them in memory. During this process step_reading_indices will be called regularly. At the end of the process stop_reading_indices will be called.

References IndexReader::start(), and updateProcessView().

Referenced by main().

void SongSelectorLogic::startAnotherAnalyzer ( Song finished_analyzing,
int  on_slot 
) [virtual]

This function is called by the analyzer manager when a slot comes free either due to a timeout or due to a descent stop. In any case we need to start a new one here.

References Config::analyzers, Song::contains_tag(), Tags::find_tag_create_if_necessary(), TreeWidgetSong::getSong(), i, ITERATE_OVER, Song::needs_analysis(), reread_and_repaint(), SongSlot::songs_per_second(), tag, and treeWidgetIterator< T >::val().

void SongSelectorLogic::startExistenceCheck (  )  [virtual, slot]
void SongSelectorLogic::startRenamerOnIndices (  )  [virtual, slot]
void SongSelectorLogic::startRenamerOnSongs (  )  [virtual, slot]
void SongSelectorLogic::startSong ( const QModelIndex &  i  )  [virtual, slot]
void SongSelectorLogic::step_reading_indices ( vector< Song * > *  new_songs  ) 

Executed as the response to an event posted by indexreader. The newsongs vector contains all the newly indexed songs. In return this function must contact the database which will actually add the songs to the full database, the cache if appropriate and the visualization collection if appropriate.

This version of the item list updater is used from within the index scanner It will not sort the data it retrieves from the database and will also not report on the lack of exiting songs at the moment. The history view is also not updated here.

References DataBase::addNewSongs(), database, Config::limit_downrange, Config::limit_indistance, Config::limit_uprange, main_song, monitor_song, ConfigState::set(), and songList.

Referenced by CollectionOfSongs::run().

void SongSelectorLogic::stop_reading_indices ( unsigned4  total  ) 

Executed as the response to an event posted by the indexReader. It signals the finishing of reading the current index collection.

References doSpectrumPca(), initialize_extras(), and startExistenceCheck().

Referenced by CollectionOfSongs::run().

void SongSelectorLogic::switchMonitorToMain (  )  [virtual, slot]
void SongSelectorLogic::timerTick (  )  [virtual, slot]

The timer thread will periodically call this function. Since it is the same thread it will be able to continue below. We don' want that because then we might have race conditions.

We can now check whether any button has been check to start an analyzer. We do this after the signal check because this function will also redraw the colors for the analyzer and will ensure an immediate color change when the text is updated in the signal checking round.

References Config::auto_popqueue, SongProcess::checkSignals(), TreeWidgetSong::getSong(), monitor_song, poll_death(), queueOrder(), ConfigState::setOn(), ProcessManager::startSong(), and toAnalyzeOrNot().

Referenced by SongSelectorLogic().

virtual void SongSelectorLogic::toAnalyzeOrNot (  )  [virtual, slot]

Referenced by SongSelectorLogic(), and timerTick().

void SongSelectorLogic::toggle_temporange (  )  [virtual, slot]
void SongSelectorLogic::updateItemList (  )  [virtual, slot]
void SongSelectorLogic::updateProcessView ( bool  main_changed  )  [virtual]

Member Data Documentation


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