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); }
CAddFilesDialog::CAddFilesDialog(QWidget *parent) : QDialog(parent), ui(new Ui::CAddFilesDialog) { ui->setupUi(this); ui->tableView->setModel(&m_model); connect(ui->addBtn, SIGNAL(clicked()), this, SLOT(onAddFile())); connect(ui->actionAdd_directory, SIGNAL(triggered()), this, SLOT(addDirectory())); connect(ui->actionAdd_file, SIGNAL(triggered()), this, SLOT(addFiles())); }
void fileList::onPlay() { int currentTrack = 0; if(ui.pbRec->isChecked()) { ui.pbPlay->setChecked(false); isPlayed = false; } else { if(ui.twList->rowCount() < 1) { ui.pbPlay->setChecked(false); isPlayed = false; QMessageBox::warning(this, tr("ExpertSDR message"), tr("Can't play IQ files.\n" "Playlist is empty. Please add IQ wav files to the list and try again."), QMessageBox::Ok); onAddFile(); return; } ui.pbRec->setEnabled(false); ui.pbPlay->setChecked(true); if(pIqReader->isOpen()) pIqReader->close(); currentTrack = ui.twList->currentRow(); if(currentTrack < 0) { currentTrack = 0; ui.twList->setCurrentCell(0, 0); reinterpret_cast<wavSample*>(ui.twList->cellWidget(0 ,0))->setStyleSheet("QLabel{background-color: transparent; color: rgb(255, 106, 0);}"); reinterpret_cast<wavSample*>(ui.twList->cellWidget(0 ,0))->setActive(true); lastRow = 0; } iqFile.setFileName(reinterpret_cast<wavSample*>(ui.twList->cellWidget(currentTrack ,0))->fileName()); pIqReader->open(&iqFile); if(!pIqReader->isOpen()) { ui.pbPlay->setChecked(false); isPlayed = false; return; } ui.slIqTrack->setMaximum(pIqReader->time().second() + pIqReader->time().minute()*60 + pIqReader->time().hour()*3600); timerId = startTimer(100); if(!isPlayed) emit isPlay(true); else emit isChangedPlayFile(true); isPlayed = true; ui.pbPause->setEnabled(true); } }
LRESULT WaitingUsersFrame::onSpeaker(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/) { //disable drawing here to avoid the flicker while updating the tree ctrlQueued.SetRedraw(FALSE); if(wParam == SPEAK_ADD_FILE) { const pair<User::Ptr, string> *p = (pair<User::Ptr, string> *)lParam; onAddFile(p->first, p->second); delete p; if(BOOLSETTING(BOLD_WAITING_USERS)) setDirty(); updateStatus(); } else if(wParam == SPEAK_REMOVE_USER) { onRemoveUser(reinterpret_cast<UserPtr *>(lParam)->u); delete reinterpret_cast<UserPtr *>(lParam); if(BOOLSETTING(BOLD_WAITING_USERS)) setDirty(); updateStatus(); } ctrlQueued.SetRedraw(TRUE); return 0; }