Plugin::Descriptor::SubPluginFeatures: made some methods const
We can safely make fillDescriptionWidget() and listSubPluginKeys() const methods. Furthermore descriptor pointer to listSubPluginKeys() can be const as well. Might allow more optimizations by the compiler.
This commit is contained in:
@@ -133,11 +133,12 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
virtual void fillDescriptionWidget( QWidget *, const Key * )
|
||||
virtual void fillDescriptionWidget( QWidget *, const Key * ) const
|
||||
{
|
||||
}
|
||||
|
||||
virtual void listSubPluginKeys( Plugin::Descriptor *, KeyList & )
|
||||
virtual void listSubPluginKeys( const Plugin::Descriptor *,
|
||||
KeyList & ) const
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <QtGui/QHBoxLayout>
|
||||
#include <QtGui/QLabel>
|
||||
|
||||
@@ -46,7 +45,7 @@ LadspaSubPluginFeatures::LadspaSubPluginFeatures( Plugin::PluginTypes _type ) :
|
||||
|
||||
|
||||
void LadspaSubPluginFeatures::fillDescriptionWidget( QWidget * _parent,
|
||||
const Key * _key )
|
||||
const Key * _key ) const
|
||||
{
|
||||
const ladspa_key_t & lkey = subPluginKeyToLadspaKey( _key );
|
||||
ladspa2LMMS * lm = engine::getLADSPAManager();
|
||||
@@ -114,8 +113,8 @@ void LadspaSubPluginFeatures::fillDescriptionWidget( QWidget * _parent,
|
||||
|
||||
|
||||
|
||||
void LadspaSubPluginFeatures::listSubPluginKeys( Plugin::Descriptor * _desc,
|
||||
KeyList & _kl )
|
||||
void LadspaSubPluginFeatures::listSubPluginKeys(
|
||||
const Plugin::Descriptor * _desc, KeyList & _kl ) const
|
||||
{
|
||||
ladspa2LMMS * lm = engine::getLADSPAManager();
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _LADSPA_SUBPLUGIN_FEATURES_H
|
||||
#define _LADSPA_SUBPLUGIN_FEATURES_H
|
||||
|
||||
@@ -38,9 +37,11 @@ class LadspaSubPluginFeatures : public Plugin::Descriptor::SubPluginFeatures
|
||||
public:
|
||||
LadspaSubPluginFeatures( Plugin::PluginTypes _type );
|
||||
|
||||
virtual void fillDescriptionWidget( QWidget * _parent, const Key * _key );
|
||||
virtual void fillDescriptionWidget( QWidget * _parent,
|
||||
const Key * _key ) const;
|
||||
|
||||
virtual void listSubPluginKeys( Plugin::Descriptor * _desc, KeyList & _kl );
|
||||
virtual void listSubPluginKeys( const Plugin::Descriptor * _desc,
|
||||
KeyList & _kl ) const;
|
||||
|
||||
static ladspa_key_t subPluginKeyToLadspaKey( const Key * _key );
|
||||
|
||||
|
||||
@@ -40,18 +40,17 @@ VstSubPluginFeatures::VstSubPluginFeatures( Plugin::PluginTypes _type ) :
|
||||
|
||||
|
||||
void VstSubPluginFeatures::fillDescriptionWidget( QWidget * _parent,
|
||||
const Key * _key )
|
||||
const Key * _key ) const
|
||||
{
|
||||
new QLabel( QWidget::tr( "Name: " ) + _key->name, _parent );
|
||||
new QLabel( QWidget::tr( "File: " ) + _key->attributes["file"],
|
||||
_parent );
|
||||
new QLabel( QWidget::tr( "File: " ) + _key->attributes["file"], _parent );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void VstSubPluginFeatures::listSubPluginKeys( Plugin::Descriptor * _desc,
|
||||
KeyList & _kl )
|
||||
void VstSubPluginFeatures::listSubPluginKeys( const Plugin::Descriptor * _desc,
|
||||
KeyList & _kl ) const
|
||||
{
|
||||
QStringList dlls = QDir( configManager::inst()->vstDir() ).
|
||||
entryList( QStringList() << "*.dll",
|
||||
@@ -64,6 +63,5 @@ void VstSubPluginFeatures::listSubPluginKeys( Plugin::Descriptor * _desc,
|
||||
am["file"] = *it;
|
||||
_kl.push_back( Key( _desc, QFileInfo( *it ).baseName(), am ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -35,9 +35,11 @@ class VstSubPluginFeatures : public Plugin::Descriptor::SubPluginFeatures
|
||||
public:
|
||||
VstSubPluginFeatures( Plugin::PluginTypes _type );
|
||||
|
||||
virtual void fillDescriptionWidget( QWidget * _parent, const Key * _key );
|
||||
virtual void fillDescriptionWidget( QWidget * _parent,
|
||||
const Key * _key ) const;
|
||||
|
||||
virtual void listSubPluginKeys( Plugin::Descriptor * _desc, KeyList & _kl );
|
||||
virtual void listSubPluginKeys( const Plugin::Descriptor * _desc,
|
||||
KeyList & _kl ) const;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user