Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
a1b3558
Allow sub plugins for instruments aswell
JohannesLorenz Dec 27, 2018
4d64c42
Fix Engine.cpp not compiling on some compilers
JohannesLorenz Dec 27, 2018
fcd1a7e
Fix or remove wrong or useless debug printfs
JohannesLorenz Dec 27, 2018
f3b2383
Fix missing IntrumentTrack header
JohannesLorenz Dec 27, 2018
d5dcebe
Use QString for SubPluginFeatures' virtuals
JohannesLorenz Jan 18, 2019
31dc8e1
Test deployment preparation in regular builds (#4847)
jasp00 Feb 25, 2019
e34f75a
Add needed macOS shortcuts (#4851)
tresf Feb 25, 2019
ad1fa16
Move apt_mingw_cache out of build directory (#4842)
jasp00 Feb 25, 2019
a233291
Add missing include
lukas-w Feb 27, 2019
05d5e20
Fix DrumSynth sscanf (#4869)
M374LX Mar 3, 2019
e54969c
Add /sbin to AppImage search path
tresf Mar 5, 2019
009a451
Fix AudioFileProcessor tooltip (#4868)
M374LX Mar 5, 2019
991ffcd
Disable soundio on macOS
tresf Mar 5, 2019
9e6ce06
Blacklist $HOME as VST directory
tresf Mar 7, 2019
cdd1ddb
Sync Debian version (#4840)
jasp00 Mar 7, 2019
9148ce1
Fix loading 32bit VSTs when loading LMMS in the build directory
PhysSong Mar 10, 2019
17e87c1
Fix MidiJack crash on exit
lukas-w Mar 10, 2019
2a72808
Fix #3926: QCursor in AFP
michaelgregorius Mar 3, 2019
9a91848
Fix CONTRIBUTORS override
PhysSong Mar 11, 2019
9280568
Debian integration: update build dependencies
PhysSong Mar 11, 2019
97502a1
Debian: don't bundle CALF LADSPA library separately anymore
PhysSong Mar 11, 2019
af40c76
Better Wine detection and support
PhysSong Mar 11, 2019
8c4514f
Check if winegcc works before building RemoteVstPlugin
PhysSong Mar 11, 2019
ae4e40d
Modify VST build systems to make debian integration work correctly
PhysSong Mar 11, 2019
5eb6b13
Allow creating AppImages on systems newer than linuxdeployqt official…
PhysSong Mar 11, 2019
61c3f87
Support FX Mixer for sample tracks and add controls to sample track w…
PhysSong Mar 11, 2019
04768ee
Fix zyn pitch on project load/export
tresf Mar 11, 2019
37290ac
Add info about LadspaControls::m_noLink
JohannesLorenz Mar 11, 2019
97d5529
Fix compilation on Qt4
tresf Mar 12, 2019
295b899
Avoid shallow clones in all Debian sid builds (#4888)
jasp00 Mar 13, 2019
17f6235
Add VST always-on-top config option
DomClark Mar 3, 2019
6fef905
Ensure VST windows show properly in taskbar
DomClark Mar 3, 2019
205b575
Don't show error when loading empty VeSTige instance
DomClark Mar 3, 2019
3aeacca
Fix layout of VstSyncData struct
DomClark Mar 3, 2019
2d71d61
Rework after code reading
JohannesLorenz Mar 15, 2019
f8ba88d
Make instrument window's piano optional
JohannesLorenz Mar 16, 2019
aac516e
Forbid copying the Knob class
JohannesLorenz Mar 16, 2019
7e75a82
Always instantiate at least a dummy plugin
JohannesLorenz Mar 16, 2019
4129be8
Add explenation for LadspaControls::m_noLink
JohannesLorenz Mar 17, 2019
ef6bac6
Merge branch 'misc-lv2-preparation'
JohannesLorenz Mar 17, 2019
0c3db10
Fix Blackman-Harris window formula (#4895)
he29-net Mar 17, 2019
dd6c18e
Automation Editor: Don't accept drag events when there's no pattern
lukas-w Mar 9, 2019
e1adfc3
TCO drag: Fix Ctrl+Drag crash
lukas-w Mar 1, 2019
7952416
Bump zyn submodule
tresf Mar 18, 2019
ea5cbe6
Allow new Zyn bank creation on Linux (#4905)
tresf Mar 18, 2019
f79c292
Fix empty editors after closing them and creating a new project (#4891)
necrashter Mar 19, 2019
1adf160
Make instrument window's piano optional
JohannesLorenz Mar 21, 2019
2061d6c
Merge branch 'master' into instr-sub-plugins
JohannesLorenz Mar 22, 2019
52d1f55
Remove useless include
JohannesLorenz Mar 22, 2019
3483581
Fix invalid display names
JohannesLorenz Mar 22, 2019
82cf453
Allow sub plugins for instruments aswell
JohannesLorenz Mar 22, 2019
032c324
Travis: use carla instead of carla-git
PhysSong Mar 25, 2019
7984bb9
Merge branch 'stable-1.2'
PhysSong Mar 26, 2019
f18efb4
Travis: fix shellcheck warnings for the Debian sid script
PhysSong Mar 26, 2019
4dce466
Remove some Qt4 compatibility code
PhysSong Mar 26, 2019
93ec816
SetupDialog: fix file dialog not opening for theme directory
PhysSong Mar 28, 2019
3ef33db
PluginBrowser: Tree layout and search bar
Mar 30, 2019
ac257f0
PluginBrowser: Tree layout and search bar (#4759)
JohannesLorenz Apr 3, 2019
07dcea1
Replace Monstro icons
LostRobotMusic Apr 13, 2019
be31a55
Shrink ComboBox arrow section slightly
LostRobotMusic Apr 13, 2019
b3461e2
Merge pull request #4943 from RoxasKH/new-monstro-icons
LostRobotMusic Apr 13, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
PluginBrowser: Tree layout and search bar
  • Loading branch information
CYBERDEViLNL authored and CYBERDEViLNL committed Apr 2, 2019
commit 3ef33dbbe994141ce3d7c5da7b9d44bcb1fdffb2
25 changes: 15 additions & 10 deletions include/PluginBrowser.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
#include "SideBarWidget.h"
#include "Plugin.h"

class QLineEdit;
class QTreeWidget;
class QTreeWidgetItem;


class PluginBrowser : public SideBarWidget
{
Expand All @@ -39,18 +43,18 @@ class PluginBrowser : public SideBarWidget
PluginBrowser( QWidget * _parent );
virtual ~PluginBrowser() = default;

private:
QWidget * m_view;
};


private slots:
void onFilterChanged( const QString & filter );

private:
void addPlugins();
void updateRootVisibility( int index );
void updateRootVisibilities();

class PluginDescList : public QWidget
{
Q_OBJECT
public:
PluginDescList(QWidget* parent);
QWidget * m_view;
QTreeWidget * m_descTree;
QTreeWidgetItem * m_lmmsRoot;
QTreeWidgetItem * m_lv2Root;
};


Expand All @@ -62,6 +66,7 @@ class PluginDescWidget : public QWidget
public:
typedef Plugin::Descriptor::SubPluginFeatures::Key PluginKey;
PluginDescWidget( const PluginKey & _pk, QWidget * _parent );
QString name() const;


protected:
Expand Down
121 changes: 102 additions & 19 deletions src/gui/PluginBrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@

#include "PluginBrowser.h"

#include <QHeaderView>
#include <QLabel>
#include <QPainter>
#include <QLineEdit>
#include <QMouseEvent>
#include <QScrollArea>
#include <QPainter>
#include <QStyleOption>
#include <QTreeWidget>

#include "embed.h"
#include "Engine.h"
Expand Down Expand Up @@ -60,23 +62,91 @@ PluginBrowser::PluginBrowser( QWidget * _parent ) :
m_view );
hint->setWordWrap( true );

QScrollArea* scrollarea = new QScrollArea( m_view );
PluginDescList* descList = new PluginDescList( m_view );
scrollarea->setWidget(descList);
scrollarea->setWidgetResizable(true);
QLineEdit * searchBar = new QLineEdit( m_view );
searchBar->setPlaceholderText( "Search" );
searchBar->setMaxLength( 64 );
searchBar->setClearButtonEnabled( true );

m_descTree = new QTreeWidget( m_view );
m_descTree->setColumnCount( 1 );
m_descTree->header()->setVisible( false );
m_descTree->setIndentation( 10 );
m_descTree->setSelectionMode( QAbstractItemView::NoSelection );

connect( searchBar, SIGNAL( textEdited( const QString & ) ),
this, SLOT( onFilterChanged( const QString & ) ) );

view_layout->addWidget( hint );
view_layout->addWidget( searchBar );
view_layout->addWidget( m_descTree );

// Add LMMS root to the tree
m_lmmsRoot = new QTreeWidgetItem();
m_lmmsRoot->setText( 0, "LMMS" );
m_descTree->insertTopLevelItem( 0, m_lmmsRoot );
m_lmmsRoot->setExpanded( true );

view_layout->addWidget(hint);
view_layout->addWidget(scrollarea);
// Add LV2 root to the tree
m_lv2Root = new QTreeWidgetItem();
m_lv2Root->setText( 0, "LV2" );
m_descTree->insertTopLevelItem( 1, m_lv2Root );

// Add plugins to the tree roots
addPlugins();

// Resize
m_descTree->header()->setSectionResizeMode( QHeaderView::ResizeToContents );

// Hide empty roots
updateRootVisibilities();
}


void PluginBrowser::updateRootVisibility( int rootIndex )
{
QTreeWidgetItem * root = m_descTree->topLevelItem( rootIndex );
root->setHidden( !root->childCount() );
}


PluginDescList::PluginDescList(QWidget *parent) :
QWidget(parent)
void PluginBrowser::updateRootVisibilities()
{
QVBoxLayout* layout = new QVBoxLayout(this);
int rootCount = m_descTree->topLevelItemCount();
for (int rootIndex = 0; rootIndex < rootCount; ++rootIndex)
{
updateRootVisibility( rootIndex );
}
}


void PluginBrowser::onFilterChanged( const QString & filter )
{
int rootCount = m_descTree->topLevelItemCount();
for (int rootIndex = 0; rootIndex < rootCount; ++rootIndex)
{
QTreeWidgetItem * root = m_descTree->topLevelItem( rootIndex );

int itemCount = root->childCount();
for (int itemIndex = 0; itemIndex < itemCount; ++itemIndex)
{
QTreeWidgetItem * item = root->child( itemIndex );
PluginDescWidget * descWidget = static_cast<PluginDescWidget *>
(m_descTree->itemWidget( item, 0));
if (descWidget->name().contains(filter, Qt::CaseInsensitive))
{
item->setHidden( false );
}
else
{
item->setHidden( true );
}
}
}
}


void PluginBrowser::addPlugins()
{
QList<Plugin::Descriptor*> descs = pluginFactory->descriptors(Plugin::Instrument);
std::sort(
descs.begin(),
Expand All @@ -93,7 +163,7 @@ PluginDescList::PluginDescList(QWidget *parent) :

for (const Plugin::Descriptor* desc: descs)
{
if( desc->subPluginFeatures )
if ( desc->subPluginFeatures )
{
desc->subPluginFeatures->listSubPluginKeys(
desc,
Expand All @@ -109,13 +179,18 @@ PluginDescList::PluginDescList(QWidget *parent) :

for (const PluginKey& key : pluginKeys)
{
PluginDescWidget* p = new PluginDescWidget( key, this );
p->show();
layout->addWidget(p);
QTreeWidgetItem * item = new QTreeWidgetItem();
if ( key.desc->name == QStringLiteral("lv2instrument") )
{
m_lv2Root->addChild( item );
}
else
{
m_lmmsRoot->addChild( item );
}
PluginDescWidget* p = new PluginDescWidget( key, m_descTree );
m_descTree->setItemWidget( item, 0, p );
}

setLayout(layout);
layout->addStretch();
}


Expand All @@ -137,6 +212,14 @@ PluginDescWidget::PluginDescWidget(const PluginKey &_pk,



QString PluginDescWidget::name() const
{
return m_pluginKey.displayName();
}




void PluginDescWidget::paintEvent( QPaintEvent * )
{

Expand Down Expand Up @@ -190,7 +273,7 @@ void PluginDescWidget::leaveEvent( QEvent * _e )

void PluginDescWidget::mousePressEvent( QMouseEvent * _me )
{
if( _me->button() == Qt::LeftButton )
if ( _me->button() == Qt::LeftButton )
{
Engine::setDndPluginKey(&m_pluginKey);
new StringPairDrag("instrument",
Expand Down