diff options
Diffstat (limited to 'src/plugins')
18 files changed, 113 insertions, 98 deletions
diff --git a/src/plugins/General/covermanager/covermanager.cpp b/src/plugins/General/covermanager/covermanager.cpp index 5cb285f25..ab4303c8e 100644 --- a/src/plugins/General/covermanager/covermanager.cpp +++ b/src/plugins/General/covermanager/covermanager.cpp @@ -37,7 +37,7 @@ CoverManager::CoverManager(QObject *parent) : General(parent) void CoverManager::showWindow() { - QList <PlayListItem *> items = MediaPlayer::instance()->playListModel()->getSelectedItems(); + QList <PlayListItem *> items = MediaPlayer::instance()->playListManager()->selectedPlayList()->getSelectedItems(); if (!items.isEmpty()) { if (items.at(0)->url().contains("://")) diff --git a/src/plugins/General/fileops/fileops.cpp b/src/plugins/General/fileops/fileops.cpp index 62e723a89..a2cf0ee5d 100644 --- a/src/plugins/General/fileops/fileops.cpp +++ b/src/plugins/General/fileops/fileops.cpp @@ -30,6 +30,7 @@ #include <qmmp/soundcore.h> #include <qmmpui/generalhandler.h> #include <qmmpui/playlistmodel.h> +#include <qmmpui/playlistmanager.h> #include <qmmpui/playlistitem.h> #include <qmmpui/mediaplayer.h> #include "fileops.h" @@ -84,7 +85,7 @@ void FileOps::execAction(int n) QString pattern = m_patterns.at(n); QString destination = m_destinations.at(n); - PlayListModel *model = MediaPlayer::instance()->playListModel(); + PlayListModel *model = MediaPlayer::instance()->playListManager()->selectedPlayList(); QList<PlayListItem*> items = model->getSelectedItems(); switch (type) diff --git a/src/plugins/General/fileops/translations/fileops_plugin_cs.ts b/src/plugins/General/fileops/translations/fileops_plugin_cs.ts index 80cd25897..6a8220b8e 100644 --- a/src/plugins/General/fileops/translations/fileops_plugin_cs.ts +++ b/src/plugins/General/fileops/translations/fileops_plugin_cs.ts @@ -4,37 +4,37 @@ <context> <name>FileOps</name> <message> - <location filename="../fileops.cpp" line="97"/> + <location filename="../fileops.cpp" line="98"/> <source>Error</source> <translation>Chyba</translation> </message> <message> - <location filename="../fileops.cpp" line="98"/> + <location filename="../fileops.cpp" line="99"/> <source>Destination directory doesn't exist</source> <translation>Cílový adresář neexistuje</translation> </message> <message> - <location filename="../fileops.cpp" line="103"/> + <location filename="../fileops.cpp" line="104"/> <source>Copying</source> <translation>Kopíruje se</translation> </message> <message> - <location filename="../fileops.cpp" line="104"/> + <location filename="../fileops.cpp" line="105"/> <source>Stop</source> <translation>Přerušit</translation> </message> <message> - <location filename="../fileops.cpp" line="134"/> + <location filename="../fileops.cpp" line="135"/> <source>Copying file %1/%2</source> <translation>Kopíruje se soubor %1/%2</translation> </message> <message> - <location filename="../fileops.cpp" line="176"/> + <location filename="../fileops.cpp" line="177"/> <source>Remove files</source> <translation>Odstranit soubory</translation> </message> <message numerus="yes"> - <location filename="../fileops.cpp" line="177"/> + <location filename="../fileops.cpp" line="178"/> <source>Are you sure you want to remove %n file(s) from disk?</source> <translation> <numerusform>Jste si jisti, že chcete z disku odstranit %n soubor?</numerusform> diff --git a/src/plugins/General/fileops/translations/fileops_plugin_de.ts b/src/plugins/General/fileops/translations/fileops_plugin_de.ts index 4cd826e89..341477a22 100644 --- a/src/plugins/General/fileops/translations/fileops_plugin_de.ts +++ b/src/plugins/General/fileops/translations/fileops_plugin_de.ts @@ -4,37 +4,37 @@ <context> <name>FileOps</name> <message> - <location filename="../fileops.cpp" line="97"/> + <location filename="../fileops.cpp" line="98"/> <source>Error</source> <translation>Fehler</translation> </message> <message> - <location filename="../fileops.cpp" line="98"/> + <location filename="../fileops.cpp" line="99"/> <source>Destination directory doesn't exist</source> <translation>Das Zielverzeichnis existiert nicht</translation> </message> <message> - <location filename="../fileops.cpp" line="103"/> + <location filename="../fileops.cpp" line="104"/> <source>Copying</source> <translation>Kopiere</translation> </message> <message> - <location filename="../fileops.cpp" line="104"/> + <location filename="../fileops.cpp" line="105"/> <source>Stop</source> <translation>Stopp</translation> </message> <message> - <location filename="../fileops.cpp" line="134"/> + <location filename="../fileops.cpp" line="135"/> <source>Copying file %1/%2</source> <translation>Kopiere Datei %1/%2</translation> </message> <message> - <location filename="../fileops.cpp" line="176"/> + <location filename="../fileops.cpp" line="177"/> <source>Remove files</source> <translation>Dateien entfernen</translation> </message> <message numerus="yes"> - <location filename="../fileops.cpp" line="177"/> + <location filename="../fileops.cpp" line="178"/> <source>Are you sure you want to remove %n file(s) from disk?</source> <translation type="unfinished"> <numerusform></numerusform> diff --git a/src/plugins/General/fileops/translations/fileops_plugin_it.ts b/src/plugins/General/fileops/translations/fileops_plugin_it.ts index 000c64c7e..96b5634bf 100644 --- a/src/plugins/General/fileops/translations/fileops_plugin_it.ts +++ b/src/plugins/General/fileops/translations/fileops_plugin_it.ts @@ -4,37 +4,37 @@ <context> <name>FileOps</name> <message> - <location filename="../fileops.cpp" line="97"/> + <location filename="../fileops.cpp" line="98"/> <source>Error</source> <translation>Errore</translation> </message> <message> - <location filename="../fileops.cpp" line="98"/> + <location filename="../fileops.cpp" line="99"/> <source>Destination directory doesn't exist</source> <translation>Cartella di destinazione</translation> </message> <message> - <location filename="../fileops.cpp" line="103"/> + <location filename="../fileops.cpp" line="104"/> <source>Copying</source> <translation>Copia</translation> </message> <message> - <location filename="../fileops.cpp" line="104"/> + <location filename="../fileops.cpp" line="105"/> <source>Stop</source> <translation>Ferma</translation> </message> <message> - <location filename="../fileops.cpp" line="134"/> + <location filename="../fileops.cpp" line="135"/> <source>Copying file %1/%2</source> <translation>Copia del file</translation> </message> <message> - <location filename="../fileops.cpp" line="176"/> + <location filename="../fileops.cpp" line="177"/> <source>Remove files</source> <translation>Rimuovi file</translation> </message> <message numerus="yes"> - <location filename="../fileops.cpp" line="177"/> + <location filename="../fileops.cpp" line="178"/> <source>Are you sure you want to remove %n file(s) from disk?</source> <translation> <numerusform>Vuoi davvero rimuovere %n file(s) dal disco?</numerusform> diff --git a/src/plugins/General/fileops/translations/fileops_plugin_lt.ts b/src/plugins/General/fileops/translations/fileops_plugin_lt.ts index 69ac4bc3d..fb6e6bf79 100644 --- a/src/plugins/General/fileops/translations/fileops_plugin_lt.ts +++ b/src/plugins/General/fileops/translations/fileops_plugin_lt.ts @@ -4,37 +4,37 @@ <context> <name>FileOps</name> <message> - <location filename="../fileops.cpp" line="97"/> + <location filename="../fileops.cpp" line="98"/> <source>Error</source> <translation>Klaida</translation> </message> <message> - <location filename="../fileops.cpp" line="98"/> + <location filename="../fileops.cpp" line="99"/> <source>Destination directory doesn't exist</source> <translation>Aplankas neegzistuoja</translation> </message> <message> - <location filename="../fileops.cpp" line="103"/> + <location filename="../fileops.cpp" line="104"/> <source>Copying</source> <translation>Kopijuoju</translation> </message> <message> - <location filename="../fileops.cpp" line="104"/> + <location filename="../fileops.cpp" line="105"/> <source>Stop</source> <translation>Stop</translation> </message> <message> - <location filename="../fileops.cpp" line="134"/> + <location filename="../fileops.cpp" line="135"/> <source>Copying file %1/%2</source> <translation>Kopijuoju bylą %1/%2</translation> </message> <message> - <location filename="../fileops.cpp" line="176"/> + <location filename="../fileops.cpp" line="177"/> <source>Remove files</source> <translation>Ištrinti bylas</translation> </message> <message numerus="yes"> - <location filename="../fileops.cpp" line="177"/> + <location filename="../fileops.cpp" line="178"/> <source>Are you sure you want to remove %n file(s) from disk?</source> <translation type="unfinished"> <numerusform></numerusform> diff --git a/src/plugins/General/fileops/translations/fileops_plugin_pl.ts b/src/plugins/General/fileops/translations/fileops_plugin_pl.ts index 2d67a70ec..db73e9c36 100644 --- a/src/plugins/General/fileops/translations/fileops_plugin_pl.ts +++ b/src/plugins/General/fileops/translations/fileops_plugin_pl.ts @@ -4,37 +4,37 @@ <context> <name>FileOps</name> <message> - <location filename="../fileops.cpp" line="97"/> + <location filename="../fileops.cpp" line="98"/> <source>Error</source> <translation>Błąd</translation> </message> <message> - <location filename="../fileops.cpp" line="98"/> + <location filename="../fileops.cpp" line="99"/> <source>Destination directory doesn't exist</source> <translation>Katalog docelowy nie istnieje</translation> </message> <message> - <location filename="../fileops.cpp" line="103"/> + <location filename="../fileops.cpp" line="104"/> <source>Copying</source> <translation>Kopiowanie</translation> </message> <message> - <location filename="../fileops.cpp" line="104"/> + <location filename="../fileops.cpp" line="105"/> <source>Stop</source> <translation></translation> </message> <message> - <location filename="../fileops.cpp" line="134"/> + <location filename="../fileops.cpp" line="135"/> <source>Copying file %1/%2</source> <translation>Kopiowanie pliku %1/%2</translation> </message> <message> - <location filename="../fileops.cpp" line="176"/> + <location filename="../fileops.cpp" line="177"/> <source>Remove files</source> <translation>Usuń pliki</translation> </message> <message numerus="yes"> - <location filename="../fileops.cpp" line="177"/> + <location filename="../fileops.cpp" line="178"/> <source>Are you sure you want to remove %n file(s) from disk?</source> <translation> <numerusform>Czy napewno chcesz usunąć %n plik(ów) z dysku?</numerusform> diff --git a/src/plugins/General/fileops/translations/fileops_plugin_ru.ts b/src/plugins/General/fileops/translations/fileops_plugin_ru.ts index 8da9527f4..54353ecc7 100644 --- a/src/plugins/General/fileops/translations/fileops_plugin_ru.ts +++ b/src/plugins/General/fileops/translations/fileops_plugin_ru.ts @@ -4,37 +4,37 @@ <context> <name>FileOps</name> <message> - <location filename="../fileops.cpp" line="97"/> + <location filename="../fileops.cpp" line="98"/> <source>Error</source> <translation>Ошибка</translation> </message> <message> - <location filename="../fileops.cpp" line="98"/> + <location filename="../fileops.cpp" line="99"/> <source>Destination directory doesn't exist</source> <translation>Директория назначения не существует</translation> </message> <message> - <location filename="../fileops.cpp" line="103"/> + <location filename="../fileops.cpp" line="104"/> <source>Copying</source> <translation>Копирование</translation> </message> <message> - <location filename="../fileops.cpp" line="104"/> + <location filename="../fileops.cpp" line="105"/> <source>Stop</source> <translation>Остановить</translation> </message> <message> - <location filename="../fileops.cpp" line="134"/> + <location filename="../fileops.cpp" line="135"/> <source>Copying file %1/%2</source> <translation>Копирование файла %1/%2</translation> </message> <message> - <location filename="../fileops.cpp" line="176"/> + <location filename="../fileops.cpp" line="177"/> <source>Remove files</source> <translation>Удалить файлы</translation> </message> <message numerus="yes"> - <location filename="../fileops.cpp" line="177"/> + <location filename="../fileops.cpp" line="178"/> <source>Are you sure you want to remove %n file(s) from disk?</source> <translation> <numerusform>Вы уверены, что хотите удалить %n файл с диска?</numerusform> diff --git a/src/plugins/General/fileops/translations/fileops_plugin_tr.ts b/src/plugins/General/fileops/translations/fileops_plugin_tr.ts index 96df85603..88ef5d138 100644 --- a/src/plugins/General/fileops/translations/fileops_plugin_tr.ts +++ b/src/plugins/General/fileops/translations/fileops_plugin_tr.ts @@ -4,37 +4,37 @@ <context> <name>FileOps</name> <message> - <location filename="../fileops.cpp" line="97"/> + <location filename="../fileops.cpp" line="98"/> <source>Error</source> <translation>Hata</translation> </message> <message> - <location filename="../fileops.cpp" line="98"/> + <location filename="../fileops.cpp" line="99"/> <source>Destination directory doesn't exist</source> <translation>Hedef dizin mevcut değil</translation> </message> <message> - <location filename="../fileops.cpp" line="103"/> + <location filename="../fileops.cpp" line="104"/> <source>Copying</source> <translation>Kopyalıyor</translation> </message> <message> - <location filename="../fileops.cpp" line="104"/> + <location filename="../fileops.cpp" line="105"/> <source>Stop</source> <translation>Dur</translation> </message> <message> - <location filename="../fileops.cpp" line="134"/> + <location filename="../fileops.cpp" line="135"/> <source>Copying file %1/%2</source> <translation>%1/%2 dosyası kopyalanıyor</translation> </message> <message> - <location filename="../fileops.cpp" line="176"/> + <location filename="../fileops.cpp" line="177"/> <source>Remove files</source> <translation>Dosyaları kaldır</translation> </message> <message numerus="yes"> - <location filename="../fileops.cpp" line="177"/> + <location filename="../fileops.cpp" line="178"/> <source>Are you sure you want to remove %n file(s) from disk?</source> <translation type="unfinished"> <numerusform></numerusform> diff --git a/src/plugins/General/fileops/translations/fileops_plugin_uk_UA.ts b/src/plugins/General/fileops/translations/fileops_plugin_uk_UA.ts index 330683148..6f846f613 100644 --- a/src/plugins/General/fileops/translations/fileops_plugin_uk_UA.ts +++ b/src/plugins/General/fileops/translations/fileops_plugin_uk_UA.ts @@ -4,37 +4,37 @@ <context> <name>FileOps</name> <message> - <location filename="../fileops.cpp" line="97"/> + <location filename="../fileops.cpp" line="98"/> <source>Error</source> <translation>Помилка</translation> </message> <message> - <location filename="../fileops.cpp" line="98"/> + <location filename="../fileops.cpp" line="99"/> <source>Destination directory doesn't exist</source> <translation>Тека призначення не існує</translation> </message> <message> - <location filename="../fileops.cpp" line="103"/> + <location filename="../fileops.cpp" line="104"/> <source>Copying</source> <translation>Копіювання</translation> </message> <message> - <location filename="../fileops.cpp" line="104"/> + <location filename="../fileops.cpp" line="105"/> <source>Stop</source> <translation>Зупинити</translation> </message> <message> - <location filename="../fileops.cpp" line="134"/> + <location filename="../fileops.cpp" line="135"/> <source>Copying file %1/%2</source> <translation>Копіювання файла %1/%2</translation> </message> <message> - <location filename="../fileops.cpp" line="176"/> + <location filename="../fileops.cpp" line="177"/> <source>Remove files</source> <translation>Видалити файли</translation> </message> <message numerus="yes"> - <location filename="../fileops.cpp" line="177"/> + <location filename="../fileops.cpp" line="178"/> <source>Are you sure you want to remove %n file(s) from disk?</source> <translation> <numerusform>Ви дійсно бажаєте видалити %n файл(ів) з диску?</numerusform> diff --git a/src/plugins/General/fileops/translations/fileops_plugin_zh_CN.ts b/src/plugins/General/fileops/translations/fileops_plugin_zh_CN.ts index 6bbd98d7d..5223deb6d 100644 --- a/src/plugins/General/fileops/translations/fileops_plugin_zh_CN.ts +++ b/src/plugins/General/fileops/translations/fileops_plugin_zh_CN.ts @@ -4,37 +4,37 @@ <context> <name>FileOps</name> <message> - <location filename="../fileops.cpp" line="97"/> + <location filename="../fileops.cpp" line="98"/> <source>Error</source> <translation>错误</translation> </message> <message> - <location filename="../fileops.cpp" line="98"/> + <location filename="../fileops.cpp" line="99"/> <source>Destination directory doesn't exist</source> <translation>目标目录不存在</translation> </message> <message> - <location filename="../fileops.cpp" line="103"/> + <location filename="../fileops.cpp" line="104"/> <source>Copying</source> <translation>正在复制</translation> </message> <message> - <location filename="../fileops.cpp" line="104"/> + <location filename="../fileops.cpp" line="105"/> <source>Stop</source> <translation>停止</translation> </message> <message> - <location filename="../fileops.cpp" line="134"/> + <location filename="../fileops.cpp" line="135"/> <source>Copying file %1/%2</source> <translation>正在复制文件 %1/%2</translation> </message> <message> - <location filename="../fileops.cpp" line="176"/> + <location filename="../fileops.cpp" line="177"/> <source>Remove files</source> <translation>删除文件</translation> </message> <message numerus="yes"> - <location filename="../fileops.cpp" line="177"/> + <location filename="../fileops.cpp" line="178"/> <source>Are you sure you want to remove %n file(s) from disk?</source> <translation type="unfinished"> <numerusform></numerusform> diff --git a/src/plugins/General/fileops/translations/fileops_plugin_zh_TW.ts b/src/plugins/General/fileops/translations/fileops_plugin_zh_TW.ts index 013bf5e7a..2238a5356 100644 --- a/src/plugins/General/fileops/translations/fileops_plugin_zh_TW.ts +++ b/src/plugins/General/fileops/translations/fileops_plugin_zh_TW.ts @@ -4,37 +4,37 @@ <context> <name>FileOps</name> <message> - <location filename="../fileops.cpp" line="97"/> + <location filename="../fileops.cpp" line="98"/> <source>Error</source> <translation>錯誤</translation> </message> <message> - <location filename="../fileops.cpp" line="98"/> + <location filename="../fileops.cpp" line="99"/> <source>Destination directory doesn't exist</source> <translation>目標目錄早已存在</translation> </message> <message> - <location filename="../fileops.cpp" line="103"/> + <location filename="../fileops.cpp" line="104"/> <source>Copying</source> <translation>正在復制</translation> </message> <message> - <location filename="../fileops.cpp" line="104"/> + <location filename="../fileops.cpp" line="105"/> <source>Stop</source> <translation>停止</translation> </message> <message> - <location filename="../fileops.cpp" line="134"/> + <location filename="../fileops.cpp" line="135"/> <source>Copying file %1/%2</source> <translation>復制檔案 %1/%2</translation> </message> <message> - <location filename="../fileops.cpp" line="176"/> + <location filename="../fileops.cpp" line="177"/> <source>Remove files</source> <translation>刪除檔案</translation> </message> <message numerus="yes"> - <location filename="../fileops.cpp" line="177"/> + <location filename="../fileops.cpp" line="178"/> <source>Are you sure you want to remove %n file(s) from disk?</source> <translation type="unfinished"> <numerusform></numerusform> diff --git a/src/plugins/General/hal/halplugin.cpp b/src/plugins/General/hal/halplugin.cpp index 002ebc0e3..1d40e0c8b 100644 --- a/src/plugins/General/hal/halplugin.cpp +++ b/src/plugins/General/hal/halplugin.cpp @@ -23,7 +23,7 @@ #include <qmmpui/generalhandler.h> #include <qmmpui/mediaplayer.h> -#include <qmmpui/playlistmodel.h> +#include <qmmpui/playlistmanager.h> #include <qmmpui/playlistitem.h> #include <qmmp/qmmp.h> #include "haldevice.h" @@ -190,9 +190,9 @@ void HalPlugin::processAction(QAction *action) qDebug("HalPlugin: action triggered: %s", qPrintable(action->data().toString())); QString path = action->data().toString(); if (path.startsWith("cdda://")) - MediaPlayer::instance()->playListModel()->addFile(path); + MediaPlayer::instance()->playListManager()->selectedPlayList()->addFile(path); else - MediaPlayer::instance()->playListModel()->addDirectory(path); + MediaPlayer::instance()->playListManager()->selectedPlayList()->addDirectory(path); } QAction *HalPlugin::findAction(const QString &dev_path) @@ -229,7 +229,7 @@ HalDevice *HalPlugin::findDevice(QAction *action) void HalPlugin::addPath(const QString &path) { - foreach(PlayListItem *item, MediaPlayer::instance()->playListModel()->items()) // Is it already exist? + foreach(PlayListItem *item, MediaPlayer::instance()->playListManager()->selectedPlayList()->items()) // Is it already exist? { if (item->url().startsWith(path)) return; @@ -237,11 +237,11 @@ void HalPlugin::addPath(const QString &path) if (path.startsWith("cdda://") && m_addTracks) { - MediaPlayer::instance()->playListModel()->addFile(path); + MediaPlayer::instance()->playListManager()->selectedPlayList()->addFile(path); return; } else if (!path.startsWith("cdda://") && m_addFiles) - MediaPlayer::instance()->playListModel()->addDirectory(path); + MediaPlayer::instance()->playListManager()->selectedPlayList()->addDirectory(path); } void HalPlugin::removePath(const QString &path) @@ -250,7 +250,7 @@ void HalPlugin::removePath(const QString &path) (!path.startsWith("cdda://") && !m_removeFiles)) //process settings return; - PlayListModel *model = MediaPlayer::instance()->playListModel(); + PlayListModel *model = MediaPlayer::instance()->playListManager()->selectedPlayList(); int i = 0; while (model->count() > 0 && i < model->count()) diff --git a/src/plugins/General/lyrics/lyrics.cpp b/src/plugins/General/lyrics/lyrics.cpp index e0492cbf5..65ab6182a 100644 --- a/src/plugins/General/lyrics/lyrics.cpp +++ b/src/plugins/General/lyrics/lyrics.cpp @@ -23,7 +23,7 @@ #include <qmmp/soundcore.h> #include <qmmpui/generalhandler.h> -#include <qmmpui/playlistmodel.h> +#include <qmmpui/playlistmanager.h> #include <qmmpui/playlistitem.h> #include <qmmpui/mediaplayer.h> #include "lyricswindow.h" @@ -43,7 +43,8 @@ Lyrics::~Lyrics() void Lyrics::showLyrics() { - QList <PlayListItem *> items = MediaPlayer::instance()->playListModel()->getSelectedItems(); + PlayListManager *pl_manager = MediaPlayer::instance()->playListManager(); + QList <PlayListItem *> items = pl_manager->selectedPlayList()->getSelectedItems(); if (!items.isEmpty()) { if (items.at(0)->artist().isEmpty() || items.at(0)->title().isEmpty()) diff --git a/src/plugins/General/mpris/playerobject.cpp b/src/plugins/General/mpris/playerobject.cpp index 894b68617..d7166e964 100644 --- a/src/plugins/General/mpris/playerobject.cpp +++ b/src/plugins/General/mpris/playerobject.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2008 by Ilya Kotov * + * Copyright (C) 2008-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -24,7 +24,7 @@ #include <qmmp/soundcore.h> #include <qmmp/metadatamanager.h> #include <qmmpui/mediaplayer.h> -#include <qmmpui/playlistmodel.h> +#include <qmmpui/playlistmanager.h> #include "playerobject.h" @@ -53,18 +53,17 @@ const QDBusArgument &operator >> (const QDBusArgument &arg, PlayerStatus &status return arg; } -PlayerObject::PlayerObject(QObject *parent) - : QObject(parent) +PlayerObject::PlayerObject(QObject *parent) : QObject(parent) { qDBusRegisterMetaType<PlayerStatus>(); m_core = SoundCore::instance(); m_player = MediaPlayer::instance(); - m_model = m_player->playListModel(); + m_pl_manager = m_player->playListManager(); 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_model, SIGNAL(repeatableListChanged(bool)), SLOT(updateStatus())); - connect(m_model, SIGNAL(shuffleChanged(bool)), 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())); } @@ -118,9 +117,9 @@ PlayerStatus PlayerObject::GetStatus() case Qmmp::Paused: st.state = 1; }; - st.random = int(m_model->isShuffle()); + st.random = int(m_pl_manager->isShuffle()); st.repeat = int(m_player->isRepeatable()); - st.repeatPlayList = int(m_model->isRepeatableList()); + st.repeatPlayList = int(m_pl_manager->isRepeatableList()); return st; } diff --git a/src/plugins/General/mpris/playerobject.h b/src/plugins/General/mpris/playerobject.h index dbd7e771c..709357387 100644 --- a/src/plugins/General/mpris/playerobject.h +++ b/src/plugins/General/mpris/playerobject.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2008 by Ilya Kotov * + * Copyright (C) 2008-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -25,7 +25,7 @@ class SoundCore; class MediaPlayer; -class PlayListModel; +class PlayListManager; /** @author Ilya Kotov <forkotov02@hotmail.ru> @@ -94,7 +94,7 @@ private slots: private: SoundCore *m_core; MediaPlayer *m_player; - PlayListModel *m_model; + PlayListManager *m_pl_manager; }; diff --git a/src/plugins/General/mpris/tracklistobject.cpp b/src/plugins/General/mpris/tracklistobject.cpp index 6b3699a0c..3ca1830ba 100644 --- a/src/plugins/General/mpris/tracklistobject.cpp +++ b/src/plugins/General/mpris/tracklistobject.cpp @@ -21,18 +21,20 @@ #include <QFile> #include <QUrl> -#include <qmmpui/playlistmodel.h> +#include <qmmpui/playlistmanager.h> #include <qmmpui/mediaplayer.h> #include <qmmpui/playlistitem.h> #include "tracklistobject.h" -TrackListObject::TrackListObject(QObject *parent) - : QObject(parent) +TrackListObject::TrackListObject(QObject *parent) : QObject(parent) { m_player = MediaPlayer::instance(); - m_model = m_player->playListModel(); + m_pl_manager = m_player->playListManager(); + m_model = m_pl_manager->currentPlayList(); connect (m_model, SIGNAL(listChanged()), SLOT(updateTrackList())); + connect (m_pl_manager, SIGNAL(currentPlayListChanged(PlayListModel*,PlayListModel*)), + SLOT(switchPlayList(PlayListModel*,PlayListModel*))); } @@ -111,3 +113,12 @@ void TrackListObject::updateTrackList() { emit TrackListChange(m_model->count()); } + +void TrackListObject::switchPlayList(PlayListModel *cur, PlayListModel *prev) +{ + m_model = cur; + connect (m_model, SIGNAL(listChanged()), SLOT(updateTrackList())); + if(prev) + disconnect(prev,0,this,0); + updateTrackList(); +} diff --git a/src/plugins/General/mpris/tracklistobject.h b/src/plugins/General/mpris/tracklistobject.h index 856ebd5df..0004f25b9 100644 --- a/src/plugins/General/mpris/tracklistobject.h +++ b/src/plugins/General/mpris/tracklistobject.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2008 by Ilya Kotov * + * Copyright (C) 2008-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -25,6 +25,7 @@ #include <QVariantMap> class PlayListModel; +class PlayListManager; class MediaPlayer; /** @@ -54,9 +55,11 @@ signals: private slots: void updateTrackList(); + void switchPlayList(PlayListModel *cur, PlayListModel *prev); private: PlayListModel *m_model; + PlayListManager *m_pl_manager; MediaPlayer *m_player; }; |
