Exemplo n.º 1
0
DualFilterControlDialog::DualFilterControlDialog( DualFilterControls* controls ) :
	EffectControlDialog( controls )
{
	setAutoFillBackground( true );
	QPalette pal;
	pal.setBrush( backgroundRole(), PLUGIN_NAME::getIconPixmap( "artwork" ) );
	setPalette( pal );
	setFixedSize( 373, 109 );

	makeknob( cut1Knob, 24, 26, m_cut1Model, tr( "FREQ" ), tr( "Cutoff frequency" ), "Hz" )
	makeknob( res1Knob, 74, 26, m_res1Model, tr( "RESO" ), tr( "Resonance" ), "" )
	makeknob( gain1Knob, 124, 26, m_gain1Model, tr( "GAIN" ), tr( "Gain" ), "%" )
	makeknob( mixKnob, 173, 37, m_mixModel, tr( "MIX" ), tr( "Mix" ), "" )
	makeknob( cut2Knob, 222, 26, m_cut2Model, tr( "FREQ" ), tr( "Cutoff frequency" ), "Hz" )
	makeknob( res2Knob, 272, 26, m_res2Model, tr( "RESO" ), tr( "Resonance" ), "" )
	makeknob( gain2Knob, 322, 26, m_gain2Model, tr( "GAIN" ), tr( "Gain" ), "%" )

	gain1Knob-> setVolumeKnob( true );
	gain2Knob-> setVolumeKnob( true );

	LedCheckBox * enabled1Toggle = new LedCheckBox( "", this,
				tr( "Filter 1 enabled" ), LedCheckBox::Green );
	LedCheckBox * enabled2Toggle = new LedCheckBox( "", this,
				tr( "Filter 2 enabled" ), LedCheckBox::Green );

	enabled1Toggle -> move( 12, 11 );
	enabled1Toggle -> setModel( &controls -> m_enabled1Model );
	ToolTip::add( enabled1Toggle, tr( "Click to enable/disable Filter 1" ) );
	enabled2Toggle -> move( 210, 11 );
	enabled2Toggle -> setModel( &controls -> m_enabled2Model );
	ToolTip::add( enabled2Toggle, tr( "Click to enable/disable Filter 2" ) );

	ComboBox * m_filter1ComboBox = new ComboBox( this );
	m_filter1ComboBox->setGeometry( 19, 70, 137, 22 );
	m_filter1ComboBox->setFont( pointSize<8>( m_filter1ComboBox->font() ) );
	m_filter1ComboBox->setModel( &controls->m_filter1Model );

	ComboBox * m_filter2ComboBox = new ComboBox( this );
	m_filter2ComboBox->setGeometry( 217, 70, 137, 22 );
	m_filter2ComboBox->setFont( pointSize<8>( m_filter2ComboBox->font() ) );
	m_filter2ComboBox->setModel( &controls->m_filter2Model );
}
Exemplo n.º 2
0
DualFilterControlDialog::DualFilterControlDialog( DualFilterControls* controls ) :
	EffectControlDialog( controls )
{
	setAutoFillBackground( true );
	QPalette pal;
	pal.setBrush( backgroundRole(), PLUGIN_NAME::getIconPixmap( "artwork" ) );
	setPalette( pal );
	setFixedSize( 150, 220 );

	makeknob( cut1Knob, 33, 30, m_cut1Model, "FREQ", "Cutoff frequency", "Hz" )
	makeknob( res1Knob, 75, 30, m_res1Model, "RESO", "Resonance", "" )
	makeknob( gain1Knob, 117, 30, m_gain1Model, "GAIN", "Gain", "%" )
	makeknob( mixKnob, 62, 100, m_mixModel, "MIX", "Mix", "" )
	makeknob( cut2Knob, 33, 145, m_cut2Model, "FREQ", "Cutoff frequency", "Hz" )
	makeknob( res2Knob, 75, 145, m_res2Model, "RESO", "Resonance", "" )
	makeknob( gain2Knob, 117, 145, m_gain2Model, "GAIN", "Gain", "%" )

	gain1Knob-> setVolumeKnob( true );
	gain2Knob-> setVolumeKnob( true );

	ledCheckBox * enabled1Toggle = new ledCheckBox( "", this,
				tr( "Filter 1 enabled" ), ledCheckBox::Green );
	ledCheckBox * enabled2Toggle = new ledCheckBox( "", this,
				tr( "Filter 2 enabled" ), ledCheckBox::Green );

	enabled1Toggle -> move( 5, 30 );
	enabled1Toggle -> setModel( &controls -> m_enabled1Model );
	toolTip::add( enabled1Toggle, tr( "Click to enable/disable Filter 1" ) );
	enabled2Toggle -> move( 5, 145 );
	enabled2Toggle -> setModel( &controls -> m_enabled2Model );
	toolTip::add( enabled2Toggle, tr( "Click to enable/disable Filter 2" ) );

	comboBox * m_filter1ComboBox = new comboBox( this );
	m_filter1ComboBox->setGeometry( 5, 70, 140, 22 );
	m_filter1ComboBox->setFont( pointSize<8>( m_filter1ComboBox->font() ) );
	m_filter1ComboBox->setModel( &controls->m_filter1Model );

	comboBox * m_filter2ComboBox = new comboBox( this );
	m_filter2ComboBox->setGeometry( 5, 185, 140, 22 );
	m_filter2ComboBox->setFont( pointSize<8>( m_filter2ComboBox->font() ) );
	m_filter2ComboBox->setModel( &controls->m_filter2Model );
}
Exemplo n.º 3
0
WatsynView::WatsynView( Instrument * _instrument,
					QWidget * _parent ) :
	InstrumentView( _instrument, _parent )
{
	setAutoFillBackground( true );
	QPalette pal;

	pal.setBrush( backgroundRole(),	PLUGIN_NAME::getIconPixmap(	"artwork" ) );
	setPalette( pal );

// knobs... lots of em

	makeknob( a1_volKnob, 130, A1ROW, tr( "Volume" ), "%", "aKnob" )
	makeknob( a2_volKnob, 130, A2ROW, tr( "Volume" ), "%", "aKnob" )
	makeknob( b1_volKnob, 130, B1ROW, tr( "Volume" ), "%", "bKnob" )
	makeknob( b2_volKnob, 130, B2ROW, tr( "Volume" ), "%", "bKnob"  )

	makeknob( a1_panKnob, 154, A1ROW, tr( "Panning" ), "", "aKnob" )
	makeknob( a2_panKnob, 154, A2ROW, tr( "Panning" ), "", "aKnob" )
	makeknob( b1_panKnob, 154, B1ROW, tr( "Panning" ), "", "bKnob"  )
	makeknob( b2_panKnob, 154, B2ROW, tr( "Panning" ), "", "bKnob"  )

	makeknob( a1_multKnob, 178, A1ROW, tr( "Freq. multiplier" ), "/8", "aKnob" )
	makeknob( a2_multKnob, 178, A2ROW, tr( "Freq. multiplier" ), "/8", "aKnob" )
	makeknob( b1_multKnob, 178, B1ROW, tr( "Freq. multiplier" ), "/8", "bKnob"  )
	makeknob( b2_multKnob, 178, B2ROW, tr( "Freq. multiplier" ), "/8", "bKnob"  )

	makeknob( a1_ltuneKnob, 202, A1ROW, tr( "Left detune" ), tr( " cents" ), "aKnob" )
	makeknob( a2_ltuneKnob, 202, A2ROW, tr( "Left detune" ), tr( " cents" ), "aKnob" )
	makeknob( b1_ltuneKnob, 202, B1ROW, tr( "Left detune" ), tr( " cents" ), "bKnob"  )
	makeknob( b2_ltuneKnob, 202, B2ROW, tr( "Left detune" ), tr( " cents" ), "bKnob"  )

	makeknob( a1_rtuneKnob, 226, A1ROW, tr( "Right detune" ), tr( " cents" ), "aKnob" )
	makeknob( a2_rtuneKnob, 226, A2ROW, tr( "Right detune" ), tr( " cents" ), "aKnob" )
	makeknob( b1_rtuneKnob, 226, B1ROW, tr( "Right detune" ), tr( " cents" ), "bKnob"  )
	makeknob( b2_rtuneKnob, 226, B2ROW, tr( "Right detune" ), tr( " cents" ), "bKnob"  )

	makeknob( m_abmixKnob, 4, 3, tr( "A-B Mix" ), "", "mixKnob" )

	makeknob( m_envAmtKnob, 88, 3, tr( "Mix envelope amount" ), "", "mixenvKnob" )

	maketsknob( m_envAttKnob, 88, A1ROW, tr( "Mix envelope attack" ), " ms", "mixenvKnob" )
	maketsknob( m_envHoldKnob, 88, A2ROW, tr( "Mix envelope hold" ), " ms", "mixenvKnob" )
	maketsknob( m_envDecKnob, 88, B1ROW, tr( "Mix envelope decay" ), " ms", "mixenvKnob" )

	makeknob( m_xtalkKnob, 88, B2ROW, tr( "Crosstalk" ), "", "xtalkKnob" )

// let's set volume knobs
	a1_volKnob -> setVolumeKnob( true );
	a2_volKnob -> setVolumeKnob( true );
	b1_volKnob -> setVolumeKnob( true );
	b2_volKnob -> setVolumeKnob( true );

	m_abmixKnob -> setFixedSize( 31, 31 );


// button groups next.
// graph select buttons
	PixmapButton * a1_selectButton = new PixmapButton( this, NULL );
	a1_selectButton -> move( 4, 121 );
	a1_selectButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "a1_active" ) );
	a1_selectButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "a1_inactive" ) );
	ToolTip::add( a1_selectButton, tr( "Select oscillator A1") );

	PixmapButton * a2_selectButton = new PixmapButton( this, NULL );
	a2_selectButton -> move( 44, 121 );
	a2_selectButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "a2_active" ) );
	a2_selectButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "a2_inactive" ) );
	ToolTip::add( a2_selectButton, tr( "Select oscillator A2") );

	PixmapButton * b1_selectButton = new PixmapButton( this, NULL );
	b1_selectButton -> move( 84, 121 );
	b1_selectButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "b1_active" ) );
	b1_selectButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "b1_inactive" ) );
	ToolTip::add( b1_selectButton, tr( "Select oscillator B1") );

	PixmapButton * b2_selectButton = new PixmapButton( this, NULL );
	b2_selectButton -> move( 124, 121 );
	b2_selectButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "b2_active" ) );
	b2_selectButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "b2_inactive" ) );
	ToolTip::add( b2_selectButton, tr( "Select oscillator B2") );

	m_selectedGraphGroup = new automatableButtonGroup( this );
	m_selectedGraphGroup -> addButton( a1_selectButton );
	m_selectedGraphGroup -> addButton( a2_selectButton );
	m_selectedGraphGroup -> addButton( b1_selectButton );
	m_selectedGraphGroup -> addButton( b2_selectButton );
	WatsynInstrument * w = castModel<WatsynInstrument>();
	m_selectedGraphGroup -> setModel( &w -> m_selectedGraph);

// A-modulation button group
	PixmapButton * amod_mixButton = new PixmapButton( this, NULL );
	amod_mixButton -> move( 4, 50 );
	amod_mixButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "amix_active" ) );
	amod_mixButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "amix_inactive" ) );
	ToolTip::add( amod_mixButton, tr( "Mix output of A2 to A1" ) );

	PixmapButton * amod_amButton = new PixmapButton( this, NULL );
	amod_amButton -> move( 4, 66 );
	amod_amButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "aam_active" ) );
	amod_amButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "aam_inactive" ) );
	ToolTip::add( amod_amButton, tr( "Modulate amplitude of A1 with output of A2" ) );

	PixmapButton * amod_rmButton = new PixmapButton( this, NULL );
	amod_rmButton -> move( 4, 82 );
	amod_rmButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "arm_active" ) );
	amod_rmButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "arm_inactive" ) );
	ToolTip::add( amod_rmButton, tr( "Ring-modulate A1 and A2" ) );

	PixmapButton * amod_pmButton = new PixmapButton( this, NULL );
	amod_pmButton -> move( 4, 98 );
	amod_pmButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "apm_active" ) );
	amod_pmButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "apm_inactive" ) );
	ToolTip::add( amod_pmButton, tr( "Modulate phase of A1 with output of A2" ) );

	m_aModGroup = new automatableButtonGroup( this );
	m_aModGroup -> addButton( amod_mixButton );
	m_aModGroup -> addButton( amod_amButton );
	m_aModGroup -> addButton( amod_rmButton );
	m_aModGroup -> addButton( amod_pmButton );

// B-modulation button group
	PixmapButton * bmod_mixButton = new PixmapButton( this, NULL );
	bmod_mixButton -> move( 44, 50 );
	bmod_mixButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "bmix_active" ) );
	bmod_mixButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "bmix_inactive" ) );
	ToolTip::add( bmod_mixButton, tr( "Mix output of B2 to B1" ) );

	PixmapButton * bmod_amButton = new PixmapButton( this, NULL );
	bmod_amButton -> move( 44, 66 );
	bmod_amButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "bam_active" ) );
	bmod_amButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "bam_inactive" ) );
	ToolTip::add( bmod_amButton, tr( "Modulate amplitude of B1 with output of B2" ) );

	PixmapButton * bmod_rmButton = new PixmapButton( this, NULL );
	bmod_rmButton -> move( 44, 82 );
	bmod_rmButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "brm_active" ) );
	bmod_rmButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "brm_inactive" ) );
	ToolTip::add( bmod_rmButton, tr( "Ring-modulate B1 and B2" ) );

	PixmapButton * bmod_pmButton = new PixmapButton( this, NULL );
	bmod_pmButton -> move( 44, 98 );
	bmod_pmButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "bpm_active" ) );
	bmod_pmButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "bpm_inactive" ) );
	ToolTip::add( bmod_pmButton, tr( "Modulate phase of B1 with output of B2" ) );

	m_bModGroup = new automatableButtonGroup( this );
	m_bModGroup -> addButton( bmod_mixButton );
	m_bModGroup -> addButton( bmod_amButton );
	m_bModGroup -> addButton( bmod_rmButton );
	m_bModGroup -> addButton( bmod_pmButton );


// graph widgets
	pal = QPalette();
	pal.setBrush( backgroundRole(), PLUGIN_NAME::getIconPixmap("wavegraph") );
// a1 graph
	a1_graph = new Graph( this, Graph::LinearStyle, 224, 105 );
	a1_graph->move( 4, 141 );
	a1_graph->setAutoFillBackground( true );
	a1_graph->setGraphColor( QColor( 0x43, 0xb2, 0xff ) );
	ToolTip::add( a1_graph, tr ( "Draw your own waveform here by dragging your mouse on this graph." ) );
	a1_graph->setPalette( pal );

// a2 graph
	a2_graph = new Graph( this, Graph::LinearStyle, 224, 105 );
	a2_graph->move( 4, 141 );
	a2_graph->setAutoFillBackground( true );
	a2_graph->setGraphColor( QColor( 0x43, 0xb2, 0xff ) );
	ToolTip::add( a2_graph, tr ( "Draw your own waveform here by dragging your mouse on this graph." ) );
	a2_graph->setPalette( pal );

// b1 graph
	b1_graph = new Graph( this, Graph::LinearStyle, 224, 105 );
	b1_graph->move( 4, 141 );
	b1_graph->setAutoFillBackground( true );
	b1_graph->setGraphColor( QColor( 0xfc, 0x54, 0x31 ) );
	ToolTip::add( b1_graph, tr ( "Draw your own waveform here by dragging your mouse on this graph." ) );
	b1_graph->setPalette( pal );

// b2 graph
	b2_graph = new Graph( this, Graph::LinearStyle, 224, 105 );
	b2_graph->move( 4, 141 );
	b2_graph->setAutoFillBackground( true );
	b2_graph->setGraphColor( QColor( 0xfc, 0x54, 0x31 ) );
	ToolTip::add( b2_graph, tr ( "Draw your own waveform here by dragging your mouse on this graph." ) );
	b2_graph->setPalette( pal );


// misc pushbuttons
// waveform modifications

	m_loadButton = new PixmapButton( this, tr( "Load waveform" ) );
	m_loadButton -> move ( 173, 121 );
	m_loadButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "load_active" ) );
	m_loadButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "load_inactive" ) );
	ToolTip::add( m_loadButton, tr( "Click to load a waveform from a sample file" ) );

	m_phaseLeftButton = new PixmapButton( this, tr( "Phase left" ) );
	m_phaseLeftButton -> move ( 193, 121 );
	m_phaseLeftButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "phl_active" ) );
	m_phaseLeftButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "phl_inactive" ) );
	ToolTip::add( m_phaseLeftButton, tr( "Click to shift phase by -15 degrees" ) );

	m_phaseRightButton = new PixmapButton( this, tr( "Phase right" ) );
	m_phaseRightButton -> move ( 210, 121 );
	m_phaseRightButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "phr_active" ) );
	m_phaseRightButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "phr_inactive" ) );
	ToolTip::add( m_phaseRightButton, tr( "Click to shift phase by +15 degrees" ) );

	m_normalizeButton = new PixmapButton( this, tr( "Normalize" ) );
	m_normalizeButton -> move ( 230, 121 );
	m_normalizeButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "norm_active" ) );
	m_normalizeButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "norm_inactive" ) );
	ToolTip::add( m_normalizeButton, tr( "Click to normalize" ) );


	m_invertButton = new PixmapButton( this, tr( "Invert" ) );
	m_invertButton -> move ( 230, 138 );
	m_invertButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "inv_active" ) );
	m_invertButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "inv_inactive" ) );
	ToolTip::add( m_invertButton, tr( "Click to invert" ) );

	m_smoothButton = new PixmapButton( this, tr( "Smooth" ) );
	m_smoothButton -> move ( 230, 155 );
	m_smoothButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "smooth_active" ) );
	m_smoothButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "smooth_inactive" ) );
	ToolTip::add( m_smoothButton, tr( "Click to smooth" ) );

// waveforms

	m_sinWaveButton = new PixmapButton( this, tr( "Sine wave" ) );
	m_sinWaveButton -> move ( 230, 176 );
	m_sinWaveButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "sin_active" ) );
	m_sinWaveButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "sin_inactive" ) );
	ToolTip::add( m_sinWaveButton, tr( "Click for sine wave" ) );

	m_triWaveButton = new PixmapButton( this, tr( "Triangle wave" ) );
	m_triWaveButton -> move ( 230, 194 );
	m_triWaveButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "tri_active" ) );
	m_triWaveButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "tri_inactive" ) );
	ToolTip::add( m_triWaveButton, tr( "Click for triangle wave" ) );

	m_sawWaveButton = new PixmapButton( this, tr( "Triangle wave" ) );
	m_sawWaveButton -> move ( 230, 212 );
	m_sawWaveButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "saw_active" ) );
	m_sawWaveButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "saw_inactive" ) );
	ToolTip::add( m_sawWaveButton, tr( "Click for saw wave" ) );

	m_sqrWaveButton = new PixmapButton( this, tr( "Square wave" ) );
	m_sqrWaveButton -> move ( 230, 230 );
	m_sqrWaveButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "sqr_active" ) );
	m_sqrWaveButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "sqr_inactive" ) );
	ToolTip::add( m_sqrWaveButton, tr( "Click for square wave" ) );



	connect( m_sinWaveButton, SIGNAL( clicked() ), this, SLOT( sinWaveClicked() ) );
	connect( m_triWaveButton, SIGNAL( clicked() ), this, SLOT( triWaveClicked() ) );
	connect( m_sawWaveButton, SIGNAL( clicked() ), this, SLOT( sawWaveClicked() ) );
	connect( m_sqrWaveButton, SIGNAL( clicked() ), this, SLOT( sqrWaveClicked() ) );
	connect( m_normalizeButton, SIGNAL( clicked() ), this, SLOT( normalizeClicked() ) );
	connect( m_invertButton, SIGNAL( clicked() ), this, SLOT( invertClicked() ) );
	connect( m_smoothButton, SIGNAL( clicked() ), this, SLOT( smoothClicked() ) );
	connect( m_phaseLeftButton, SIGNAL( clicked() ), this, SLOT( phaseLeftClicked() ) );
	connect( m_phaseRightButton, SIGNAL( clicked() ), this, SLOT( phaseRightClicked() ) );
	connect( m_loadButton, SIGNAL( clicked() ), this, SLOT( loadClicked() ) );

	connect( a1_selectButton, SIGNAL( clicked() ), this, SLOT( updateLayout() ) );
	connect( a2_selectButton, SIGNAL( clicked() ), this, SLOT( updateLayout() ) );
	connect( b1_selectButton, SIGNAL( clicked() ), this, SLOT( updateLayout() ) );
	connect( b2_selectButton, SIGNAL( clicked() ), this, SLOT( updateLayout() ) );

	updateLayout();
}