From 3db127ce64eadb54568e218124744a1de713667e Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Thu, 31 Dec 2015 23:49:04 +0800 Subject: Inanimate Dream. (WTF) --- qmpmainwindow.cpp | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) (limited to 'qmpmainwindow.cpp') diff --git a/qmpmainwindow.cpp b/qmpmainwindow.cpp index f79583c..dd2d74a 100644 --- a/qmpmainwindow.cpp +++ b/qmpmainwindow.cpp @@ -11,13 +11,19 @@ qmpMainWindow::qmpMainWindow(QWidget *parent) : ui(new Ui::qmpMainWindow) { ui->setupUi(this);player=new CMidiPlayer(); - playing=false;stopped=true;dragging=false; - plistw=new qmpplistwindow(this); - chnlw=new qmpchannelswindow(this); ui->lbFileName->setText(""); + playing=false;stopped=true;dragging=false; + plistw=new qmpPlistWindow(this); + chnlw=new qmpChannelsWindow(this); + efxw=new qmpEfxWindow(this); + infow=new qmpInfoWindow(this); timer=new QTimer(this);ref=this; + fnA1=new QAction("File Information",ui->lbFileName); + ui->lbFileName->addAction(fnA1); + connect(fnA1,SIGNAL(triggered()),this,SLOT(onfnA1())); connect(timer,SIGNAL(timeout()),this,SLOT(updateWidgets())); connect(timer,SIGNAL(timeout()),chnlw,SLOT(channelWindowsUpdate())); + connect(timer,SIGNAL(timeout()),infow,SLOT(updateInfo())); } qmpMainWindow::~qmpMainWindow() @@ -29,6 +35,11 @@ qmpMainWindow::~qmpMainWindow() void qmpMainWindow::closeEvent(QCloseEvent *event) { on_pbStop_clicked(); + efxw->close();chnlw->close();plistw->close();infow->close(); + delete efxw;efxw=NULL; + delete chnlw;chnlw=NULL; + delete plistw;plistw=NULL; + delete infow;infow=NULL; event->accept(); } @@ -78,6 +89,8 @@ void qmpMainWindow::updateWidgets() } } +QString qmpMainWindow::getFileName(){return ui->lbFileName->text();} + void qmpMainWindow::on_pbPlayPause_clicked() { playing=!playing; @@ -162,6 +175,7 @@ void qmpMainWindow::dialogClosed() { if(!plistw->isVisible())ui->pbPList->setChecked(false); if(!chnlw->isVisible())ui->pbChannels->setChecked(false); + if(!efxw->isVisible())ui->pbEfx->setChecked(false); } void qmpMainWindow::on_pbPList_clicked() @@ -226,3 +240,20 @@ void qmpMainWindow::selectionChanged() st=std::chrono::steady_clock::now();offset=0; timer->start(100); } + +void qmpMainWindow::on_pbEfx_clicked() +{ + efxw->show(); +} + +void qmpMainWindow::on_lbFileName_customContextMenuRequested(const QPoint &pos) +{ + QMenu menu(ui->lbFileName); + menu.addActions(ui->lbFileName->actions()); + menu.exec(this->pos()+ui->lbFileName->pos()+pos); +} + +void qmpMainWindow::onfnA1() +{ + infow->show(); +} -- cgit v1.2.3