void MP3collection::normalise()
{
if ( check4normalise() )
{
infoWarnError
(INFORMATION, nice
("Normalise"), nice
(QString("%1 already normalised").
arg(ui->lbl_selection->text())));
return;
}
dlg->setModal(Qt::WindowModal);
file = QString("%1/%2.mp3").
arg(currentDir, ui
->lbl_selection
->text
());
cmd = "lame";
args.append("--scale");
args.append("2");
args.append(file);
args.append(tmpFile);
proc->start(cmd, args);
connect(proc,
SIGNAL(finished
(int,
QProcess::ExitStatus)),
this,
SLOT(procEnd
(int)));
// proc->waitForFinished(); /// Including this leaves blank previous dialogues.
dlg->exec();
connect(proc, SIGNAL(finished(int)), dlg, SLOT(close())); /// These don't seem to work
connect(dlg, SIGNAL(finished(int)), proc, SLOT(kill())); /// ditto
}
void MP3collection::procEnd(int i)
{
//It would be nice to close the dialogue here but it doesn't know about [I]dlg[/I] of course.
qDebug()<<i;
// close();
}
void MP3collection::normalise()
{
if ( check4normalise() )
{
infoWarnError(INFORMATION, nice("Normalise"), nice(QString("%1 already normalised").
arg(ui->lbl_selection->text())));
return;
}
QString file, cmd;
QStringList args;
QProcess *proc = new QProcess(this);
QProgressDialog *dlg = new QProgressDialog("Normalisation", "Cancel",0,0);
dlg->setModal(Qt::WindowModal);
file = QString("%1/%2.mp3").arg(currentDir, ui->lbl_selection->text());
cmd = "lame";
args.append("--scale");
args.append("2");
args.append(file);
args.append(tmpFile);
proc->start(cmd, args);
connect(proc, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(procEnd(int)));
// proc->waitForFinished(); /// Including this leaves blank previous dialogues.
dlg->exec();
connect(proc, SIGNAL(finished(int)), dlg, SLOT(close())); /// These don't seem to work
connect(dlg, SIGNAL(finished(int)), proc, SLOT(kill())); /// ditto
}
void MP3collection::procEnd(int i)
{
//It would be nice to close the dialogue here but it doesn't know about [I]dlg[/I] of course.
qDebug()<<i;
// close();
}
To copy to clipboard, switch view to plain text mode
Bookmarks