Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
saves the collapsing state with the project / clean up code
  • Loading branch information
BaraMGB committed Aug 24, 2019
commit 3ea3da8c5e6d7ebf6d80249fe813e02428785287
2 changes: 2 additions & 0 deletions include/ControllerRackView.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* ControllerRackView.h - view for song's controllers
*
* Copyright (c) 2008-2009 Paul Giblock <drfaygo/at/gmail.com>
* Copyright (c) 2019 Steffen Baranowsky <BaraMGB/at/freenet.de>
*
* This file is part of LMMS - https://lmms.io
*
Expand Down Expand Up @@ -83,6 +84,7 @@ private slots:

private:
QVector<ControllerView *> m_controllerViews;
QVector<bool> m_collapsingStateOnLoad;

QScrollArea * m_scrollArea;
QVBoxLayout * m_scrollAreaLayout;
Expand Down
10 changes: 5 additions & 5 deletions include/ControllerView.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* ControllerView.h - view-component for an control
*
* Copyright (c) 2008 Paul Giblock <drfaygo/at/gmail.com>
* Copyright (c) 2019 Steffen Baranowsky <BaraMGB/at/freenet.de>
*
* This file is part of LMMS - https://lmms.io
*
Expand Down Expand Up @@ -56,10 +57,9 @@ class ControllerView : public QFrame, public ModelView

bool isCollapsed() const;

public slots:

void collapseController();
void expandController();
public slots:
void collapseController(bool collapse);
void toggleCollapseController();

void rename();
Expand All @@ -82,7 +82,7 @@ public slots:
virtual void paintEvent(QPaintEvent *);
virtual void contextMenuEvent(QContextMenuEvent *);
virtual void modelChanged();
virtual void mouseDoubleClickEvent(QMouseEvent *);
virtual void mouseDoubleClickEvent(QMouseEvent *me);
virtual void dragEnterEvent( QDragEnterEvent * dee );
virtual void dropEvent( QDropEvent * de );

Expand All @@ -95,6 +95,6 @@ public slots:
QLineEdit * m_nameLineEdit;
QPushButton * m_collapseButton;
Controller * m_modelC;
} ;
};

#endif
41 changes: 32 additions & 9 deletions src/gui/widgets/ControllerRackView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*
* Copyright (c) 2008-2009 Paul Giblock <drfaygo/at/gmail.com>
* Copyright (c) 2010-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2019 Steffen Baranowsky <BaraMGB/at/freenet.de>
*
* This file is part of LMMS - https://lmms.io
*
Expand Down Expand Up @@ -45,7 +46,8 @@


ControllerRackView::ControllerRackView() :
QWidget()
QWidget(),
m_collapsingStateOnLoad()
{
setWindowIcon(embed::getIconPixmap("controller"));
setWindowTitle(tr("Controller Rack"));
Expand Down Expand Up @@ -102,9 +104,14 @@ ControllerRackView::~ControllerRackView()



void ControllerRackView::saveSettings(QDomDocument &,
QDomElement & parent)
void ControllerRackView::saveSettings(QDomDocument &, QDomElement & parent)
{
parent.setAttribute(QString("controllerCount"), m_controllerViews.size());
for (auto i = 1; i <= m_controllerViews.size(); i++)
{
bool collapsed = m_controllerViews.at(i - 1)->isCollapsed();
parent.setAttribute(QString("controllerView") + QString::number(i), collapsed);
}
MainWindow::saveWidgetState(this, parent);
}

Expand All @@ -113,6 +120,12 @@ void ControllerRackView::saveSettings(QDomDocument &,

void ControllerRackView::loadSettings(const QDomElement & _this)
{
int controllerCount = _this.attribute(QString("controllerCount")).toInt();
for (auto i = 1; i <= controllerCount; i++)
{
bool collapsingState = _this.attribute(QString("controllerView") + QString::number(i)).toInt();
m_collapsingStateOnLoad.append(collapsingState);
}
MainWindow::restoreWidgetState(this, _this);
}

Expand All @@ -123,15 +136,15 @@ void ControllerRackView::deleteController(ControllerView * view)
{
Controller * c = view->getController();

if(c->connectionCount() > 0)
if (c->connectionCount() > 0)
{
QMessageBox msgBox;
msgBox.setIcon(QMessageBox::Question);
msgBox.setWindowTitle(tr("Confirm Delete"));
msgBox.setText(tr("Confirm delete? There are existing connection(s) "
"associated with this controller. There is no way to undo."));
msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
if(msgBox.exec() != QMessageBox::Ok)
if (msgBox.exec() != QMessageBox::Ok)
{
return;
}
Expand All @@ -147,7 +160,7 @@ void ControllerRackView::collapsingAll()
{
for (auto &it : m_controllerViews)
{
it->collapseController();
it->collapseController(true);
}
}

Expand All @@ -158,7 +171,7 @@ void ControllerRackView::expandAll()
{
for (auto &it : m_controllerViews)
{
it->expandController();
it->collapseController(false);
}
}

Expand All @@ -175,8 +188,15 @@ void ControllerRackView::onControllerAdded(Controller * controller)
connect(controllerView, SIGNAL(controllerMoveUp(ControllerView*)), this, SLOT(moveControllerUp(ControllerView*)));
connect(controllerView, SIGNAL(controllerMoveDown(ControllerView*)), this, SLOT(moveControllerDown(ControllerView*)));
m_controllerViews.append(controllerView);
int n = m_scrollAreaLayout->count() - 1; //-1 because the stretch?
int n = m_scrollAreaLayout->count() - 1;
m_scrollAreaLayout->insertWidget(n, controllerView);
if (Engine::getSong()->isLoadingProject())
{
if (m_collapsingStateOnLoad.at(m_controllerViews.size() - 1))
{
controllerView->collapseController(true);
}
}

update();
}
Expand Down Expand Up @@ -207,7 +227,7 @@ void ControllerRackView::onControllerRemoved(Controller * removedController)

void ControllerRackView::onControllerCollapsed()
{
//we hide the scrollbar and test in update() if a scrollbar is needed
//we hide the scrollbar and let update() test if a scrollbar is needed
m_scrollArea->verticalScrollBar()->hide();
update();
}
Expand Down Expand Up @@ -250,6 +270,9 @@ void ControllerRackView::moveControllerDown(ControllerView *cv)
}
}




const QVector<ControllerView *> ControllerRackView::controllerViews() const
{
return m_controllerViews;
Expand Down
78 changes: 39 additions & 39 deletions src/gui/widgets/ControllerView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*
* Copyright (c) 2008-2009 Paul Giblock <drfaygo/at/gmail.com>
* Copyright (c) 2011-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2019 Steffen Baranowsky <BaraMGB/at/freenet.de>
*
* This file is part of LMMS - https://lmms.io
*
Expand Down Expand Up @@ -113,22 +114,21 @@ bool ControllerView::isCollapsed() const



void ControllerView::collapseController()
void ControllerView::collapseController(bool collapse)
{
m_collapseButton->setIcon(embed::getIconPixmap("stepper-left"));
m_controllerDlg->hide();
setFixedHeight(m_titleBarHeight);
emit controllerCollapsed();
}




void ControllerView::expandController()
{
m_controllerDlg->show();
setFixedHeight(m_controllerDlg->height() + m_titleBarHeight + 1);
m_collapseButton->setIcon(embed::getIconPixmap("stepper-down"));
if (collapse)
{
m_collapseButton->setIcon(embed::getIconPixmap("stepper-left"));
m_controllerDlg->hide();
setFixedHeight(m_titleBarHeight);
emit controllerCollapsed();
}
else
{
m_controllerDlg->show();
setFixedHeight(m_controllerDlg->height() + m_titleBarHeight + 1);
m_collapseButton->setIcon(embed::getIconPixmap("stepper-down"));
}
}


Expand All @@ -144,14 +144,7 @@ void ControllerView::deleteController()

void ControllerView::toggleCollapseController()
{
if(m_controllerDlg->isHidden())
{
expandController();
}
else
{
collapseController();
}
collapseController(!m_controllerDlg->isHidden());
}


Expand Down Expand Up @@ -198,17 +191,20 @@ void ControllerView::moveDown()



void ControllerView::mouseDoubleClickEvent(QMouseEvent *)
void ControllerView::mouseDoubleClickEvent(QMouseEvent * me)
{
rename();
if (me->y() <= m_titleBarHeight)
{
rename();
}
}




void ControllerView::dragEnterEvent(QDragEnterEvent *dee)
{
StringPairDrag::processDragEnterEvent(dee, "float_value,automatable_model" );
StringPairDrag::processDragEnterEvent(dee, "automatable_model" );
}


Expand All @@ -221,21 +217,23 @@ void ControllerView::dropEvent(QDropEvent * de)
if (type == "automatable_model")
{
AutomatableModel * mod = dynamic_cast<AutomatableModel *>(Engine::projectJournal()->journallingObject(val.toInt()));
if (m_modelC->hasModel(mod))
{
QMessageBox::warning(this, tr("LMMS"), tr("Cycle Detected."));
}

if (mod != NULL && m_modelC->hasModel(mod) == false)
if (mod != nullptr)
{
if (mod->controllerConnection())
if (m_modelC->hasModel(mod))
{
mod->controllerConnection()->setController(getController());
QMessageBox::warning(this, tr("LMMS"), tr("Cycle Detected."));
}
else
{
ControllerConnection * cc = new ControllerConnection(getController());
mod->setControllerConnection(cc);
if (mod->controllerConnection())
{
mod->controllerConnection()->setController(getController());
}
else
{
ControllerConnection * cc = new ControllerConnection(getController());
mod->setControllerConnection(cc);
}
}
}
}
Expand All @@ -253,9 +251,9 @@ void ControllerView::modelChanged()

void ControllerView::paintEvent(QPaintEvent*)
{
QPainter p( this );
QRect rect( 1, 1, width()-2, m_titleBarHeight );
p.fillRect( rect, p.background() );
QPainter p(this);
QRect rect(1, 1, width() - 2, m_titleBarHeight);
p.fillRect(rect, p.background());
}


Expand All @@ -278,6 +276,8 @@ void ControllerView::contextMenuEvent(QContextMenuEvent *)
contextMenu->addAction(embed::getIconPixmap("stepper-down"), tr("Move &down"), this, SLOT(moveDown())
)->setDisabled(gui->getControllerRackView()->controllerViews().last() == this);
contextMenu->addSeparator();

contextMenu->exec(QCursor::pos());

delete contextMenu;
}