void ptToolBox::createMenuActions() { if (FBlockAction) return; // actions already exist. FBlockAction = new QAction(this); connect(FBlockAction, SIGNAL(triggered()), this, SLOT(toggleBlocked())); FBlockAction->setIcon(QIcon(*Theme->ptIconCircleRed)); FBlockAction->setIconVisibleInMenu(true); FResetAction = new QAction(QIcon(*Theme->ptIconReset), tr("&Reset"), this); connect(FResetAction, SIGNAL(triggered()), this, SLOT(resetFilter())); FResetAction->setIconVisibleInMenu(true); FSaveAction = new QAction(QIcon(*Theme->ptIconSavePreset), tr("&Save preset"), this); connect(FSaveAction, SIGNAL(triggered()), this, SLOT(savePreset())); FSaveAction->setIconVisibleInMenu(true); FAppendAction = new QAction(QIcon(*Theme->ptIconAppendPreset), tr("&Append preset"), this); connect(FAppendAction, SIGNAL(triggered()), this, SLOT(appendPreset())); FAppendAction->setIconVisibleInMenu(true); FFavAction = new QAction(this); connect(FFavAction, SIGNAL(triggered()), this, SLOT(toggleFavourite())); FFavAction->setIconVisibleInMenu(true); FHideAction = new QAction(QIcon(*Theme->ptIconCrossRed), tr("&Hide"), this); connect(FHideAction, SIGNAL(triggered()), this, SLOT(toggleHidden())); FHideAction->setIconVisibleInMenu(true); }
void KinectV2Classifier::eventSave(ofxControlButtonEventArgs & evt) { string filename = ofSystemTextBoxDialog("Name of your preset"); if (filename != "") { savePreset(filename+".xml"); } }
void StatusDialog::on_saveButton_clicked() { StatusPresetCaption caption_dialog; caption_dialog.setWindowTitle(tr("Preset caption")); caption_dialog.setWindowIcon(m_icon_manager.getIcon("statuses")); caption_dialog.setButtonIcon(m_icon_manager.getIcon("apply"), m_icon_manager.getIcon("cancel")); if ( QtopiaApplication::execDialog(&caption_dialog) ) { savePreset(caption_dialog.getCaption()); } }
// Check whether current preset may be reset. bool synthv1widget_preset::queryPreset (void) { if (m_iInitPreset == 0) return true; synthv1_config *pConfig = synthv1_config::getInstance(); if (pConfig == NULL) return false; if (m_iDirtyPreset > 0) { const QString sPreset(pConfig->sPreset); if (sPreset.isEmpty()) { if (QMessageBox::warning(this, tr("Warning") + " - " SYNTHV1_TITLE, tr("Some parameters have been changed.\n\n" "Do you want to discard the changes?"), QMessageBox::Discard | QMessageBox::Cancel) == QMessageBox::Cancel) return false; } else { switch (QMessageBox::warning(this, tr("Warning") + " - " SYNTHV1_TITLE, tr("Some preset parameters have been changed:\n\n" "\"%1\".\n\nDo you want to save the changes?") .arg(sPreset), QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel)) { case QMessageBox::Save: savePreset(sPreset); // Fall thru... case QMessageBox::Discard: break; default: // Cancel... setPreset(sPreset); return false; } } } return true; }
void PitchBendSequenceDialog::saveSettings() { const int preset = m_sequencePreset->currentIndex(); /* Only one setting (sequence_preset) is global; the other settings pertain to one specific preset. */ { // Put "settings" in its own scope to prevent accidental use // after endGroup. QSettings settings; settings.beginGroup(PitchBendSequenceConfigGroup); settings.setValue("sequence_preset", preset); settings.endGroup(); } if (preset >= m_numBuiltins) { savePreset(preset); } }
void VstPluginWindow::menuItemSelected (int menuItemID, int topLevelMenuIndex) { if ((menuItemID & PluginMenuCommandIDMask) == PluginMenuCommandIDMask) specialEditor->menuItemSelected(combinedMenuNames[topLevelMenuIndex], (menuItemID & ~PluginMenuCommandIDMask)); else if (topLevelMenuIndex == combinedMenuNames.indexOf(CommandCategories::presets)) { switch (menuItemID) { case 1: loadPreset (); break; case 2: savePreset (); break; default: if (menuItemID >= 100 && menuItemID < (100 + plugin->getNumPrograms ())) { plugin->setCurrentProgram (menuItemID - 100); updateParameters (); } } } else if (topLevelMenuIndex == combinedMenuNames.indexOf(CommandCategories::options)) { if (menuItemID == 1) { bool keysVisible = plugin->getBoolValue (PROP_WINDOWVISIBLEMIDIKEY, true); if (content) content->activateMidiKeyboard (! keysVisible); plugin->setValue (PROP_WINDOWVISIBLEMIDIKEY, ! keysVisible); } } toFront (false); }
void Equalizer::createEvents() { connect(defaultButton, SIGNAL(clicked()), this, SLOT(defaultEqualizer())); connect(okButton, SIGNAL(clicked()), this, SLOT(ok())); connect(cancelButton, SIGNAL(clicked()), this, SLOT(close())); connect(newButton, SIGNAL(clicked()), this, SLOT(newPreset())); connect(editButton, SIGNAL(clicked()), this, SLOT(editPreset())); connect(saveButton, SIGNAL(clicked()), this, SLOT(savePreset())); connect(deleteButton, SIGNAL(clicked()), this, SLOT(deletePreset())); connect(presetCombo, SIGNAL(activated(int)), this, SLOT(loadPreset())); connect(presetCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(indexChanged())); for (int i = 0; i < 16; i++) { connect(eq[i], &QSlider::valueChanged, [this,i](int arg) { equalizerChanged(i, arg); eqDb[i]->setText(QString("%1dB").arg(arg)); }); } }
void LLWLParamManager::update(LLViewerCamera * cam) { LLFastTimer ftm(LLFastTimer::FTM_UPDATE_WLPARAM); // update clouds, sun, and general mCurParams.updateCloudScrolling(); // update only if running if(mAnimator.mIsRunning) { mAnimator.update(mCurParams); } // update the shaders and the menu propagateParameters(); // sync menus if they exist if(LLFloaterWindLight::isOpen()) { LLFloaterWindLight::instance()->syncMenu(); } if(LLFloaterDayCycle::isOpen()) { LLFloaterDayCycle::instance()->syncMenu(); } if(LLFloaterEnvSettings::isOpen()) { LLFloaterEnvSettings::instance()->syncMenu(); } F32 camYaw = cam->getYaw(); stop_glerror(); // *TODO: potential optimization - this block may only need to be // executed some of the time. For example for water shaders only. { F32 camYawDelta = mSunDeltaYaw * DEG_TO_RAD; LLVector3 lightNorm3(mLightDir); lightNorm3 *= LLQuaternion(-(camYaw + camYawDelta), LLVector3(0.f, 1.f, 0.f)); mRotatedLightDir = LLVector4(lightNorm3, 0.f); LLViewerShaderMgr::shader_iter shaders_iter, end_shaders; end_shaders = LLViewerShaderMgr::instance()->endShaders(); for(shaders_iter = LLViewerShaderMgr::instance()->beginShaders(); shaders_iter != end_shaders; ++shaders_iter) { if (shaders_iter->mProgramObject != 0 && (gPipeline.canUseWindLightShaders() || shaders_iter->mShaderGroup == LLGLSLShader::SG_WATER)) { shaders_iter->mUniformsDirty = TRUE; } } } //Mix windlight settings if needed if(sNeedsMix == TRUE) { if(sMixSet == NULL) { sNeedsMix = FALSE; return; } if (wlSmoothTransitionTimer.getElapsedTimeF32() >= (sMixTime / 100)) //100 steps inbetween { wlSmoothTransitionTimer.reset(); mCurParams.mix(mCurParams, *sMixSet, sMixCount / 100);//.01 to 1.0 } sMixCount++; if((sMixCount / 100) == 1) { //All done sNeedsMix = FALSE; std::string wlSkyPresetName = "(Region settings)"; mCurParams.mName = wlSkyPresetName; removeParamSet( wlSkyPresetName, true ); addParamSet( wlSkyPresetName, mCurParams ); savePreset( wlSkyPresetName ); mAnimator.mIsRunning = false; mAnimator.mUseLindenTime = false; loadPreset( wlSkyPresetName, true ); sMixSet = NULL; } } }
void EffectRack::menuRequested(QListWidgetItem* it)/*{{{*/ { if (it == 0 || track == 0) return; RackSlot* curitem = (RackSlot*) it; Pipeline* epipe = track->efxPipe(); int idx = row(curitem); QString name; bool mute = false; bool nativeGui = false; Pipeline* pipe = track->efxPipe(); if (pipe) { name = pipe->name(idx); mute = (pipe->isActive(idx) == false); nativeGui = pipe->hasNativeGui(idx); } //enum { NEW, CHANGE, UP, DOWN, REMOVE, BYPASS, SHOW, SAVE }; enum { NEW, CHANGE, UP, DOWN, REMOVE, BYPASS, SHOW, SHOW_NATIVE, SAVE }; QMenu* menu = new QMenu; QAction* newAction = menu->addAction(tr("new")); QAction* changeAction = menu->addAction(tr("change")); QAction* upAction = menu->addAction(QIcon(*upIcon), tr("move up")); //, UP, UP); QAction* downAction = menu->addAction(QIcon(*downIcon), tr("move down")); //, DOWN, DOWN); QAction* removeAction = menu->addAction(tr("remove")); //, REMOVE, REMOVE); QAction* bypassAction = menu->addAction(tr("bypass")); //, BYPASS, BYPASS); QAction* showGuiAction = menu->addAction(tr("show gui")); //, SHOW, SHOW); QAction* showNativeGuiAction = menu->addAction(tr("show native gui")); //, SHOW_NATIVE, SHOW_NATIVE); QAction* saveAction = menu->addAction(tr("save preset")); newAction->setData(NEW); changeAction->setData(CHANGE); upAction->setData(UP); downAction->setData(DOWN); removeAction->setData(REMOVE); bypassAction->setData(BYPASS); showGuiAction->setData(SHOW); showNativeGuiAction->setData(SHOW_NATIVE); saveAction->setData(SAVE); bypassAction->setCheckable(true); showGuiAction->setCheckable(true); showNativeGuiAction->setCheckable(true); bypassAction->setChecked(mute); showGuiAction->setChecked(pipe->guiVisible(idx)); showNativeGuiAction->setEnabled(nativeGui); if (nativeGui) showNativeGuiAction->setChecked(pipe->nativeGuiVisible(idx)); if (pipe->empty(idx)) { menu->removeAction(changeAction); menu->removeAction(saveAction); upAction->setEnabled(false); downAction->setEnabled(false); removeAction->setEnabled(false); bypassAction->setEnabled(false); showGuiAction->setEnabled(false); showNativeGuiAction->setEnabled(false); } else { menu->removeAction(newAction); if (idx == 0) upAction->setEnabled(true); if (idx == ((int)epipe->size() - 1)) downAction->setEnabled(false); } QPoint pt = QCursor::pos(); QAction* act = menu->exec(pt, 0); //delete menu; if (!act) { delete menu; return; } int sel = act->data().toInt(); delete menu; int pdepth = epipe->size(); switch (sel) { case NEW: { choosePlugin(it); break; } case CHANGE: { choosePlugin(it, true); break; } case REMOVE: { BasePlugin* oldPlugin = (*epipe)[idx]; oldPlugin->setActive(false); oldPlugin->aboutToRemove(); if(debugMsg) qCritical("Plugin to remove now and here"); audio->msgAddPlugin(track, idx, 0); song->dirty = true; break; } case BYPASS: { bool flag = !pipe->isActive(idx); pipe->setActive(idx, flag); break; } case SHOW: { bool flag = !pipe->guiVisible(idx); pipe->showGui(idx, flag); break; } case SHOW_NATIVE: { printf("Show native GUI called\n"); bool flag = !pipe->nativeGuiVisible(idx); pipe->showNativeGui(idx, flag); break; } case UP: if (idx > 0) { setCurrentItem(item(idx - 1)); pipe->move(idx, true); } break; case DOWN: if (idx < pdepth) { setCurrentItem(item(idx + 1)); pipe->move(idx, false); } break; case SAVE: savePreset(idx); break; } //Already done on songChanged //updateContents(); song->update(SC_RACK); }/*}}}*/
VestigeInstrumentView::VestigeInstrumentView( Instrument * _instrument, QWidget * _parent ) : InstrumentView( _instrument, _parent ), lastPosInMenu (0) { if( s_artwork == NULL ) { s_artwork = new QPixmap( PLUGIN_NAME::getIconPixmap( "artwork" ) ); } m_openPluginButton = new pixmapButton( this, "" ); m_openPluginButton->setCheckable( false ); m_openPluginButton->setCursor( Qt::PointingHandCursor ); m_openPluginButton->move( 216, 81 ); m_openPluginButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "select_file_active" ) ); m_openPluginButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "select_file" ) ); connect( m_openPluginButton, SIGNAL( clicked() ), this, SLOT( openPlugin() ) ); toolTip::add( m_openPluginButton, tr( "Open other VST-plugin" ) ); m_openPluginButton->setWhatsThis( tr( "Click here, if you want to open another VST-plugin. After " "clicking on this button, a file-open-dialog appears " "and you can select your file." ) ); m_managePluginButton = new pixmapButton( this, "" ); m_managePluginButton->setCheckable( false ); m_managePluginButton->setCursor( Qt::PointingHandCursor ); m_managePluginButton->move( 216, 101 ); m_managePluginButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "track_op_menu_active" ) ); m_managePluginButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "track_op_menu" ) ); connect( m_managePluginButton, SIGNAL( clicked() ), this, SLOT( managePlugin() ) ); toolTip::add( m_managePluginButton, tr( "Control VST-plugin from LMMS host" ) ); m_managePluginButton->setWhatsThis( tr( "Click here, if you want to control VST-plugin from host." ) ); m_openPresetButton = new pixmapButton( this, "" ); m_openPresetButton->setCheckable( false ); m_openPresetButton->setCursor( Qt::PointingHandCursor ); m_openPresetButton->move( 200, 224 ); m_openPresetButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "project_open", 20, 20 ) ); m_openPresetButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "project_open", 20, 20 ) ); connect( m_openPresetButton, SIGNAL( clicked() ), this, SLOT( openPreset() ) ); toolTip::add( m_openPresetButton, tr( "Open VST-plugin preset" ) ); m_openPresetButton->setWhatsThis( tr( "Click here, if you want to open another *.fxp, *.fxb VST-plugin preset." ) ); m_rolLPresetButton = new pixmapButton( this, "" ); m_rolLPresetButton->setCheckable( false ); m_rolLPresetButton->setCursor( Qt::PointingHandCursor ); m_rolLPresetButton->move( 190, 201 ); m_rolLPresetButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "stepper-left-press" ) ); m_rolLPresetButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "stepper-left" ) ); connect( m_rolLPresetButton, SIGNAL( clicked() ), this, SLOT( previousProgram() ) ); toolTip::add( m_rolLPresetButton, tr( "Previous (-)" ) ); m_rolLPresetButton->setShortcut( Qt::Key_Minus ); m_rolLPresetButton->setWhatsThis( tr( "Click here, if you want to switch to another VST-plugin preset program." ) ); m_savePresetButton = new pixmapButton( this, "" ); m_savePresetButton->setCheckable( false ); m_savePresetButton->setCursor( Qt::PointingHandCursor ); m_savePresetButton->move( 224, 224 ); m_savePresetButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "project_save", 20, 20 ) ); m_savePresetButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "project_save", 20, 20 ) ); connect( m_savePresetButton, SIGNAL( clicked() ), this, SLOT( savePreset() ) ); toolTip::add( m_savePresetButton, tr( "Save preset" ) ); m_savePresetButton->setWhatsThis( tr( "Click here, if you want to save current VST-plugin preset program." ) ); m_rolRPresetButton = new pixmapButton( this, "" ); m_rolRPresetButton->setCheckable( false ); m_rolRPresetButton->setCursor( Qt::PointingHandCursor ); m_rolRPresetButton->move( 209, 201 ); m_rolRPresetButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "stepper-right-press" ) ); m_rolRPresetButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "stepper-right" ) ); connect( m_rolRPresetButton, SIGNAL( clicked() ), this, SLOT( nextProgram() ) ); toolTip::add( m_rolRPresetButton, tr( "Next (+)" ) ); m_rolRPresetButton->setShortcut( Qt::Key_Plus ); m_rolRPresetButton->setWhatsThis( tr( "Click here, if you want to switch to another VST-plugin preset program." ) ); m_selPresetButton = new QPushButton( tr( "" ), this ); m_selPresetButton->setGeometry( 228, 201, 16, 16 ); QMenu *menu = new QMenu; connect( menu, SIGNAL( aboutToShow() ), this, SLOT( updateMenu() ) ); m_selPresetButton->setIcon( PLUGIN_NAME::getIconPixmap( "stepper-down" ) ); m_selPresetButton->setWhatsThis( tr( "Click here to select presets that are currently loaded in VST." ) ); m_selPresetButton->setMenu(menu); m_toggleGUIButton = new QPushButton( tr( "Show/hide GUI" ), this ); m_toggleGUIButton->setGeometry( 20, 130, 200, 24 ); m_toggleGUIButton->setIcon( embed::getIconPixmap( "zoom" ) ); m_toggleGUIButton->setFont( pointSize<8>( m_toggleGUIButton->font() ) ); connect( m_toggleGUIButton, SIGNAL( clicked() ), this, SLOT( toggleGUI() ) ); m_toggleGUIButton->setWhatsThis( tr( "Click here to show or hide the graphical user interface " "(GUI) of your VST-plugin." ) ); QPushButton * note_off_all_btn = new QPushButton( tr( "Turn off all " "notes" ), this ); note_off_all_btn->setGeometry( 20, 160, 200, 24 ); note_off_all_btn->setIcon( embed::getIconPixmap( "state_stop" ) ); note_off_all_btn->setFont( pointSize<8>( note_off_all_btn->font() ) ); connect( note_off_all_btn, SIGNAL( clicked() ), this, SLOT( noteOffAll() ) ); setAcceptDrops( true ); _instrument2 = _instrument; _parent2 = _parent; }
void synthv1widget_preset::savePreset (void) { savePreset(m_pComboBox->currentText()); }
// Constructor. synthv1widget_preset::synthv1widget_preset ( QWidget *pParent ) : QWidget (pParent) { m_pNewButton = new QToolButton(); m_pOpenButton = new QToolButton(); m_pComboBox = new QComboBox(); m_pSaveButton = new QToolButton(); m_pDeleteButton = new QToolButton(); m_pResetButton = new QToolButton(); m_pNewButton->setIcon(QIcon(":/images/presetNew.png")); m_pOpenButton->setIcon(QIcon(":/images/presetOpen.png")); m_pComboBox->setEditable(true); m_pComboBox->setMinimumWidth(240); #if QT_VERSION >= 0x040200 m_pComboBox->setCompleter(NULL); #endif m_pComboBox->setInsertPolicy(QComboBox::NoInsert); m_pSaveButton->setIcon(QIcon(":/images/presetSave.png")); m_pDeleteButton->setIcon(QIcon(":/images/presetDelete.png")); m_pResetButton->setText("Reset"); m_pNewButton->setToolTip(tr("New Preset")); m_pOpenButton->setToolTip(tr("Open Preset")); m_pSaveButton->setToolTip(tr("Save Preset")); m_pDeleteButton->setToolTip(tr("Delete Preset")); m_pResetButton->setToolTip(tr("Reset Preset")); QHBoxLayout *pHBoxLayout = new QHBoxLayout(); pHBoxLayout->setMargin(2); pHBoxLayout->setSpacing(4); pHBoxLayout->addWidget(m_pNewButton); pHBoxLayout->addWidget(m_pOpenButton); pHBoxLayout->addWidget(m_pComboBox); pHBoxLayout->addWidget(m_pSaveButton); pHBoxLayout->addWidget(m_pDeleteButton); pHBoxLayout->addSpacing(4); pHBoxLayout->addWidget(m_pResetButton); QWidget::setLayout(pHBoxLayout); m_iInitPreset = 0; m_iDirtyPreset = 0; // UI signal/slot connections... QObject::connect(m_pNewButton, SIGNAL(clicked()), SLOT(newPreset())); QObject::connect(m_pOpenButton, SIGNAL(clicked()), SLOT(openPreset())); QObject::connect(m_pComboBox, SIGNAL(editTextChanged(const QString&)), SLOT(stabilizePreset())); QObject::connect(m_pComboBox, SIGNAL(activated(const QString&)), SLOT(activatePreset(const QString&))); QObject::connect(m_pSaveButton, SIGNAL(clicked()), SLOT(savePreset())); QObject::connect(m_pDeleteButton, SIGNAL(clicked()), SLOT(deletePreset())); QObject::connect(m_pResetButton, SIGNAL(clicked()), SLOT(resetPreset())); refreshPreset(); stabilizePreset(); }
void ofApp::exit() { savePreset(); }
VstEffectControlDialog::VstEffectControlDialog( VstEffectControls * _ctl ) : EffectControlDialog( _ctl ), m_pluginWidget( NULL ), m_plugin( NULL ), tbLabel( NULL ) { QGridLayout * l = new QGridLayout( this ); l->setContentsMargins( 10, 10, 10, 10 ); l->setVerticalSpacing( 2 ); l->setHorizontalSpacing( 2 ); if( _ctl != NULL && _ctl->m_effect != NULL && _ctl->m_effect->m_plugin != NULL ) { m_plugin = _ctl->m_effect->m_plugin; m_plugin->showEditor( NULL, true ); m_pluginWidget = m_plugin->pluginWidget(); #ifdef LMMS_BUILD_WIN32 if( !m_pluginWidget ) { m_pluginWidget = m_plugin->pluginWidget( false ); } #endif } if( m_pluginWidget ) { setWindowTitle( m_pluginWidget->windowTitle() ); setMinimumWidth( 250 ); QPushButton * btn = new QPushButton( tr( "Show/hide" ) ); btn->setCheckable( true ); connect( btn, SIGNAL( toggled( bool ) ), m_pluginWidget, SLOT( setVisible( bool ) ) ); emit btn->click(); btn->setMinimumWidth( 78 ); btn->setMaximumWidth( 78 ); btn->setMinimumHeight( 24 ); btn->setMaximumHeight( 24 ); m_managePluginButton = new pixmapButton( this, "" ); m_managePluginButton->setCheckable( false ); m_managePluginButton->setCursor( Qt::PointingHandCursor ); m_managePluginButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "track_op_menu" ) ); m_managePluginButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "track_op_menu" ) ); connect( m_managePluginButton, SIGNAL( clicked() ), _ctl, SLOT( managePlugin() ) ); toolTip::add( m_managePluginButton, tr( "Control VST-plugin from LMMS host" ) ); m_managePluginButton->setWhatsThis( tr( "Click here, if you want to control VST-plugin from host." ) ); m_managePluginButton->setMinimumWidth( 21 ); m_managePluginButton->setMaximumWidth( 21 ); m_managePluginButton->setMinimumHeight( 21 ); m_managePluginButton->setMaximumHeight( 21 ); m_openPresetButton = new pixmapButton( this, "" ); m_openPresetButton->setCheckable( false ); m_openPresetButton->setCursor( Qt::PointingHandCursor ); m_openPresetButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "stepper-up-press" ) ); m_openPresetButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "stepper-up" ) ); connect( m_openPresetButton, SIGNAL( clicked() ), _ctl, SLOT( openPreset() ) ); toolTip::add( m_openPresetButton, tr( "Open VST-plugin preset" ) ); m_openPresetButton->setWhatsThis( tr( "Click here, if you want to open another *.fxp, *.fxb VST-plugin preset." ) ); m_openPresetButton->setMinimumWidth( 16 ); m_openPresetButton->setMaximumWidth( 16 ); m_openPresetButton->setMinimumHeight( 16 ); m_openPresetButton->setMaximumHeight( 16 ); m_rolLPresetButton = new pixmapButton( this, "" ); m_rolLPresetButton->setCheckable( false ); m_rolLPresetButton->setCursor( Qt::PointingHandCursor ); m_rolLPresetButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "stepper-left-press" ) ); m_rolLPresetButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "stepper-left" ) ); connect( m_rolLPresetButton, SIGNAL( clicked() ), _ctl, SLOT( rolrPreset() ) ); connect( m_rolLPresetButton, SIGNAL( clicked() ), this, SLOT( update() ) ); toolTip::add( m_rolLPresetButton, tr( "Previous (-)" ) ); m_rolLPresetButton->setShortcut( Qt::Key_Minus ); m_rolLPresetButton->setWhatsThis( tr( "Click here, if you want to switch to another VST-plugin preset program." ) ); m_rolLPresetButton->setMinimumWidth( 16 ); m_rolLPresetButton->setMaximumWidth( 16 ); m_rolLPresetButton->setMinimumHeight( 16 ); m_rolLPresetButton->setMaximumHeight( 16 ); m_rolRPresetButton = new pixmapButton( this, "" ); m_rolRPresetButton->setCheckable( false ); m_rolRPresetButton->setCursor( Qt::PointingHandCursor ); m_rolRPresetButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "stepper-right-press" ) ); m_rolRPresetButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "stepper-right" ) ); connect( m_rolRPresetButton, SIGNAL( clicked() ), _ctl, SLOT( rollPreset() ) ); connect( m_rolRPresetButton, SIGNAL( clicked() ), this, SLOT( update() ) ); toolTip::add( m_rolRPresetButton, tr( "Next (+)" ) ); m_rolRPresetButton->setShortcut( Qt::Key_Plus ); m_rolRPresetButton->setWhatsThis( tr( "Click here, if you want to switch to another VST-plugin preset program." ) ); m_rolRPresetButton->setMinimumWidth( 16 ); m_rolRPresetButton->setMaximumWidth( 16 ); m_rolRPresetButton->setMinimumHeight( 16 ); m_rolRPresetButton->setMaximumHeight( 16 ); _ctl->m_selPresetButton = new QPushButton( tr( "" ), this ); _ctl->m_selPresetButton->setCheckable( false ); _ctl->m_selPresetButton->setCursor( Qt::PointingHandCursor ); _ctl->m_selPresetButton->setIcon( PLUGIN_NAME::getIconPixmap( "stepper-down" ) ); _ctl->m_selPresetButton->setWhatsThis( tr( "Click here to select presets that are currently loaded in VST." ) ); _ctl->m_selPresetButton->setMenu(_ctl->menu); _ctl->m_selPresetButton->setMinimumWidth( 16 ); _ctl->m_selPresetButton->setMaximumWidth( 16 ); _ctl->m_selPresetButton->setMinimumHeight( 16 ); _ctl->m_selPresetButton->setMaximumHeight( 16 ); m_savePresetButton = new pixmapButton( this, "" ); m_savePresetButton->setCheckable( false ); m_savePresetButton->setCursor( Qt::PointingHandCursor ); m_savePresetButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "project_save", 21, 21 ) ); m_savePresetButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "project_save", 21, 21 ) ); connect( m_savePresetButton, SIGNAL( clicked() ), _ctl, SLOT( savePreset() ) ); toolTip::add( m_savePresetButton, tr( "Save preset" ) ); m_savePresetButton->setWhatsThis( tr( "Click here, if you want to save current VST-plugin preset program." ) ); m_savePresetButton->setMinimumWidth( 21 ); m_savePresetButton->setMaximumWidth( 21 ); m_savePresetButton->setMinimumHeight( 21 ); m_savePresetButton->setMaximumHeight( 21 ); int newSize = m_pluginWidget->width() + 20; newSize = (newSize < 250) ? 250 : newSize; QWidget* resize = new QWidget(this); resize->resize( newSize, 10 ); QWidget* space0 = new QWidget(this); space0->resize(8, 10); QWidget* space1 = new QWidget(this); space1->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); QFont f( "Arial", 10 ); l->addItem( new QSpacerItem( newSize - 20, 30, QSizePolicy::Fixed, QSizePolicy::Fixed ), 1, 0 ); l->addWidget( resize, 2, 0, 1, 1, Qt::AlignCenter ); l->addWidget( m_pluginWidget, 3, 0, 1, 1, Qt::AlignCenter ); l->setRowStretch( 5, 1 ); l->setColumnStretch( 1, 1 ); QToolBar * tb = new QToolBar( this ); tb->resize( newSize , 32 ); tb->addWidget(space0); tb->addWidget( m_rolLPresetButton ); tb->addWidget( m_rolRPresetButton ); tb->addWidget( _ctl->m_selPresetButton ); tb->addWidget( m_openPresetButton ); tb->addWidget( m_savePresetButton ); tb->addWidget( m_managePluginButton ); tb->addWidget( btn ); tb->addWidget(space1); tbLabel = new QLabel( tr( "Effect by: " ), this ); tbLabel->setFont( pointSize<7>( f ) ); tbLabel->setTextFormat(Qt::RichText); tbLabel->setAlignment( Qt::AlignTop | Qt::AlignLeft ); tb->addWidget( tbLabel ); } }
void ofxControlPanel::savePresetPrompt(ofxControlButtonEventArgs &e) { string name = ofSystemTextBoxDialog("Preset name"); savePreset(name); }
//*************************************************************************** Kwave::CurveWidget::CurveWidget(QWidget *parent) :QWidget(parent), m_width(0), m_height(0), m_curve(), m_menu(0), m_preset_menu(0), m_current(Kwave::Curve::NoPoint), m_last(Kwave::Curve::NoPoint), m_down(false), m_knob(), m_selected_knob() { KIconLoader icon_loader; // set the default curve m_curve.fromCommand(_("curve(linear,0,0,1,1)")); QPalette pal = palette(); pal.setColor(QPalette::Window, Qt::black); setPalette(pal); // create the pixmaps for the selected and non-selected knob m_knob = icon_loader.loadIcon(_("knob.xpm"), KIconLoader::Small); m_selected_knob = icon_loader.loadIcon(_("selectedknob.xpm"), KIconLoader::Small); // set up the context menu for the right mouse button m_menu = new QMenu(this); Q_ASSERT(m_menu); if (!m_menu) return; QMenu *interpolation = m_menu->addMenu(i18n("Interpolation")); Q_ASSERT(interpolation); if (!interpolation) return; m_menu->addSeparator(); QMenu *transform = m_menu->addMenu(i18n("Transform")); Q_ASSERT(transform); if (!transform) return; transform->addAction(i18n("Flip horizontal"), this, SLOT(HFlip())); transform->addAction(i18n("Flip vertical"), this, SLOT(VFlip())); transform->addSeparator(); transform->addAction(i18n("Into first half"), this, SLOT(firstHalf())); transform->addAction(i18n("Into second half"), this, SLOT(secondHalf())); QMenu *del = m_menu->addMenu(i18n("Delete")); Q_ASSERT(del); if (!del) return; m_menu->addAction(i18n("Fit In"), this, SLOT(scaleFit())); m_menu->addSeparator(); /* list of presets */ m_preset_menu = m_menu->addMenu(i18n("Presets")); Q_ASSERT(m_preset_menu); if (!m_preset_menu) return; loadPresetList(); connect(m_preset_menu, SIGNAL(triggered(QAction*)), this, SLOT(loadPreset(QAction*))); m_menu->addAction( icon_loader.loadIcon(_("document-export"), KIconLoader::Small), i18n("Save Preset"), this, SLOT(savePreset())); del->addAction( icon_loader.loadIcon(_("edit-delete"), KIconLoader::Small), i18n("Currently Selected Point"), this, SLOT(deleteLast()), QKeySequence::Delete); del->addAction(i18n("Every Second Point"), this, SLOT(deleteSecond())); QStringList types = Kwave::Interpolation::descriptions(true); int id = 0; foreach (const QString &text, types) { QAction *action = new QAction(interpolation); action->setText(text); action->setData(id++); interpolation->addAction(action); }
Equalizer_Dialog::Equalizer_Dialog(QWidget *parent) : QDialog(parent) { //! ----- setup Gui this->resize(435, 265); QVBoxLayout* verticalLayout = new QVBoxLayout(this); QHBoxLayout *horizontalLayout = new QHBoxLayout(); _comboBoxPreset = new QComboBox(this); QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); sizePolicy.setHeightForWidth(_comboBoxPreset->sizePolicy().hasHeightForWidth()); _comboBoxPreset->setSizePolicy(sizePolicy); horizontalLayout->addWidget(_comboBoxPreset); QToolButton *_presetSaveButton = new QToolButton(this); _presetSaveButton->setIcon(QIcon::fromTheme("document-save")); _presetSaveButton->setToolTip(tr("Save preset")); horizontalLayout->addWidget(_presetSaveButton); QToolButton *_presetDelButton = new QToolButton(this); _presetDelButton->setIcon(QIcon::fromTheme("edit-delete")); _presetDelButton->setToolTip(tr("Delete preset")); horizontalLayout->addWidget(_presetDelButton); verticalLayout->addLayout(horizontalLayout); QFrame *line = new QFrame(this); line->setFrameShape(QFrame::HLine); line->setFrameShadow(QFrame::Sunken); verticalLayout->addWidget(line); _enableCheckBox = new QCheckBox(this); _enableCheckBox->setText(tr("Enable equalizer")); verticalLayout->addWidget(_enableCheckBox); _slider_container = new QWidget(this); _slider_container->setEnabled(false); QSizePolicy sizePolicy1(QSizePolicy::Preferred, QSizePolicy::Expanding); sizePolicy1.setHorizontalStretch(0); sizePolicy1.setVerticalStretch(0); sizePolicy1.setHeightForWidth(_slider_container->sizePolicy().hasHeightForWidth()); _slider_container->setSizePolicy(sizePolicy1); _slider_container->setLayout(new QHBoxLayout() ); verticalLayout->addWidget(_slider_container); QWidget::setTabOrder(_comboBoxPreset, _presetSaveButton); //! ----- Add equalizer slider eqSliderPreamp = new EqualizerSlider("Pre-amp", _slider_container); connect(eqSliderPreamp, SIGNAL(valueChanged(int)), SLOT(equalizerChanged())); _slider_container->layout()->addWidget(eqSliderPreamp); QFrame* l = new QFrame(_slider_container); l->setFrameShape(QFrame::VLine); l->setFrameShadow(QFrame::Sunken); _slider_container->layout()->addWidget(l); for (int i=0 ; i < Equalizer::kBands ; ++i) { EqualizerSlider* eq = new EqualizerSlider(kGainText[i], _slider_container); eqSliderList[i] = eq; _slider_container->layout()->addWidget(eq); connect(eq, SIGNAL(valueChanged(int)), SLOT(equalizerChanged())); } //! ----- load Settings _settingChanged = false; restoreSettings(); //! ----- signals connection connect(_comboBoxPreset, SIGNAL(currentIndexChanged(QString)), SLOT(applyPreset(QString))); connect(_enableCheckBox, SIGNAL(toggled(bool)), this, SLOT(enableChanged(bool))); connect(_presetSaveButton, SIGNAL(clicked()), this, SLOT(savePreset())); connect(_presetDelButton, SIGNAL(clicked()), this, SLOT(delPreset())); }