36 , m_pCurrentItem( nullptr )
42 setFixedSize( width(), height() );
44 setWindowTitle( tr(
"Select LADSPA FX" ) );
48 m_nameLbl->setText( QString(
"") );
49 m_labelLbl->setText( QString(
"") );
50 m_typeLbl->setText( QString(
"") );
51 m_pIDLbl->setText( QString(
"") );
52 m_pMakerLbl->setText( QString(
"") );
53 m_pCopyrightLbl->setText( QString(
"") );
54 m_pPluginsListBox->clear();
55 m_pOkBtn->setEnabled(
false);
57 m_pGroupsListView->setHeaderLabels( QStringList( tr(
"Groups" ) ) );
59#ifdef H2CORE_HAVE_LADSPA
67 m_pGroupsListView->headerItem()->setHidden(
true );
77 connect( m_pPluginsListBox, SIGNAL( itemSelectionChanged () ),
this, SLOT(
pluginSelected() ) );
93#ifdef H2CORE_HAVE_LADSPA
94 m_pGroupsListView->clear();
100 for (uint i = 0; i < pFXGroup->
getChildList().size(); i++) {
102 addGroup( m_pGroupsListView, pNewGroup );
114#ifdef H2CORE_HAVE_LADSPA
117 QTreeWidgetItem* pNewItem =
new QTreeWidgetItem( parent );
118 QFont f = pNewItem->font( 0 );
120 pNewItem->setFont( 0, f );
121 buildGroup( pNewItem, pGroup );
126 QTreeWidgetItem* pNewItem =
new QTreeWidgetItem( parent );
127 buildGroup( pNewItem, pGroup );
132 QString sGroupName = pGroup->
getName();
133 if (sGroupName == QString(
"Uncategorized")) {
134 sGroupName = tr(
"Alphabetic List");
136 else if (sGroupName == QString(
"Categorized(LRDF)")) {
137 sGroupName = tr(
"Categorized");
139 else if (sGroupName == QString(
"Recently Used")) {
140 sGroupName = tr(
"Recently Used");
142 pNewItem->setText( 0, sGroupName );
145 for ( uint i = 0; i < pGroup->
getChildList().size(); i++ ) {
148 addGroup( pNewItem, pNewGroup );
170#ifdef H2CORE_HAVE_LADSPA
174 if ( m_pPluginsListBox->selectedItems().isEmpty() )
return;
176 QString sSelected = m_pPluginsListBox->currentItem()->text();
181 for (uint i = 0; i < pluginList.size(); i++) {
185 m_nameLbl->setText( pFXInfo->
m_sName );
186 m_labelLbl->setText( pFXInfo->
m_sLabel );
189 m_typeLbl->setText( tr(
"Stereo") );
192 m_typeLbl->setText( tr(
"Mono") );
196 m_typeLbl->setText( tr(
"Not supported") );
199 m_pIDLbl->setText( pFXInfo->
m_sID );
200 m_pMakerLbl->setText( pFXInfo->
m_sMaker );
206 m_pOkBtn->setEnabled(
true);
215#ifdef H2CORE_HAVE_LADSPA
218 m_pOkBtn->setEnabled(
false);
219 m_nameLbl->setText( QString(
"") );
220 m_labelLbl->setText( QString(
"") );
221 m_typeLbl->setText( QString(
"") );
222 m_pIDLbl->setText( QString(
"") );
223 m_pMakerLbl->setText( QString(
"") );
224 m_pCopyrightLbl->setText( QString(
"") );
227 if ( currentItem ==
nullptr ) {
231 if ( currentItem->childCount() ) {
232 currentItem->setExpanded(
true );
235 QString itemText = currentItem->text( 0 );
237 m_pPluginsListBox->clear();
241 std::vector<H2Core::LadspaFXInfo*> pluginList = findPluginsInGroup( itemText, pFXGroup );
243 int selectedIndex = -1;
244 for (
int i = 0; i < (int)pluginList.size(); i++) {
246 m_pPluginsListBox->addItem( pluginList[ i ]->m_sName );
251 if ( selectedIndex >= 0 ) {
252 m_pPluginsListBox->setCurrentRow( selectedIndex );
258#ifdef H2CORE_HAVE_LADSPA
259std::vector<H2Core::LadspaFXInfo*> LadspaFXSelector::findPluginsInGroup(
const QString& sSelectedGroup,
H2Core::LadspaFXGroup *pGroup )
262 std::vector<H2Core::LadspaFXInfo*> list;
264 if ( pGroup->
getName() == sSelectedGroup ) {
266 for ( uint i = 0; i < pGroup->
getLadspaInfo().size(); ++i ) {
268 list.push_back( pInfo );
274 for ( uint i = 0; i < pGroup->
getChildList().size(); ++i ) {
276 list = findPluginsInGroup( sSelectedGroup, pNewGroup );
277 if (list.size() != 0) {
LadspaFXGroup * getLadspaFXGroup()
static Effects * get_instance()
Returns a pointer to the current Effects singleton stored in __instance.
std::vector< LadspaFXInfo * > getPluginList()
Loads only usable plugins.
LadspaFX * getLadspaFX(int nFX) const
std::vector< LadspaFXInfo * > getLadspaInfo() const
const QString & getName() const
std::vector< LadspaFXGroup * > getChildList() const
unsigned m_nIAPorts
input audio port
unsigned m_nOAPorts
output audio port
const QString & getPluginName() const
void on_m_pGroupsListView_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous)
QTreeWidgetItem * m_pCurrentItem
QString m_sSelectedPluginName
LadspaFXSelector(int nLadspaFX)