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