MixerCurve::MixerCurve(QWidget *parent) : QFrame(parent), m_mixerUI(new Ui::MixerCurve) { m_mixerUI->setupUi(this); // setup some convienence pointers m_curve = m_mixerUI->CurveWidget; m_settings = m_mixerUI->CurveSettings; m_mixerUI->SettingsGroup->hide(); // create our spin delegate m_spinDelegate = new DoubleSpinDelegate(); // set the default mixer type setMixerType(MixerCurve::MIXERCURVE_THROTTLE); // paint the ui UpdateCurveUI(); // wire up our signals connect(m_mixerUI->CurveType, SIGNAL(currentIndexChanged(int)), this, SLOT(CurveTypeChanged())); connect(m_mixerUI->ResetCurve, SIGNAL(clicked()), this, SLOT(ResetCurve())); connect(m_mixerUI->PopupCurve, SIGNAL(clicked()), this, SLOT(PopupCurve())); connect(m_mixerUI->GenerateCurve, SIGNAL(clicked()), this, SLOT(GenerateCurve())); connect(m_curve, SIGNAL(curveUpdated()), this, SLOT(UpdateSettingsTable())); connect(m_settings, SIGNAL(cellChanged(int, int)), this, SLOT(SettingsTableChanged())); connect(m_mixerUI->CurveMin, SIGNAL(valueChanged(double)), this, SLOT(CurveMinChanged(double))); connect(m_mixerUI->CurveMax, SIGNAL(valueChanged(double)), this, SLOT(CurveMaxChanged(double))); connect(m_mixerUI->CurveStep, SIGNAL(valueChanged(double)), this, SLOT(GenerateCurve())); }
void MixerCurve::CommandActivated(MixerNode* node) { QString name = (node) ? node->getName() : "Reset"; if (name == "Reset") { ResetCurve(); m_curve->showCommands(false); } else if (name == "Commands") { } else if (name == "Popup" ) { PopupCurve(); } else if (name == "Linear") { m_mixerUI->CurveType->setCurrentIndex(m_mixerUI->CurveType->findText("Linear")); } else if (name == "Log") { m_mixerUI->CurveType->setCurrentIndex(m_mixerUI->CurveType->findText("Log")); } else if (name == "Exp") { m_mixerUI->CurveType->setCurrentIndex(m_mixerUI->CurveType->findText("Exp")); } else if (name == "Flat") { m_mixerUI->CurveType->setCurrentIndex(m_mixerUI->CurveType->findText("Flat")); } else if (name == "Step") { m_mixerUI->CurveType->setCurrentIndex(m_mixerUI->CurveType->findText("Step")); } else if (name == "MinPlus") { m_mixerUI->CurveMin->stepUp(); } else if (name == "MinMinus") { m_mixerUI->CurveMin->stepDown(); } else if (name == "MaxPlus") { m_mixerUI->CurveMax->stepUp(); } else if (name == "MaxMinus"){ m_mixerUI->CurveMax->stepDown(); } else if (name == "StepPlus") { m_mixerUI->CurveStep->stepUp(); m_curve->setCommandText("StepValue", QString("%0").arg(getCurveStep())); } else if (name == "StepMinus") { m_mixerUI->CurveStep->stepDown(); m_curve->setCommandText("StepValue", QString("%0").arg(getCurveStep())); } GenerateCurve(); }
MixerCurve::MixerCurve(QWidget *parent) : QFrame(parent), m_mixerUI(new Ui::MixerCurvePlot) { m_mixerUI->setupUi(this); // setup some convienence pointers m_curve = m_mixerUI->CurveWidget; m_settings = m_mixerUI->CurveSettings; // by default mixcurve isn't used for curve2source m_mixerUI->CBCurve2Source->hide(); m_mixerUI->SettingsGroup->hide(); m_curve->showCommands(false); m_curve->showCommand("Reset", false); m_curve->showCommand("Popup", false); m_curve->showCommand("Commands", false); // create our spin delegate m_spinDelegate = new DoubleSpinDelegate(); // set the default mixer type setMixerType(MixerCurve::MIXERCURVE_THROTTLE); // setup and turn off advanced mode CommandActivated(); // paint the ui UpdateCurveUI(); // wire up our signals connect(m_mixerUI->CurveType, SIGNAL(currentIndexChanged(int)), this, SLOT(CurveTypeChanged())); connect(m_mixerUI->ResetCurve, SIGNAL(clicked()), this, SLOT(ResetCurve())); connect(m_mixerUI->PopupCurve, SIGNAL(clicked()),this,SLOT(PopupCurve())); connect(m_mixerUI->GenerateCurve, SIGNAL(clicked()), this, SLOT(GenerateCurve())); connect(m_curve, SIGNAL(curveUpdated()), this, SLOT(UpdateSettingsTable())); connect(m_curve, SIGNAL(commandActivated(MixerNode*)),this, SLOT(CommandActivated(MixerNode*))); connect(m_settings, SIGNAL(cellChanged(int,int)), this, SLOT(SettingsTableChanged())); connect(m_mixerUI->CurveMin, SIGNAL(valueChanged(double)), this, SLOT(CurveMinChanged(double))); connect(m_mixerUI->CurveMax, SIGNAL(valueChanged(double)), this, SLOT(CurveMaxChanged(double))); connect(m_mixerUI->CurveStep, SIGNAL(valueChanged(double)), this, SLOT(GenerateCurve())); }