diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2009-03-06 10:39:45 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2009-03-06 10:39:45 +0000 |
| commit | cda0f909b32538ec98b891590ae17c4115da0846 (patch) | |
| tree | 30a26589705f3f4c73f5b4bd2a1e529f69a8e5e6 /src/qmmpui/playlistmodel.cpp | |
| parent | 6f2cb48f2aefdea338d59111fd9f80440b6c1dc1 (diff) | |
| download | qmmp-cda0f909b32538ec98b891590ae17c4115da0846.tar.gz qmmp-cda0f909b32538ec98b891590ae17c4115da0846.tar.bz2 qmmp-cda0f909b32538ec98b891590ae17c4115da0846.zip | |
playlist api changes and optimizations
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@822 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/qmmpui/playlistmodel.cpp')
| -rw-r--r-- | src/qmmpui/playlistmodel.cpp | 54 |
1 files changed, 48 insertions, 6 deletions
diff --git a/src/qmmpui/playlistmodel.cpp b/src/qmmpui/playlistmodel.cpp index efcf2cbd7..0b1ed5361 100644 --- a/src/qmmpui/playlistmodel.cpp +++ b/src/qmmpui/playlistmodel.cpp @@ -41,6 +41,7 @@ #include "playlistmodel.h" #include "playlistitem.h" #include "playstate.h" +#include "playlistsettings.h" #include <QMetaType> @@ -96,6 +97,7 @@ PlayListModel::~PlayListModel() l->wait(); } } + delete PlaylistSettings::instance(); } void PlayListModel::load(PlayListItem *item) @@ -424,7 +426,7 @@ void PlayListModel::readSettings() m_current = 0; m_block_update_signals = TRUE; foreach(FileInfo *info, infoList) - load(new PlayListItem(info, &settings)); //using one and the same settings object for all playlist items + load(new PlayListItem(info)); m_block_update_signals = FALSE; doCurrentVisibleRequest(); } @@ -454,11 +456,7 @@ void PlayListModel::addFile(const QString& path) { if (path.isEmpty()) return; - /*if(path.startsWith("http://")) - load(new PlayListItem(path)); - else if(Decoder::supports(path)) - load(new PlayListItem(path));*/ - QList <FileInfo *> playList = Decoder::createPlayList(path); + QList <FileInfo *> playList = Decoder::createPlayList(path, PlaylistSettings::instance()->useMetadata()); foreach(FileInfo *info, playList) emit load(new PlayListItem(info)); @@ -952,3 +950,47 @@ void PlayListModel::preparePlayState() { m_play_state->prepare(); } + +bool PlayListModel::convertUnderscore() +{ + return PlaylistSettings::instance()->convertUnderscore(); +} + +bool PlayListModel::convertTwenty() +{ + return PlaylistSettings::instance()->convertTwenty(); +} + +bool PlayListModel::useMetadata() +{ + return PlaylistSettings::instance()->useMetadata(); +} + +const QString PlayListModel::format() const +{ + return PlaylistSettings::instance()->format(); +} + +void PlayListModel::setConvertUnderscore(bool yes) +{ + PlaylistSettings::instance()->setConvertUnderscore(yes); + emit settingsChanged(); +} + +void PlayListModel::setConvertTwenty(bool yes) +{ + PlaylistSettings::instance()->setConvertTwenty(yes); + emit settingsChanged(); +} + +void PlayListModel::setUseMetadata(bool yes) +{ + PlaylistSettings::instance()->setUseMetadata(yes); + emit settingsChanged(); +} + +void PlayListModel::setFormat(const QString &format) +{ + PlaylistSettings::instance()->setFormat(format); + emit settingsChanged(); +} |
