aboutsummaryrefslogtreecommitdiff
path: root/src/qmmpui/playlistmanager.cpp
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2018-06-14 18:34:01 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2018-06-14 18:34:01 +0000
commitb2eb788e01c0ec9b6f7369a3187260e1debc2d16 (patch)
treecee73535a6dafbbba26e2a05a0cba0c5a7440de6 /src/qmmpui/playlistmanager.cpp
parent38dd812f98037deaf6393964b1a1318fe1d7c52b (diff)
downloadqmmp-b2eb788e01c0ec9b6f7369a3187260e1debc2d16.tar.gz
qmmp-b2eb788e01c0ec9b6f7369a3187260e1debc2d16.tar.bz2
qmmp-b2eb788e01c0ec9b6f7369a3187260e1debc2d16.zip
saving track properties
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@8036 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/qmmpui/playlistmanager.cpp')
-rw-r--r--src/qmmpui/playlistmanager.cpp29
1 files changed, 25 insertions, 4 deletions
diff --git a/src/qmmpui/playlistmanager.cpp b/src/qmmpui/playlistmanager.cpp
index dfa4c4127..e0d72ab60 100644
--- a/src/qmmpui/playlistmanager.cpp
+++ b/src/qmmpui/playlistmanager.cpp
@@ -305,6 +305,20 @@ void PlayListManager::readPlayLists()
tracks.last()->setDuration(value.toInt());
else if (param == "length")
tracks.last()->setDuration(value.toInt() * 1000);
+ else if (param == "bitrate")
+ tracks.last()->setValue(Qmmp::BITRATE, value);
+ else if (param == "samplerate")
+ tracks.last()->setValue(Qmmp::SAMPLERATE, value);
+ else if (param == "channels")
+ tracks.last()->setValue(Qmmp::CHANNELS, value);
+ else if (param == "bits_per_sample")
+ tracks.last()->setValue(Qmmp::BITS_PER_SAMPLE, value);
+ else if (param == "format_name")
+ tracks.last()->setValue(Qmmp::FORMAT_NAME, value);
+ else if (param == "decoder")
+ tracks.last()->setValue(Qmmp::DECODER, value);
+ else if (param == "file_size")
+ tracks.last()->setValue(Qmmp::FILE_SIZE, value);
}
buffer.close();
if(m_models.isEmpty())
@@ -358,10 +372,17 @@ void PlayListManager::writePlayLists()
plFile.write(QString("comment=%1\n").arg(t->value(Qmmp::COMMENT)).toUtf8());
plFile.write(QString("genre=%1\n").arg(t->value(Qmmp::GENRE)).toUtf8());
plFile.write(QString("composer=%1\n").arg(t->value(Qmmp::COMPOSER)).toUtf8());
- plFile.write(QString("year=%1\n").arg(t->value(Qmmp::YEAR)).toUtf8());
- plFile.write(QString("track=%1\n").arg(t->value(Qmmp::TRACK)).toUtf8());
- plFile.write(QString("disc=%1\n").arg(t->value(Qmmp::DISCNUMBER)).toUtf8());
- plFile.write(QString("duration=%1\n").arg(t->duration()).toUtf8());
+ plFile.write(QString("year=%1\n").arg(t->value(Qmmp::YEAR)).toLatin1());
+ plFile.write(QString("track=%1\n").arg(t->value(Qmmp::TRACK)).toLatin1());
+ plFile.write(QString("disc=%1\n").arg(t->value(Qmmp::DISCNUMBER)).toLatin1());
+ plFile.write(QString("duration=%1\n").arg(t->duration()).toLatin1());
+ plFile.write(QString("bitrate=%1\n").arg(t->value(Qmmp::BITRATE)).toLatin1());
+ plFile.write(QString("samplerate=%1\n").arg(t->value(Qmmp::SAMPLERATE)).toLatin1());
+ plFile.write(QString("channels=%1\n").arg(t->value(Qmmp::CHANNELS)).toLatin1());
+ plFile.write(QString("bits_per_sample=%1\n").arg(t->value(Qmmp::BITS_PER_SAMPLE)).toLatin1());
+ plFile.write(QString("format_name=%1\n").arg(t->value(Qmmp::FORMAT_NAME)).toLatin1());
+ plFile.write(QString("decoder=%1\n").arg(t->value(Qmmp::DECODER)).toLatin1());
+ plFile.write(QString("file_size=%1\n").arg(t->value(Qmmp::FILE_SIZE)).toLatin1());
}
}
plFile.commit();