Skip to content

Commit

Permalink
Merge branch 'variable-tab-widget'
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesLorenz committed Jul 17, 2019
2 parents 59e186d + aa8f936 commit 73c2c70
Show file tree
Hide file tree
Showing 51 changed files with 85 additions and 53 deletions.
2 changes: 1 addition & 1 deletion include/DummyInstrument.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class DummyInstrument : public Instrument

virtual PluginView * instantiateView( QWidget * _parent )
{
return new InstrumentView( this, _parent );
return new InstrumentViewFixedSize( this, _parent );
}
} ;

Expand Down
19 changes: 17 additions & 2 deletions include/InstrumentView.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@
class InstrumentTrackWindow;


//! Instrument view with variable size
class LMMS_EXPORT InstrumentView : public PluginView
{
public:
InstrumentView( Instrument * _instrument, QWidget * _parent );
virtual ~InstrumentView();
~InstrumentView() override;

Instrument * model()
{
Expand All @@ -48,11 +49,25 @@ class LMMS_EXPORT InstrumentView : public PluginView
return( castModel<Instrument>() );
}

virtual void setModel( Model * _model, bool = false );
void setModel( Model * _model, bool = false ) override;

InstrumentTrackWindow * instrumentTrackWindow();

} ;




//! Instrument view with fixed LMMS-default size
class LMMS_EXPORT InstrumentViewFixedSize : public InstrumentView
{
QSize sizeHint() const override { return QSize(250, 250); }
QSize minimumSizeHint() const override { return sizeHint(); }

public:
using InstrumentView::InstrumentView;
~InstrumentViewFixedSize() override;
} ;


#endif
1 change: 1 addition & 0 deletions include/TabWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class TabWidget : public QWidget
virtual void resizeEvent( QResizeEvent * _re );
virtual void wheelEvent( QWheelEvent * _we );
virtual QSize minimumSizeHint() const;
virtual QSize sizeHint() const;

private:
struct widgetDesc
Expand Down
2 changes: 1 addition & 1 deletion plugins/FreeBoy/FreeBoy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ class FreeBoyKnob : public Knob

FreeBoyInstrumentView::FreeBoyInstrumentView( Instrument * _instrument,
QWidget * _parent ) :
InstrumentView( _instrument, _parent )
InstrumentViewFixedSize( _instrument, _parent )
{

setAutoFillBackground( true );
Expand Down
2 changes: 1 addition & 1 deletion plugins/FreeBoy/FreeBoy.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class FreeBoyInstrument : public Instrument
} ;


class FreeBoyInstrumentView : public InstrumentView
class FreeBoyInstrumentView : public InstrumentViewFixedSize
{
Q_OBJECT
public:
Expand Down
2 changes: 1 addition & 1 deletion plugins/GigPlayer/GigPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,7 @@ class gigKnob : public Knob


GigInstrumentView::GigInstrumentView( Instrument * _instrument, QWidget * _parent ) :
InstrumentView( _instrument, _parent )
InstrumentViewFixedSize( _instrument, _parent )
{
GigInstrument * k = castModel<GigInstrument>();

Expand Down
2 changes: 1 addition & 1 deletion plugins/GigPlayer/GigPlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ public slots:



class GigInstrumentView : public InstrumentView
class GigInstrumentView : public InstrumentViewFixedSize
{
Q_OBJECT
public:
Expand Down
2 changes: 1 addition & 1 deletion plugins/OpulenZ/OpulenZ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ void OpulenzInstrument::loadFile( const QString& file ) {

OpulenzInstrumentView::OpulenzInstrumentView( Instrument * _instrument,
QWidget * _parent ) :
InstrumentView( _instrument, _parent )
InstrumentViewFixedSize( _instrument, _parent )
{

#define KNOB_GEN(knobname, hinttext, hintunit,xpos,ypos) \
Expand Down
2 changes: 1 addition & 1 deletion plugins/OpulenZ/OpulenZ.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ private slots:



class OpulenzInstrumentView : public InstrumentView
class OpulenzInstrumentView : public InstrumentViewFixedSize
{
Q_OBJECT
public:
Expand Down
2 changes: 1 addition & 1 deletion plugins/Xpressive/Xpressive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ class XpressiveKnob: public Knob {


XpressiveView::XpressiveView(Instrument * _instrument, QWidget * _parent) :
InstrumentView(_instrument, _parent)
InstrumentViewFixedSize(_instrument, _parent)

{
const int COL_KNOBS = 194;
Expand Down
2 changes: 1 addition & 1 deletion plugins/Xpressive/Xpressive.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ protected slots:
} ;


class XpressiveView : public InstrumentView
class XpressiveView : public InstrumentViewFixedSize
{
Q_OBJECT
public:
Expand Down
2 changes: 1 addition & 1 deletion plugins/audio_file_processor/audio_file_processor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ QPixmap * AudioFileProcessorView::s_artwork = NULL;

AudioFileProcessorView::AudioFileProcessorView( Instrument * _instrument,
QWidget * _parent ) :
InstrumentView( _instrument, _parent )
InstrumentViewFixedSize( _instrument, _parent )
{
if( s_artwork == NULL )
{
Expand Down
2 changes: 1 addition & 1 deletion plugins/audio_file_processor/audio_file_processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ private slots:
class AudioFileProcessorWaveView;


class AudioFileProcessorView : public InstrumentView
class AudioFileProcessorView : public InstrumentViewFixedSize
{
Q_OBJECT
public:
Expand Down
2 changes: 1 addition & 1 deletion plugins/bit_invader/bit_invader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ PluginView * bitInvader::instantiateView( QWidget * _parent )

bitInvaderView::bitInvaderView( Instrument * _instrument,
QWidget * _parent ) :
InstrumentView( _instrument, _parent )
InstrumentViewFixedSize( _instrument, _parent )
{
setAutoFillBackground( true );
QPalette pal;
Expand Down
2 changes: 1 addition & 1 deletion plugins/bit_invader/bit_invader.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ protected slots:



class bitInvaderView : public InstrumentView
class bitInvaderView : public InstrumentViewFixedSize
{
Q_OBJECT
public:
Expand Down
2 changes: 1 addition & 1 deletion plugins/carlabase/carla.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ void CarlaInstrument::sampleRateChanged()
// -------------------------------------------------------------------

CarlaInstrumentView::CarlaInstrumentView(CarlaInstrument* const instrument, QWidget* const parent)
: InstrumentView(instrument, parent),
: InstrumentViewFixedSize(instrument, parent),
fHandle(instrument->fHandle),
fDescriptor(instrument->fDescriptor),
fTimerId(fHandle != NULL && fDescriptor->ui_idle != NULL ? startTimer(30) : 0)
Expand Down
2 changes: 1 addition & 1 deletion plugins/carlabase/carla.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ private slots:
friend class CarlaInstrumentView;
};

class CarlaInstrumentView : public InstrumentView
class CarlaInstrumentView : public InstrumentViewFixedSize
{
Q_OBJECT

Expand Down
2 changes: 1 addition & 1 deletion plugins/kicker/kicker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ class kickerLargeKnob : public Knob

kickerInstrumentView::kickerInstrumentView( Instrument * _instrument,
QWidget * _parent ) :
InstrumentView( _instrument, _parent )
InstrumentViewFixedSize( _instrument, _parent )
{
const int ROW1 = 14;
const int ROW2 = ROW1 + 56;
Expand Down
2 changes: 1 addition & 1 deletion plugins/kicker/kicker.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class kickerInstrument : public Instrument



class kickerInstrumentView : public InstrumentView
class kickerInstrumentView : public InstrumentViewFixedSize
{
Q_OBJECT
public:
Expand Down
2 changes: 1 addition & 1 deletion plugins/lb302/lb302.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ PluginView * lb302Synth::instantiateView( QWidget * _parent )


lb302SynthView::lb302SynthView( Instrument * _instrument, QWidget * _parent ) :
InstrumentView( _instrument, _parent )
InstrumentViewFixedSize( _instrument, _parent )
{
// GUI
m_vcfCutKnob = new Knob( knobBright_26, this );
Expand Down
2 changes: 1 addition & 1 deletion plugins/lb302/lb302.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public slots:
} ;


class lb302SynthView : public InstrumentView
class lb302SynthView : public InstrumentViewFixedSize
{
Q_OBJECT
public:
Expand Down
2 changes: 1 addition & 1 deletion plugins/monstro/Monstro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1447,7 +1447,7 @@ void MonstroInstrument::updateSlope2()

MonstroView::MonstroView( Instrument * _instrument,
QWidget * _parent ) :
InstrumentView( _instrument, _parent )
InstrumentViewFixedSize( _instrument, _parent )
{
m_operatorsView = setupOperatorsView( this );
setWidgetBackground( m_operatorsView, "artwork_op" );
Expand Down
2 changes: 1 addition & 1 deletion plugins/monstro/Monstro.h
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ public slots:

};

class MonstroView : public InstrumentView
class MonstroView : public InstrumentViewFixedSize
{
Q_OBJECT
public:
Expand Down
2 changes: 1 addition & 1 deletion plugins/nes/Nes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ QPixmap * NesInstrumentView::s_artwork = NULL;


NesInstrumentView::NesInstrumentView( Instrument * instrument, QWidget * parent ) :
InstrumentView( instrument, parent )
InstrumentViewFixedSize( instrument, parent )
{
setAutoFillBackground( true );
QPalette pal;
Expand Down
2 changes: 1 addition & 1 deletion plugins/nes/Nes.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ public slots:
};


class NesInstrumentView : public InstrumentView
class NesInstrumentView : public InstrumentViewFixedSize
{
Q_OBJECT
public:
Expand Down
2 changes: 1 addition & 1 deletion plugins/organic/organic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ class organicKnob : public Knob

organicInstrumentView::organicInstrumentView( Instrument * _instrument,
QWidget * _parent ) :
InstrumentView( _instrument, _parent ),
InstrumentViewFixedSize( _instrument, _parent ),
m_oscKnobs( NULL )
{
organicInstrument * oi = castModel<organicInstrument>();
Expand Down
2 changes: 1 addition & 1 deletion plugins/organic/organic.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ private slots:
} ;


class organicInstrumentView : public InstrumentView
class organicInstrumentView : public InstrumentViewFixedSize
{
Q_OBJECT
public:
Expand Down
2 changes: 1 addition & 1 deletion plugins/patman/patman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ PluginView * patmanInstrument::instantiateView( QWidget * _parent )


PatmanView::PatmanView( Instrument * _instrument, QWidget * _parent ) :
InstrumentView( _instrument, _parent ),
InstrumentViewFixedSize( _instrument, _parent ),
m_pi( NULL )
{
setAutoFillBackground( true );
Expand Down
2 changes: 1 addition & 1 deletion plugins/patman/patman.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public slots:



class PatmanView : public InstrumentView
class PatmanView : public InstrumentViewFixedSize
{
Q_OBJECT
public:
Expand Down
2 changes: 1 addition & 1 deletion plugins/sf2_player/sf2_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ class sf2Knob : public Knob


sf2InstrumentView::sf2InstrumentView( Instrument * _instrument, QWidget * _parent ) :
InstrumentView( _instrument, _parent )
InstrumentViewFixedSize( _instrument, _parent )
{
// QVBoxLayout * vl = new QVBoxLayout( this );
// QHBoxLayout * hl = new QHBoxLayout();
Expand Down
2 changes: 1 addition & 1 deletion plugins/sf2_player/sf2_player.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class sf2Font



class sf2InstrumentView : public InstrumentView
class sf2InstrumentView : public InstrumentViewFixedSize
{
Q_OBJECT
public:
Expand Down
2 changes: 1 addition & 1 deletion plugins/sfxr/sfxr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ class sfxrKnob : public Knob

sfxrInstrumentView::sfxrInstrumentView( Instrument * _instrument,
QWidget * _parent ) :
InstrumentView( _instrument, _parent )
InstrumentViewFixedSize( _instrument, _parent )
{
srand(time(NULL));
setAutoFillBackground( true );
Expand Down
2 changes: 1 addition & 1 deletion plugins/sfxr/sfxr.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ class sfxrInstrument : public Instrument



class sfxrInstrumentView : public InstrumentView
class sfxrInstrumentView : public InstrumentViewFixedSize
{
Q_OBJECT
public:
Expand Down
2 changes: 1 addition & 1 deletion plugins/sid/sid_instrument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ class sidKnob : public Knob

sidInstrumentView::sidInstrumentView( Instrument * _instrument,
QWidget * _parent ) :
InstrumentView( _instrument, _parent )
InstrumentViewFixedSize( _instrument, _parent )
{

setAutoFillBackground( true );
Expand Down
2 changes: 1 addition & 1 deletion plugins/sid/sid_instrument.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class sidInstrument : public Instrument



class sidInstrumentView : public InstrumentView
class sidInstrumentView : public InstrumentViewFixedSize
{
Q_OBJECT
public:
Expand Down
2 changes: 1 addition & 1 deletion plugins/stk/mallets/mallets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ PluginView * malletsInstrument::instantiateView( QWidget * _parent )

malletsInstrumentView::malletsInstrumentView( malletsInstrument * _instrument,
QWidget * _parent ) :
InstrumentView( _instrument, _parent )
InstrumentViewFixedSize( _instrument, _parent )
{
m_modalBarWidget = setupModalBarControls( this );
setWidgetBackground( m_modalBarWidget, "artwork" );
Expand Down
2 changes: 1 addition & 1 deletion plugins/stk/mallets/mallets.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class malletsInstrument : public Instrument
} ;


class malletsInstrumentView: public InstrumentView
class malletsInstrumentView: public InstrumentViewFixedSize
{
Q_OBJECT
public:
Expand Down
2 changes: 1 addition & 1 deletion plugins/triple_oscillator/TripleOscillator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ class TripleOscKnob : public Knob

TripleOscillatorView::TripleOscillatorView( Instrument * _instrument,
QWidget * _parent ) :
InstrumentView( _instrument, _parent )
InstrumentViewFixedSize( _instrument, _parent )
{
setAutoFillBackground( true );
QPalette pal;
Expand Down
2 changes: 1 addition & 1 deletion plugins/triple_oscillator/TripleOscillator.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ protected slots:



class TripleOscillatorView : public InstrumentView
class TripleOscillatorView : public InstrumentViewFixedSize
{
Q_OBJECT
public:
Expand Down
4 changes: 2 additions & 2 deletions plugins/vestige/vestige.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ PluginView * vestigeInstrument::instantiateView( QWidget * _parent )

VestigeInstrumentView::VestigeInstrumentView( Instrument * _instrument,
QWidget * _parent ) :
InstrumentView( _instrument, _parent ),
InstrumentViewFixedSize( _instrument, _parent ),
lastPosInMenu (0)
{
if( s_artwork == NULL )
Expand Down Expand Up @@ -900,7 +900,7 @@ void VestigeInstrumentView::paintEvent( QPaintEvent * )

manageVestigeInstrumentView::manageVestigeInstrumentView( Instrument * _instrument,
QWidget * _parent, vestigeInstrument * m_vi2 ) :
InstrumentView( _instrument, _parent )
InstrumentViewFixedSize( _instrument, _parent )
{
m_vi = m_vi2;
m_vi->m_scrollArea = new QScrollArea( this );
Expand Down
Loading

0 comments on commit 73c2c70

Please sign in to comment.