diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2008-05-26 21:26:46 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2008-05-26 21:26:46 +0000 |
| commit | 0ded49767b9cb8a9b870f10bde72c434453ea43b (patch) | |
| tree | 73c7f4d337acc0d0f8dd10c200b415223ef7db4d /src/ui/mainwindow.cpp | |
| parent | a0bf7877cd6b08b686133861237f5a1e02dad2b3 (diff) | |
| download | qmmp-0ded49767b9cb8a9b870f10bde72c434453ea43b.tar.gz qmmp-0ded49767b9cb8a9b870f10bde72c434453ea43b.tar.bz2 qmmp-0ded49767b9cb8a9b870f10bde72c434453ea43b.zip | |
added PlayListItem class, removed MediaFile
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@388 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/ui/mainwindow.cpp')
| -rw-r--r-- | src/ui/mainwindow.cpp | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/src/ui/mainwindow.cpp b/src/ui/mainwindow.cpp index 4de1dfd4f..ff77f6b38 100644 --- a/src/ui/mainwindow.cpp +++ b/src/ui/mainwindow.cpp @@ -331,24 +331,9 @@ void MainWindow::showOutputState(const OutputState &st) m_generalHandler->setState(General::Playing); if (m_playListModel->currentItem()) { - SongInfo info; - FileTag *tag = m_playListModel->currentItem()->tag(); - if (tag && !tag->isEmpty()) - { - info.setValue(SongInfo::TITLE, tag->title()); - info.setValue(SongInfo::ARTIST, tag->artist()); - info.setValue(SongInfo::ALBUM, tag->album()); - info.setValue(SongInfo::COMMENT, tag->comment()); - info.setValue(SongInfo::GENRE, tag->genre()); - info.setValue(SongInfo::YEAR, tag->year()); - info.setValue(SongInfo::TRACK, tag->track()); - } - else - info.setValue(SongInfo::TITLE, m_playlist->currentItem()->title()); - info.setValue(SongInfo::LENGTH, (uint) m_playlist->currentItem()->length()); - info.setValue(SongInfo::STREAM, - m_playlist->currentItem()->path().startsWith("http://")); - info.setValue(SongInfo::PATH, m_playlist->currentItem()->path()); + SongInfo info = *m_playListModel->currentItem(); + if(info.isEmpty()) + info.setValue(SongInfo::TITLE, m_playlist->currentItem()->text()); m_generalHandler->setSongInfo(info); } break; @@ -429,7 +414,7 @@ void MainWindow::showDecoderState(const DecoderState &st) void MainWindow::changeTitle(const QString &title) { if (m_playlist->currentItem()) - m_playlist->currentItem()->changeTitle(title); + m_playlist->currentItem()->setText(title); m_playlist->listWidget()->updateList(); SongInfo info; info.setValue(SongInfo::TITLE, title); @@ -485,7 +470,7 @@ void MainWindow::addFile() return; // foreach(QString s, files) - // m_playListModel->load(new MediaFile(s)); + // m_playListModel->load(new PlayListItem(s)); m_playListModel->addFiles(files); m_lastDir = files.at(0); @@ -503,7 +488,7 @@ void MainWindow::addFile() return; /* foreach(QString s, files) - m_playListModel->load(new MediaFile(s)); + m_playListModel->load(new PlayListItem(s)); */ m_playListModel->addFiles(files); m_lastDir = files.at(0); |
