void TBSelectItemViewer::SetSource(TBSelectItemSource *source) { if (m_source == source) return; if (m_source) m_source->m_viewers.Remove(this); m_source = source; if (m_source) m_source->m_viewers.AddLast(this); OnSourceChanged(); }
ResetCache(); if (init) { //Force filling out of the current item queue_end_++; Lookup(current_); } } //----------------------------------------------------------------------------- void PlayerHistory::SetPlayer(Player* player) { connect(this, SIGNAL(OnPlayFile(Media,bool)), player, SLOT(PlayFile(Media,bool))); connect(player, SIGNAL(OnStatus(PlayerState)), this, SLOT(Status(PlayerState))); connect(player, SIGNAL(OnSourceChanged()), this, SLOT(SourceChanged())); OnPlayFile(Lookup(current_),false);//force through the current item to the player } //----------------------------------------------------------------------------- void PlayerHistory::PlayFile(const Media& entry) { LOG("History") << "PlayFile"; if (entry == Lookup(current_)) { //There is a bit of a special case if the current item has been re-requested //Causes it to play if we are stopped but otherwise ignores it if (!current_played_) OnPlayFile(Lookup(current_), true); }