Esempio n. 1
0
ControllerView::ControllerView( Controller * _model, QWidget * _parent ) :
	QFrame( _parent ),
	ModelView( _model, this ),
	m_subWindow( NULL ),
	m_controllerDlg( NULL ),
	m_show( true )
{
	this->setFrameStyle( QFrame::StyledPanel );
	this->setFrameShadow( QFrame::Raised );

	QVBoxLayout *vBoxLayout = new QVBoxLayout(this);

	QHBoxLayout *hBox = new QHBoxLayout();
	vBoxLayout->addLayout(hBox);

	QLabel *label = new QLabel( "<b>" + _model->displayName() + "</b>", this);
	QSizePolicy sizePolicy = label->sizePolicy();
	sizePolicy.setHorizontalStretch(1);
	label->setSizePolicy(sizePolicy);

	hBox->addWidget(label);

	QPushButton * controlsButton = new QPushButton( tr( "Controls" ), this );
	connect( controlsButton, SIGNAL( clicked() ), SLOT( editControls() ) );

	hBox->addWidget(controlsButton);

	m_nameLabel = new QLabel(_model->name(), this);
	vBoxLayout->addWidget(m_nameLabel);


	m_controllerDlg = getController()->createDialog( gui->mainWindow()->workspace() );

	m_subWindow = gui->mainWindow()->addWindowedWidget( m_controllerDlg );
	
	Qt::WindowFlags flags = m_subWindow->windowFlags();
	flags &= ~Qt::WindowMaximizeButtonHint;
	m_subWindow->setWindowFlags( flags );
	m_subWindow->setFixedSize( m_subWindow->size() );

	m_subWindow->setWindowIcon( m_controllerDlg->windowIcon() );

	connect( m_controllerDlg, SIGNAL( closed() ),
		this, SLOT( closeControls() ) );

	m_subWindow->hide();

	setWhatsThis( tr( "Controllers are able to automate the value of a knob, "
				"slider, and other controls."  ) );

	setModel( _model );
}
Esempio n. 2
0
ControllerView::ControllerView( Controller * _model, QWidget * _parent ) :
	QWidget( _parent ),
	ModelView( _model, this ),
	m_bg( embed::getIconPixmap( "controller_bg" ) ),
	m_subWindow( NULL ),
	m_controllerDlg( NULL ),
	m_show( true )
{
	setFixedSize( 210, 32 );

	QPushButton * ctls_btn = new QPushButton( tr( "Controls" ), this );
	
	QFont f = ctls_btn->font();
	ctls_btn->setFont( pointSize<8>( f ) );
	ctls_btn->setGeometry( 140, 2, 50, 14 );
	connect( ctls_btn, SIGNAL( clicked() ), 
				this, SLOT( editControls() ) );

	m_controllerDlg = getController()->createDialog( engine::mainWindow()->workspace() );

	m_subWindow = engine::mainWindow()->workspace()->addSubWindow( 
                m_controllerDlg );
	
	Qt::WindowFlags flags = m_subWindow->windowFlags();
	flags &= ~Qt::WindowMaximizeButtonHint;
	m_subWindow->setWindowFlags( flags );
	m_subWindow->setFixedSize( m_subWindow->size() );

	m_subWindow->setWindowIcon( m_controllerDlg->windowIcon() );

	connect( m_controllerDlg, SIGNAL( closed() ),
		this, SLOT( closeControls() ) );

	m_subWindow->hide();

	setWhatsThis( tr( "Controllers are able to automate the value of a knob, "
				"slider, and other controls."  ) );

	setModel( _model );
}
Esempio n. 3
0
EffectView::EffectView( Effect * _model, QWidget * _parent ) :
	PluginView( _model, _parent ),
	m_bg( embed::getIconPixmap( "effect_plugin" ) ),
	m_subWindow( NULL ),
	m_controlView( NULL )
{
	setFixedSize( 210, 60 );
	
	// Disable effects that are of type "DummyEffect"
	bool isEnabled = !dynamic_cast<DummyEffect *>( effect() );
	m_bypass = new LedCheckBox( this, "", isEnabled ? LedCheckBox::Green : LedCheckBox::Red );
	m_bypass->move( 3, 3 );
	m_bypass->setEnabled( isEnabled );
	m_bypass->setWhatsThis( tr( "Toggles the effect on or off." ) );
	
	ToolTip::add( m_bypass, tr( "On/Off" ) );


	m_wetDry = new Knob( knobBright_26, this );
	m_wetDry->setLabel( tr( "W/D" ) );
	m_wetDry->move( 27, 5 );
	m_wetDry->setEnabled( isEnabled );
	m_wetDry->setHintText( tr( "Wet Level:" ), "" );
	m_wetDry->setWhatsThis( tr( "The Wet/Dry knob sets the ratio between "
					"the input signal and the effect signal that "
					"forms the output." ) );


	m_autoQuit = new TempoSyncKnob( knobBright_26, this );
	m_autoQuit->setLabel( tr( "DECAY" ) );
	m_autoQuit->move( 60, 5 );
	m_autoQuit->setEnabled( isEnabled );
	m_autoQuit->setHintText( tr( "Time:" ), "ms" );
	m_autoQuit->setWhatsThis( tr(
"The Decay knob controls how many buffers of silence must pass before the "
"plugin stops processing.  Smaller values will reduce the CPU overhead but "
"run the risk of clipping the tail on delay and reverb effects." ) );


	m_gate = new Knob( knobBright_26, this );
	m_gate->setLabel( tr( "GATE" ) );
	m_gate->move( 93, 5 );
	m_gate->setEnabled( isEnabled );
	m_gate->setHintText( tr( "Gate:" ), "" );
	m_gate->setWhatsThis( tr(
"The Gate knob controls the signal level that is considered to be 'silence' "
"while deciding when to stop processing signals." ) );


	setModel( _model );

	if( effect()->controls()->controlCount() > 0 )
	{
		QPushButton * ctls_btn = new QPushButton( tr( "Controls" ),
									this );
		QFont f = ctls_btn->font();
		ctls_btn->setFont( pointSize<8>( f ) );
		ctls_btn->setGeometry( 140, 14, 50, 20 );
		connect( ctls_btn, SIGNAL( clicked() ),
					this, SLOT( editControls() ) );

		m_controlView = effect()->controls()->createView();
		if( m_controlView )
		{
			m_subWindow = gui->mainWindow()->addWindowedWidget(
								m_controlView,
				Qt::SubWindow | Qt::CustomizeWindowHint  |
					Qt::WindowTitleHint | Qt::WindowSystemMenuHint );
			m_subWindow->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
			m_subWindow->setFixedSize( m_subWindow->size() );

			connect( m_controlView, SIGNAL( closed() ),
					this, SLOT( closeEffects() ) );

			m_subWindow->hide();
		}
	}


	setWhatsThis( tr(
"Effect plugins function as a chained series of effects where the signal will "
"be processed from top to bottom.\n\n"

"The On/Off switch allows you to bypass a given plugin at any point in "
"time.\n\n"

"The Wet/Dry knob controls the balance between the input signal and the "
"effected signal that is the resulting output from the effect.  The input "
"for the stage is the output from the previous stage. So, the 'dry' signal "
"for effects lower in the chain contains all of the previous effects.\n\n"

"The Decay knob controls how long the signal will continue to be processed "
"after the notes have been released.  The effect will stop processing signals "
"when the volume has dropped below a given threshold for a given length of "
"time.  This knob sets the 'given length of time'.  Longer times will require "
"more CPU, so this number should be set low for most effects.  It needs to be "
"bumped up for effects that produce lengthy periods of silence, e.g. "
"delays.\n\n"

"The Gate knob controls the 'given threshold' for the effect's auto shutdown.  "
"The clock for the 'given length of time' will begin as soon as the processed "
"signal level drops below the level specified with this knob.\n\n"

"The Controls button opens a dialog for editing the effect's parameters.\n\n"

"Right clicking will bring up a context menu where you can change the order "
"in which the effects are processed or delete an effect altogether." ) );

	//move above vst effect view creation
	//setModel( _model );
}
Esempio n. 4
0
EffectView::EffectView( Effect * _model, QWidget * _parent ) :
	PluginView( _model, _parent ),
	m_bg( embed::getIconPixmap( "effect_plugin" ) ),
	m_subWindow( NULL ),
	m_controlView( NULL )
{
	setFixedSize( 210, 60 );

	// Disable effects that are of type "DummyEffect"
	bool isEnabled = !dynamic_cast<DummyEffect *>( effect() );
	m_bypass = new LedCheckBox( this, "", isEnabled ? LedCheckBox::Green : LedCheckBox::Red );
	m_bypass->move( 3, 3 );
	m_bypass->setEnabled( isEnabled );

	ToolTip::add( m_bypass, tr( "On/Off" ) );


	m_wetDry = new Knob( knobBright_26, this );
	m_wetDry->setLabel( tr( "W/D" ) );
	m_wetDry->move( 27, 5 );
	m_wetDry->setEnabled( isEnabled );
	m_wetDry->setHintText( tr( "Wet Level:" ), "" );


	m_autoQuit = new TempoSyncKnob( knobBright_26, this );
	m_autoQuit->setLabel( tr( "DECAY" ) );
	m_autoQuit->move( 60, 5 );
	m_autoQuit->setEnabled( isEnabled && !effect()->m_autoQuitDisabled );
	m_autoQuit->setHintText( tr( "Time:" ), "ms" );


	m_gate = new Knob( knobBright_26, this );
	m_gate->setLabel( tr( "GATE" ) );
	m_gate->move( 93, 5 );
	m_gate->setEnabled( isEnabled && !effect()->m_autoQuitDisabled );
	m_gate->setHintText( tr( "Gate:" ), "" );


	setModel( _model );

	if( effect()->controls()->controlCount() > 0 )
	{
		QPushButton * ctls_btn = new QPushButton( tr( "Controls" ),
									this );
		QFont f = ctls_btn->font();
		ctls_btn->setFont( pointSize<8>( f ) );
		ctls_btn->setGeometry( 140, 14, 50, 20 );
		connect( ctls_btn, SIGNAL( clicked() ),
					this, SLOT( editControls() ) );

		m_controlView = effect()->controls()->createView();
		if( m_controlView )
		{
			m_subWindow = gui->mainWindow()->addWindowedWidget( m_controlView );
			m_subWindow->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
			if (m_subWindow->layout()) {
				m_subWindow->layout()->setSizeConstraint(QLayout::SetFixedSize);
			}

			Qt::WindowFlags flags = m_subWindow->windowFlags();
			flags &= ~Qt::WindowMaximizeButtonHint;
			m_subWindow->setWindowFlags( flags );

			connect( m_controlView, SIGNAL( closed() ),
					this, SLOT( closeEffects() ) );

			m_subWindow->hide();
		}
	}


	//move above vst effect view creation
	//setModel( _model );
}