From 34daf0378bc83e63ff687dbcd8aefe4ce59c4fe7 Mon Sep 17 00:00:00 2001 From: enp2s0 Date: Wed, 7 Aug 2024 12:29:35 -0400 Subject: [PATCH 01/16] mini fx rewrite without merge conflicts --- include/Effect.h | 7 -- include/EffectLabelButton.h | 55 ++++++++++++ include/EffectView.h | 14 ++- src/core/Effect.cpp | 11 +-- src/gui/CMakeLists.txt | 1 + src/gui/EffectView.cpp | 119 +++++++++++++------------- src/gui/widgets/EffectLabelButton.cpp | 73 ++++++++++++++++ 7 files changed, 205 insertions(+), 75 deletions(-) create mode 100644 include/EffectLabelButton.h create mode 100644 src/gui/widgets/EffectLabelButton.cpp diff --git a/include/Effect.h b/include/Effect.h index 34f8be00a07..6105b60b97e 100644 --- a/include/Effect.h +++ b/include/Effect.h @@ -125,12 +125,6 @@ class LMMS_EXPORT Effect : public Plugin return 1.0f - m_wetDryModel.value(); } - inline float gate() const - { - const float level = m_gateModel.value(); - return level*level * m_processors; - } - inline f_cnt_t bufferCount() const { return m_bufferCount; @@ -227,7 +221,6 @@ class LMMS_EXPORT Effect : public Plugin BoolModel m_enabledModel; FloatModel m_wetDryModel; - FloatModel m_gateModel; TempoSyncKnobModel m_autoQuitModel; bool m_autoQuitDisabled; diff --git a/include/EffectLabelButton.h b/include/EffectLabelButton.h new file mode 100644 index 00000000000..7d76ac7ddff --- /dev/null +++ b/include/EffectLabelButton.h @@ -0,0 +1,55 @@ +/* + * EffectLabelButton.h - class trackLabelButton + * + * Copyright (c) 2004-2008 Tobias Doerffel + * + * This file is part of LMMS - https://lmms.io + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + */ + +#ifndef LMMS_GUI_EFFECT_LABEL_BUTTON_H +#define LMMS_GUI_EFFECT_LABEL_BUTTON_H + +#include + +namespace lmms::gui +{ + +class EffectView; + +class EffectLabelButton : public QPushButton +{ + Q_OBJECT +public: + EffectLabelButton( EffectView * _tv, QWidget * _parent ); + ~EffectLabelButton() override = default; + +protected: + void paintEvent(QPaintEvent* pe) override; + +private: + EffectView * m_effectView; + QString m_iconName; + QRect m_buttonRect; + QString elideName( const QString &name ); +} ; + + +} // namespace lmms::gui + +#endif // LMMS_GUI_EFFECT_LABEL_BUTTON_H \ No newline at end of file diff --git a/include/EffectView.h b/include/EffectView.h index 805e4a4279c..a9a836a9f13 100644 --- a/include/EffectView.h +++ b/include/EffectView.h @@ -29,12 +29,16 @@ #include "AutomatableModel.h" #include "PluginView.h" #include "Effect.h" +#include "EffectLabelButton.h" class QGraphicsOpacityEffect; class QGroupBox; class QLabel; class QPushButton; class QMdiSubWindow; +class QHBoxLayout; +class QLabel; +class QToolButton; namespace lmms::gui { @@ -62,12 +66,14 @@ class EffectView : public PluginView } static constexpr int DEFAULT_WIDTH = 215; - static constexpr int DEFAULT_HEIGHT = 60; + static constexpr int DEFAULT_HEIGHT = 35; void mouseMoveEvent(QMouseEvent* event) override; void mousePressEvent(QMouseEvent* event) override; void mouseReleaseEvent(QMouseEvent* event) override; + void setViewWidth(int px); + public slots: void editControls(); void moveUp(); @@ -88,17 +94,19 @@ public slots: private: - QPixmap m_bg; + QHBoxLayout* m_mainLayout; LedCheckBox * m_bypass; + EffectLabelButton* m_label; Knob * m_wetDry; TempoSyncKnob * m_autoQuit; - Knob * m_gate; QMdiSubWindow * m_subWindow; EffectControlDialog * m_controlView; + int m_viewWidth; bool m_dragging; QGraphicsOpacityEffect* m_opacityEffect; + friend class EffectLabelButton; } ; diff --git a/src/core/Effect.cpp b/src/core/Effect.cpp index b6b2840515a..e9d8e6be1ce 100644 --- a/src/core/Effect.cpp +++ b/src/core/Effect.cpp @@ -50,7 +50,6 @@ Effect::Effect( const Plugin::Descriptor * _desc, m_bufferCount( 0 ), m_enabledModel( true, this, tr( "Effect enabled" ) ), m_wetDryModel( 1.0f, -1.0f, 1.0f, 0.01f, this, tr( "Wet/Dry mix" ) ), - m_gateModel( 0.0f, 0.0f, 1.0f, 0.01f, this, tr( "Gate" ) ), m_autoQuitModel( 1.0f, 1.0f, 8000.0f, 100.0f, 1.0f, this, tr( "Decay" ) ), m_autoQuitDisabled( false ) { @@ -91,7 +90,6 @@ void Effect::saveSettings( QDomDocument & _doc, QDomElement & _this ) m_enabledModel.saveSettings( _doc, _this, "on" ); m_wetDryModel.saveSettings( _doc, _this, "wet" ); m_autoQuitModel.saveSettings( _doc, _this, "autoquit" ); - m_gateModel.saveSettings( _doc, _this, "gate" ); controls()->saveState( _doc, _this ); } @@ -103,7 +101,6 @@ void Effect::loadSettings( const QDomElement & _this ) m_enabledModel.loadSettings( _this, "on" ); m_wetDryModel.loadSettings( _this, "wet" ); m_autoQuitModel.loadSettings( _this, "autoquit" ); - m_gateModel.loadSettings( _this, "gate" ); QDomNode node = _this.firstChild(); while( !node.isNull() ) @@ -146,19 +143,19 @@ Effect * Effect::instantiate( const QString& pluginName, -void Effect::checkGate( double _out_sum ) +void Effect::checkGate(double _out_sum) { - if( m_autoQuitDisabled ) + if(m_autoQuitDisabled) { return; } // Check whether we need to continue processing input. Restart the // counter if the threshold has been exceeded. - if (_out_sum - gate() <= F_EPSILON) + if (_out_sum <= F_EPSILON) { incrementBufferCount(); - if( bufferCount() > timeout() ) + if(bufferCount() > timeout()) { stopRunning(); resetBufferCount(); diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 4195ec58c1a..d4a5a4446b9 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -103,6 +103,7 @@ SET(LMMS_SRCS gui/widgets/CaptionMenu.cpp gui/widgets/ComboBox.cpp gui/widgets/CustomTextKnob.cpp + gui/widgets/EffectLabelButton.cpp gui/widgets/Fader.cpp gui/widgets/FloatModelEditorBase.cpp gui/widgets/Graph.cpp diff --git a/src/gui/EffectView.cpp b/src/gui/EffectView.cpp index 6f2b984c32a..242462f802a 100644 --- a/src/gui/EffectView.cpp +++ b/src/gui/EffectView.cpp @@ -28,6 +28,10 @@ #include #include #include +#include +#include +#include +#include #include "EffectView.h" #include "DummyEffect.h" @@ -47,63 +51,57 @@ namespace lmms::gui EffectView::EffectView( Effect * _model, QWidget * _parent ) : PluginView( _model, _parent ), - m_bg( embed::getIconPixmap( "effect_plugin" ) ), m_subWindow( nullptr ), m_controlView(nullptr), m_dragging(false) { - setFixedSize(EffectView::DEFAULT_WIDTH, EffectView::DEFAULT_HEIGHT); setFocusPolicy(Qt::StrongFocus); + setViewWidth(EffectView::DEFAULT_WIDTH); + + m_mainLayout = new QHBoxLayout(); + m_mainLayout->setContentsMargins(8, 2, 8, 2); - // Disable effects that are of type "DummyEffect" + bool hasControls = effect()->controls()->controlCount() > 0; bool isEnabled = !dynamic_cast( effect() ); - m_bypass = new LedCheckBox( this, "", isEnabled ? LedCheckBox::LedColor::Green : LedCheckBox::LedColor::Red ); - m_bypass->move( 3, 3 ); - m_bypass->setEnabled( isEnabled ); + m_bypass = new LedCheckBox(this, "", isEnabled ? LedCheckBox::LedColor::Green : LedCheckBox::LedColor::Red); + m_bypass->setEnabled(isEnabled); m_bypass->setToolTip(tr("On/Off")); + m_mainLayout->addWidget(m_bypass); + + QFont labelFont = adjustedToPixelSize(font(), 10); + m_label = new EffectLabelButton(this, this); + m_label->setText(model()->displayName()); + m_label->setFont(labelFont); + m_label->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Maximum); + if(hasControls) + { + connect(m_label, SIGNAL(clicked()), this, SLOT(editControls())); + } + m_mainLayout->addWidget(m_label); + m_wetDry = new Knob(KnobType::Small17, this); + m_wetDry->setEnabled(isEnabled); + m_wetDry->setHintText(tr("Wet Level:"), ""); + m_mainLayout->addWidget(m_wetDry); - m_wetDry = new Knob( KnobType::Bright26, this ); - m_wetDry->setLabel( tr( "W/D" ) ); - m_wetDry->move( 40 - m_wetDry->width() / 2, 5 ); - m_wetDry->setEnabled( isEnabled ); - m_wetDry->setHintText( tr( "Wet Level:" ), "" ); - - - m_autoQuit = new TempoSyncKnob( KnobType::Bright26, this ); - m_autoQuit->setLabel( tr( "DECAY" ) ); - m_autoQuit->move( 78 - m_autoQuit->width() / 2, 5 ); - m_autoQuit->setEnabled( isEnabled && !effect()->m_autoQuitDisabled ); - m_autoQuit->setHintText( tr( "Time:" ), "ms" ); - - - m_gate = new Knob( KnobType::Bright26, this ); - m_gate->setLabel( tr( "GATE" ) ); - m_gate->move( 116 - m_gate->width() / 2, 5 ); - m_gate->setEnabled( isEnabled && !effect()->m_autoQuitDisabled ); - m_gate->setHintText( tr( "Gate:" ), "" ); - + m_autoQuit = new TempoSyncKnob(KnobType::Small17, this); + m_autoQuit->setEnabled(isEnabled && !effect()->m_autoQuitDisabled); + m_autoQuit->setVisible(isEnabled && !effect()->m_autoQuitDisabled); + m_autoQuit->setHintText(tr("Stop after:"), "ms"); + m_mainLayout->addWidget(m_autoQuit); - setModel( _model ); + setModel(_model); - if( effect()->controls()->controlCount() > 0 ) + if(hasControls) { - auto ctls_btn = new QPushButton(tr("Controls"), this); - QFont f = ctls_btn->font(); - ctls_btn->setFont(adjustedToPixelSize(f, 10)); - ctls_btn->setGeometry( 150, 14, 50, 20 ); - connect( ctls_btn, SIGNAL(clicked()), - this, SLOT(editControls())); - m_controlView = effect()->controls()->createView(); - if( m_controlView ) + if(m_controlView) { - m_subWindow = getGUI()->mainWindow()->addWindowedWidget( m_controlView ); - - if ( !m_controlView->isResizable() ) + m_subWindow = getGUI()->mainWindow()->addWindowedWidget(m_controlView); + if (!m_controlView->isResizable()) { - m_subWindow->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ); + m_subWindow->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); if (m_subWindow->layout()) { m_subWindow->layout()->setSizeConstraint(QLayout::SetFixedSize); @@ -112,9 +110,9 @@ EffectView::EffectView( Effect * _model, QWidget * _parent ) : Qt::WindowFlags flags = m_subWindow->windowFlags(); flags &= ~Qt::WindowMaximizeButtonHint; - m_subWindow->setWindowFlags( flags ); + m_subWindow->setWindowFlags(flags); - connect( m_controlView, SIGNAL(closed()), + connect(m_controlView, SIGNAL(closed()), this, SLOT(closeEffects())); m_subWindow->hide(); @@ -125,8 +123,7 @@ EffectView::EffectView( Effect * _model, QWidget * _parent ) : m_opacityEffect->setOpacity(1); setGraphicsEffect(m_opacityEffect); - //move above vst effect view creation - //setModel( _model ); + setLayout(m_mainLayout); } @@ -148,12 +145,14 @@ void EffectView::editControls() { m_subWindow->show(); m_subWindow->raise(); - effect()->controls()->setViewVisible( true ); + effect()->controls()->setViewVisible(true); + m_label->setDown(true); } else { m_subWindow->hide(); - effect()->controls()->setViewVisible( false ); + effect()->controls()->setViewVisible(false); + m_label->setDown(false); } } } @@ -255,19 +254,15 @@ void EffectView::mouseMoveEvent(QMouseEvent* event) void EffectView::paintEvent( QPaintEvent * ) { - QPainter p( this ); - p.drawPixmap( 0, 0, m_bg ); - - QFont f = adjustedToPixelSize(font(), 10); - f.setBold( true ); - p.setFont( f ); + QPainter p(this); + QPainterPath path; - QString elidedText = p.fontMetrics().elidedText( model()->displayName(), Qt::ElideRight, width() - 22 ); + path.addRoundedRect(QRectF(2, 2, m_viewWidth - 4, EffectView::DEFAULT_HEIGHT - 4), 2, 2); - p.setPen( palette().shadow().color() ); - p.drawText( 6, 55, elidedText ); - p.setPen( palette().text().color() ); - p.drawText( 5, 54, elidedText ); + QPen pen(Qt::black, 1); + p.setPen(pen); + p.fillPath(path, QColor(0x3b, 0x42, 0x4a)); + p.drawPath(path); } @@ -278,7 +273,15 @@ void EffectView::modelChanged() m_bypass->setModel( &effect()->m_enabledModel ); m_wetDry->setModel( &effect()->m_wetDryModel ); m_autoQuit->setModel( &effect()->m_autoQuitModel ); - m_gate->setModel( &effect()->m_gateModel ); +} + + + + +void EffectView::setViewWidth(int px) +{ + m_viewWidth = px; + setFixedSize(m_viewWidth, EffectView::DEFAULT_HEIGHT); } } // namespace lmms::gui diff --git a/src/gui/widgets/EffectLabelButton.cpp b/src/gui/widgets/EffectLabelButton.cpp new file mode 100644 index 00000000000..3943fbd674e --- /dev/null +++ b/src/gui/widgets/EffectLabelButton.cpp @@ -0,0 +1,73 @@ +/* + * EffectLabelButton.cpp - implementation of class trackLabelButton, a label + * which is renamable by double-clicking it + * + * Copyright (c) 2004-2008 Tobias Doerffel + * + * This file is part of LMMS - https://lmms.io + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + */ + + +#include "EffectLabelButton.h" + +#include +#include + +#include "ConfigManager.h" +#include "embed.h" +#include "EffectView.h" +#include "Effect.h" + +namespace lmms::gui +{ + +EffectLabelButton::EffectLabelButton( EffectView * _tv, QWidget * _parent ) : + QPushButton( _parent ), + m_effectView( _tv ), + m_iconName() +{ + setAttribute(Qt::WA_OpaquePaintEvent, true); + setAcceptDrops(false); + + setCursor( QCursor( embed::getIconPixmap( "hand" ), 3, 3 ) ); + setStyleSheet("text-align:left;padding:2px;"); + + //setFixedSize( 160, 29 ); + //setIconSize( QSize( 24, 24 ) ); +} + +void EffectLabelButton::paintEvent(QPaintEvent* pe) +{ + //setDown(!m_effectView->m_subWindow->isVisible()); + QPushButton::paintEvent(pe); +} + +QString EffectLabelButton::elideName( const QString &name ) +{ + const int spacing = 16; + const int maxTextWidth = width() - spacing - iconSize().width(); + + setToolTip(name); + + QFontMetrics metrics( font() ); + QString elidedName = metrics.elidedText( name, Qt::ElideRight, maxTextWidth ); + return elidedName; +} + +} // namespace lmms::gui \ No newline at end of file From 124a894a99b87d968e0a3deaceca8bd09ff627e1 Mon Sep 17 00:00:00 2001 From: enp2s0 Date: Wed, 7 Aug 2024 16:29:52 -0400 Subject: [PATCH 02/16] clear checked status of label button when fx window is closed --- src/gui/EffectView.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/gui/EffectView.cpp b/src/gui/EffectView.cpp index 242462f802a..d72164e529d 100644 --- a/src/gui/EffectView.cpp +++ b/src/gui/EffectView.cpp @@ -49,15 +49,15 @@ namespace lmms::gui { -EffectView::EffectView( Effect * _model, QWidget * _parent ) : - PluginView( _model, _parent ), - m_subWindow( nullptr ), +EffectView::EffectView(Effect * _model, QWidget * _parent) : + PluginView(_model, _parent), + m_subWindow(nullptr), m_controlView(nullptr), m_dragging(false) { setFocusPolicy(Qt::StrongFocus); setViewWidth(EffectView::DEFAULT_WIDTH); - + m_mainLayout = new QHBoxLayout(); m_mainLayout->setContentsMargins(8, 2, 8, 2); @@ -73,6 +73,7 @@ EffectView::EffectView( Effect * _model, QWidget * _parent ) : m_label = new EffectLabelButton(this, this); m_label->setText(model()->displayName()); m_label->setFont(labelFont); + m_label->setCheckable(true); m_label->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Maximum); if(hasControls) { @@ -146,13 +147,13 @@ void EffectView::editControls() m_subWindow->show(); m_subWindow->raise(); effect()->controls()->setViewVisible(true); - m_label->setDown(true); + m_label->setChecked(true); } else { m_subWindow->hide(); effect()->controls()->setViewVisible(false); - m_label->setDown(false); + m_label->setChecked(false); } } } @@ -189,7 +190,8 @@ void EffectView::closeEffects() { m_subWindow->hide(); } - effect()->controls()->setViewVisible( false ); + effect()->controls()->setViewVisible(false); + m_label->setChecked(false); } From 9d019452f2b18b588114ba647f9404a07a259aec Mon Sep 17 00:00:00 2001 From: enp2s0 Date: Thu, 8 Aug 2024 09:56:38 -0400 Subject: [PATCH 03/16] style & cleanup --- include/EffectView.h | 3 --- src/core/Effect.cpp | 6 +++--- src/gui/EffectView.cpp | 17 ++++------------- 3 files changed, 7 insertions(+), 19 deletions(-) diff --git a/include/EffectView.h b/include/EffectView.h index a9a836a9f13..035681671a0 100644 --- a/include/EffectView.h +++ b/include/EffectView.h @@ -72,8 +72,6 @@ class EffectView : public PluginView void mousePressEvent(QMouseEvent* event) override; void mouseReleaseEvent(QMouseEvent* event) override; - void setViewWidth(int px); - public slots: void editControls(); void moveUp(); @@ -102,7 +100,6 @@ public slots: QMdiSubWindow * m_subWindow; EffectControlDialog * m_controlView; - int m_viewWidth; bool m_dragging; QGraphicsOpacityEffect* m_opacityEffect; diff --git a/src/core/Effect.cpp b/src/core/Effect.cpp index e9d8e6be1ce..d581a7c73d2 100644 --- a/src/core/Effect.cpp +++ b/src/core/Effect.cpp @@ -143,9 +143,9 @@ Effect * Effect::instantiate( const QString& pluginName, -void Effect::checkGate(double _out_sum) +void Effect::checkGate( double _out_sum ) { - if(m_autoQuitDisabled) + if( m_autoQuitDisabled ) { return; } @@ -155,7 +155,7 @@ void Effect::checkGate(double _out_sum) if (_out_sum <= F_EPSILON) { incrementBufferCount(); - if(bufferCount() > timeout()) + if( bufferCount() > timeout() ) { stopRunning(); resetBufferCount(); diff --git a/src/gui/EffectView.cpp b/src/gui/EffectView.cpp index d72164e529d..8e471f7add9 100644 --- a/src/gui/EffectView.cpp +++ b/src/gui/EffectView.cpp @@ -55,9 +55,9 @@ EffectView::EffectView(Effect * _model, QWidget * _parent) : m_controlView(nullptr), m_dragging(false) { + setFixedSize(EffectView::DEFAULT_WIDTH, EffectView::DEFAULT_HEIGHT); setFocusPolicy(Qt::StrongFocus); - setViewWidth(EffectView::DEFAULT_WIDTH); - + m_mainLayout = new QHBoxLayout(); m_mainLayout->setContentsMargins(8, 2, 8, 2); @@ -92,7 +92,7 @@ EffectView::EffectView(Effect * _model, QWidget * _parent) : m_autoQuit->setHintText(tr("Stop after:"), "ms"); m_mainLayout->addWidget(m_autoQuit); - setModel(_model); + setModel( _model ); if(hasControls) { @@ -259,7 +259,7 @@ void EffectView::paintEvent( QPaintEvent * ) QPainter p(this); QPainterPath path; - path.addRoundedRect(QRectF(2, 2, m_viewWidth - 4, EffectView::DEFAULT_HEIGHT - 4), 2, 2); + path.addRoundedRect(QRectF(2, 2, EffectView::DEFAULT_WIDTH - 4, EffectView::DEFAULT_HEIGHT - 4), 2, 2); QPen pen(Qt::black, 1); p.setPen(pen); @@ -277,13 +277,4 @@ void EffectView::modelChanged() m_autoQuit->setModel( &effect()->m_autoQuitModel ); } - - - -void EffectView::setViewWidth(int px) -{ - m_viewWidth = px; - setFixedSize(m_viewWidth, EffectView::DEFAULT_HEIGHT); -} - } // namespace lmms::gui From efd8cfec4360e0a65483ab7fc52a7450e015e1e7 Mon Sep 17 00:00:00 2001 From: enp2s0 Date: Thu, 8 Aug 2024 10:04:32 -0400 Subject: [PATCH 04/16] add spaces --- src/gui/EffectView.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/gui/EffectView.cpp b/src/gui/EffectView.cpp index 8e471f7add9..9cff3010fc6 100644 --- a/src/gui/EffectView.cpp +++ b/src/gui/EffectView.cpp @@ -99,10 +99,10 @@ EffectView::EffectView(Effect * _model, QWidget * _parent) : m_controlView = effect()->controls()->createView(); if(m_controlView) { - m_subWindow = getGUI()->mainWindow()->addWindowedWidget(m_controlView); - if (!m_controlView->isResizable()) + m_subWindow = getGUI()->mainWindow()->addWindowedWidget( m_controlView ); + if ( !m_controlView->isResizable() ) { - m_subWindow->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + m_subWindow->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ); if (m_subWindow->layout()) { m_subWindow->layout()->setSizeConstraint(QLayout::SetFixedSize); @@ -111,9 +111,9 @@ EffectView::EffectView(Effect * _model, QWidget * _parent) : Qt::WindowFlags flags = m_subWindow->windowFlags(); flags &= ~Qt::WindowMaximizeButtonHint; - m_subWindow->setWindowFlags(flags); + m_subWindow->setWindowFlags( flags ); - connect(m_controlView, SIGNAL(closed()), + connect( m_controlView, SIGNAL(closed()), this, SLOT(closeEffects())); m_subWindow->hide(); @@ -146,13 +146,13 @@ void EffectView::editControls() { m_subWindow->show(); m_subWindow->raise(); - effect()->controls()->setViewVisible(true); + effect()->controls()->setViewVisible( true ); m_label->setChecked(true); } else { m_subWindow->hide(); - effect()->controls()->setViewVisible(false); + effect()->controls()->setViewVisible( false ); m_label->setChecked(false); } } From eaf94e4f5bac964fd7aed6677c1a2f5c5c5a7697 Mon Sep 17 00:00:00 2001 From: enp2s0 Date: Thu, 8 Aug 2024 10:07:04 -0400 Subject: [PATCH 05/16] more --- src/gui/EffectView.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/EffectView.cpp b/src/gui/EffectView.cpp index 9cff3010fc6..8d62d790eda 100644 --- a/src/gui/EffectView.cpp +++ b/src/gui/EffectView.cpp @@ -97,7 +97,7 @@ EffectView::EffectView(Effect * _model, QWidget * _parent) : if(hasControls) { m_controlView = effect()->controls()->createView(); - if(m_controlView) + if( m_controlView ) { m_subWindow = getGUI()->mainWindow()->addWindowedWidget( m_controlView ); if ( !m_controlView->isResizable() ) @@ -190,7 +190,7 @@ void EffectView::closeEffects() { m_subWindow->hide(); } - effect()->controls()->setViewVisible(false); + effect()->controls()->setViewVisible( false ); m_label->setChecked(false); } From 889818ab08602cf5741efa0344b372db50d41077 Mon Sep 17 00:00:00 2001 From: enp2s0 Date: Thu, 8 Aug 2024 10:12:55 -0400 Subject: [PATCH 06/16] effectlabelbutton style cleanup --- include/EffectLabelButton.h | 8 ++++---- src/gui/widgets/EffectLabelButton.cpp | 18 +++++++----------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/include/EffectLabelButton.h b/include/EffectLabelButton.h index 7d76ac7ddff..6ddb9d6d7ba 100644 --- a/include/EffectLabelButton.h +++ b/include/EffectLabelButton.h @@ -36,18 +36,18 @@ class EffectLabelButton : public QPushButton { Q_OBJECT public: - EffectLabelButton( EffectView * _tv, QWidget * _parent ); + EffectLabelButton(EffectView* _tv, QWidget* _parent); ~EffectLabelButton() override = default; protected: void paintEvent(QPaintEvent* pe) override; private: - EffectView * m_effectView; + EffectView* m_effectView; QString m_iconName; QRect m_buttonRect; - QString elideName( const QString &name ); -} ; + QString elideName(const QString &name); +}; } // namespace lmms::gui diff --git a/src/gui/widgets/EffectLabelButton.cpp b/src/gui/widgets/EffectLabelButton.cpp index 3943fbd674e..f1ca867f477 100644 --- a/src/gui/widgets/EffectLabelButton.cpp +++ b/src/gui/widgets/EffectLabelButton.cpp @@ -37,36 +37,32 @@ namespace lmms::gui { -EffectLabelButton::EffectLabelButton( EffectView * _tv, QWidget * _parent ) : - QPushButton( _parent ), - m_effectView( _tv ), +EffectLabelButton::EffectLabelButton(EffectView* _tv, QWidget* _parent) : + QPushButton(_parent), + m_effectView(_tv), m_iconName() { setAttribute(Qt::WA_OpaquePaintEvent, true); setAcceptDrops(false); - setCursor( QCursor( embed::getIconPixmap( "hand" ), 3, 3 ) ); + setCursor(QCursor(embed::getIconPixmap("hand"), 3, 3)); setStyleSheet("text-align:left;padding:2px;"); - - //setFixedSize( 160, 29 ); - //setIconSize( QSize( 24, 24 ) ); } void EffectLabelButton::paintEvent(QPaintEvent* pe) { - //setDown(!m_effectView->m_subWindow->isVisible()); QPushButton::paintEvent(pe); } -QString EffectLabelButton::elideName( const QString &name ) +QString EffectLabelButton::elideName(const QString &name) { const int spacing = 16; const int maxTextWidth = width() - spacing - iconSize().width(); setToolTip(name); - QFontMetrics metrics( font() ); - QString elidedName = metrics.elidedText( name, Qt::ElideRight, maxTextWidth ); + QFontMetrics metrics(font()); + QString elidedName = metrics.elidedText(name, Qt::ElideRight, maxTextWidth); return elidedName; } From 5b3ce79e0bf6c13108bf6791fecbb0455675ed78 Mon Sep 17 00:00:00 2001 From: enp2s0 Date: Thu, 8 Aug 2024 10:19:57 -0400 Subject: [PATCH 07/16] remove unused graphics --- data/themes/classic/effect_plugin.png | Bin 14355 -> 0 bytes data/themes/default/effect_plugin.png | Bin 443 -> 0 bytes 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 data/themes/classic/effect_plugin.png delete mode 100644 data/themes/default/effect_plugin.png diff --git a/data/themes/classic/effect_plugin.png b/data/themes/classic/effect_plugin.png deleted file mode 100644 index 6a759672ff59121a87eaf6dcd08bd8424d88f372..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14355 zcmV+uIPAxXP)89G9I)cUHbq4AOJ~3 zK~#9!?R`tHZCQ2RH^yB1JZ{~(^#F=00=96#FJfbC83?+_^-FiRn`<%Vz7-`J$nrokPZOh1=a3#3A?%Heb zwbz<+JihUbZxHOypZ&#O{_fGy@gI`vXYQWwPj25n!|gk_are$`?DrkLcPJF=x`(Pl zdIu4Mh_EaT`*nqMfvAE2hzf`RQGfstF`x$^<2uKQ;|uJo;Qt{sP9qS&`PK&i9N4wTq47Q$ z|1P3X2=WhYeusdF(A7VozLi0U+XaRKq);&Yhg1AGJH_s&UU2+D$LjG1{uz%6#02e{ z&k(@c*XcfxeP*|{0ATw3aoY$qp60X`s9YV_O3 zri*_b0ZIg#7S1^DBTqbzv$HdN_3JO-^*3IB?TB|zKmAAlNo=aawi zDf#}3e?89n%3po`KlU#F{`S4Ie*4y)cIVzb+_`fXckkTAy6$6RsA6m?(Q#8%Djt3siWT<=OD~y`r%m>K*pY=jX(~^RO^v8;3Zzo~o_8%{BOH7{;;~6lzeFcx@ga zj5iT*e0+r8`|Z!-kDq=TzxL@*dep*YAD*2lC4G>+SpBdG2?J>BU<&-+$}j zYme;dzy9g}{@q6OXZO!L-oN=C?%&_z=FOWpKR-v8J}y=Pg+Tm)t6LM8C(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4(zvMhyS} N002ovPDHLkV1fX2eboQ} diff --git a/data/themes/default/effect_plugin.png b/data/themes/default/effect_plugin.png deleted file mode 100644 index 4c312037984b87f1cfe71c4b1b2191a9ab17e9bb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 443 zcmeAS@N?(olHy`uVBq!ia0vp^*MQiPgAGV}eY{!;q}Y<$DuPYS-e z?e6Q#pS}NIu&ok`c=7zVw*32i=gCXvuRHnl)639=h08K0Em=P~MaEs9iSN*k0s(=0)S95B}UR$HRfvai5fnL@r+}_~?*p#o;-k8=x%y~z~a!s+yLLs}|O zsD(98XF*KFsisefC%NuKDCq3CFMZm-Vlo%w;C@#s`o&%!XhWEzfLK6*=oW6Ep((7{J~|+Sx19sql_C0tISFV6$R?mE zwaI7q#Wi%Y?&dgsq{%2x*VMBu^UvGYhYzkk;B-CHYtq83+wW#PnX}}(&W0Nko_t|X W>U00^!J{PsiUUtqKbLh*2~7Y(Dy|d& From af9ed03464c23c4d1a2ba3dc895cccf8034802d6 Mon Sep 17 00:00:00 2001 From: enp2s0 Date: Thu, 8 Aug 2024 23:26:38 -0400 Subject: [PATCH 08/16] effectlabelbutton cleanup --- include/EffectLabelButton.h | 8 +------- src/gui/EffectView.cpp | 2 -- src/gui/widgets/EffectLabelButton.cpp | 24 ++++-------------------- 3 files changed, 5 insertions(+), 29 deletions(-) diff --git a/include/EffectLabelButton.h b/include/EffectLabelButton.h index 6ddb9d6d7ba..4831414bba3 100644 --- a/include/EffectLabelButton.h +++ b/include/EffectLabelButton.h @@ -1,7 +1,7 @@ /* * EffectLabelButton.h - class trackLabelButton * - * Copyright (c) 2004-2008 Tobias Doerffel + * Copyright (c) 2024 Noah Brecht * * This file is part of LMMS - https://lmms.io * @@ -39,14 +39,8 @@ class EffectLabelButton : public QPushButton EffectLabelButton(EffectView* _tv, QWidget* _parent); ~EffectLabelButton() override = default; -protected: - void paintEvent(QPaintEvent* pe) override; - private: EffectView* m_effectView; - QString m_iconName; - QRect m_buttonRect; - QString elideName(const QString &name); }; diff --git a/src/gui/EffectView.cpp b/src/gui/EffectView.cpp index 8d62d790eda..2488f545453 100644 --- a/src/gui/EffectView.cpp +++ b/src/gui/EffectView.cpp @@ -73,8 +73,6 @@ EffectView::EffectView(Effect * _model, QWidget * _parent) : m_label = new EffectLabelButton(this, this); m_label->setText(model()->displayName()); m_label->setFont(labelFont); - m_label->setCheckable(true); - m_label->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Maximum); if(hasControls) { connect(m_label, SIGNAL(clicked()), this, SLOT(editControls())); diff --git a/src/gui/widgets/EffectLabelButton.cpp b/src/gui/widgets/EffectLabelButton.cpp index f1ca867f477..c43d9b7172b 100644 --- a/src/gui/widgets/EffectLabelButton.cpp +++ b/src/gui/widgets/EffectLabelButton.cpp @@ -2,7 +2,7 @@ * EffectLabelButton.cpp - implementation of class trackLabelButton, a label * which is renamable by double-clicking it * - * Copyright (c) 2004-2008 Tobias Doerffel + * Copyright (c) 2024 Noah Brecht * * This file is part of LMMS - https://lmms.io * @@ -39,31 +39,15 @@ namespace lmms::gui EffectLabelButton::EffectLabelButton(EffectView* _tv, QWidget* _parent) : QPushButton(_parent), - m_effectView(_tv), - m_iconName() + m_effectView(_tv) { setAttribute(Qt::WA_OpaquePaintEvent, true); setAcceptDrops(false); setCursor(QCursor(embed::getIconPixmap("hand"), 3, 3)); setStyleSheet("text-align:left;padding:2px;"); -} - -void EffectLabelButton::paintEvent(QPaintEvent* pe) -{ - QPushButton::paintEvent(pe); -} - -QString EffectLabelButton::elideName(const QString &name) -{ - const int spacing = 16; - const int maxTextWidth = width() - spacing - iconSize().width(); - - setToolTip(name); - - QFontMetrics metrics(font()); - QString elidedName = metrics.elidedText(name, Qt::ElideRight, maxTextWidth); - return elidedName; + setCheckable(true); + setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Maximum); } } // namespace lmms::gui \ No newline at end of file From 34a48d82aa318aa00389672b51b2a54feffb75be Mon Sep 17 00:00:00 2001 From: enp2s0 Date: Thu, 8 Aug 2024 23:35:05 -0400 Subject: [PATCH 09/16] classes are no longer friends, they hate eachother now --- include/EffectView.h | 3 +-- src/gui/EffectView.cpp | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/include/EffectView.h b/include/EffectView.h index 035681671a0..2f6d5334085 100644 --- a/include/EffectView.h +++ b/include/EffectView.h @@ -48,7 +48,6 @@ class Knob; class LedCheckBox; class TempoSyncKnob; - class EffectView : public PluginView { Q_OBJECT @@ -103,7 +102,7 @@ public slots: bool m_dragging; QGraphicsOpacityEffect* m_opacityEffect; - friend class EffectLabelButton; + //friend class EffectLabelButton; } ; diff --git a/src/gui/EffectView.cpp b/src/gui/EffectView.cpp index 2488f545453..8074b9b0552 100644 --- a/src/gui/EffectView.cpp +++ b/src/gui/EffectView.cpp @@ -45,7 +45,6 @@ #include "SubWindow.h" #include "TempoSyncKnob.h" - namespace lmms::gui { From 7f541f5fde825933232ebc24ba173f2362b07e16 Mon Sep 17 00:00:00 2001 From: enp2s0 Date: Thu, 8 Aug 2024 23:43:42 -0400 Subject: [PATCH 10/16] simpler margin calc and connect() --- src/gui/EffectView.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/EffectView.cpp b/src/gui/EffectView.cpp index 8074b9b0552..dab33cad90e 100644 --- a/src/gui/EffectView.cpp +++ b/src/gui/EffectView.cpp @@ -74,7 +74,7 @@ EffectView::EffectView(Effect * _model, QWidget * _parent) : m_label->setFont(labelFont); if(hasControls) { - connect(m_label, SIGNAL(clicked()), this, SLOT(editControls())); + connect(m_label, &EffectLabelButton::clicked, this, &EffectView::editControls); } m_mainLayout->addWidget(m_label); @@ -256,7 +256,7 @@ void EffectView::paintEvent( QPaintEvent * ) QPainter p(this); QPainterPath path; - path.addRoundedRect(QRectF(2, 2, EffectView::DEFAULT_WIDTH - 4, EffectView::DEFAULT_HEIGHT - 4), 2, 2); + path.addRoundedRect(rect().marginsRemoved(QMargins(2, 2, 2, 2)), 2, 2); QPen pen(Qt::black, 1); p.setPen(pen); From 5127544b4850e08703ee140b0e42e5ce1c4d920e Mon Sep 17 00:00:00 2001 From: enp2s0 Date: Thu, 8 Aug 2024 23:45:34 -0400 Subject: [PATCH 11/16] missing space --- src/gui/EffectView.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/EffectView.cpp b/src/gui/EffectView.cpp index dab33cad90e..36530c8f5c3 100644 --- a/src/gui/EffectView.cpp +++ b/src/gui/EffectView.cpp @@ -45,6 +45,7 @@ #include "SubWindow.h" #include "TempoSyncKnob.h" + namespace lmms::gui { From 89cb23f451bbe96a539a15c80d10f9f743e30b17 Mon Sep 17 00:00:00 2001 From: enp2s0 Date: Thu, 8 Aug 2024 23:56:52 -0400 Subject: [PATCH 12/16] one more space --- include/EffectView.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/EffectView.h b/include/EffectView.h index 2f6d5334085..c7b1f245b8c 100644 --- a/include/EffectView.h +++ b/include/EffectView.h @@ -40,6 +40,7 @@ class QHBoxLayout; class QLabel; class QToolButton; + namespace lmms::gui { From 809a15203432c19323920926eb79e7c57b73b560 Mon Sep 17 00:00:00 2001 From: enp2s0 Date: Thu, 8 Aug 2024 23:58:42 -0400 Subject: [PATCH 13/16] wrong place --- include/EffectView.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/EffectView.h b/include/EffectView.h index c7b1f245b8c..3fb4bad35b9 100644 --- a/include/EffectView.h +++ b/include/EffectView.h @@ -40,7 +40,6 @@ class QHBoxLayout; class QLabel; class QToolButton; - namespace lmms::gui { @@ -49,6 +48,7 @@ class Knob; class LedCheckBox; class TempoSyncKnob; + class EffectView : public PluginView { Q_OBJECT From e6aa0ea051035fa72217ed84c2d862b2618f6e86 Mon Sep 17 00:00:00 2001 From: Michael Gregorius Date: Fri, 9 Aug 2024 20:04:15 +0200 Subject: [PATCH 14/16] Code cleanup Newline at the end of the `EffectLabelButton` files. Cleanup of includes and forward declarations. Remove commented out friend declaration. --- include/EffectLabelButton.h | 2 +- include/EffectView.h | 15 ++++++--------- src/gui/EffectView.cpp | 2 ++ src/gui/widgets/EffectLabelButton.cpp | 2 +- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/include/EffectLabelButton.h b/include/EffectLabelButton.h index 4831414bba3..0bd076eaf74 100644 --- a/include/EffectLabelButton.h +++ b/include/EffectLabelButton.h @@ -46,4 +46,4 @@ class EffectLabelButton : public QPushButton } // namespace lmms::gui -#endif // LMMS_GUI_EFFECT_LABEL_BUTTON_H \ No newline at end of file +#endif // LMMS_GUI_EFFECT_LABEL_BUTTON_H diff --git a/include/EffectView.h b/include/EffectView.h index 3fb4bad35b9..725a5c43f40 100644 --- a/include/EffectView.h +++ b/include/EffectView.h @@ -26,20 +26,18 @@ #ifndef LMMS_GUI_EFFECT_VIEW_H #define LMMS_GUI_EFFECT_VIEW_H -#include "AutomatableModel.h" #include "PluginView.h" -#include "Effect.h" -#include "EffectLabelButton.h" class QGraphicsOpacityEffect; -class QGroupBox; -class QLabel; -class QPushButton; class QMdiSubWindow; class QHBoxLayout; -class QLabel; class QToolButton; +namespace lmms +{ +class Effect; +} + namespace lmms::gui { @@ -47,6 +45,7 @@ class EffectControlDialog; class Knob; class LedCheckBox; class TempoSyncKnob; +class EffectLabelButton; class EffectView : public PluginView @@ -102,8 +101,6 @@ public slots: bool m_dragging; QGraphicsOpacityEffect* m_opacityEffect; - - //friend class EffectLabelButton; } ; diff --git a/src/gui/EffectView.cpp b/src/gui/EffectView.cpp index 36530c8f5c3..cdc187d023e 100644 --- a/src/gui/EffectView.cpp +++ b/src/gui/EffectView.cpp @@ -33,9 +33,11 @@ #include #include +#include "Effect.h" #include "EffectView.h" #include "DummyEffect.h" #include "CaptionMenu.h" +#include "EffectLabelButton.h" #include "embed.h" #include "GuiApplication.h" #include "gui_templates.h" diff --git a/src/gui/widgets/EffectLabelButton.cpp b/src/gui/widgets/EffectLabelButton.cpp index c43d9b7172b..63ee2a80a36 100644 --- a/src/gui/widgets/EffectLabelButton.cpp +++ b/src/gui/widgets/EffectLabelButton.cpp @@ -50,4 +50,4 @@ EffectLabelButton::EffectLabelButton(EffectView* _tv, QWidget* _parent) : setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Maximum); } -} // namespace lmms::gui \ No newline at end of file +} // namespace lmms::gui From b09286e86e77c4fcffe387bfc7cf31b26c22e91c Mon Sep 17 00:00:00 2001 From: enp2s0 Date: Sun, 11 Aug 2024 20:58:21 -0400 Subject: [PATCH 15/16] bring back knob labels --- include/EffectView.h | 2 +- src/gui/EffectView.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/EffectView.h b/include/EffectView.h index 725a5c43f40..b964bbd018c 100644 --- a/include/EffectView.h +++ b/include/EffectView.h @@ -65,7 +65,7 @@ class EffectView : public PluginView } static constexpr int DEFAULT_WIDTH = 215; - static constexpr int DEFAULT_HEIGHT = 35; + static constexpr int DEFAULT_HEIGHT = 47; void mouseMoveEvent(QMouseEvent* event) override; void mousePressEvent(QMouseEvent* event) override; diff --git a/src/gui/EffectView.cpp b/src/gui/EffectView.cpp index cdc187d023e..4ef433383a1 100644 --- a/src/gui/EffectView.cpp +++ b/src/gui/EffectView.cpp @@ -61,7 +61,7 @@ EffectView::EffectView(Effect * _model, QWidget * _parent) : setFocusPolicy(Qt::StrongFocus); m_mainLayout = new QHBoxLayout(); - m_mainLayout->setContentsMargins(8, 2, 8, 2); + m_mainLayout->setContentsMargins(8, 0, 8, 0); bool hasControls = effect()->controls()->controlCount() > 0; bool isEnabled = !dynamic_cast( effect() ); @@ -74,7 +74,6 @@ EffectView::EffectView(Effect * _model, QWidget * _parent) : QFont labelFont = adjustedToPixelSize(font(), 10); m_label = new EffectLabelButton(this, this); m_label->setText(model()->displayName()); - m_label->setFont(labelFont); if(hasControls) { connect(m_label, &EffectLabelButton::clicked, this, &EffectView::editControls); @@ -84,12 +83,15 @@ EffectView::EffectView(Effect * _model, QWidget * _parent) : m_wetDry = new Knob(KnobType::Small17, this); m_wetDry->setEnabled(isEnabled); m_wetDry->setHintText(tr("Wet Level:"), ""); + m_wetDry->setLabel("W/D"); m_mainLayout->addWidget(m_wetDry); m_autoQuit = new TempoSyncKnob(KnobType::Small17, this); m_autoQuit->setEnabled(isEnabled && !effect()->m_autoQuitDisabled); m_autoQuit->setVisible(isEnabled && !effect()->m_autoQuitDisabled); m_autoQuit->setHintText(tr("Stop after:"), "ms"); + m_autoQuit->setLabel("STOP"); + m_autoQuit->setFont(labelFont); m_mainLayout->addWidget(m_autoQuit); setModel( _model ); From 082e06825e6fa10e7d0cf44e261f7baaf5faa304 Mon Sep 17 00:00:00 2001 From: Rossmaxx <74815851+Rossmaxx@users.noreply.github.com> Date: Sat, 28 Sep 2024 20:38:28 +0530 Subject: [PATCH 16/16] Fix build --- src/core/Effect.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/Effect.cpp b/src/core/Effect.cpp index 92bef0e96d6..7b11494d0a0 100644 --- a/src/core/Effect.cpp +++ b/src/core/Effect.cpp @@ -187,7 +187,7 @@ void Effect::checkGate(double outSum) // Check whether we need to continue processing input. Restart the // counter if the threshold has been exceeded. - if (out_sum <= F_EPSILON) + if (outSum <= F_EPSILON) { incrementBufferCount(); if( bufferCount() > timeout() )