aboutsummaryrefslogtreecommitdiff
path: root/src/qmmpui/generalhandler.cpp
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2008-03-18 11:47:14 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2008-03-18 11:47:14 +0000
commit6925380098f9de4841534db7e8285ba0c18c2ca2 (patch)
treea29374713c232d31b49afead88707f924e8c9f76 /src/qmmpui/generalhandler.cpp
parent625b2712c1c9fa46ba43684a24a477aa60d88089 (diff)
downloadqmmp-6925380098f9de4841534db7e8285ba0c18c2ca2.tar.gz
qmmp-6925380098f9de4841534db7e8285ba0c18c2ca2.tar.bz2
qmmp-6925380098f9de4841534db7e8285ba0c18c2ca2.zip
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
Diffstat (limited to 'src/qmmpui/generalhandler.cpp')
-rw-r--r--src/qmmpui/generalhandler.cpp18
1 files changed, 18 insertions, 0 deletions
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