| 34 | |
| 35 | |
| 36 | EffectSelectDialog::EffectSelectDialog( QWidget * _parent ) : |
| 37 | QDialog( _parent ), |
| 38 | ui( new Ui::EffectSelectDialog ), |
| 39 | m_sourceModel(), |
| 40 | m_model(), |
| 41 | m_descriptionWidget( NULL ) |
| 42 | { |
| 43 | ui->setupUi( this ); |
| 44 | |
| 45 | setWindowIcon( embed::getIconPixmap( "setup_audio" ) ); |
| 46 | |
| 47 | // query effects |
| 48 | |
| 49 | EffectKeyList subPluginEffectKeys; |
| 50 | |
| 51 | for (const Plugin::Descriptor* desc: pluginFactory->descriptors(Plugin::Effect)) |
| 52 | { |
| 53 | if( desc->subPluginFeatures ) |
| 54 | { |
| 55 | desc->subPluginFeatures->listSubPluginKeys( |
| 56 | // as iterators are always stated to be not |
| 57 | // equal with pointers, we dereference the |
| 58 | // iterator and take the address of the item, |
| 59 | // so we're on the safe side and the compiler |
| 60 | // likely will reduce that to just "it" |
| 61 | desc, |
| 62 | subPluginEffectKeys ); |
| 63 | } |
| 64 | else |
| 65 | { |
| 66 | m_effectKeys << EffectKey( desc, desc->name ); |
| 67 | |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | m_effectKeys += subPluginEffectKeys; |
| 72 | |
| 73 | // and fill our source model |
| 74 | m_sourceModel.setHorizontalHeaderItem( 0, new QStandardItem( tr( "Name" ) ) ); |
| 75 | m_sourceModel.setHorizontalHeaderItem( 1, new QStandardItem( tr( "Type" ) ) ); |
| 76 | int row = 0; |
| 77 | for( EffectKeyList::ConstIterator it = m_effectKeys.begin(); |
| 78 | it != m_effectKeys.end(); ++it ) |
| 79 | { |
| 80 | QString name; |
| 81 | QString type; |
| 82 | if( ( *it ).desc->subPluginFeatures ) |
| 83 | { |
| 84 | name = ( *it ).name; |
| 85 | type = ( *it ).desc->displayName; |
| 86 | } |
| 87 | else |
| 88 | { |
| 89 | name = ( *it ).desc->displayName; |
| 90 | type = "LMMS"; |
| 91 | } |
| 92 | m_sourceModel.setItem( row, 0, new QStandardItem( name ) ); |
| 93 | m_sourceModel.setItem( row, 1, new QStandardItem( type ) ); |
nothing calls this directly
no test coverage detected