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

Make EffectControlDialog inherit PluginView #7544

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 5 additions & 10 deletions include/EffectControlDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#include <QWidget>

#include "ModelView.h"
#include "PluginView.h"

namespace lmms
{
Expand All @@ -39,26 +39,21 @@ class EffectControls;
namespace gui
{

class LMMS_EXPORT EffectControlDialog : public QWidget, public ModelView
class LMMS_EXPORT EffectControlDialog : public PluginView
{
Q_OBJECT
public:
EffectControlDialog( EffectControls * _controls );
EffectControlDialog(EffectControls *controls);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
EffectControlDialog(EffectControls *controls);
EffectControlDialog(EffectControls* controls);

style

~EffectControlDialog() override = default;

virtual bool isResizable() const {return false;}


signals:
void closed();


protected:
void closeEvent( QCloseEvent * _ce ) override;
void closeEvent(QCloseEvent *closeEv) override;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
void closeEvent(QCloseEvent *closeEv) override;
void closeEvent(QCloseEvent* closeEv) override;


EffectControls * m_effectControls;

} ;
};

} // namespace gui

Expand Down
10 changes: 6 additions & 4 deletions include/EffectView.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,17 @@
#ifndef LMMS_GUI_EFFECT_VIEW_H
#define LMMS_GUI_EFFECT_VIEW_H

#include "AutomatableModel.h"
#include "PluginView.h"
#include <QPixmap>
#include <QWidget>
#include "ModelView.h"
#include "Effect.h"

class QGraphicsOpacityEffect;
class QGroupBox;
class QLabel;
class QPushButton;
class QMdiSubWindow;
class QMouseEvent;

namespace lmms::gui
{
Expand All @@ -45,11 +47,11 @@ class LedCheckBox;
class TempoSyncKnob;


class EffectView : public PluginView
class EffectView : public QWidget, public ModelView
{
Q_OBJECT
public:
EffectView( Effect * _model, QWidget * _parent );
EffectView(Effect *model, QWidget *parent);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
EffectView(Effect *model, QWidget *parent);
EffectView(Effect* model, QWidget* parent);

~EffectView() override;

inline Effect * effect()
Expand Down
2 changes: 1 addition & 1 deletion include/ModelView.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace lmms::gui
class LMMS_EXPORT ModelView
{
public:
ModelView( Model* model, QWidget* widget );
ModelView(Model* model, QWidget* parent);
virtual ~ModelView();

virtual void setModel( Model* model, bool isOldModelValid = true );
Expand Down
3 changes: 2 additions & 1 deletion src/core/Effect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ void Effect::checkGate(double outSum)

gui::PluginView * Effect::instantiateView( QWidget * _parent )
{
return new gui::EffectView( this, _parent );
assert(false); // This function implements a virtual, but for Effects, this is unused
return nullptr;
}


Expand Down
15 changes: 7 additions & 8 deletions src/gui/EffectControlDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,20 @@ namespace lmms::gui
{


EffectControlDialog::EffectControlDialog( EffectControls * _controls ) :
QWidget( nullptr ),
ModelView( _controls, this ),
m_effectControls( _controls )
EffectControlDialog::EffectControlDialog(EffectControls *controls) :
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
EffectControlDialog::EffectControlDialog(EffectControls *controls) :
EffectControlDialog::EffectControlDialog(EffectControls* controls) :

PluginView(controls->effect(), nullptr),
m_effectControls(controls)
{
setWindowTitle( m_effectControls->effect()->displayName() );
setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred );
setWindowTitle(m_effectControls->effect()->displayName());
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
}




void EffectControlDialog::closeEvent( QCloseEvent * _ce )
void EffectControlDialog::closeEvent(QCloseEvent *closeEv)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
void EffectControlDialog::closeEvent(QCloseEvent *closeEv)
void EffectControlDialog::closeEvent(QCloseEvent* closeEv)

{
_ce->ignore();
closeEv->ignore();
emit closed();
}

Expand Down
13 changes: 7 additions & 6 deletions src/gui/EffectView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@
namespace lmms::gui
{

EffectView::EffectView( Effect * _model, QWidget * _parent ) :
PluginView( _model, _parent ),
m_bg( embed::getIconPixmap( "effect_plugin" ) ),
m_subWindow( nullptr ),
EffectView::EffectView(Effect * modelParam, QWidget *parent) :
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
EffectView::EffectView(Effect * modelParam, QWidget *parent) :
EffectView::EffectView(Effect* modelParam, QWidget* parent) :

QWidget(parent),
ModelView(modelParam, this),
m_bg(embed::getIconPixmap("effect_plugin")),
m_subWindow(nullptr),
m_controlView(nullptr),
m_dragging(false)
{
Expand Down Expand Up @@ -85,7 +86,7 @@ EffectView::EffectView( Effect * _model, QWidget * _parent ) :
m_gate->setHintText( tr( "Gate:" ), "" );


setModel( _model );
setModel(modelParam);

if( effect()->controls()->controlCount() > 0 )
{
Expand Down Expand Up @@ -126,7 +127,7 @@ EffectView::EffectView( Effect * _model, QWidget * _parent ) :
setGraphicsEffect(m_opacityEffect);

//move above vst effect view creation
//setModel( _model );
//setModel(modelParam);
}


Expand Down
6 changes: 3 additions & 3 deletions src/gui/ModelView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ namespace lmms::gui
{


ModelView::ModelView( Model* model, QWidget* widget ) :
m_widget( widget ),
m_model( model )
ModelView::ModelView(Model* model, QWidget* parent) :
m_widget(parent),
m_model(model)
{
}

Expand Down
Loading