From 41d78f3a67e2356008911b07f8cc0d0cdafd7fda Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Mon, 18 Apr 2016 23:34:22 +0800 Subject: Use std::vector for the event list. Add panic action. Minor changes on the panic function. --- qmidiplayer-desktop/qmpmainwindow.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'qmidiplayer-desktop/qmpmainwindow.cpp') diff --git a/qmidiplayer-desktop/qmpmainwindow.cpp b/qmidiplayer-desktop/qmpmainwindow.cpp index b01df10..82537d2 100644 --- a/qmidiplayer-desktop/qmpmainwindow.cpp +++ b/qmidiplayer-desktop/qmpmainwindow.cpp @@ -65,10 +65,12 @@ void qmpMainWindow::init() infow=new qmpInfoWindow(this); helpw=new qmpHelpWindow(this); timer=new QTimer(this); - fnA1=new QAction("File Information",ui->lbFileName); - fnA2=new QAction("Render to Wave",ui->lbFileName); + fnA1=new QAction(tr("File Information"),ui->lbFileName); + fnA2=new QAction(tr("Render to Wave"),ui->lbFileName); + fnA3=new QAction(tr("Panic"),ui->lbFileName); ui->lbFileName->addAction(fnA1); ui->lbFileName->addAction(fnA2); + ui->lbFileName->addAction(fnA3); if(singleFS){player->fluidPreInitialize();playerSetup();player->fluidInitialize(); for(int i=settingsw->getSFWidget()->count()-1;i>=0;--i) LOAD_SOUNDFONT;} @@ -90,6 +92,7 @@ void qmpMainWindow::init() ui->vsMasterVol->setValue(qmpSettingsWindow::getSettingsIntf()->value("Audio/Gain",50).toInt()); connect(fnA1,SIGNAL(triggered()),this,SLOT(onfnA1())); connect(fnA2,SIGNAL(triggered()),this,SLOT(onfnA2())); + connect(fnA3,SIGNAL(triggered()),this,SLOT(onfnA3())); connect(timer,SIGNAL(timeout()),this,SLOT(updateWidgets())); connect(timer,SIGNAL(timeout()),chnlw,SLOT(channelWindowsUpdate())); connect(timer,SIGNAL(timeout()),infow,SLOT(updateInfo())); @@ -544,6 +547,11 @@ void qmpMainWindow::onfnA2() renderTh=new std::thread(&CMidiPlayer::rendererThread,player); } +void qmpMainWindow::onfnA3() +{ + player->playerPanic(); +} + void qmpMainWindow::on_pbSettings_clicked() { if(ui->pbSettings->isChecked())settingsw->show();else settingsw->close(); -- cgit v1.2.3