Commit 2a9478e4 authored by Scott Wheeler's avatar Scott Wheeler

More updates getting this ready to sneek into usage...

svn path=/trunk/kdemultimedia/juk/; revision=291176
parent c3ada070
...@@ -62,26 +62,33 @@ void PlayerManager::play(const QString &fileName) ...@@ -62,26 +62,33 @@ void PlayerManager::play(const QString &fileName)
if(!m_player) if(!m_player)
return; return;
if(m_player->paused()) if(fileName.isNull()) {
m_player->stop(); if(m_player->paused())
m_player->play();
m_player->play(fileName); if(m_player->playing())
m_player->seekPosition(0);
}
else {
if(m_player->paused())
m_player->stop();
m_player->play(fileName);
}
// Make sure that the m_player actually starts before doing anything. // Make sure that the m_player actually starts before doing anything.
if(m_player->playing()) { if(!m_player->playing()) {
stop();
return;
}
m_actionCollection->action("pause")->setEnabled(true); m_actionCollection->action("pause")->setEnabled(true);
m_actionCollection->action("stop")->setEnabled(true); m_actionCollection->action("stop")->setEnabled(true);
m_actionCollection->action("forward")->setEnabled(true); m_actionCollection->action("forward")->setEnabled(true);
m_actionCollection->action("back")->setEnabled(true); m_actionCollection->action("back")->setEnabled(true);
m_sliderAction->trackPositionSlider()->setValue(0); m_sliderAction->trackPositionSlider()->setValue(0);
m_sliderAction->trackPositionSlider()->setEnabled(true); m_sliderAction->trackPositionSlider()->setEnabled(true);
// m_playTimer->start(m_pollInterval); // m_playTimer->start(m_pollInterval);
}
else
stop();
} }
void PlayerManager::pause() void PlayerManager::pause()
...@@ -215,6 +222,15 @@ void PlayerManager::setup() ...@@ -215,6 +222,15 @@ void PlayerManager::setup()
m_actionCollection->action("forward")->setEnabled(false); m_actionCollection->action("forward")->setEnabled(false);
m_sliderAction = static_cast<SliderAction *>(m_actionCollection->action("trackPositionAction")); m_sliderAction = static_cast<SliderAction *>(m_actionCollection->action("trackPositionAction"));
KAction *outputAction = m_actionCollection->action("outputSelect");
if(outputAction) {
int mediaSystem = static_cast<KSelectAction *>(outputAction)->currentItem();
m_player = Player::createPlayer(mediaSystem);
}
else
m_player = Player::createPlayer();
} }
#include "playermanager.moc" #include "playermanager.moc"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment