aboutsummaryrefslogtreecommitdiff
path: root/src/ui/mainwindow.cpp
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2008-09-26 17:10:51 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2008-09-26 17:10:51 +0000
commit76095a46370939213ceffca85129baa3d9bac0d4 (patch)
treef71b49e6f0c1cdcc2cf378610f90b439943a95ec /src/ui/mainwindow.cpp
parent525d822bec49c9952388b71ffd7c293528b31c24 (diff)
downloadqmmp-76095a46370939213ceffca85129baa3d9bac0d4.tar.gz
qmmp-76095a46370939213ceffca85129baa3d9bac0d4.tar.bz2
qmmp-76095a46370939213ceffca85129baa3d9bac0d4.zip
enabled in-stream metadata support
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@562 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/ui/mainwindow.cpp')
-rw-r--r--src/ui/mainwindow.cpp40
1 files changed, 35 insertions, 5 deletions
diff --git a/src/ui/mainwindow.cpp b/src/ui/mainwindow.cpp
index e456183ed..e2e3709ce 100644
--- a/src/ui/mainwindow.cpp
+++ b/src/ui/mainwindow.cpp
@@ -148,8 +148,7 @@ MainWindow::MainWindow(const QStringList& args, BuiltinCommandLineOption* option
connect(m_core, SIGNAL(stateChanged(Qmmp::State)), SLOT(showState(Qmmp::State)));
connect(m_core, SIGNAL(elapsedChanged(qint64)),m_playlist, SLOT(setTime(qint64)));
connect(m_core, SIGNAL(elapsedChanged(qint64)),m_titlebar, SLOT(setTime(qint64)));
-
-
+ connect(m_core, SIGNAL(metaDataChanged()),SLOT(showMetaData()));
updateEQ();
@@ -208,7 +207,7 @@ void MainWindow::play()
}
else
{
- //find out the reason why the playback failed
+ //find out the reason why playback failed
switch ((int) m_core->state())
{
case Qmmp::FatalError:
@@ -333,13 +332,13 @@ void MainWindow::showState(Qmmp::State state)
case Qmmp::Playing:
{
m_generalHandler->setState(General::Playing);
- if (m_playListModel->currentItem())
+ /*if (m_playListModel->currentItem())
{
SongInfo info = *m_playListModel->currentItem();
if (info.isEmpty())
info.setValue(SongInfo::TITLE, m_playlist->currentItem()->text());
m_generalHandler->setSongInfo(info);
- }
+ }*/
if (m_playlist->listWidget())
m_playlist->listWidget()->updateList(); //removes progress message from TextScroller
break;
@@ -456,6 +455,37 @@ void MainWindow::showState(Qmmp::State state)
}
}*/
+void MainWindow::showMetaData()
+{
+ qDebug("===== metadata ======");
+ qDebug("ARTIST = %s", qPrintable(m_core->metaData(Qmmp::TITLE)));
+ qDebug("TITLE = %s", qPrintable(m_core->metaData(Qmmp::ARTIST)));
+ qDebug("ALBUM = %s", qPrintable(m_core->metaData(Qmmp::ALBUM)));
+ qDebug("COMMENT = %s", qPrintable(m_core->metaData(Qmmp::COMMENT)));
+ qDebug("GENRE = %s", qPrintable(m_core->metaData(Qmmp::GENRE)));
+ qDebug("YEAR = %s", qPrintable(m_core->metaData(Qmmp::YEAR)));
+ qDebug("TRACK = %s", qPrintable(m_core->metaData(Qmmp::TRACK)));
+ qDebug("== end of metadata ==");
+
+ if (m_playlist->currentItem())
+ {
+ SongInfo info;
+ info.setValue(SongInfo::TITLE, m_core->metaData(Qmmp::TITLE));
+ info.setValue(SongInfo::ARTIST, m_core->metaData(Qmmp::ARTIST));
+ info.setValue(SongInfo::ALBUM, m_core->metaData(Qmmp::ALBUM));
+ info.setValue(SongInfo::COMMENT, m_core->metaData(Qmmp::COMMENT));
+ info.setValue(SongInfo::GENRE, m_core->metaData(Qmmp::GENRE));
+ info.setValue(SongInfo::YEAR, m_core->metaData(Qmmp::YEAR).toUInt());
+ info.setValue(SongInfo::TRACK, m_core->metaData(Qmmp::TRACK).toUInt());
+ //info.setValue(SongInfo::LENGTH, st.tag()->length());
+ info.setValue(SongInfo::STREAM, !QFile::exists(m_playlist->currentItem()->path()));
+ info.setValue(SongInfo::PATH, m_playlist->currentItem()->path());
+ m_generalHandler->setSongInfo(info);
+ m_playlist->currentItem()->updateMetaData(m_core->metaData());
+ m_playlist->listWidget()->updateList();
+ }
+}
+
void MainWindow::changeTitle(const QString &title)
{
if (m_playlist->currentItem())