Commit b931274a authored by Scott Wheeler's avatar Scott Wheeler

API cleanups

svn path=/trunk/kdemultimedia/juk/; revision=206623
parent 5d9e5ff1
......@@ -119,11 +119,11 @@ void JuK::setupActions()
// play menu
randomPlayAction = new KToggleAction(i18n("Random Play"), 0, actionCollection(), "randomPlay");
playAction = new KAction(i18n("&Play"), "player_play", 0, this, SLOT(playFile()), actionCollection(), "playFile");
pauseAction = new KAction(i18n("P&ause"), "player_pause", 0, this, SLOT(pauseFile()), actionCollection(), "pauseFile");
stopAction = new KAction(i18n("&Stop"), "player_stop", 0, this, SLOT(stopFile()), actionCollection(), "stopFile");
backAction = new KAction(i18n("Skip &Back"), "player_start", 0, this, SLOT(backFile()), actionCollection(), "backFile");
forwardAction = new KAction(i18n("Skip &Forward"), "player_end", 0, this, SLOT(forwardFile()), actionCollection(), "forwardFile");
playAction = new KAction(i18n("&Play"), "player_play", 0, this, SLOT(play()), actionCollection(), "play");
pauseAction = new KAction(i18n("P&ause"), "player_pause", 0, this, SLOT(pause()), actionCollection(), "pause");
stopAction = new KAction(i18n("&Stop"), "player_stop", 0, this, SLOT(stop()), actionCollection(), "stop");
backAction = new KAction(i18n("Skip &Back"), "player_start", 0, this, SLOT(back()), actionCollection(), "back");
forwardAction = new KAction(i18n("Skip &Forward"), "player_end", 0, this, SLOT(forward()), actionCollection(), "forward");
// tagger menu
new KAction(i18n("Save"), "filesave", "CTRL+t", splitter, SLOT(saveItem()), actionCollection(), "saveItem");
......@@ -162,11 +162,11 @@ void JuK::setupSystemTray()
systemTray = new SystemTray(this, "systemTray");
systemTray->show();
connect(systemTray, SIGNAL(play()), this, SLOT(playFile()));
connect(systemTray, SIGNAL(stop()), this, SLOT(stopFile()));
connect(systemTray, SIGNAL(pause()), this, SLOT(pauseFile()));
connect(systemTray, SIGNAL(back()), this, SLOT(backFile()));
connect(systemTray, SIGNAL(forward()), this, SLOT(forwardFile()));
connect(systemTray, SIGNAL(play()), this, SLOT(play()));
connect(systemTray, SIGNAL(stop()), this, SLOT(stop()));
connect(systemTray, SIGNAL(pause()), this, SLOT(pause()));
connect(systemTray, SIGNAL(back()), this, SLOT(back()));
connect(systemTray, SIGNAL(forward()), this, SLOT(forward()));
if(player && player->paused())
systemTray->slotPause();
......@@ -297,7 +297,7 @@ void JuK::saveConfig()
bool JuK::queryClose()
{
stopFile();
stop();
delete(player);
Cache::instance()->save();
saveConfig();
......@@ -336,7 +336,7 @@ void JuK::updatePlaylistInfo()
// player menu
////////////////////////////////////////////////////////////////////////////////
void JuK::playFile()
void JuK::play()
{
if(!player)
return;
......@@ -358,10 +358,10 @@ void JuK::playFile()
else if(player->playing())
player->seekPosition(0);
else
playFile(splitter->playNextFile(randomPlayAction->isChecked()));
play(splitter->playNextFile(randomPlayAction->isChecked()));
}
void JuK::pauseFile()
void JuK::pause()
{
if(!player)
return;
......@@ -373,7 +373,7 @@ void JuK::pauseFile()
systemTray->slotPause();
}
void JuK::stopFile()
void JuK::stop()
{
if(!player)
return;
......@@ -397,14 +397,14 @@ void JuK::stopFile()
systemTray->slotStop();
}
void JuK::backFile()
void JuK::back()
{
playFile(splitter->playPreviousFile(randomPlayAction->isChecked()));
play(splitter->playPreviousFile(randomPlayAction->isChecked()));
}
void JuK::forwardFile()
void JuK::forward()
{
playFile(splitter->playNextFile(randomPlayAction->isChecked()));
play(splitter->playNextFile(randomPlayAction->isChecked()));
}
////////////////////////////////////////////////////////////////////////////////
......@@ -429,7 +429,7 @@ void JuK::toggleSystemTray(bool enabled)
void JuK::setOutput(int output)
{
stopFile();
stop();
delete(player);
player = Player::createPlayer(output);
}
......@@ -477,7 +477,7 @@ void JuK::pollPlay()
playTimer->stop();
if(!player->paused())
playFile(splitter->playNextFile(randomPlayAction->isChecked()));
play(splitter->playNextFile(randomPlayAction->isChecked()));
}
else if(!trackPositionDragging) {
......@@ -507,7 +507,7 @@ void JuK::setVolume(int volume)
}
}
void JuK::playFile(const QString &file)
void JuK::play(const QString &file)
{
if(!player)
return;
......@@ -538,7 +538,7 @@ void JuK::playFile(const QString &file)
systemTray->slotPlay();
}
else
stopFile();
stop();
}
#include "juk.moc"
......@@ -73,11 +73,11 @@ private slots:
void cut() { splitter->copy(); splitter->clear(); }
// player menu
void playFile();
void pauseFile();
void stopFile();
void backFile();
void forwardFile();
void play();
void pause();
void stop();
void back();
void forward();
// settings menu
void showGenreListEditor();
......@@ -105,10 +105,10 @@ private slots:
* This is the main method to play stuff. Everything else is just a wrapper
* around this.
*/
void playFile(const QString &file);
void play(const QString &file);
void playSelectedFile() { playFile(splitter->playSelectedFile()); }
void playFirstFile() { playFile(splitter->playFirstFile()); }
void playSelectedFile() { play(splitter->playSelectedFile()); }
void playFirstFile() { play(splitter->playFirstFile()); }
private:
// layout objects
......
......@@ -33,11 +33,11 @@
<Separator/>
<Action name="playFile"/>
<Action name="pauseFile"/>
<Action name="stopFile"/>
<Action name="backFile"/>
<Action name="forwardFile"/>
<Action name="play"/>
<Action name="pause"/>
<Action name="stop"/>
<Action name="back"/>
<Action name="forward"/>
</Menu>
<Menu name="playlist"><text>Tagger</text>
<Action name="saveItem"/>
......@@ -68,13 +68,13 @@
</ToolBar>
<ToolBar name="playToolBar" noMerge="1"><text>Play Toolbar</text>
<Action name="playFile"/>
<Action name="pauseFile"/>
<Action name="stopFile"/>
<Action name="play"/>
<Action name="pause"/>
<Action name="stop"/>
<Separator lineSeparator="false"/>
<Action name="backFile"/>
<Action name="forwardFile"/>
<Action name="back"/>
<Action name="forward"/>
<Action name="trackPositionAction"/>
</kpartgui>
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