| 42 | #include <QLabel> |
| 43 | |
| 44 | VstEffectControlDialog::VstEffectControlDialog( VstEffectControls * _ctl ) : |
| 45 | EffectControlDialog( _ctl ), |
| 46 | m_pluginWidget( NULL ), |
| 47 | |
| 48 | m_plugin( NULL ), |
| 49 | tbLabel( NULL ) |
| 50 | { |
| 51 | QGridLayout * l = new QGridLayout( this ); |
| 52 | l->setContentsMargins( 10, 10, 10, 10 ); |
| 53 | l->setVerticalSpacing( 2 ); |
| 54 | l->setHorizontalSpacing( 2 ); |
| 55 | |
| 56 | bool embed_vst = false; |
| 57 | |
| 58 | if( _ctl != NULL && _ctl->m_effect != NULL && |
| 59 | _ctl->m_effect->m_plugin != NULL ) |
| 60 | { |
| 61 | m_plugin = _ctl->m_effect->m_plugin; |
| 62 | embed_vst = m_plugin->embedMethod() != "none"; |
| 63 | |
| 64 | if (embed_vst) { |
| 65 | if (m_plugin->hasEditor() && ! m_plugin->pluginWidget()) { |
| 66 | m_plugin->createUI(this); |
| 67 | } |
| 68 | m_pluginWidget = m_plugin->pluginWidget(); |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | if (m_plugin) |
| 73 | { |
| 74 | setWindowTitle( m_plugin->name() ); |
| 75 | |
| 76 | QPushButton * btn = new QPushButton( tr( "Show/hide" )); |
| 77 | |
| 78 | if (embed_vst) { |
| 79 | btn->setCheckable( true ); |
| 80 | btn->setChecked( true ); |
| 81 | connect( btn, SIGNAL( toggled( bool ) ), |
| 82 | SLOT( togglePluginUI( bool ) ) ); |
| 83 | } else { |
| 84 | connect( btn, SIGNAL( clicked() ), |
| 85 | m_plugin.data(), SLOT( toggleUI() ) ); |
| 86 | } |
| 87 | |
| 88 | btn->setMinimumWidth( 78 ); |
| 89 | btn->setMaximumWidth( 78 ); |
| 90 | btn->setMinimumHeight( 24 ); |
| 91 | btn->setMaximumHeight( 24 ); |
| 92 | m_togglePluginButton = btn; |
| 93 | |
| 94 | m_managePluginButton = new PixmapButton( this, "" ); |
| 95 | m_managePluginButton->setCheckable( false ); |
| 96 | m_managePluginButton->setCursor( Qt::PointingHandCursor ); |
| 97 | m_managePluginButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap( |
| 98 | "controls_active" ) ); |
| 99 | m_managePluginButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( |
| 100 | "controls" ) ); |
| 101 | connect( m_managePluginButton, SIGNAL( clicked() ), _ctl, |
nothing calls this directly
no test coverage detected