Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redesign of the Controller Rack #2944

Open
wants to merge 35 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
16203e1
Redesign of the Controller Rack
BaraMGB Jul 28, 2016
f8ea0cc
makes the controller title bar themable in styles.css
BaraMGB Jul 31, 2016
e79196f
change width when scroll bar is needed
BaraMGB Jul 31, 2016
ff124c2
minor style corretions
BaraMGB Jul 31, 2016
9ba7cd7
change window width if scrollbar is needed/minor style corrections
BaraMGB Jul 31, 2016
8ccf0f7
minor corrections
BaraMGB Jul 31, 2016
5eb3b63
change order of member variables to avoiding compiler warnings
BaraMGB Aug 2, 2016
ff7cd24
change identify method for peakcontroller dialog for avoiding subwindow
BaraMGB Aug 2, 2016
c7dbd45
detect collapse for resize window if scrollbar is not needed anymore
BaraMGB Aug 2, 2016
b853dc3
Adds drop feature to controller
BaraMGB Aug 5, 2016
82da86b
change some Headers
BaraMGB Jan 24, 2017
187406e
rebase to master
BaraMGB Jan 24, 2017
aa88b07
correct artwork files
BaraMGB Jan 24, 2017
2aa980d
add controller type to title bar
BaraMGB Jan 24, 2017
b152520
pull master
BaraMGB Aug 27, 2017
8c98234
Merge branch 'master' of https://github.com/LMMS/lmms into controller…
BaraMGB Mar 11, 2018
a93c61a
remove the <controls> button in the effect chain for peak controllers
BaraMGB Mar 11, 2018
50c6cce
Controls button in EffectRack now shows/hides ControllerRack
BaraMGB Mar 12, 2018
437facd
add <collapse/expand all> in context menu
BaraMGB Mar 12, 2018
286414e
add <move up/down controller> in the context menu
BaraMGB Mar 13, 2018
210d7f2
merge master
BaraMGB Jun 12, 2019
40c557d
clean up ControllerRackView.*
BaraMGB Jun 25, 2019
1f8b0e2
clean up ControllerView.*
BaraMGB Jun 25, 2019
f5ef8a3
fix: Controller position after reload project is wrong
BaraMGB Aug 1, 2019
5dd58d6
merge master
BaraMGB Aug 1, 2019
7427142
merge master part2
BaraMGB Aug 1, 2019
cf6c7a8
ensure qt5.4 compatibility for windows builds
BaraMGB Aug 13, 2019
d325dd2
improve the collapsing
BaraMGB Aug 13, 2019
3ea3da8
saves the collapsing state with the project / clean up code
BaraMGB Aug 24, 2019
1252142
clean up code
BaraMGB Aug 24, 2019
66ad5b5
fix crash during load an old project
BaraMGB Aug 25, 2019
b863932
suggested changes from code review by PhysSong
BaraMGB Aug 28, 2019
afafa21
move SubWindow logic from EffectView to EffectControllerDialog
BaraMGB Aug 28, 2019
9e67b38
export ControllerRackView class
BaraMGB Aug 29, 2019
63a14a4
clean up #includes in PeakControllerDialog.cpp
BaraMGB Aug 29, 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
Binary file added data/themes/classic/peak_controller_artwork.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/themes/default/peak_controller_artwork.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions data/themes/default/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ QMenu::indicator:selected {
background-color: #101213;
}

ControllerView {
background-color: qlineargradient(spread:reflect, x1:0, y1:0, x2:0, y2:1, stop:0 #636c7a, stop:1 #343840);
}

PianoRoll {
background-color: #141616;
qproperty-backgroundShade: rgba(255, 255, 255, 10);
Expand Down
25 changes: 19 additions & 6 deletions include/ControllerRackView.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@
#ifndef CONTROLLER_RACK_VIEW_H
#define CONTROLLER_RACK_VIEW_H

#include <QWidget>
#include <QCloseEvent>
#include <QMdiSubWindow>
#include <QWidget>

#include "SerializingObject.h"
#include "lmms_basics.h"
#include "SerializingObject.h"


class QPushButton;
Expand All @@ -55,29 +56,41 @@ class ControllerRackView : public QWidget, public SerializingObject
return "ControllerRackView";
}

QMdiSubWindow *subWin() const;

bool allExpanded() const;
bool allCollapsed() const;

public slots:
void deleteController( ControllerView * _view );
void collapsingAll();
void expandAll();
void onControllerAdded( Controller * );
void onControllerRemoved( Controller * );
void onControllerCollapsed();
void setAllExpanded(bool allExpanded);
void setAllCollapsed(bool allCollapsed);

protected:
virtual void closeEvent( QCloseEvent * _ce );
virtual void resizeEvent( QResizeEvent * re );
virtual void paintEvent( QPaintEvent * pe );

private slots:
void addController();

void moveControllerUp(ControllerView * cv);
void moveControllerDown(ControllerView * cv);

private:
QVector<ControllerView *> m_controllerViews;

QScrollArea * m_scrollArea;
QVBoxLayout * m_scrollAreaLayout;
QPushButton * m_addButton;
QMdiSubWindow * m_subWin;

// Stores the index of where to insert the next ControllerView.
// Needed so that the StretchItem always stays at the last position.
int m_nextIndex;
bool m_allExpanded;
bool m_allCollapsed;
} ;

#endif
31 changes: 24 additions & 7 deletions include/ControllerView.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@
#define CONTROLLER_VIEW_H

#include <QFrame>
#include <QLabel>

#include "AutomatableModel.h"
#include "Controller.h"
#include "ModelView.h"

class QGroupBox;
class QLabel;
class QLineEdit;
class QPushButton;
class QMdiSubWindow;

Expand All @@ -58,28 +59,44 @@ class ControllerView : public QFrame, public ModelView


public slots:
void editControls();

void collapseController();
void expandController();
void deleteController();
void displayHelp();
void closeControls();
void renameController();
void toggleCollapseController();
void renameFinished();
void rename();
void moveUp();
void moveDown();


signals:
void deleteController( ControllerView * _view );
void controllerCollapsed();
void collapseAll();
void expandAll();
void controllerMoveUp(ControllerView * view);
void controllerMoveDown(ControllerView * view);


protected:
virtual void paintEvent( QPaintEvent * event );
virtual void contextMenuEvent( QContextMenuEvent * _me );
virtual void modelChanged();
virtual void mouseDoubleClickEvent( QMouseEvent * event );
virtual void dragEnterEvent( QDragEnterEvent * dee );
virtual void dropEvent( QDropEvent * de );


private:
QMdiSubWindow * m_subWindow;
ControllerDialog * m_controllerDlg;
QLabel * m_nameLabel;
const int m_titleBarHeight;
bool m_show;

QLabel * controllerTypeLabel;
QLineEdit * m_nameLineEdit;
QPushButton * m_collapse;
Controller * m_modelC;
} ;

#endif
3 changes: 2 additions & 1 deletion include/PeakController.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class EXPORT PeakController : public Controller
virtual void saveSettings( QDomDocument & _doc, QDomElement & _this );
virtual void loadSettings( const QDomElement & _this );
virtual QString nodeName() const;
PeakControllerEffect *getPeakControllerEffect();

static void initGetControllerBySetting();
static PeakController * getControllerBySetting( const QDomElement & _this );
Expand Down Expand Up @@ -87,7 +88,7 @@ class PeakControllerDialog : public ControllerDialog
{
Q_OBJECT
public:
PeakControllerDialog( Controller * _controller, QWidget * _parent );
PeakControllerDialog(PeakController *_controller, QWidget * _parent );
virtual ~PeakControllerDialog();

protected:
Expand Down
2 changes: 1 addition & 1 deletion plugins/peak_controller_effect/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
INCLUDE(BuildPlugin)

BUILD_PLUGIN(peakcontrollereffect peak_controller_effect.cpp peak_controller_effect_controls.cpp peak_controller_effect_control_dialog.cpp peak_controller_effect.h peak_controller_effect_controls.h peak_controller_effect_control_dialog.h MOCFILES peak_controller_effect_controls.h peak_controller_effect_control_dialog.h EMBEDDED_RESOURCES artwork.png logo.png)
BUILD_PLUGIN(peakcontrollereffect peak_controller_effect.cpp peak_controller_effect_controls.cpp peak_controller_effect_control_dialog.cpp peak_controller_effect.h peak_controller_effect_controls.h peak_controller_effect_control_dialog.h MOCFILES peak_controller_effect_controls.h peak_controller_effect_control_dialog.h peak_controller_effect_control_dialog.h EMBEDDED_RESOURCES artwork.png logo.png)
PhysSong marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ PeakControllerEffectControlDialog::PeakControllerEffectControlDialog(
setWindowIcon( embed::getIconPixmap( "controller" ) );
setAutoFillBackground( true );
QPalette pal;
pal.setBrush( backgroundRole(), PLUGIN_NAME::getIconPixmap( "artwork" ) );
pal.setBrush( backgroundRole(), QBrush( embed::getIconPixmap( "peak_controller_artwork" ) ) );
setPalette( pal );
setFixedSize( 240, 80 );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class LedCheckBox;

class PeakControllerEffectControlDialog : public EffectControlDialog
{
Q_OBJECT
public:
PeakControllerEffectControlDialog(
PeakControllerEffectControls * _controls );
Expand Down
5 changes: 5 additions & 0 deletions src/core/PeakController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,11 @@ QString PeakController::nodeName() const
return( "Peakcontroller" );
}

PeakControllerEffect * PeakController::getPeakControllerEffect()
{
return m_peakEffect;
}



ControllerDialog * PeakController::createDialog( QWidget * _parent )
Expand Down
21 changes: 13 additions & 8 deletions src/gui/PeakControllerDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,31 +27,36 @@
#include <QLabel>
#include <QPushButton>
#include <QMdiArea>
#include <QMdiSubWindow>
#include <QPainter>

#include "CaptionMenu.h"
#include "gui_templates.h"
#include "embed.h"
#include "Engine.h"
#include "MainWindow.h"
#include "ToolTip.h"

#include "PeakController.h"
#include "ControllerDialog.h"
#include "Knob.h"
#include "TempoSyncKnob.h"
#include "PixmapButton.h"
#include "plugins/peak_controller_effect/peak_controller_effect.h"
#include "plugins/peak_controller_effect/peak_controller_effect_control_dialog.cpp"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't you include "embed.h" and <QIcon> and then change line 42 to:

	setWindowIcon( QIcon(embed::getIconPixmap( "controller" )) );

instead of including peak_controller_effect_control_dialog.cpp?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand. Please, can you elaborate? Have you tested your suggestion?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes when I remove the .cpp include it fails compiling with: error: 'embed' has not been declared.

So I added #include "embed.h". Then it fails because setWindowIcon aspects a QIcon but a QPixmap is given.

So that's why also included <QIcon> and changed the setWindowIcon line.

After that it compiles and works fine here.

#include "EffectControlDialog.h"
#include <QLayout>


PeakControllerDialog::PeakControllerDialog( Controller * _model, QWidget * _parent ) :
PeakControllerDialog::PeakControllerDialog( PeakController * _model, QWidget * _parent ) :
ControllerDialog( _model, _parent )
{
EffectControlDialog * dlg = _model->getPeakControllerEffect()->controls()->createView();
setWindowTitle( tr( "PEAK" ) );
setWindowIcon( embed::getIconPixmap( "controller" ) );
setFixedSize( 256, 64 );

ToolTip::add( this, tr( "LFO Controller" ) );

QLabel * l = new QLabel( this );
l->setText( "Use FX's controls" );
l->move(10, 10);
setFixedSize( dlg->size() );
dlg->setParent( this );
dlg->show();

setModel( _model );
}
Expand Down
Loading