"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "plugins/vestige/vestige.cpp" between
lmms-1.2.0-rc7.tar.gz and lmms-1.2.0-rc8.tar.gz

About: LMMS (Linux MultiMedia Studio) is a sound generation system (creation of melodies and beats, synthesis and mixing of sounds, arranging of samples; full MIDI support). Release candidate.

vestige.cpp  (lmms-1.2.0-rc7):vestige.cpp  (lmms-1.2.0-rc8)
skipping to change at line 108 skipping to change at line 108
}; };
class VstInstrumentPlugin : public VstPlugin class VstInstrumentPlugin : public VstPlugin
{ {
public: public:
using VstPlugin::VstPlugin; using VstPlugin::VstPlugin;
void createUI( QWidget *parent ) override void createUI( QWidget *parent ) override
{ {
Q_UNUSED(parent); Q_UNUSED(parent);
if ( !hasEditor() ) {
return;
}
if ( embedMethod() != "none" ) { if ( embedMethod() != "none" ) {
m_pluginSubWindow.reset(new vstSubWin( gui->mainWindow()- >workspace() )); m_pluginSubWindow.reset(new vstSubWin( gui->mainWindow()- >workspace() ));
VstPlugin::createUI( m_pluginSubWindow.get() ); VstPlugin::createUI( m_pluginSubWindow.get() );
m_pluginSubWindow->setWidget(pluginWidget()); m_pluginSubWindow->setWidget(pluginWidget());
} else { } else {
VstPlugin::createUI( nullptr ); VstPlugin::createUI( nullptr );
} }
} }
/// Overwrite editor() to return the sub window instead of the embed widg et /// Overwrite editor() to return the sub window instead of the embed widg et
skipping to change at line 200 skipping to change at line 203
knobFModel[i] = new FloatModel( 0.0f, 0.0f, 1.0f, 0.01f, this, QString::number(i) ); knobFModel[i] = new FloatModel( 0.0f, 0.0f, 1.0f, 0.01f, this, QString::number(i) );
knobFModel[i]->loadSettings( _this, paramStr ); knobFModel[i]->loadSettings( _this, paramStr );
if( !( knobFModel[ i ]->isAutomated() || knobFModel[ i ]- >controllerConnection() ) ) if( !( knobFModel[ i ]->isAutomated() || knobFModel[ i ]- >controllerConnection() ) )
{ {
knobFModel[ i ]->setValue(LocaleHelper::toFloat(s _dumpValues.at(2))); knobFModel[ i ]->setValue(LocaleHelper::toFloat(s _dumpValues.at(2)));
knobFModel[ i ]->setInitValue(LocaleHelper::toFlo at(s_dumpValues.at(2))); knobFModel[ i ]->setInitValue(LocaleHelper::toFlo at(s_dumpValues.at(2)));
} }
connect( knobFModel[i], SIGNAL( dataChanged() ), this, SL #if QT_VERSION < 0x050000
OT( setParameter() ) ); connect( knobFModel[i], SIGNAL( dataChanged( Model * ) ),
this, SLOT( setParameter( Model * ) ), Qt::Direct
Connection );
#else
connect( knobFModel[i], &FloatModel::dataChanged, this,
[this, i]() { setParameter( knobFModel[i] ); }, Q
t::DirectConnection);
#endif
} }
} }
m_pluginMutex.unlock(); m_pluginMutex.unlock();
} }
void vestigeInstrument::setParameter( void ) void vestigeInstrument::setParameter( Model * action )
{ {
Model *action = qobject_cast<Model *>(sender());
int knobUNID = action->displayName().toInt(); int knobUNID = action->displayName().toInt();
if ( m_plugin != NULL ) { if ( m_plugin != NULL ) {
m_plugin->setParam( knobUNID, knobFModel[knobUNID]->value() ); m_plugin->setParam( knobUNID, knobFModel[knobUNID]->value() );
} }
} }
void vestigeInstrument::handleConfigChange(QString cls, QString attr, QString va lue) void vestigeInstrument::handleConfigChange(QString cls, QString attr, QString va lue)
{ {
Q_UNUSED(cls); Q_UNUSED(attr); Q_UNUSED(value); Q_UNUSED(cls); Q_UNUSED(attr); Q_UNUSED(value);
skipping to change at line 907 skipping to change at line 914
vstKnobs[ i ] = new Knob( knobBright_26, this, s_dumpValues.at( 1 ) ); vstKnobs[ i ] = new Knob( knobBright_26, this, s_dumpValues.at( 1 ) );
vstKnobs[ i ]->setHintText( s_dumpValues.at( 1 ) + ":", "" ); vstKnobs[ i ]->setHintText( s_dumpValues.at( 1 ) + ":", "" );
vstKnobs[ i ]->setLabel( s_dumpValues.at( 1 ).left( 15 ) ); vstKnobs[ i ]->setLabel( s_dumpValues.at( 1 ).left( 15 ) );
if( !hasKnobModel ) if( !hasKnobModel )
{ {
sprintf( paramStr, "%d", i); sprintf( paramStr, "%d", i);
m_vi->knobFModel[ i ] = new FloatModel( LocaleHelper::toF loat(s_dumpValues.at(2)), m_vi->knobFModel[ i ] = new FloatModel( LocaleHelper::toF loat(s_dumpValues.at(2)),
0.0f, 1.0f, 0.01f, castModel<vestigeInstrument>() , tr( paramStr ) ); 0.0f, 1.0f, 0.01f, castModel<vestigeInstrument>() , tr( paramStr ) );
} }
connect( m_vi->knobFModel[i], SIGNAL( dataChanged() ), this, SLOT
( setParameter() ) ); FloatModel * model = m_vi->knobFModel[i];
vstKnobs[i] ->setModel( m_vi->knobFModel[i] ); #if QT_VERSION < 0x050000
connect( model, SIGNAL( dataChanged( Model * ) ), this,
SLOT( setParameter( Model * ) ), Qt::DirectConnection );
#else
connect( model, &FloatModel::dataChanged, this,
[this, model]() { setParameter( model ); }, Qt::DirectCon
nection);
#endif
vstKnobs[i] ->setModel( model );
} }
int i = 0; int i = 0;
for( int lrow = 1; lrow < ( int( m_vi->paramCount / 10 ) + 1 ) + 1; lrow+ + ) for( int lrow = 1; lrow < ( int( m_vi->paramCount / 10 ) + 1 ) + 1; lrow+ + )
{ {
for( int lcolumn = 0; lcolumn < 10; lcolumn++ ) for( int lcolumn = 0; lcolumn < 10; lcolumn++ )
{ {
if( i < m_vi->paramCount ) if( i < m_vi->paramCount )
{ {
l->addWidget( vstKnobs[i], lrow, lcolumn, Qt::Ali gnCenter ); l->addWidget( vstKnobs[i], lrow, lcolumn, Qt::Ali gnCenter );
skipping to change at line 1026 skipping to change at line 1041
m_vi->m_subWindow->close(); m_vi->m_subWindow->close();
if ( m_vi->m_subWindow != NULL ) if ( m_vi->m_subWindow != NULL )
delete m_vi->m_subWindow; delete m_vi->m_subWindow;
m_vi->m_subWindow = NULL; m_vi->m_subWindow = NULL;
} }
m_vi->p_subWindow = NULL; m_vi->p_subWindow = NULL;
} }
void manageVestigeInstrumentView::setParameter( void ) void manageVestigeInstrumentView::setParameter( Model * action )
{ {
Model *action = qobject_cast<Model *>(sender());
int knobUNID = action->displayName().toInt(); int knobUNID = action->displayName().toInt();
if ( m_vi->m_plugin != NULL ) { if ( m_vi->m_plugin != NULL ) {
m_vi->m_plugin->setParam( knobUNID, m_vi->knobFModel[knobUNID]->v alue() ); m_vi->m_plugin->setParam( knobUNID, m_vi->knobFModel[knobUNID]->v alue() );
} }
} }
void manageVestigeInstrumentView::dragEnterEvent( QDragEnterEvent * _dee ) void manageVestigeInstrumentView::dragEnterEvent( QDragEnterEvent * _dee )
{ {
if( _dee->mimeData()->hasFormat( StringPairDrag::mimeType() ) ) if( _dee->mimeData()->hasFormat( StringPairDrag::mimeType() ) )
 End of changes. 7 change blocks. 
11 lines changed or deleted 25 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)