void a2a::errorHandler(QString error) { if (!error.isEmpty()) { QMessageBox::warning(this,tr("Warning"),error); resetParams(); } }
Encode_Status VaapiEncoderH264::start() { printf("start"); FUNC_ENTER(); resetParams(); return VaapiEncoderBase::start(); }
Minesweeper::Minesweeper(){ done = false; displayVideo = NULL; images = NULL; textFont = NULL; flagsQuantity = 0; resetParams(); }
a2a::a2a(QWidget *parent) : QMainWindow(parent), ui(new Ui::a2a) { ui->setupUi(this); resetParams(); connect(&audio,SIGNAL(error(QString)),this,SLOT(errorHandler(QString))); connect(&audio,SIGNAL(status(QString)),this,SLOT(statusHandler(QString))); QTimer::singleShot(0,this,SLOT(loadConf())); }
AdvGaits::AdvGaits(QWidget *parent) : QWidget(parent), ui(new Ui::AdvGaits) { ui->setupUi(this); p = new Params; resetParams(); p->frequencyOdd = 0; p->frequencyEven = 0; p->phaseOdd = 0; p->phaseEven = 0; p->wavelengthOdd = 0; p->wavelengthEven = 0; }
void Minesweeper::resetGame(){ resetParams(); flagsQuantity = BOMB_TOTAL; mineTable.clear(); minesCoord.clear(); digitsCoord.clear(); vector<square> rows(SIZE_COL); mineTable.resize(SIZE_ROW,rows); TOP_SCORE = getTopScore(); insertMines(); insertDigits(); }
void sstvRx::init() { setFilters(); // setup sstvRx Filters resetParams(true); #ifndef QT_NO_DEBUG scopeViewerData->setAlternativeScaleMultiplier(SUBSAMPLINGFACTOR/rxClock); scopeViewerData->setCurveName("RX VOL",SCDATA1); scopeViewerData->setCurveName("TEST",SCDATA2); scopeViewerData->setCurveName("STATE",SCDATA3); scopeViewerData->setCurveName("DEMOD",SCDATA4); scopeViewerData->setAxisTitles("Samples","int","State"); scopeViewerSyncNarrow->setAlternativeScaleMultiplier(SUBSAMPLINGFACTOR/rxClock); scopeViewerSyncWide->setAlternativeScaleMultiplier(SUBSAMPLINGFACTOR/rxClock); #endif }
// sFSectTmp为段名 // 这个是按照段名-参数名处理数据(sSectName是段名,如SYSTEM;sVal是带段名.参数名的形式;如:SYSTEM.state=online,SYSTEM.state.eff_date=20101010235600) long HBParamMonitor::dealParamOpera(char *sSectName,char *sVal, long lCMDID) { /*if(!m_poCmdCom) return -1;// 无连接*/ if(!m_poCmdOpera){ m_poCmdOpera = new SysParamClient(); m_poCmdOpera->setDebugState(true); } long res = -1; resetParams(); INFOPOINT(3,"[HBParamMonitor.dealParamOpera]%s","根据实际参数数据处理数据"); res = m_poCmdOpera->deal4Monitor(sSectName,sVal,lCMDID,m_poCmdCom); if(res == 0) return 0;//无返回结果,超时 switch(lCMDID) { case MSG_PARAM_CHANGE: case MSG_PARAM_S_C: case MSG_PARAM_S_D: { /*if(pIndexList) { pIndexList->clearAll(); delete pIndexList; pIndexList = 0; }*/ m_iRowNum = 0; return res; } default: { m_iParamNum = 0; memsetSysInfo(); long lRes = m_poCmdOpera->VecToSysParamInfo(m_poParamHisRecord,m_iParamNum,lCMDID); if(m_iParamNum<=0) return 0;//有返回数据,但数据内容为NULL res = GetParamInfoAll(); return res; break; } } return 0;//不处理 }
void reset() { resetState(); resetParams(); }
Sfxr::Sfxr() { resetParams(); mBaseSamplerate = 44100; }
result Sfxr::loadPreset(int aPresetNo, int aRandSeed) { if (aPresetNo < 0 || aPresetNo > 6) return INVALID_PARAMETER; resetParams(); mRand.srand(aRandSeed); switch(aPresetNo) { case 0: // pickup/coin mParams.p_base_freq=0.4f+frnd(0.5f); mParams.p_env_attack=0.0f; mParams.p_env_sustain=frnd(0.1f); mParams.p_env_decay=0.1f+frnd(0.4f); mParams.p_env_punch=0.3f+frnd(0.3f); if(rnd(1)) { mParams.p_arp_speed=0.5f+frnd(0.2f); mParams.p_arp_mod=0.2f+frnd(0.4f); } break; case 1: // laser/shoot mParams.wave_type=rnd(2); if(mParams.wave_type==2 && rnd(1)) mParams.wave_type=rnd(1); mParams.p_base_freq=0.5f+frnd(0.5f); mParams.p_freq_limit=mParams.p_base_freq-0.2f-frnd(0.6f); if(mParams.p_freq_limit<0.2f) mParams.p_freq_limit=0.2f; mParams.p_freq_ramp=-0.15f-frnd(0.2f); if(rnd(2)==0) { mParams.p_base_freq=0.3f+frnd(0.6f); mParams.p_freq_limit=frnd(0.1f); mParams.p_freq_ramp=-0.35f-frnd(0.3f); } if(rnd(1)) { mParams.p_duty=frnd(0.5f); mParams.p_duty_ramp=frnd(0.2f); } else { mParams.p_duty=0.4f+frnd(0.5f); mParams.p_duty_ramp=-frnd(0.7f); } mParams.p_env_attack=0.0f; mParams.p_env_sustain=0.1f+frnd(0.2f); mParams.p_env_decay=frnd(0.4f); if(rnd(1)) mParams.p_env_punch=frnd(0.3f); if(rnd(2)==0) { mParams.p_pha_offset=frnd(0.2f); mParams.p_pha_ramp=-frnd(0.2f); } if(rnd(1)) mParams.p_hpf_freq=frnd(0.3f); break; case 2: // explosion mParams.wave_type=3; if(rnd(1)) { mParams.p_base_freq=0.1f+frnd(0.4f); mParams.p_freq_ramp=-0.1f+frnd(0.4f); } else { mParams.p_base_freq=0.2f+frnd(0.7f); mParams.p_freq_ramp=-0.2f-frnd(0.2f); } mParams.p_base_freq*=mParams.p_base_freq; if(rnd(4)==0) mParams.p_freq_ramp=0.0f; if(rnd(2)==0) mParams.p_repeat_speed=0.3f+frnd(0.5f); mParams.p_env_attack=0.0f; mParams.p_env_sustain=0.1f+frnd(0.3f); mParams.p_env_decay=frnd(0.5f); if(rnd(1)==0) { mParams.p_pha_offset=-0.3f+frnd(0.9f); mParams.p_pha_ramp=-frnd(0.3f); } mParams.p_env_punch=0.2f+frnd(0.6f); if(rnd(1)) { mParams.p_vib_strength=frnd(0.7f); mParams.p_vib_speed=frnd(0.6f); } if(rnd(2)==0) { mParams.p_arp_speed=0.6f+frnd(0.3f); mParams.p_arp_mod=0.8f-frnd(1.6f); } break; case 3: // powerup if(rnd(1)) mParams.wave_type=1; else mParams.p_duty=frnd(0.6f); if(rnd(1)) { mParams.p_base_freq=0.2f+frnd(0.3f); mParams.p_freq_ramp=0.1f+frnd(0.4f); mParams.p_repeat_speed=0.4f+frnd(0.4f); } else { mParams.p_base_freq=0.2f+frnd(0.3f); mParams.p_freq_ramp=0.05f+frnd(0.2f); if(rnd(1)) { mParams.p_vib_strength=frnd(0.7f); mParams.p_vib_speed=frnd(0.6f); } } mParams.p_env_attack=0.0f; mParams.p_env_sustain=frnd(0.4f); mParams.p_env_decay=0.1f+frnd(0.4f); break; case 4: // hit/hurt mParams.wave_type=rnd(2); if(mParams.wave_type==2) mParams.wave_type=3; if(mParams.wave_type==0) mParams.p_duty=frnd(0.6f); mParams.p_base_freq=0.2f+frnd(0.6f); mParams.p_freq_ramp=-0.3f-frnd(0.4f); mParams.p_env_attack=0.0f; mParams.p_env_sustain=frnd(0.1f); mParams.p_env_decay=0.1f+frnd(0.2f); if(rnd(1)) mParams.p_hpf_freq=frnd(0.3f); break; case 5: // jump mParams.wave_type=0; mParams.p_duty=frnd(0.6f); mParams.p_base_freq=0.3f+frnd(0.3f); mParams.p_freq_ramp=0.1f+frnd(0.2f); mParams.p_env_attack=0.0f; mParams.p_env_sustain=0.1f+frnd(0.3f); mParams.p_env_decay=0.1f+frnd(0.2f); if(rnd(1)) mParams.p_hpf_freq=frnd(0.3f); if(rnd(1)) mParams.p_lpf_freq=1.0f-frnd(0.6f); break; case 6: // blip/select mParams.wave_type=rnd(1); if(mParams.wave_type==0) mParams.p_duty=frnd(0.6f); mParams.p_base_freq=0.2f+frnd(0.4f); mParams.p_env_attack=0.0f; mParams.p_env_sustain=0.1f+frnd(0.1f); mParams.p_env_decay=frnd(0.2f); mParams.p_hpf_freq=0.1f; break; } return 0; }
bool MRFRegistration2DParametersWidget::initialise(mitk::DataStorage::Pointer storage) { // Populate the combo boxes with the data // // // mitk::DataStorage::SetOfObjects::ConstPointer images = storage->GetAll(); for(unsigned int i = 0; i < images->size(); i++) { // check that the item is an image mitk::Image::Pointer image = mitk::Image::New(); image = dynamic_cast<mitk::Image*>(images->GetElement(i)->GetData()); if(image) { // now break out the slices and times steps int timeSteps = image->GetTimeSteps(); for(int t = 0; t < timeSteps; t++) { // now break out the z slices int zdims = image->GetDimension(2); for(int z = 0; z < zdims; z++) { // we now need to split them up so as to access the // 2d slices // // // mitk::ImageSliceSelector::Pointer timeImageSelector = mitk::ImageSliceSelector::New(); timeImageSelector->SetInput(image); timeImageSelector->SetTimeNr(t); timeImageSelector->SetSliceNr(z); try { timeImageSelector->Update(); } catch(mitk::Exception &e) { std::cout << "Error in extracting a slice" << std::endl; std::cout << e << std::endl; break; } mitk::Image::Pointer imageSlice = timeImageSelector->GetOutput(); imageSlice->SetGeometry(image->GetGeometry(0)); imageSlice->Update(); imageHolder.push_back(imageSlice); // add an entry into the combo boxes // // // QString entryName = QString::fromStdString(images->GetElement(i)->GetName()) + " z: " + QString::number(z) + " t: " + QString::number(t); this->fixedImageSelector->addItem(entryName); this->movingImageSelector->addItem(entryName); } } } } // connect up all the buttons connect(this->makeGridButton, SIGNAL(pressed()), this, SLOT(updateGridImage())); connect(this->linkDisplacementToGrid, SIGNAL(pressed()), this, SLOT(setMaxDisplacementToGrid())); connect(this->resetParamsButton, SIGNAL(pressed()), this, SLOT(resetParams())); connect(this->startRegistrationButton, SIGNAL(pressed()), this, SLOT(startRegistration())); return true; }
// Constructor. synthv1widget::synthv1widget ( QWidget *pParent, Qt::WindowFlags wflags ) : QWidget(pParent, wflags) { Q_INIT_RESOURCE(synthv1); #if QT_VERSION >= 0x050000 // HACK: Dark themes grayed/disabled color group fix... QPalette pal; if (pal.base().color().value() < 0x7f) { const QColor& color = pal.window().color(); const int iGroups = int(QPalette::Active | QPalette::Inactive) + 1; for (int i = 0; i < iGroups; ++i) { const QPalette::ColorGroup group = QPalette::ColorGroup(i); pal.setBrush(group, QPalette::Light, color.lighter(150)); pal.setBrush(group, QPalette::Midlight, color.lighter(120)); pal.setBrush(group, QPalette::Dark, color.darker(150)); pal.setBrush(group, QPalette::Mid, color.darker(120)); pal.setBrush(group, QPalette::Shadow, color.darker(200)); } pal.setColor(QPalette::Disabled, QPalette::ButtonText, pal.mid().color()); QWidget::setPalette(pal); } #endif m_ui.setupUi(this); // Init sched notifier. m_sched_notifier = NULL; // Init swapable params A/B to default. for (uint32_t i = 0; i < synthv1::NUM_PARAMS; ++i) m_params_ab[i] = synthv1_param::paramDefaultValue(synthv1::ParamIndex(i)); // Start clean. m_iUpdate = 0; // Replicate the stacked/pages for (int iTab = 0; iTab < m_ui.StackedWidget->count(); ++iTab) m_ui.TabBar->addTab(m_ui.StackedWidget->widget(iTab)->windowTitle()); // Swappable params A/B group. QButtonGroup *pSwapParamsGroup = new QButtonGroup(this); pSwapParamsGroup->addButton(m_ui.SwapParamsAButton); pSwapParamsGroup->addButton(m_ui.SwapParamsBButton); pSwapParamsGroup->setExclusive(true); m_ui.SwapParamsAButton->setChecked(true); // Wave shapes. QStringList shapes; shapes << tr("Pulse"); shapes << tr("Saw"); shapes << tr("Sine"); shapes << tr("Rand"); shapes << tr("Noise"); m_ui.Dco1Shape1Knob->insertItems(0, shapes); m_ui.Dco1Shape2Knob->insertItems(0, shapes); m_ui.Dco2Shape1Knob->insertItems(0, shapes); m_ui.Dco2Shape2Knob->insertItems(0, shapes); m_ui.Lfo1ShapeKnob->insertItems(0, shapes); m_ui.Lfo2ShapeKnob->insertItems(0, shapes); // Filter types. QStringList types; types << tr("LPF"); types << tr("BPF"); types << tr("HPF"); types << tr("BRF"); m_ui.Dcf1TypeKnob->insertItems(0, types); m_ui.Dcf2TypeKnob->insertItems(0, types); // Filter slopes. QStringList slopes; slopes << tr("12dB/oct"); slopes << tr("24dB/oct"); m_ui.Dcf1SlopeKnob->insertItems(0, slopes); m_ui.Dcf2SlopeKnob->insertItems(0, slopes); // Dynamic states. QStringList states; states << tr("Off"); states << tr("On"); m_ui.Dco1Bandl1Knob->insertItems(0, states); m_ui.Dco1Bandl2Knob->insertItems(0, states); m_ui.Dco2Bandl1Knob->insertItems(0, states); m_ui.Dco2Bandl2Knob->insertItems(0, states); m_ui.Dyn1CompressKnob->insertItems(0, states); m_ui.Dyn1LimiterKnob->insertItems(0, states); // Special values const QString& sOff = states.first(); m_ui.Cho1WetKnob->setSpecialValueText(sOff); m_ui.Fla1WetKnob->setSpecialValueText(sOff); m_ui.Pha1WetKnob->setSpecialValueText(sOff); m_ui.Del1WetKnob->setSpecialValueText(sOff); m_ui.Rev1WetKnob->setSpecialValueText(sOff); const QString& sAuto = tr("Auto"); m_ui.Del1BpmKnob->setSpecialValueText(sAuto); // Wave integer widths. m_ui.Dco1Width1Knob->setDecimals(0); m_ui.Dco1Width2Knob->setDecimals(0); m_ui.Dco2Width1Knob->setDecimals(0); m_ui.Dco2Width2Knob->setDecimals(0); m_ui.Lfo1WidthKnob->setDecimals(0); m_ui.Lfo2WidthKnob->setDecimals(0); // DCO octave limits. m_ui.Dco1OctaveKnob->setMinimum(-4.0f); m_ui.Dco1OctaveKnob->setMaximum(+4.0f); m_ui.Dco2OctaveKnob->setMinimum(-4.0f); m_ui.Dco2OctaveKnob->setMaximum(+4.0f); // DCO balance limits. m_ui.Dco1BalanceKnob->setMinimum(-1.0f); m_ui.Dco1BalanceKnob->setMaximum(+1.0f); m_ui.Dco2BalanceKnob->setMinimum(-1.0f); m_ui.Dco2BalanceKnob->setMaximum(+1.0f); // DCO tune limits. m_ui.Dco1TuningKnob->setMinimum(-1.0f); m_ui.Dco1TuningKnob->setMaximum(+1.0f); m_ui.Dco2TuningKnob->setMinimum(-1.0f); m_ui.Dco2TuningKnob->setMaximum(+1.0f); // DCF volume (env.amount) limits. m_ui.Dcf1EnvelopeKnob->setMinimum(-1.0f); m_ui.Dcf1EnvelopeKnob->setMaximum(+1.0f); m_ui.Dcf2EnvelopeKnob->setMinimum(-1.0f); m_ui.Dcf2EnvelopeKnob->setMaximum(+1.0f); // LFO parameter limits. m_ui.Lfo1SweepKnob->setMinimum(-1.0f); m_ui.Lfo1SweepKnob->setMaximum(+1.0f); m_ui.Lfo1CutoffKnob->setMinimum(-1.0f); m_ui.Lfo1CutoffKnob->setMaximum(+1.0f); m_ui.Lfo1ResoKnob->setMinimum(-1.0f); m_ui.Lfo1ResoKnob->setMaximum(+1.0f); m_ui.Lfo1PitchKnob->setMinimum(-1.0f); m_ui.Lfo1PitchKnob->setMaximum(+1.0f); m_ui.Lfo1PanningKnob->setMinimum(-1.0f); m_ui.Lfo1PanningKnob->setMaximum(+1.0f); m_ui.Lfo1VolumeKnob->setMinimum(-1.0f); m_ui.Lfo1VolumeKnob->setMaximum(+1.0f); m_ui.Lfo2SweepKnob->setMinimum(-1.0f); m_ui.Lfo2SweepKnob->setMaximum(+1.0f); m_ui.Lfo2CutoffKnob->setMinimum(-1.0f); m_ui.Lfo2CutoffKnob->setMaximum(+1.0f); m_ui.Lfo2ResoKnob->setMinimum(-1.0f); m_ui.Lfo2ResoKnob->setMaximum(+1.0f); m_ui.Lfo2PitchKnob->setMinimum(-1.0f); m_ui.Lfo2PitchKnob->setMaximum(+1.0f); m_ui.Lfo2PanningKnob->setMinimum(-1.0f); m_ui.Lfo2PanningKnob->setMaximum(+1.0f); m_ui.Lfo2VolumeKnob->setMinimum(-1.0f); m_ui.Lfo2VolumeKnob->setMaximum(+1.0f); // Channel filters QStringList channels; channels << tr("Omni"); for (int iChannel = 0; iChannel < 16; ++iChannel) channels << QString::number(iChannel + 1); m_ui.Def1ChannelKnob->insertItems(0, channels); m_ui.Def2ChannelKnob->insertItems(0, channels); // Mono switches m_ui.Def1MonoKnob->insertItems(0, states); m_ui.Def2MonoKnob->insertItems(0, states); // Output (stereo-)width limits. m_ui.Out1WidthKnob->setMinimum(-1.0f); m_ui.Out1WidthKnob->setMaximum(+1.0f); m_ui.Out2WidthKnob->setMinimum(-1.0f); m_ui.Out2WidthKnob->setMaximum(+1.0f); // Output (stereo-)panning limits. m_ui.Out1PanningKnob->setMinimum(-1.0f); m_ui.Out1PanningKnob->setMaximum(+1.0f); m_ui.Out2PanningKnob->setMinimum(-1.0f); m_ui.Out2PanningKnob->setMaximum(+1.0f); // Effects (delay BPM) m_ui.Del1BpmKnob->setScale(1.0f); m_ui.Del1BpmKnob->setMinimum(3.6f); m_ui.Del1BpmKnob->setMaximum(360.0f); m_ui.Del1BpmKnob->setSingleStep(1.0f); // Reverb (stereo-)width limits. m_ui.Rev1WidthKnob->setMinimum(-1.0f); m_ui.Rev1WidthKnob->setMaximum(+1.0f); // DCO1 setParamKnob(synthv1::DCO1_SHAPE1, m_ui.Dco1Shape1Knob); setParamKnob(synthv1::DCO1_WIDTH1, m_ui.Dco1Width1Knob); setParamKnob(synthv1::DCO1_BANDL1, m_ui.Dco1Bandl1Knob); setParamKnob(synthv1::DCO1_SHAPE2, m_ui.Dco1Shape2Knob); setParamKnob(synthv1::DCO1_WIDTH2, m_ui.Dco1Width2Knob); setParamKnob(synthv1::DCO1_BANDL2, m_ui.Dco1Bandl2Knob); setParamKnob(synthv1::DCO1_BALANCE, m_ui.Dco1BalanceKnob); setParamKnob(synthv1::DCO1_DETUNE, m_ui.Dco1DetuneKnob); setParamKnob(synthv1::DCO1_PHASE, m_ui.Dco1PhaseKnob); setParamKnob(synthv1::DCO1_OCTAVE, m_ui.Dco1OctaveKnob); setParamKnob(synthv1::DCO1_TUNING, m_ui.Dco1TuningKnob); setParamKnob(synthv1::DCO1_GLIDE, m_ui.Dco1GlideKnob); setParamKnob(synthv1::DCO1_ENVTIME, m_ui.Dco1EnvTimeKnob); QObject::connect( m_ui.Dco1Shape1Knob, SIGNAL(valueChanged(float)), m_ui.Dco1Wave1, SLOT(setWaveShape(float))); QObject::connect( m_ui.Dco1Wave1, SIGNAL(waveShapeChanged(float)), m_ui.Dco1Shape1Knob, SLOT(setValue(float))); QObject::connect( m_ui.Dco1Width1Knob, SIGNAL(valueChanged(float)), m_ui.Dco1Wave1, SLOT(setWaveWidth(float))); QObject::connect( m_ui.Dco1Wave1, SIGNAL(waveWidthChanged(float)), m_ui.Dco1Width1Knob, SLOT(setValue(float))); QObject::connect( m_ui.Dco1Shape2Knob, SIGNAL(valueChanged(float)), m_ui.Dco1Wave2, SLOT(setWaveShape(float))); QObject::connect( m_ui.Dco1Wave2, SIGNAL(waveShapeChanged(float)), m_ui.Dco1Shape2Knob, SLOT(setValue(float))); QObject::connect( m_ui.Dco1Width2Knob, SIGNAL(valueChanged(float)), m_ui.Dco1Wave2, SLOT(setWaveWidth(float))); QObject::connect( m_ui.Dco1Wave2, SIGNAL(waveWidthChanged(float)), m_ui.Dco1Width2Knob, SLOT(setValue(float))); // DCF1 setParamKnob(synthv1::DCF1_CUTOFF, m_ui.Dcf1CutoffKnob); setParamKnob(synthv1::DCF1_RESO, m_ui.Dcf1ResoKnob); setParamKnob(synthv1::DCF1_TYPE, m_ui.Dcf1TypeKnob); setParamKnob(synthv1::DCF1_SLOPE, m_ui.Dcf1SlopeKnob); setParamKnob(synthv1::DCF1_ENVELOPE, m_ui.Dcf1EnvelopeKnob); setParamKnob(synthv1::DCF1_ATTACK, m_ui.Dcf1AttackKnob); setParamKnob(synthv1::DCF1_DECAY, m_ui.Dcf1DecayKnob); setParamKnob(synthv1::DCF1_SUSTAIN, m_ui.Dcf1SustainKnob); setParamKnob(synthv1::DCF1_RELEASE, m_ui.Dcf1ReleaseKnob); QObject::connect( m_ui.Dcf1Filt, SIGNAL(cutoffChanged(float)), m_ui.Dcf1CutoffKnob, SLOT(setValue(float))); QObject::connect( m_ui.Dcf1CutoffKnob, SIGNAL(valueChanged(float)), m_ui.Dcf1Filt, SLOT(setCutoff(float))); QObject::connect( m_ui.Dcf1Filt, SIGNAL(resoChanged(float)), m_ui.Dcf1ResoKnob, SLOT(setValue(float))); QObject::connect( m_ui.Dcf1ResoKnob, SIGNAL(valueChanged(float)), m_ui.Dcf1Filt, SLOT(setReso(float))); QObject::connect( m_ui.Dcf1TypeKnob, SIGNAL(valueChanged(float)), m_ui.Dcf1Filt, SLOT(setType(float))); QObject::connect( m_ui.Dcf1SlopeKnob, SIGNAL(valueChanged(float)), m_ui.Dcf1Filt, SLOT(setSlope(float))); QObject::connect( m_ui.Dcf1Env, SIGNAL(attackChanged(float)), m_ui.Dcf1AttackKnob, SLOT(setValue(float))); QObject::connect( m_ui.Dcf1AttackKnob, SIGNAL(valueChanged(float)), m_ui.Dcf1Env, SLOT(setAttack(float))); QObject::connect( m_ui.Dcf1Env, SIGNAL(decayChanged(float)), m_ui.Dcf1DecayKnob, SLOT(setValue(float))); QObject::connect( m_ui.Dcf1DecayKnob, SIGNAL(valueChanged(float)), m_ui.Dcf1Env, SLOT(setDecay(float))); QObject::connect( m_ui.Dcf1Env, SIGNAL(sustainChanged(float)), m_ui.Dcf1SustainKnob, SLOT(setValue(float))); QObject::connect( m_ui.Dcf1SustainKnob, SIGNAL(valueChanged(float)), m_ui.Dcf1Env, SLOT(setSustain(float))); QObject::connect( m_ui.Dcf1Env, SIGNAL(releaseChanged(float)), m_ui.Dcf1ReleaseKnob, SLOT(setValue(float))); QObject::connect( m_ui.Dcf1ReleaseKnob, SIGNAL(valueChanged(float)), m_ui.Dcf1Env, SLOT(setRelease(float))); // LFO1 setParamKnob(synthv1::LFO1_SHAPE, m_ui.Lfo1ShapeKnob); setParamKnob(synthv1::LFO1_WIDTH, m_ui.Lfo1WidthKnob); setParamKnob(synthv1::LFO1_RATE, m_ui.Lfo1RateKnob); setParamKnob(synthv1::LFO1_PANNING, m_ui.Lfo1PanningKnob); setParamKnob(synthv1::LFO1_VOLUME, m_ui.Lfo1VolumeKnob); setParamKnob(synthv1::LFO1_CUTOFF, m_ui.Lfo1CutoffKnob); setParamKnob(synthv1::LFO1_RESO, m_ui.Lfo1ResoKnob); setParamKnob(synthv1::LFO1_PITCH, m_ui.Lfo1PitchKnob); setParamKnob(synthv1::LFO1_SWEEP, m_ui.Lfo1SweepKnob); setParamKnob(synthv1::LFO1_ATTACK, m_ui.Lfo1AttackKnob); setParamKnob(synthv1::LFO1_DECAY, m_ui.Lfo1DecayKnob); setParamKnob(synthv1::LFO1_SUSTAIN, m_ui.Lfo1SustainKnob); setParamKnob(synthv1::LFO1_RELEASE, m_ui.Lfo1ReleaseKnob); QObject::connect( m_ui.Lfo1ShapeKnob, SIGNAL(valueChanged(float)), m_ui.Lfo1Wave, SLOT(setWaveShape(float))); QObject::connect( m_ui.Lfo1Wave, SIGNAL(waveShapeChanged(float)), m_ui.Lfo1ShapeKnob, SLOT(setValue(float))); QObject::connect( m_ui.Lfo1WidthKnob, SIGNAL(valueChanged(float)), m_ui.Lfo1Wave, SLOT(setWaveWidth(float))); QObject::connect( m_ui.Lfo1Wave, SIGNAL(waveWidthChanged(float)), m_ui.Lfo1WidthKnob, SLOT(setValue(float))); QObject::connect( m_ui.Lfo1Env, SIGNAL(attackChanged(float)), m_ui.Lfo1AttackKnob, SLOT(setValue(float))); QObject::connect( m_ui.Lfo1AttackKnob, SIGNAL(valueChanged(float)), m_ui.Lfo1Env, SLOT(setAttack(float))); QObject::connect( m_ui.Lfo1Env, SIGNAL(decayChanged(float)), m_ui.Lfo1DecayKnob, SLOT(setValue(float))); QObject::connect( m_ui.Lfo1DecayKnob, SIGNAL(valueChanged(float)), m_ui.Lfo1Env, SLOT(setDecay(float))); QObject::connect( m_ui.Lfo1Env, SIGNAL(sustainChanged(float)), m_ui.Lfo1SustainKnob, SLOT(setValue(float))); QObject::connect( m_ui.Lfo1SustainKnob, SIGNAL(valueChanged(float)), m_ui.Lfo1Env, SLOT(setSustain(float))); QObject::connect( m_ui.Lfo1Env, SIGNAL(releaseChanged(float)), m_ui.Lfo1ReleaseKnob, SLOT(setValue(float))); QObject::connect( m_ui.Lfo1ReleaseKnob, SIGNAL(valueChanged(float)), m_ui.Lfo1Env, SLOT(setRelease(float))); // DCA1 setParamKnob(synthv1::DCA1_VOLUME, m_ui.Dca1VolumeKnob); setParamKnob(synthv1::DCA1_ATTACK, m_ui.Dca1AttackKnob); setParamKnob(synthv1::DCA1_DECAY, m_ui.Dca1DecayKnob); setParamKnob(synthv1::DCA1_SUSTAIN, m_ui.Dca1SustainKnob); setParamKnob(synthv1::DCA1_RELEASE, m_ui.Dca1ReleaseKnob); QObject::connect( m_ui.Dca1Env, SIGNAL(attackChanged(float)), m_ui.Dca1AttackKnob, SLOT(setValue(float))); QObject::connect( m_ui.Dca1AttackKnob, SIGNAL(valueChanged(float)), m_ui.Dca1Env, SLOT(setAttack(float))); QObject::connect( m_ui.Dca1Env, SIGNAL(decayChanged(float)), m_ui.Dca1DecayKnob, SLOT(setValue(float))); QObject::connect( m_ui.Dca1DecayKnob, SIGNAL(valueChanged(float)), m_ui.Dca1Env, SLOT(setDecay(float))); QObject::connect( m_ui.Dca1Env, SIGNAL(sustainChanged(float)), m_ui.Dca1SustainKnob, SLOT(setValue(float))); QObject::connect( m_ui.Dca1SustainKnob, SIGNAL(valueChanged(float)), m_ui.Dca1Env, SLOT(setSustain(float))); QObject::connect( m_ui.Dca1Env, SIGNAL(releaseChanged(float)), m_ui.Dca1ReleaseKnob, SLOT(setValue(float))); QObject::connect( m_ui.Dca1ReleaseKnob, SIGNAL(valueChanged(float)), m_ui.Dca1Env, SLOT(setRelease(float))); // DEF1 setParamKnob(synthv1::DEF1_PITCHBEND, m_ui.Def1PitchbendKnob); setParamKnob(synthv1::DEF1_MODWHEEL, m_ui.Def1ModwheelKnob); setParamKnob(synthv1::DEF1_PRESSURE, m_ui.Def1PressureKnob); setParamKnob(synthv1::DEF1_VELOCITY, m_ui.Def1VelocityKnob); setParamKnob(synthv1::DEF1_CHANNEL, m_ui.Def1ChannelKnob); setParamKnob(synthv1::DEF1_MONO, m_ui.Def1MonoKnob); // OUT1 setParamKnob(synthv1::OUT1_WIDTH, m_ui.Out1WidthKnob); setParamKnob(synthv1::OUT1_PANNING, m_ui.Out1PanningKnob); setParamKnob(synthv1::OUT1_VOLUME, m_ui.Out1VolumeKnob); // DCO2 setParamKnob(synthv1::DCO2_SHAPE1, m_ui.Dco2Shape1Knob); setParamKnob(synthv1::DCO2_WIDTH1, m_ui.Dco2Width1Knob); setParamKnob(synthv1::DCO2_BANDL1, m_ui.Dco2Bandl1Knob); setParamKnob(synthv1::DCO2_SHAPE2, m_ui.Dco2Shape2Knob); setParamKnob(synthv1::DCO2_WIDTH2, m_ui.Dco2Width2Knob); setParamKnob(synthv1::DCO2_BANDL2, m_ui.Dco2Bandl2Knob); setParamKnob(synthv1::DCO2_BALANCE, m_ui.Dco2BalanceKnob); setParamKnob(synthv1::DCO2_DETUNE, m_ui.Dco2DetuneKnob); setParamKnob(synthv1::DCO2_PHASE, m_ui.Dco2PhaseKnob); setParamKnob(synthv1::DCO2_OCTAVE, m_ui.Dco2OctaveKnob); setParamKnob(synthv1::DCO2_TUNING, m_ui.Dco2TuningKnob); setParamKnob(synthv1::DCO2_GLIDE, m_ui.Dco2GlideKnob); setParamKnob(synthv1::DCO2_ENVTIME, m_ui.Dco2EnvTimeKnob); QObject::connect( m_ui.Dco2Shape1Knob, SIGNAL(valueChanged(float)), m_ui.Dco2Wave1, SLOT(setWaveShape(float))); QObject::connect( m_ui.Dco2Wave1, SIGNAL(waveShapeChanged(float)), m_ui.Dco2Shape1Knob, SLOT(setValue(float))); QObject::connect( m_ui.Dco2Width1Knob, SIGNAL(valueChanged(float)), m_ui.Dco2Wave1, SLOT(setWaveWidth(float))); QObject::connect( m_ui.Dco2Wave1, SIGNAL(waveWidthChanged(float)), m_ui.Dco2Width1Knob, SLOT(setValue(float))); QObject::connect( m_ui.Dco2Shape2Knob, SIGNAL(valueChanged(float)), m_ui.Dco2Wave2, SLOT(setWaveShape(float))); QObject::connect( m_ui.Dco2Wave2, SIGNAL(waveShapeChanged(float)), m_ui.Dco2Shape2Knob, SLOT(setValue(float))); QObject::connect( m_ui.Dco2Width2Knob, SIGNAL(valueChanged(float)), m_ui.Dco2Wave2, SLOT(setWaveWidth(float))); QObject::connect( m_ui.Dco2Wave2, SIGNAL(waveWidthChanged(float)), m_ui.Dco2Width2Knob, SLOT(setValue(float))); // DCF2 setParamKnob(synthv1::DCF2_CUTOFF, m_ui.Dcf2CutoffKnob); setParamKnob(synthv1::DCF2_RESO, m_ui.Dcf2ResoKnob); setParamKnob(synthv1::DCF2_TYPE, m_ui.Dcf2TypeKnob); setParamKnob(synthv1::DCF2_SLOPE, m_ui.Dcf2SlopeKnob); setParamKnob(synthv1::DCF2_ENVELOPE, m_ui.Dcf2EnvelopeKnob); setParamKnob(synthv1::DCF2_ATTACK, m_ui.Dcf2AttackKnob); setParamKnob(synthv1::DCF2_DECAY, m_ui.Dcf2DecayKnob); setParamKnob(synthv1::DCF2_SUSTAIN, m_ui.Dcf2SustainKnob); setParamKnob(synthv1::DCF2_RELEASE, m_ui.Dcf2ReleaseKnob); QObject::connect( m_ui.Dcf2Filt, SIGNAL(cutoffChanged(float)), m_ui.Dcf2CutoffKnob, SLOT(setValue(float))); QObject::connect( m_ui.Dcf2CutoffKnob, SIGNAL(valueChanged(float)), m_ui.Dcf2Filt, SLOT(setCutoff(float))); QObject::connect( m_ui.Dcf2Filt, SIGNAL(resoChanged(float)), m_ui.Dcf2ResoKnob, SLOT(setValue(float))); QObject::connect( m_ui.Dcf2ResoKnob, SIGNAL(valueChanged(float)), m_ui.Dcf2Filt, SLOT(setReso(float))); QObject::connect( m_ui.Dcf2TypeKnob, SIGNAL(valueChanged(float)), m_ui.Dcf2Filt, SLOT(setType(float))); QObject::connect( m_ui.Dcf2SlopeKnob, SIGNAL(valueChanged(float)), m_ui.Dcf2Filt, SLOT(setSlope(float))); QObject::connect( m_ui.Dcf2Env, SIGNAL(attackChanged(float)), m_ui.Dcf2AttackKnob, SLOT(setValue(float))); QObject::connect( m_ui.Dcf2AttackKnob, SIGNAL(valueChanged(float)), m_ui.Dcf2Env, SLOT(setAttack(float))); QObject::connect( m_ui.Dcf2Env, SIGNAL(decayChanged(float)), m_ui.Dcf2DecayKnob, SLOT(setValue(float))); QObject::connect( m_ui.Dcf2DecayKnob, SIGNAL(valueChanged(float)), m_ui.Dcf2Env, SLOT(setDecay(float))); QObject::connect( m_ui.Dcf2Env, SIGNAL(sustainChanged(float)), m_ui.Dcf2SustainKnob, SLOT(setValue(float))); QObject::connect( m_ui.Dcf2SustainKnob, SIGNAL(valueChanged(float)), m_ui.Dcf2Env, SLOT(setSustain(float))); QObject::connect( m_ui.Dcf2Env, SIGNAL(releaseChanged(float)), m_ui.Dcf2ReleaseKnob, SLOT(setValue(float))); QObject::connect( m_ui.Dcf2ReleaseKnob, SIGNAL(valueChanged(float)), m_ui.Dcf2Env, SLOT(setRelease(float))); // LFO2 setParamKnob(synthv1::LFO2_SHAPE, m_ui.Lfo2ShapeKnob); setParamKnob(synthv1::LFO2_WIDTH, m_ui.Lfo2WidthKnob); setParamKnob(synthv1::LFO2_RATE, m_ui.Lfo2RateKnob); setParamKnob(synthv1::LFO2_PANNING, m_ui.Lfo2PanningKnob); setParamKnob(synthv1::LFO2_VOLUME, m_ui.Lfo2VolumeKnob); setParamKnob(synthv1::LFO2_CUTOFF, m_ui.Lfo2CutoffKnob); setParamKnob(synthv1::LFO2_RESO, m_ui.Lfo2ResoKnob); setParamKnob(synthv1::LFO2_PITCH, m_ui.Lfo2PitchKnob); setParamKnob(synthv1::LFO2_SWEEP, m_ui.Lfo2SweepKnob); setParamKnob(synthv1::LFO2_ATTACK, m_ui.Lfo2AttackKnob); setParamKnob(synthv1::LFO2_DECAY, m_ui.Lfo2DecayKnob); setParamKnob(synthv1::LFO2_SUSTAIN, m_ui.Lfo2SustainKnob); setParamKnob(synthv1::LFO2_RELEASE, m_ui.Lfo2ReleaseKnob); QObject::connect( m_ui.Lfo2ShapeKnob, SIGNAL(valueChanged(float)), m_ui.Lfo2Wave, SLOT(setWaveShape(float))); QObject::connect( m_ui.Lfo2Wave, SIGNAL(waveShapeChanged(float)), m_ui.Lfo2ShapeKnob, SLOT(setValue(float))); QObject::connect( m_ui.Lfo2WidthKnob, SIGNAL(valueChanged(float)), m_ui.Lfo2Wave, SLOT(setWaveWidth(float))); QObject::connect( m_ui.Lfo2Wave, SIGNAL(waveWidthChanged(float)), m_ui.Lfo2WidthKnob, SLOT(setValue(float))); QObject::connect( m_ui.Lfo2Env, SIGNAL(attackChanged(float)), m_ui.Lfo2AttackKnob, SLOT(setValue(float))); QObject::connect( m_ui.Lfo2AttackKnob, SIGNAL(valueChanged(float)), m_ui.Lfo2Env, SLOT(setAttack(float))); QObject::connect( m_ui.Lfo2Env, SIGNAL(decayChanged(float)), m_ui.Lfo2DecayKnob, SLOT(setValue(float))); QObject::connect( m_ui.Lfo2DecayKnob, SIGNAL(valueChanged(float)), m_ui.Lfo2Env, SLOT(setDecay(float))); QObject::connect( m_ui.Lfo2Env, SIGNAL(sustainChanged(float)), m_ui.Lfo2SustainKnob, SLOT(setValue(float))); QObject::connect( m_ui.Lfo2SustainKnob, SIGNAL(valueChanged(float)), m_ui.Lfo2Env, SLOT(setSustain(float))); QObject::connect( m_ui.Lfo2Env, SIGNAL(releaseChanged(float)), m_ui.Lfo2ReleaseKnob, SLOT(setValue(float))); QObject::connect( m_ui.Lfo2ReleaseKnob, SIGNAL(valueChanged(float)), m_ui.Lfo2Env, SLOT(setRelease(float))); // DCA2 setParamKnob(synthv1::DCA2_VOLUME, m_ui.Dca2VolumeKnob); setParamKnob(synthv1::DCA2_ATTACK, m_ui.Dca2AttackKnob); setParamKnob(synthv1::DCA2_DECAY, m_ui.Dca2DecayKnob); setParamKnob(synthv1::DCA2_SUSTAIN, m_ui.Dca2SustainKnob); setParamKnob(synthv1::DCA2_RELEASE, m_ui.Dca2ReleaseKnob); QObject::connect( m_ui.Dca2Env, SIGNAL(attackChanged(float)), m_ui.Dca2AttackKnob, SLOT(setValue(float))); QObject::connect( m_ui.Dca2AttackKnob, SIGNAL(valueChanged(float)), m_ui.Dca2Env, SLOT(setAttack(float))); QObject::connect( m_ui.Dca2Env, SIGNAL(decayChanged(float)), m_ui.Dca2DecayKnob, SLOT(setValue(float))); QObject::connect( m_ui.Dca2DecayKnob, SIGNAL(valueChanged(float)), m_ui.Dca2Env, SLOT(setDecay(float))); QObject::connect( m_ui.Dca2Env, SIGNAL(sustainChanged(float)), m_ui.Dca2SustainKnob, SLOT(setValue(float))); QObject::connect( m_ui.Dca2SustainKnob, SIGNAL(valueChanged(float)), m_ui.Dca2Env, SLOT(setSustain(float))); QObject::connect( m_ui.Dca2Env, SIGNAL(releaseChanged(float)), m_ui.Dca2ReleaseKnob, SLOT(setValue(float))); QObject::connect( m_ui.Dca2ReleaseKnob, SIGNAL(valueChanged(float)), m_ui.Dca2Env, SLOT(setRelease(float))); // DEF2 setParamKnob(synthv1::DEF2_PITCHBEND, m_ui.Def2PitchbendKnob); setParamKnob(synthv1::DEF2_MODWHEEL, m_ui.Def2ModwheelKnob); setParamKnob(synthv1::DEF2_PRESSURE, m_ui.Def2PressureKnob); setParamKnob(synthv1::DEF2_VELOCITY, m_ui.Def2VelocityKnob); setParamKnob(synthv1::DEF2_CHANNEL, m_ui.Def2ChannelKnob); setParamKnob(synthv1::DEF2_MONO, m_ui.Def2MonoKnob); // OUT2 setParamKnob(synthv1::OUT2_WIDTH, m_ui.Out2WidthKnob); setParamKnob(synthv1::OUT2_PANNING, m_ui.Out2PanningKnob); setParamKnob(synthv1::OUT2_VOLUME, m_ui.Out2VolumeKnob); // Effects setParamKnob(synthv1::CHO1_WET, m_ui.Cho1WetKnob); setParamKnob(synthv1::CHO1_DELAY, m_ui.Cho1DelayKnob); setParamKnob(synthv1::CHO1_FEEDB, m_ui.Cho1FeedbKnob); setParamKnob(synthv1::CHO1_RATE, m_ui.Cho1RateKnob); setParamKnob(synthv1::CHO1_MOD, m_ui.Cho1ModKnob); setParamKnob(synthv1::FLA1_WET, m_ui.Fla1WetKnob); setParamKnob(synthv1::FLA1_DELAY, m_ui.Fla1DelayKnob); setParamKnob(synthv1::FLA1_FEEDB, m_ui.Fla1FeedbKnob); setParamKnob(synthv1::FLA1_DAFT, m_ui.Fla1DaftKnob); setParamKnob(synthv1::PHA1_WET, m_ui.Pha1WetKnob); setParamKnob(synthv1::PHA1_RATE, m_ui.Pha1RateKnob); setParamKnob(synthv1::PHA1_FEEDB, m_ui.Pha1FeedbKnob); setParamKnob(synthv1::PHA1_DEPTH, m_ui.Pha1DepthKnob); setParamKnob(synthv1::PHA1_DAFT, m_ui.Pha1DaftKnob); setParamKnob(synthv1::DEL1_WET, m_ui.Del1WetKnob); setParamKnob(synthv1::DEL1_DELAY, m_ui.Del1DelayKnob); setParamKnob(synthv1::DEL1_FEEDB, m_ui.Del1FeedbKnob); setParamKnob(synthv1::DEL1_BPM, m_ui.Del1BpmKnob); QObject::connect(m_ui.Del1BpmKnob, SIGNAL(valueChanged(float)), SLOT(bpmSyncChanged())); // Reverb setParamKnob(synthv1::REV1_WET, m_ui.Rev1WetKnob); setParamKnob(synthv1::REV1_ROOM, m_ui.Rev1RoomKnob); setParamKnob(synthv1::REV1_DAMP, m_ui.Rev1DampKnob); setParamKnob(synthv1::REV1_FEEDB, m_ui.Rev1FeedbKnob); setParamKnob(synthv1::REV1_WIDTH, m_ui.Rev1WidthKnob); // Dynamics setParamKnob(synthv1::DYN1_COMPRESS, m_ui.Dyn1CompressKnob); setParamKnob(synthv1::DYN1_LIMITER, m_ui.Dyn1LimiterKnob); // Preset management QObject::connect(m_ui.Preset, SIGNAL(newPresetFile()), SLOT(newPreset())); QObject::connect(m_ui.Preset, SIGNAL(loadPresetFile(const QString&)), SLOT(loadPreset(const QString&))); QObject::connect(m_ui.Preset, SIGNAL(savePresetFile(const QString&)), SLOT(savePreset(const QString&))); QObject::connect(m_ui.Preset, SIGNAL(resetPresetFile()), SLOT(resetParams())); // Swap params A/B QObject::connect(m_ui.SwapParamsAButton, SIGNAL(toggled(bool)), SLOT(swapParams(bool))); QObject::connect(m_ui.SwapParamsBButton, SIGNAL(toggled(bool)), SLOT(swapParams(bool))); // Direct stacked-page signal/slot QObject::connect(m_ui.TabBar, SIGNAL(currentChanged(int)), m_ui.StackedWidget, SLOT(setCurrentIndex(int))); // Menu actions QObject::connect(m_ui.helpConfigureAction, SIGNAL(triggered(bool)), SLOT(helpConfigure())); QObject::connect(m_ui.helpAboutAction, SIGNAL(triggered(bool)), SLOT(helpAbout())); QObject::connect(m_ui.helpAboutQtAction, SIGNAL(triggered(bool)), SLOT(helpAboutQt())); // General knob/dial behavior init... synthv1_config *pConfig = synthv1_config::getInstance(); if (pConfig) { synthv1widget_dial::setDialMode( synthv1widget_dial::DialMode(pConfig->iKnobDialMode)); } // Epilog. // QWidget::adjustSize(); m_ui.StatusBar->showMessage(tr("Ready"), 5000); m_ui.StatusBar->setModified(false); m_ui.Preset->setDirtyPreset(false); }
void HBParamMonitor::clearEnv() { memsetSysInfo(); resetParams(); m_iRowNum = 0; }
// 获取参数(参数转化,直接按照 段 参数=值 生效日期的格式显示)[改进中] long HBParamMonitor::GetParamInfoAll() { long res = 0; resetParams(); FormatParamHisRecord(); if(pIndexList){ pIndexList->clearAll(); //delete pIndexList; //pIndexList = 0; } else { pIndexList = new HashList<int>(MAX_ITEMS*4+16); } // 初始行数据下标 int iListPos = 0; int iKey = 0; for(;iKey<m_iParamNum; iKey++) { if(m_poParamHisRecord[iKey].sParamValue[0] != '\0' && strcmp(m_poParamHisRecord[iKey].sParamOrValue,m_poParamHisRecord[iKey].sParamValue)!=0) { analyseParamInfo(iListPos,m_poParamHisRecord[iKey].sWholeParamName,m_poParamHisRecord[iKey].sParamOrValue,".原值=",iKey); analyseParamInfo(iListPos,m_poParamHisRecord[iKey].sWholeParamName,m_poParamHisRecord[iKey].sParamValue,".新值=",iKey); } else { analyseParamInfo(iListPos,m_poParamHisRecord[iKey].sWholeParamName,m_poParamHisRecord[iKey].sParamValue,"=",iKey); } if(m_poParamHisRecord[iKey].sDate[0] != '\0') { analyseParamInfo(iListPos,m_poParamHisRecord[iKey].sWholeParamName,m_poParamHisRecord[iKey].sDate,"生效日期: ",iKey); } try { if(!m_poBaseRuleMgr) m_poBaseRuleMgr = new BaseRuleMgr(); } catch (...) { m_poBaseRuleMgr = 0; } if(m_poBaseRuleMgr) { char sEffType[64] = {0}; BaseSysParamRule *pParamRule = m_poBaseRuleMgr->getParamRule(m_poParamHisRecord[iKey].sSectName,m_poParamHisRecord[iKey].sParamName); if(pParamRule) { switch(pParamRule->iEffDateFlag) { case 1: strcpy(sEffType,"立即生效"); break; case 2: strcpy(sEffType,"重启生效"); break; case 3: strcpy(sEffType,"按照设定的生效日期生效"); break; default: strcpy(sEffType,"立即生效"); break; } } else { strcpy(sEffType,"立即生效"); } analyseParamInfo(iListPos,m_poParamHisRecord[iKey].sWholeParamName,sEffType," 生效方式: ",iKey); } } m_iRowNum = iListPos; res = (long)iListPos; INFOPOINT(3,"[HBParamMonitor.GetParamInfoAll],将参数数据改成行显示格式,共%ld行数据",res); return res; }
/** * A function to parse command line arguments */ static bool parseArgs(int argc, char *argv[], tParams *params) { HOLOREN_ASSERT(params != NULL); #define CMP_SHORT_OPT(arg, opt) \ (((arg)[0] == '-') && ((arg)[1] == (opt)) && ((arg)[2] == 0)) /* reset arguments */ resetParams(params); /* run through the arguments and process them */ int i = 1; while (i < argc) { if (CMP_SHORT_OPT(argv[i], 'i')) { if (++i >= argc) { std::cerr << "Option -i requires an argument" << std::endl; return false; } if (params->ifilename != NULL) { std::cerr << "Input file already given" << std::endl; return false; } params->ifilename = argv[i]; } else if (CMP_SHORT_OPT(argv[i], 'o')) { if (++i >= argc) { std::cerr << "Option -o requires an argument" << std::endl; return false; } if (params->ofilename != NULL) { std::cerr << "Output file already given" << std::endl; return false; } params->ofilename = argv[i]; } else if (CMP_SHORT_OPT(argv[i], 'r')) { if (++i >= argc) { std::cerr << "Option -r requires an argument" << std::endl; return false; } if (Utils::strCaseCmp(argv[i], "simple") == 0) { params->renderer = REN_SIMPLE; } else if (Utils::strCaseCmp(argv[i], "opencl") == 0) { params->renderer = REN_OPENCL; } else if (Utils::strCaseCmp(argv[i], "none") == 0) { params->renderer = REN_NONE; } else { std::cerr << "Uknown rendering engine: \"" << argv[i] << "\"" << std::endl; return false; } } else if (CMP_SHORT_OPT(argv[i], 'a')) { if (++i >= argc) { std::cerr << "Option -a requires an argument" << std::endl; return false; } if (Utils::strCaseCmp(argv[i], "SinglePass") == 0) { params->alg_type = COpenCLRenderer::ALGORITHM_SINGLEPASS; } else if (Utils::strCaseCmp(argv[i], "MultiPass") == 0) { params->alg_type = COpenCLRenderer::ALGORITHM_MULTIPASS; } else if (Utils::strCaseCmp(argv[i], "MultiPassCPU") == 0) { params->alg_type = COpenCLRenderer::ALGORITHM_MULTIPASS_CPU; } else if (Utils::strCaseCmp(argv[i], "MultiPassNative") == 0) { params->alg_type = COpenCLRenderer::ALGORITHM_MULTIPASS_NATIVE; } else if (Utils::strCaseCmp(argv[i], "MultiPassAligned") == 0) { params->alg_type = COpenCLRenderer::ALGORITHM_MULTIPASS_ALIGNED; } else { std::cerr << "Unknown rendering algorithm: \"" << argv[i] << "\"" << std::endl; return false; } } else if (CMP_SHORT_OPT(argv[i], 'c')) { if (++i >= argc) { std::cerr << "Option -c requires an argument" << std::endl; return false; } if (!Utils::strToULong(argv[i], ¶ms->chunk_size)) { std::cerr << "Failed to convert argument " << argv[i] << " of option -c to number" << std::endl; return false; } } else if (CMP_SHORT_OPT(argv[i], 'h')) { if (++i >= argc) { std::cerr << "Option -h requires an argument" << std::endl; return false; } if (!Utils::strToUInt(argv[i], ¶ms->of_rows)) { std::cerr << "Failed to convert argument " << argv[i] << " of option -h to number" << std::endl; return false; } } else if (CMP_SHORT_OPT(argv[i], 'w')) { if (++i >= argc) { std::cerr << "Option -w requires an argument" << std::endl; return false; } if (!Utils::strToUInt(argv[i], ¶ms->of_cols)) { std::cerr << "Failed to convert argument " << argv[i] << " of option -w to number" << std::endl; return false; } } else if (CMP_SHORT_OPT(argv[i], 's')) { if (++i >= argc) { std::cerr << "Option -s requires an argument" << std::endl; return false; } if (!Utils::strToDbl(argv[i], ¶ms->sampling)) { std::cerr << "Failed to convert argument " << argv[i] << " of option -s to number" << std::endl; return false; } } else if (CMP_SHORT_OPT(argv[i], 'l')) { if (++i >= argc) { std::cerr << "Option -l requires an argument" << std::endl; return false; } if (!Utils::strToDbl(argv[i], ¶ms->lambda)) { std::cerr << "Failed to convert argument " << argv[i] << " of option -l to number" << std::endl; return false; } } else if (CMP_SHORT_OPT(argv[i], 'z')) { if (++i >= argc) { std::cerr << "Option -z requires an argument" << std::endl; return false; } if (!Utils::strToDbl(argv[i], ¶ms->hologram_z)) { std::cerr << "Failed to convert argument " << argv[i] << " of option -z to number" << std::endl; return false; } } else if (CMP_SHORT_OPT(argv[i], 'f')) { if (++i >= argc) { std::cerr << "Option -f requires an argument" << std::endl; return false; } if (params->cl_source != NULL) { std::cerr << "OpenCL source file already given" << std::endl; return false; } params->cl_source = argv[i]; } else if (CMP_SHORT_OPT(argv[i], 'p')) { if (++i >= argc) { std::cerr << "Option -p requires an argument" << std::endl; return false; } if (params->perf_log != NULL) { std::cerr << "Performance log file already given" << std::endl; return false; } params->perf_log = argv[i]; } else if (CMP_SHORT_OPT(argv[i], 't')) { if (++i >= argc) { std::cerr << "Option -t requires an argument" << std::endl; return false; } if (!Utils::strToDbl(argv[i], ¶ms->pc_sampling_step)) { std::cerr << "Failed to convert argument " << argv[i] << " of option -t to number" << std::endl; return false; } } else { std::cerr << "Unrecognized option: " << argv[i] << std::endl; return false; } ++i; } /* check on required arguments */ if (params->ifilename == NULL) { std::cerr << "Missing input file name" << std::endl; return false; } if (params->ofilename == NULL) { std::cerr << "Missing output file name" << std::endl; return false; } #undef CMP_SHORT_OPT return true; }
void sstvRx::process() { // unsigned int ri; quint32 block; quint32 syncPosition; quint32 sampleCounterLatch; quint32 diff; syncProcessor::esyncProcessState syncStateWide; syncProcessor::esyncProcessState syncStateNarrow; syncProcessor::esyncProcessState syncState; rxSSTVStatusEvent *stce; syncWideProc.process(); syncStateWide=syncWideProc.getSyncState(syncPosition); if(syncStateWide!=syncProcessor::MODEDETECT) { usingWide=true; syncNarrowProc.setEnabled(false); syncProcPtr=&syncWideProc; } else { syncNarrowProc.process(); syncStateNarrow=syncNarrowProc.getSyncState(syncPosition); if(syncStateNarrow!=syncProcessor::MODEDETECT) { usingWide=false; syncWideProc.setEnabled(false); syncProcPtr=&syncNarrowProc; } else { syncProcPtr=NULL; syncState=syncProcessor::MODEDETECT; if(SSTVState!=HUNTING) { switchState(HUNTING); } } } if(syncProcPtr) { syncState=syncProcPtr->getSyncState(syncPosition); } if((syncProcPtr!=0) && (syncProcPtr->getSyncState(syncPosition)==syncProcessor::SYNCLOST)) { switchState(SYNCLOST); } switch (SSTVState) { case HUNTING: if(syncProcPtr==NULL) { stce= new rxSSTVStatusEvent(QString("No sync")); QApplication::postEvent( dispatcherPtr, stce ); // Qt will delete it when done advanceBuffers(); break; // no sync } stce= new rxSSTVStatusEvent(QString("Receiving ")+getSSTVModeNameLong(syncProcPtr->getMode())); lastUsedModeStr=getSSTVModeNameShort(syncProcPtr->getMode()); QApplication::postEvent( dispatcherPtr, stce ); // Qt will delete it when done // fall trough for first processing switchState(SLANTADJUST); // for logging // clear the call received via fskID emit (resetCall()); case SLANTADJUST: sampleCounterLatch=syncProcPtr->sampleCounter; //remember where we've got // ri=bufferVideoDemod.getReadIndex(); // addToLog(QString("rxFunctions: sampleCounterLatch= %1,readIndex=%2").arg(sampleCounterLatch).arg(ri),LOGRXFUNC); block=(syncPosition)/RXSTRIPE; bufferVideoDemod.rewind(syncProcPtr->sampleCounter-block*RXSTRIPE); // ri=bufferVideoDemod.getReadIndex(); // addToLog(QString("sc_rewind: block=%1,new readIndex= %2").arg(block).arg(ri),LOGRXFUNC); syncProcPtr->sampleCounter=block*RXSTRIPE; syncProcPtr->currentModePtr->setRxSampleCounter(syncProcPtr->sampleCounter); syncProcPtr->currentModePtr->redrawFast(true); syncProcPtr->currentModePtr->process(bufferVideoDemod.readPointer(),syncPosition-syncProcPtr->sampleCounter,true); // scopeViewerData->addData(SCDATA2,bufferVideoDemod.readPointer(),syncProcPtr->sampleCounter,RXSTRIPE); // addToLog(QString("slant scope add demodIdx=%1; syncProcPtr->sampleCounter=%2").arg(bufferVideoDemod.getReadIndex()).arg(syncProcPtr->sampleCounter),LOGRXFUNC); #ifndef QT_NO_DEBUG scopeViewerData->addData(SCDATA3,syncProcPtr->currentModePtr->debugStatePtr,syncProcPtr->sampleCounter,RXSTRIPE); #endif addToLog(QString("rxFunctions: currentMode pos:=%1, syncProcPtr->sampleCounter %2").arg(syncPosition-syncProcPtr->sampleCounter).arg(syncProcPtr->sampleCounter),LOGRXFUNC); // addToLog(QString("after Current mode set: %1,syncProcPtr->sampleCounter: %2").arg(rxHoldingBuffer.getReadIndex()).arg(syncProcPtr->sampleCounter),LOGRXFUNC); while(syncProcPtr->sampleCounter<sampleCounterLatch) { bufferVideoDemod.skip(RXSTRIPE); syncProcPtr->sampleCounter+=RXSTRIPE; // addToLog(QString("loop readIndex: %1,syncProcPtr->sampleCounter: %2").arg(rxHoldingBuffer.getReadIndex()).arg(syncProcPtr->sampleCounter),LOGRXFUNC); syncProcPtr->currentModePtr->process(bufferVideoDemod.readPointer()); // scopeViewerData->addData(SCDATA2,bufferVideoDemod.readPointer(),syncProcPtr->sampleCounter,RXSTRIPE); #ifndef QT_NO_DEBUG scopeViewerData->addData(SCDATA3,syncProcPtr->currentModePtr->debugStatePtr,syncProcPtr->sampleCounter,RXSTRIPE); #endif } addToLog(QString("end loop readIndex: %1,syncProcPtr->sampleCounter: %2").arg(bufferVideoDemod.getReadIndex()).arg(syncProcPtr->sampleCounter),LOGRXFUNC); syncProcPtr->currentModePtr->redrawFast(false); syncProcPtr->recalculateMatchArray(); switchState(PROCESSING); advanceBuffers(); break; case PROCESSING: if(syncState!=syncProcessor::INSYNC) { switchState(END); } else if(syncProcPtr->retraceFlag) { addToLog(QString("retrace detected"),LOGRXFUNC); saveImage(); // addToLog(QString("before rewind readIndex:=%1 sampleCounter:=%2").arg(bufferVideoDemod.getReadIndex()).arg(syncProcPtr->sampleCounter),LOGRXFUNC); rewindBuffers(8*RXSTRIPE); syncProcPtr->resetRetraceFlag(); resetParams(false); // addToLog(QString("after resetParms readIndex:=%1 sampleCounter:=%2").arg(bufferVideoDemod.getReadIndex()).arg(syncProcPtr->sampleCounter),LOGRXFUNC); break; } else { if(syncProcPtr->currentModePtr->process(bufferVideoDemod.readPointer())==modeBase::MBENDOFIMAGE) { switchState(END); } } if(syncProcPtr->hasNewClock()) { syncProcPtr->currentModePtr->init(syncProcPtr->getNewClock()); switchState(SLANTADJUST); } #ifndef QT_NO_DEBUG scopeViewerData->addData(SCDATA3,syncProcPtr->currentModePtr->debugStatePtr,syncProcPtr->sampleCounter,RXSTRIPE); #endif advanceBuffers(); if(syncProcPtr->tempOutOfSync) { bufferIdx=bufferVideoDemod.getReadIndex(); switchState(WAITFORSYNC); } break; case WAITFORSYNC: { if(!(syncState==syncProcessor::INSYNC)) { switchState(END); } else if(syncProcPtr->retraceFlag) { addToLog(QString("retrace detected"),LOGRXFUNC); saveImage(); // addToLog(QString("before rewind readIndex:=%1 sampleCounter:=%2").arg(bufferVideoDemod.getReadIndex()).arg(syncProcPtr->sampleCounter),LOGRXFUNC); rewindBuffers(8*RXSTRIPE); syncProcPtr->resetRetraceFlag(); resetParams(false); // addToLog(QString("after resetParms readIndex:=%1 sampleCounter:=%2").arg(bufferVideoDemod.getReadIndex()).arg(syncProcPtr->sampleCounter),LOGRXFUNC); break; } else { currentIdx=bufferVideoDemod.getReadIndex(); if(!syncProcPtr->tempOutOfSync) { bufferVideoDemod.setReadIndex(bufferIdx); while(bufferVideoDemod.getReadIndex()!=currentIdx) { if(syncProcPtr->currentModePtr->process(bufferVideoDemod.readPointer())==modeBase::MBENDOFIMAGE) { switchState(END); } bufferVideoDemod.skip(RXSTRIPE); } if(syncProcPtr->currentModePtr->process(bufferVideoDemod.readPointer())==modeBase::MBENDOFIMAGE) { switchState(END); } switchState(PROCESSING); } } advanceBuffers(); break; } case RESTART: resetParams(true); break; case SYNCLOST: saveImage(); diff=(syncProcPtr->sampleCounter-syncProcPtr->lastValidSyncCounter)/RXSTRIPE; addToLog(QString("rewind after synclost %1").arg(diff),LOGRXFUNC); rewindBuffers(diff*RXSTRIPE); syncProcPtr->resetRetraceFlag(); resetParams(false); break; case WAIT: break; case END: saveImage(); resetParams(false); // will set state to HUNTING advanceBuffers(); break; } }