Skip to content

Commit

Permalink
Make program remember last directory and filename for exporting
Browse files Browse the repository at this point in the history
  • Loading branch information
ZDisket committed Jun 22, 2021
1 parent c5a3ce2 commit f84769d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
11 changes: 9 additions & 2 deletions mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ MainWindow::MainWindow(QWidget *parent)

DenBatchSize = 0;
DenDone = 0;
LastExportDir = QCoreApplication::applicationDirPath() + "/Utt.wav";



Expand Down Expand Up @@ -982,14 +983,16 @@ void MainWindow::on_btnExportSel_clicked()
}


QString ofname = QFileDialog::getSaveFileName(FwParent, tr("Export WAV file"), "Utt", tr("WAV, float32 PCM (*.wav)"));
QString ofname = QFileDialog::getSaveFileName(FwParent, tr("Export WAV file"), LastExportDir, tr("WAV, float32 PCM (*.wav)"));
if (!ofname.size())
return;

std::vector<float> Audat;
QByteArray& AuBuff = AudBuffs[(size_t)ui->lstUtts->currentRow()]->buffer();
ExportAudBuffer(ofname,AuBuff,CommonSampleRate);

LastExportDir = ofname;


}

Expand Down Expand Up @@ -1028,7 +1031,7 @@ void MainWindow::on_btnExReport_clicked()
if (AltExport)
ExTitle += "s (separately)";

QString ofname = QFileDialog::getSaveFileName(FwParent,ExTitle, "Utt", tr("WAV, float32 PCM (*.wav)"));
QString ofname = QFileDialog::getSaveFileName(FwParent,ExTitle,LastExportDir, tr("WAV, float32 PCM (*.wav)"));
if (!ofname.size())
return;

Expand All @@ -1053,6 +1056,8 @@ void MainWindow::on_btnExReport_clicked()


ResetLogiLedIn(8);
LastExportDir = ofname;

return;


Expand All @@ -1071,6 +1076,8 @@ void MainWindow::on_btnExReport_clicked()

LogiLedFlashLighting(0,50,100,5000,500);

LastExportDir = ofname;


ResetLogiLedIn(8);

Expand Down
1 change: 1 addition & 0 deletions mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class MainWindow : public QMainWindow
bool DoUpdateSplitAuto;

InferIDTrueID* FindByFirst(uint32_t inGetID);
QString LastExportDir;



Expand Down

0 comments on commit f84769d

Please sign in to comment.