From 6925380098f9de4841534db7e8285ba0c18c2ca2 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Tue, 18 Mar 2008 11:47:14 +0000 Subject: make seek and time accessible by general plugins git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@278 90c681e8-e032-0410-971d-27865f9a5e38 --- src/qmmpui/generalhandler.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/qmmpui/generalhandler.cpp') diff --git a/src/qmmpui/generalhandler.cpp b/src/qmmpui/generalhandler.cpp index a70068a02..54e5a8652 100644 --- a/src/qmmpui/generalhandler.cpp +++ b/src/qmmpui/generalhandler.cpp @@ -33,10 +33,12 @@ GeneralHandler::GeneralHandler(QObject *parent) m_instance = this; m_left = 0; m_right = 0; + m_time = 0; m_state = General::Stopped; GeneralFactory* factory; m_control = new Control(this); connect(m_control, SIGNAL(commandCalled(uint)), SLOT(processCommand(uint))); + connect(m_control, SIGNAL(seekCalled(int)), SIGNAL(seekCalled(int))); connect(m_control, SIGNAL(volumeChanged(int, int)), SIGNAL(volumeChanged(int, int))); foreach(factory, *General::generalFactories()) { @@ -58,7 +60,10 @@ void GeneralHandler::setState(uint state) m_state = state; General *general; if (state == General::Stopped) + { m_songInfo.clear(); + m_time = 0; + } foreach(general, m_generals.values()) { @@ -92,6 +97,18 @@ void GeneralHandler::setVolume(int left, int right) } } +void GeneralHandler::setTime(int time) +{ + if(m_time == time) + return; + m_time = time; + General *general; + foreach(general, m_generals.values()) + { + general->setTime(time); + } +} + void GeneralHandler::setEnabled(GeneralFactory* factory, bool enable) { if (enable == m_generals.keys().contains(factory)) @@ -105,6 +122,7 @@ void GeneralHandler::setEnabled(GeneralFactory* factory, bool enable) { general->setState(m_state); general->setSongInfo(m_songInfo); + general->setTime(m_time); } } else -- cgit v1.2.3-13-gbd6f