aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/General/converter/converter.cpp
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2016-01-21 07:31:10 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2016-01-21 07:31:10 +0000
commite31a61e0273cc1723295565375e07acde066ad41 (patch)
treec9bd0e2b47cfc55ce3ae3f703f9b6eb64c5cd3a5 /src/plugins/General/converter/converter.cpp
parent7f5637710f36ecfa818b06fe008d53d1cf234ba8 (diff)
downloadqmmp-e31a61e0273cc1723295565375e07acde066ad41.tar.gz
qmmp-e31a61e0273cc1723295565375e07acde066ad41.tar.bz2
qmmp-e31a61e0273cc1723295565375e07acde066ad41.zip
improved converter
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@6070 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/General/converter/converter.cpp')
-rw-r--r--src/plugins/General/converter/converter.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/plugins/General/converter/converter.cpp b/src/plugins/General/converter/converter.cpp
index 63fe2ffd0..702a0aae2 100644
--- a/src/plugins/General/converter/converter.cpp
+++ b/src/plugins/General/converter/converter.cpp
@@ -57,8 +57,9 @@ Converter::~Converter()
}
}
-bool Converter::prepare(const QString &url, const QVariantMap &preset)
+bool Converter::prepare(const QString &url, int row, const QVariantMap &preset)
{
+ m_row = row;
InputSource *source = InputSource::create(url, this);
if(!source->initialize())
{
@@ -126,6 +127,7 @@ void Converter::run()
qDebug("Converter: staring thread");
if(m_user_stop)
{
+ emit message(m_row, tr("Cancelled"));
emit finished(this);
return;
}
@@ -140,6 +142,7 @@ void Converter::run()
if(list.isEmpty() || out_path.isEmpty() || pattern.isEmpty())
{
qWarning("Converter: invalid parameters");
+ emit message(m_row, tr("Error"));
return;
}
@@ -171,6 +174,7 @@ void Converter::run()
command.replace("%i", "\"" + tmp_path + "\"");
qDebug("Converter: starting task '%s'", qPrintable(m_preset["name"].toString()));
+ emit message(m_row, tr("Converting"));
qDeleteAll(list);
list.clear();
@@ -205,6 +209,7 @@ void Converter::run()
if(!enc_pipe)
{
qWarning("Converter: unable to open pipe");
+ emit message(m_row, tr("Error"));
return;
}
@@ -222,6 +227,7 @@ void Converter::run()
if(m_user_stop)
{
qDebug("Converter: task '%s' aborted", qPrintable(m_preset["name"].toString()));
+ emit message(m_row, tr("Cancelled"));
m_mutex.unlock();
return;
}
@@ -232,7 +238,7 @@ void Converter::run()
if(use_file)
{
qDebug("Converter: starting file encoding...");
- //emit desriptionChanged(tr("Encoding..."));
+ emit message(m_row, tr("Encoding"));
enc_pipe = popen(qPrintable(command), "w");
if(!enc_pipe)
{
@@ -270,6 +276,7 @@ void Converter::run()
}
qDebug("Converter: thread finished");
+ emit message(m_row, tr("Finished"));
emit finished(this);
}