fileList::fileList(QWidget *parent) : QWidget(parent) { ui.setupUi(this); pReader = new WavReader; pIqReader = new WavReader; pIqWriter = new WavWriter; connect(pIqReader, SIGNAL(isStart(bool)), this, SLOT(onStart(bool))); ui.twList->horizontalHeader()->setStretchLastSection(true); ui.twList->setSelectionMode(QAbstractItemView::SingleSelection); connect(ui.twList, SIGNAL(cellDoubleClicked (int, int)), this, SLOT(onTwDoubleClick(int, int))); lastRow = 1; loopMode = 0; isPlayed = false; isRecorded = false; isPause = false; connect(ui.pbAddFile, SIGNAL(clicked()), this, SLOT(onAddFile())); connect(ui.pbDelFile, SIGNAL(clicked()), this, SLOT(onDelFile())); connect(ui.pbRec, SIGNAL(clicked()), this, SLOT(onRec())); connect(ui.pbPlay, SIGNAL(clicked()), this, SLOT(onPlay())); connect(ui.pbPause, SIGNAL(clicked()), this, SLOT(onPause())); connect(ui.pbStop, SIGNAL(clicked()), this, SLOT(onStop())); connect(ui.pbBack, SIGNAL(clicked()), this, SLOT(onBack())); connect(ui.pbLoop, SIGNAL(clicked(bool)), this, SLOT(onLoop(bool))); ui.pbPause->setEnabled(false); }
void VoiceRecorder::Stop() { if(isPlaying) onPlay(false); else if(isRecording) onRec(false); }
ControlPanelWidget::ControlPanelWidget(Context& ctx, QWidget *parent) : QDockWidget(parent), ui(new Ui::ControlPanelWidget), ctx(ctx) { ui->setupUi(this); connect(ui->btnStop, SIGNAL(clicked()), this, SLOT(onStop())); connect(ui->btnPlay, SIGNAL(clicked()), this, SLOT(onPlay())); connect(ui->btnRec, SIGNAL(clicked()), this, SLOT(onRec())); connect(ui->spnBPM, SIGNAL(valueChanged(int)), this, SLOT(onBPM())); ctx.getSequencer()->addStatusListener(this); ctx.getSequencer()->addBeatListener(this); }