SilenceInterface::SilenceInterface(QWidget *parent) : QWidget(parent) { dataTimeWidget = new DateTimeWidget(this); dataTimeWidget->setGeometry (100, (480-200)/2, 240, 200); identService = new BIdentService; //showWidget = new BCameraWidget(this); //testShowWidget = new BIdentInterface(); //showWidget->setGeometry (350, 80, 400, 300); //showWidget->setGeometry (0, 15, 800, 450); // showWidget->setGeometry (0, 0, 800, 480); //testShowWidget->setGeometry (0, 0, 800, 480); //testShowWidget->setFixedSize (800, 450); ctrlTimer = new QTimer(this); showButton = new QPushButton("显示图像", this); showButton->setGeometry (400, 200, 100, 50); showButton->setDisabled (true); connect (ctrlTimer, SIGNAL(timeout()), this, SLOT(timerProc())); connect (showButton, SIGNAL(clicked(bool)), this, SLOT(toShowCamera())); ctrlTimer->start (1000*8); }
//------------------------------------------------------------------------------ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { QCoreApplication::setOrganizationName(programName); //Avoid QSettings trouble in Vista x64 QCoreApplication::addLibraryPath("plugins"); ui->setupUi(this); timer = new QTimer(this); connect(timer, SIGNAL(timeout()), this, SLOT(timerProc())); programVersion = "0.2"; programName = "PMP"; formalProgramName = "Privacy Mask Program"; setWindowTitle(tr(formalProgramName.toAscii()) + "(" + programName + ")"); // Prepare help widget formHelp = new FormHelp(0, tr(formalProgramName.toAscii()) + "(" + programName + ")"); pthread = new PThread(); connect(pthread, SIGNAL(finished()), this, SLOT(pthreadDone())); QTextCodec *codec = QTextCodec::codecForName("Shift-JIS"); QTextDecoder *decoder = codec->makeDecoder(); QString iniFname = programName + ".ini"; QSettings *ini_settings; ini_settings = new QSettings(iniFname, QSettings::IniFormat); // Get MeCab_HOME meCabHome = decoder->toUnicode(ini_settings->value("MeCab/MeCab_HOME").toByteArray()); if(meCabHome == ""){ meCabHome = "c:/Program Files (x86)/MeCab/bin/"; } // Get Mask Column No maskColumnNo = ini_settings->value("Target/MaskColumnNo").toString(); if(maskColumnNo == ""){ maskColumnNo = ""; } // Get Process Execution Timeout (default 600sec) processExecutionTimeoutSeconds = ini_settings->value("Timeout/ProcessExecution").toString(); if(processExecutionTimeoutSeconds == ""){ processExecutionTimeoutSeconds = "600"; } // Check the path to GnuPG if(! CheckMeCabHome(ini_settings)){ timer->start(1000); return; } ui->listWidgetStatus->addItem(tr("Processing status.")); }
CGpgExec::CGpgExec(QWidget *parent) : QDialog(parent), m_ui(new Ui::CGpgExec) { wparent = (MainWindow *)parent; pathToGnuPG = wparent->pathToGnuPG; processExecutionTimeoutSeconds = wparent->processExecutionTimeoutSeconds; m_ui->setupUi(this); timer = new QTimer(this); connect(timer, SIGNAL(timeout()), this, SLOT(timerProc())); }
// NOT USED CGpgExec::CGpgExec(bool *stat, QWidget *parent, QString request, QString param1, QString param2, QString *result) : QDialog(parent), m_ui(new Ui::CGpgExec) { wparent = (MainWindow *)parent; pathToGnuPG = wparent->pathToGnuPG; processExecutionTimeoutSeconds = wparent->processExecutionTimeoutSeconds; m_ui->setupUi(this); timer = new QTimer(this); connect(timer, SIGNAL(timeout()), this, SLOT(timerProc())); QString keyid = param1; QString fpath = param2; m_ui->label_FileName->setText(fpath); QFile *file = new QFile(fpath); m_ui->label_FileSize->setText(QString("%L2").arg(file->size())); *stat = gpgExecute(request, keyid, fpath, result); }
void AGOSEngine::delay(uint amount) { Common::Event event; uint32 start = _system->getMillis(); uint32 cur = start; uint this_delay, vgaPeriod; _system->getAudioCDManager()->updateCD(); _debugger->onFrame(); vgaPeriod = (_fastMode) ? 10 : _vgaPeriod; if (getGameType() == GType_PP && getGameId() != GID_DIMP) { if (vgaPeriod == 15 && _variableArray[999] == 0) vgaPeriod = 30; } _rnd.getRandomNumber(2); do { while (!_inCallBack && cur >= _lastVgaTick + vgaPeriod && !_pause) { _lastVgaTick += vgaPeriod; // don't get too many frames behind if (cur >= _lastVgaTick + vgaPeriod * 2) _lastVgaTick = cur; _inCallBack = true; timerProc(); _inCallBack = false; } while (_eventMan->pollEvent(event)) { switch (event.type) { case Common::EVENT_KEYDOWN: if (event.kbd.keycode >= Common::KEYCODE_0 && event.kbd.keycode <= Common::KEYCODE_9 && (event.kbd.hasFlags(Common::KBD_ALT) || event.kbd.hasFlags(Common::KBD_CTRL))) { _saveLoadSlot = event.kbd.keycode - Common::KEYCODE_0; // There is no save slot 0 if (_saveLoadSlot == 0) _saveLoadSlot = 10; memset(_saveLoadName, 0, sizeof(_saveLoadName)); sprintf(_saveLoadName, "Quick %d", _saveLoadSlot); _saveLoadType = (event.kbd.hasFlags(Common::KBD_ALT)) ? 1 : 2; // We should only allow a load or save when it was possible in original // This stops load/save during copy protection, conversations and cut scenes if (!_mouseHideCount && !_showPreposition) quickLoadOrSave(); } else if (event.kbd.hasFlags(Common::KBD_CTRL)) { if (event.kbd.keycode == Common::KEYCODE_a) { GUI::Dialog *_aboutDialog; _aboutDialog = new GUI::AboutDialog(); _aboutDialog->runModal(); } else if (event.kbd.keycode == Common::KEYCODE_f) { _fastMode = !_fastMode; } else if (event.kbd.keycode == Common::KEYCODE_d) { _debugger->attach(); } else if (event.kbd.keycode == Common::KEYCODE_s) { dumpAllSubroutines(); } else if (event.kbd.keycode == Common::KEYCODE_i) { dumpAllVgaImageFiles(); } } if (getGameType() == GType_PP) { if (event.kbd.hasFlags(Common::KBD_SHIFT)) _variableArray[41] = 0; else _variableArray[41] = 1; } _keyPressed = event.kbd; break; case Common::EVENT_MOUSEMOVE: break; case Common::EVENT_LBUTTONDOWN: if (getGameType() == GType_FF) setBitFlag(89, true); _leftButtonDown = true; _leftButton = 1; break; case Common::EVENT_LBUTTONUP: if (getGameType() == GType_FF) setBitFlag(89, false); _leftButton = 0; _leftButtonCount = 0; _leftClick = true; break; case Common::EVENT_RBUTTONDOWN: if (getGameType() == GType_FF) setBitFlag(92, false); _rightButtonDown = true; break; case Common::EVENT_RBUTTONUP: _rightClick = true; break; case Common::EVENT_RTL: case Common::EVENT_QUIT: return; default: break; } } if (_leftButton == 1) _leftButtonCount++; _system->getAudioCDManager()->updateCD(); _system->updateScreen(); if (amount == 0) break; this_delay = _fastMode ? 1 : 20; if (this_delay > amount) this_delay = amount; _system->delayMillis(this_delay); cur = _system->getMillis(); } while (cur < start + amount && !shouldQuit()); }
/** * @brief Default constructor. Set a start up configuration. * @param QWidget *parent - Link to parent Widget (default is null). */ Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget) { try { timer = new QTimer(this); this->timer_for_record = new QTimer(this); connect(timer, SIGNAL(timeout()), this, SLOT(timerProc())); connect(timer_for_record, SIGNAL(timeout()), this, SLOT(stopRecordingSlot())); connect(this, SIGNAL(PlotSpectrumSignal()), this, SLOT(plotSpectrums())); connect(this, SIGNAL(fill_ftt_complex_Signal()), this, SLOT(from_ftt_to_complex())); connect(this, SIGNAL(post_filtering_Signal()), this, SLOT(post_filtering())); connect(this, SIGNAL(liftering_Signal()), this, SLOT(liftering())); connect(this, SIGNAL(kaiser_window_signal()), this, SLOT(kaiser_window())); ui->setupUi(this); ui->lineEdit->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); /* { ui->plot1->xAxis->setBasePen(QPen(Qt::white, 1)); ui->plot1->yAxis->setBasePen(QPen(Qt::white, 1)); ui->plot1->xAxis->setTickPen(QPen(Qt::white, 1)); ui->plot1->yAxis->setTickPen(QPen(Qt::white, 1)); ui->plot1->xAxis->setSubTickPen(QPen(Qt::white, 1)); ui->plot1->yAxis->setSubTickPen(QPen(Qt::white, 1)); ui->plot1->xAxis->setTickLabelColor(Qt::white); ui->plot1->yAxis->setTickLabelColor(Qt::white); ui->plot1->xAxis->grid()->setPen(QPen(QColor(140, 140, 140), 1, Qt::DotLine)); ui->plot1->yAxis->grid()->setPen(QPen(QColor(140, 140, 140), 1, Qt::DotLine)); ui->plot1->xAxis->grid()->setSubGridPen(QPen(QColor(80, 80, 80), 1, Qt::DotLine)); ui->plot1->yAxis->grid()->setSubGridPen(QPen(QColor(80, 80, 80), 1, Qt::DotLine)); ui->plot1->xAxis->grid()->setSubGridVisible(true); ui->plot1->yAxis->grid()->setSubGridVisible(true); ui->plot1->xAxis->grid()->setZeroLinePen(Qt::NoPen); ui->plot1->yAxis->grid()->setZeroLinePen(Qt::NoPen); ui->plot1->xAxis->setUpperEnding(QCPLineEnding::esSpikeArrow); ui->plot1->yAxis->setUpperEnding(QCPLineEnding::esSpikeArrow); QLinearGradient plotGradient; plotGradient.setStart(0, 0); plotGradient.setFinalStop(0, 350); plotGradient.setColorAt(0, QColor(80, 80, 80)); plotGradient.setColorAt(1, QColor(50, 50, 50)); ui->plot1->setBackground(plotGradient); QLinearGradient axisRectGradient; axisRectGradient.setStart(0, 0); axisRectGradient.setFinalStop(0, 350); axisRectGradient.setColorAt(0, QColor(80, 80, 80)); axisRectGradient.setColorAt(1, QColor(30, 30, 30)); ui->plot1->axisRect()->setBackground(axisRectGradient); ui->plot1->rescaleAxes(); }*/ { ui->plot2->xAxis->setBasePen(QPen(Qt::white, 1)); ui->plot2->yAxis->setBasePen(QPen(Qt::white, 1)); ui->plot2->xAxis->setTickPen(QPen(Qt::white, 1)); ui->plot2->yAxis->setTickPen(QPen(Qt::white, 1)); ui->plot2->xAxis->setSubTickPen(QPen(Qt::white, 1)); ui->plot2->yAxis->setSubTickPen(QPen(Qt::white, 1)); ui->plot2->xAxis->setTickLabelColor(Qt::white); ui->plot2->yAxis->setTickLabelColor(Qt::white); ui->plot2->xAxis->grid()->setPen(QPen(QColor(140, 140, 140), 1, Qt::DotLine)); ui->plot2->yAxis->grid()->setPen(QPen(QColor(140, 140, 140), 1, Qt::DotLine)); ui->plot2->xAxis->grid()->setSubGridPen(QPen(QColor(80, 80, 80), 1, Qt::DotLine)); ui->plot2->yAxis->grid()->setSubGridPen(QPen(QColor(80, 80, 80), 1, Qt::DotLine)); ui->plot2->xAxis->grid()->setSubGridVisible(true); ui->plot2->yAxis->grid()->setSubGridVisible(true); ui->plot2->xAxis->grid()->setZeroLinePen(Qt::NoPen); ui->plot2->yAxis->grid()->setZeroLinePen(Qt::NoPen); ui->plot2->xAxis->setUpperEnding(QCPLineEnding::esSpikeArrow); ui->plot2->yAxis->setUpperEnding(QCPLineEnding::esSpikeArrow); QLinearGradient plotGradient; plotGradient.setStart(0, 0); plotGradient.setFinalStop(0, 350); plotGradient.setColorAt(0, QColor(80, 80, 80)); plotGradient.setColorAt(1, QColor(50, 50, 50)); ui->plot2->setBackground(plotGradient); QLinearGradient axisRectGradient; axisRectGradient.setStart(0, 0); axisRectGradient.setFinalStop(0, 350); axisRectGradient.setColorAt(0, QColor(80, 80, 80)); axisRectGradient.setColorAt(1, QColor(30, 30, 30)); ui->plot2->axisRect()->setBackground(axisRectGradient); ui->plot2->rescaleAxes(); } QGraphicsDropShadowEffect *dse = new QGraphicsDropShadowEffect(this); // for a Record button QGraphicsDropShadowEffect *dse2 = new QGraphicsDropShadowEffect(this); // for a Play button QGraphicsDropShadowEffect *dse3 = new QGraphicsDropShadowEffect(this); // for a Save QGraphicsDropShadowEffect *dse4 = new QGraphicsDropShadowEffect(this); // for a LineEdit dse -> setBlurRadius(1); dse2-> setBlurRadius(1); dse3-> setBlurRadius(1); dse4-> setBlurRadius(1); dse -> setOffset(QPoint(0,1)); dse2-> setOffset(QPoint(0,1)); dse3-> setOffset(QPoint(0,1)); dse4-> setOffset(QPoint(0,1)); QColor color; color.setRgb(1, 137, 255, 80); dse ->setColor(color); dse2->setColor(color); dse3->setColor(color); dse4->setColor(color); ui->pushButton -> setGraphicsEffect(dse); //ui->pushButton_2-> setGraphicsEffect(dse2); ui->pushButton_3-> setGraphicsEffect(dse3); ui->lineEdit -> setGraphicsEffect(dse4); this->fft = new std::float_t[2048]; for (std::int32_t i = 0; i < 2048; i++) fft[i] = 0; } catch (...){ QDEBUG("err"); } }