diff options
Diffstat (limited to 'src/plugins/General/mpris/mpris1')
4 files changed, 21 insertions, 15 deletions
diff --git a/src/plugins/General/mpris/mpris1/playerobject.cpp b/src/plugins/General/mpris/mpris1/playerobject.cpp index 8d6d0e165..27c9ca9fa 100644 --- a/src/plugins/General/mpris/mpris1/playerobject.cpp +++ b/src/plugins/General/mpris/mpris1/playerobject.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2008-2009 by Ilya Kotov * + * Copyright (C) 2008-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -25,7 +25,7 @@ #include <qmmp/metadatamanager.h> #include <qmmpui/mediaplayer.h> #include <qmmpui/playlistmanager.h> - +#include <qmmpui/qmmpuisettings.h> #include "playerobject.h" @@ -59,12 +59,13 @@ PlayerObject::PlayerObject(QObject *parent) : QObject(parent) m_core = SoundCore::instance(); m_player = MediaPlayer::instance(); m_pl_manager = m_player->playListManager(); + m_ui_settings = QmmpUiSettings::instance(); connect(m_core, SIGNAL(stateChanged (Qmmp::State)), SLOT(updateCaps())); connect(m_core, SIGNAL(metaDataChanged ()), SLOT(updateTrack())); connect(m_core, SIGNAL(stateChanged (Qmmp::State)), SLOT(updateStatus())); - connect(m_pl_manager, SIGNAL(repeatableListChanged(bool)), SLOT(updateStatus())); - connect(m_pl_manager, SIGNAL(shuffleChanged(bool)), SLOT(updateStatus())); - connect(m_player, SIGNAL(repeatableChanged(bool)), SLOT(updateStatus())); + connect(m_ui_settings, SIGNAL(repeatableListChanged(bool)), SLOT(updateStatus())); + connect(m_ui_settings, SIGNAL(shuffleChanged(bool)), SLOT(updateStatus())); + connect(m_ui_settings, SIGNAL(repeatableTrackChanged(bool)), SLOT(updateStatus())); } PlayerObject::~PlayerObject() @@ -97,7 +98,7 @@ void PlayerObject::Play() void PlayerObject::Repeat(bool in0) { - m_player->setRepeatable(in0); + m_ui_settings->setRepeatableTrack(in0); } PlayerStatus PlayerObject::GetStatus() @@ -117,9 +118,9 @@ PlayerStatus PlayerObject::GetStatus() case Qmmp::Paused: st.state = 1; }; - st.random = int(m_pl_manager->isShuffle()); - st.repeat = int(m_player->isRepeatable()); - st.repeatPlayList = int(m_pl_manager->isRepeatableList()); + st.random = int(m_ui_settings->isShuffle()); + st.repeat = int(m_ui_settings->isRepeatableTrack()); + st.repeatPlayList = int(m_ui_settings->isRepeatableList()); return st; } diff --git a/src/plugins/General/mpris/mpris1/playerobject.h b/src/plugins/General/mpris/mpris1/playerobject.h index 632ca989f..c4f07587e 100644 --- a/src/plugins/General/mpris/mpris1/playerobject.h +++ b/src/plugins/General/mpris/mpris1/playerobject.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2008-2009 by Ilya Kotov * + * Copyright (C) 2008-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -26,6 +26,7 @@ class SoundCore; class MediaPlayer; class PlayListManager; +class QmmpUiSettings; /** @author Ilya Kotov <forkotov02@hotmail.ru> @@ -39,7 +40,7 @@ struct PlayerStatus int repeatPlayList; // 0 = Stop playing once the last element has been played, 1 = Never give up playing }; -Q_DECLARE_METATYPE(PlayerStatus); +Q_DECLARE_METATYPE(PlayerStatus) class PlayerObject : public QObject { @@ -95,6 +96,7 @@ private: SoundCore *m_core; MediaPlayer *m_player; PlayListManager *m_pl_manager; + QmmpUiSettings *m_ui_settings; }; diff --git a/src/plugins/General/mpris/mpris1/tracklistobject.cpp b/src/plugins/General/mpris/mpris1/tracklistobject.cpp index 0fb498788..c7176c371 100644 --- a/src/plugins/General/mpris/mpris1/tracklistobject.cpp +++ b/src/plugins/General/mpris/mpris1/tracklistobject.cpp @@ -24,12 +24,13 @@ #include <qmmpui/playlistmanager.h> #include <qmmpui/mediaplayer.h> #include <qmmpui/playlistitem.h> - +#include <qmmpui/qmmpuisettings.h> #include "tracklistobject.h" TrackListObject::TrackListObject(QObject *parent) : QObject(parent) { m_player = MediaPlayer::instance(); + m_ui_settings = QmmpUiSettings::instance(); m_pl_manager = m_player->playListManager(); m_model = m_pl_manager->currentPlayList(); connect (m_model, SIGNAL(listChanged()), SLOT(updateTrackList())); @@ -104,12 +105,12 @@ QVariantMap TrackListObject::GetMetadata(int in0) void TrackListObject::SetLoop(bool in0) { - m_pl_manager->setRepeatableList(in0); + m_ui_settings->setRepeatableList(in0); } void TrackListObject::SetRandom(bool in0) { - m_pl_manager->setShuffle(in0); + m_ui_settings->setShuffle(in0); } void TrackListObject::disconnectPl() diff --git a/src/plugins/General/mpris/mpris1/tracklistobject.h b/src/plugins/General/mpris/mpris1/tracklistobject.h index c92844d9f..b7532656a 100644 --- a/src/plugins/General/mpris/mpris1/tracklistobject.h +++ b/src/plugins/General/mpris/mpris1/tracklistobject.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2008-2009 by Ilya Kotov * + * Copyright (C) 2008-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -27,6 +27,7 @@ class PlayListModel; class PlayListManager; class MediaPlayer; +class QmmpUiSettings; /** @author Ilya Kotov <forkotov02@hotmail.ru> @@ -63,6 +64,7 @@ private: PlayListModel *m_model; PlayListManager *m_pl_manager; MediaPlayer *m_player; + QmmpUiSettings *m_ui_settings; int m_prev_count; }; |
