aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2007-10-10 07:11:56 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2007-10-10 07:11:56 +0000
commit169ba7b277ece4284e2f46677d3646838cc42e68 (patch)
tree927ed91b1554d5a92118bb2883c38ed1379b5825
parent55a62d4a794283f05ec2c8858c059fc25f319fe6 (diff)
downloadqmmp-169ba7b277ece4284e2f46677d3646838cc42e68.tar.gz
qmmp-169ba7b277ece4284e2f46677d3646838cc42e68.tar.bz2
qmmp-169ba7b277ece4284e2f46677d3646838cc42e68.zip
read tags before plaing
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@166 90c681e8-e032-0410-971d-27865f9a5e38
-rw-r--r--src/mainwindow.cpp10
-rw-r--r--src/mainwindow.h1
-rw-r--r--src/mediafile.cpp14
-rw-r--r--src/mediafile.h1
4 files changed, 17 insertions, 9 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 1e8280875..2a6902e2c 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -166,6 +166,8 @@ void MainWindow::play()
return;
m_equalizer->loadPreset(m_playListModel->currentItem()->fileName());
+ m_playListModel->currentItem()->updateTags();
+ m_playlist->listWidget()->updateList();
QString s = m_playListModel->currentItem()->path();
if (s.isEmpty())
return;
@@ -294,12 +296,6 @@ void MainWindow::updateEQ()
m_core->setEQEnabled(m_equalizer->isEQEnabled());
}
-void MainWindow::updatePreset()
-{
- //if(m_playListModel->currentItem())
- // m_equalizer->setPresetName(m_playListModel->currentItem()->fileName());
-}
-
void MainWindow::showOutputState(const OutputState &st)
{
@@ -808,8 +804,6 @@ void MainWindow::handleCloseRequest()
QApplication::closeAllWindows();
}
-
-
void MainWindow::addUrl( )
{
AddUrlDialog::popup(this,m_playListModel);
diff --git a/src/mainwindow.h b/src/mainwindow.h
index 0647f09a6..7faf06ef3 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -97,7 +97,6 @@ private slots:
void addFile();
void addUrl();
void updateEQ();
- void updatePreset();
void updateSkin();
void forward();
void backward();
diff --git a/src/mediafile.cpp b/src/mediafile.cpp
index 9f2908685..d6ccc6668 100644
--- a/src/mediafile.cpp
+++ b/src/mediafile.cpp
@@ -110,6 +110,20 @@ void MediaFile::updateTags(const FileTag *tag)
readMetadata();
}
+void MediaFile::updateTags()
+{
+ if (m_path.startsWith("http://"))
+ return;
+
+ if (m_tag)
+ {
+ delete m_tag;
+ m_tag = 0;
+ }
+ m_tag = Decoder::createTag(m_path);
+ readMetadata();
+}
+
void MediaFile::readMetadata()
{
if (m_use_meta && m_tag && !m_tag->isEmpty())
diff --git a/src/mediafile.h b/src/mediafile.h
index 78fbd620f..799d508c1 100644
--- a/src/mediafile.h
+++ b/src/mediafile.h
@@ -48,6 +48,7 @@ public:
bool isCurrent();
void setCurrent(bool);
void updateTags(const FileTag*);
+ void updateTags();
void changeTitle(const QString&);