Commit c5ff7f0f authored by Michael Pyne's avatar Michael Pyne

Add ability to disable music crossfading in JuK. Patch is provided by Georg...

Add ability to disable music crossfading in JuK.  Patch is provided by Georg Grabler with a few tweaks
and a change in how the crossfading is actually disabled.

BUG:165786

svn path=/trunk/KDE/kdemultimedia/juk/; revision=1014489
parent 1982074a
...@@ -201,6 +201,10 @@ void JuK::setupActions() ...@@ -201,6 +201,10 @@ void JuK::setupActions()
act->setText(i18n("Remove From Playlist")); act->setText(i18n("Remove From Playlist"));
act->setIcon(KIcon("list-remove")); act->setIcon(KIcon("list-remove"));
act = collection->add<KToggleAction>("crossfadeTracks");
act->setText(i18n("Crossfade Between Tracks"));
connect(act, SIGNAL(triggered(bool)), m_player, SLOT(setCrossfadeEnabled(bool)));
act = collection->addAction("play", m_player, SLOT(play())); act = collection->addAction("play", m_player, SLOT(play()));
act->setText(i18n("&Play")); act->setText(i18n("&Play"));
act->setIcon(KIcon("media-playback-start")); act->setIcon(KIcon("media-playback-start"));
...@@ -371,6 +375,10 @@ void JuK::readConfig() ...@@ -371,6 +375,10 @@ void JuK::readConfig()
const int maxVolume = 100; const int maxVolume = 100;
const int volume = playerConfig.readEntry("Volume", maxVolume); const int volume = playerConfig.readEntry("Volume", maxVolume);
m_player->setVolume(volume * 0.01); m_player->setVolume(volume * 0.01);
bool enableCrossfade = playerConfig.readEntry("CrossfadeTracks", true);
m_player->setCrossfadeEnabled(enableCrossfade);
ActionCollection::action<KAction>("crossfadeTracks")->setChecked(enableCrossfade);
} }
// Default to no random play // Default to no random play
...@@ -418,6 +426,9 @@ void JuK::saveConfig() ...@@ -418,6 +426,9 @@ void JuK::saveConfig()
KAction *a = ActionCollection::action<KAction>("loopPlaylist"); KAction *a = ActionCollection::action<KAction>("loopPlaylist");
playerConfig.writeEntry("LoopPlaylist", a->isChecked()); playerConfig.writeEntry("LoopPlaylist", a->isChecked());
a = ActionCollection::action<KAction>("crossfadeTracks");
playerConfig.writeEntry("CrossfadeTracks", a->isChecked());
a = ActionCollection::action<KAction>("albumRandomPlay"); a = ActionCollection::action<KAction>("albumRandomPlay");
if(a->isChecked()) if(a->isChecked())
playerConfig.writeEntry("RandomPlay", "AlbumRandomPlay"); playerConfig.writeEntry("RandomPlay", "AlbumRandomPlay");
......
<!DOCTYPE kpartgui> <!DOCTYPE kpartgui>
<kpartgui name="juk" version="8"> <kpartgui name="juk" version="9">
<MenuBar> <MenuBar>
<Menu name="file" noMerge="1"><text>&amp;File</text> <Menu name="file" noMerge="1"><text>&amp;File</text>
<Action name="file_new"/> <Action name="file_new"/>
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
<Action name="actionMenu"/> <Action name="actionMenu"/>
<Action name="loopPlaylist"/> <Action name="loopPlaylist"/>
<Action name="crossfadeTracks"/>
<Separator/> <Separator/>
......
<!-- PLEASE UPDATE jukui-rtl.rc WHEN UPDATING THIS FILE --> <!-- PLEASE UPDATE jukui-rtl.rc WHEN UPDATING THIS FILE -->
<!DOCTYPE kpartgui> <!DOCTYPE kpartgui>
<kpartgui name="juk" version="8"> <kpartgui name="juk" version="9">
<MenuBar> <MenuBar>
<Menu name="file" noMerge="1"><text>&amp;File</text> <Menu name="file" noMerge="1"><text>&amp;File</text>
<Action name="file_new"/> <Action name="file_new"/>
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
<Action name="actionMenu"/> <Action name="actionMenu"/>
<Action name="loopPlaylist"/> <Action name="loopPlaylist"/>
<Action name="crossfadeTracks"/>
<Separator/> <Separator/>
......
...@@ -63,6 +63,7 @@ PlayerManager::PlayerManager() : ...@@ -63,6 +63,7 @@ PlayerManager::PlayerManager() :
m_statusLabel(0), m_statusLabel(0),
m_muted(false), m_muted(false),
m_setup(false), m_setup(false),
m_crossfadeTracks(true),
m_curOutputPath(0) m_curOutputPath(0)
{ {
// This class is the first thing constructed during program startup, and // This class is the first thing constructed during program startup, and
...@@ -386,7 +387,7 @@ void PlayerManager::mute() ...@@ -386,7 +387,7 @@ void PlayerManager::mute()
void PlayerManager::slotNeedNextUrl() void PlayerManager::slotNeedNextUrl()
{ {
if(m_file.isNull()) if(m_file.isNull() || !m_crossfadeTracks)
return; return;
m_playlistInterface->playNext(); m_playlistInterface->playNext();
...@@ -627,6 +628,11 @@ QString PlayerManager::randomPlayMode() const ...@@ -627,6 +628,11 @@ QString PlayerManager::randomPlayMode() const
return "NoRandom"; return "NoRandom";
} }
void PlayerManager::setCrossfadeEnabled(bool crossfadeEnabled)
{
m_crossfadeTracks = crossfadeEnabled;
}
void PlayerManager::setRandomPlayMode(const QString &randomMode) void PlayerManager::setRandomPlayMode(const QString &randomMode)
{ {
if(randomMode.toLower() == "random") if(randomMode.toLower() == "random")
......
...@@ -100,6 +100,7 @@ public slots: ...@@ -100,6 +100,7 @@ public slots:
void mute(); void mute();
void setRandomPlayMode(const QString &randomMode); void setRandomPlayMode(const QString &randomMode);
void setCrossfadeEnabled(bool enableCrossfade);
signals: signals:
void signalPlay(); void signalPlay();
...@@ -128,6 +129,7 @@ private: ...@@ -128,6 +129,7 @@ private:
StatusLabel *m_statusLabel; StatusLabel *m_statusLabel;
bool m_muted; bool m_muted;
bool m_setup; bool m_setup;
bool m_crossfadeTracks;
static const int m_pollInterval = 800; static const int m_pollInterval = 800;
......
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