Finished organic gui, updated stylesheet

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1008 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Paul Giblock
2008-05-21 05:47:42 +00:00
parent 642385f4ce
commit ef69e69c72
4 changed files with 67 additions and 38 deletions

View File

@@ -17,7 +17,6 @@
* plugins/audio_file_processor/reverse_off.png:
* plugins/audio_file_processor/reverse_on.png:
* plugins/audio_file_processor/artwork.png:
* data/themes/default/style.css:
Integrate new audio file processor artwork
* src/gui/widgets/volume_knob.cpp:
@@ -26,7 +25,21 @@
* src/gui/widgets/knob.cpp:
Minor graphical enhacement for styled knobs
* src/gui/piano_roll.cpp:
* include/piano_roll.h:
* data/themes/default/record_accompany.png:
- Fix annoying but where changing patterns would scroll to bar 2 instead
of bar 1
- Add record-with-accompaniment feature because it was easier to just add
a toolbutton then to strip out the code. At least now there is some
starting point for this feature should we ever decide to release it.
* plugins/organic/organic.cpp:
* plugins/organic/organic.h:
Complete organic gui
* data/themes/default/style.css:
AFP and organic knob styles
2008-05-21 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>

View File

@@ -66,3 +66,35 @@ kickerInstrumentView knob {
qproperty-centerPointY: 13.5;
qproperty-lineWidth: 3;
}
audioFileProcessorView knob {
color: rgb(240, 147, 14);
qproperty-outerColor: rgb(30, 35, 37);
qproperty-innerRadius: 4;
qproperty-outerRadius: 11.2;
qproperty-centerPointX: 18.5;
qproperty-centerPointY: 16.5;
qproperty-lineWidth: 3;
}
organicInstrumentView knob {
color: rgb(205, 16, 216);
qproperty-outerColor: rgb(23, 9, 24);
/*qproperty-outerColor: rgb(64, 21, 67);*/
qproperty-innerRadius: 2;
qproperty-outerRadius: 8.7;
qproperty-centerPointX: 10.5;
qproperty-centerPointY: 10.5;
qproperty-lineWidth: 2;
}
organicInstrumentView knob#fx1Knob,
organicInstrumentView knob#volKnob {
qproperty-innerRadius: 4;
qproperty-outerRadius: 11.2;
qproperty-centerPointX: 18.5;
qproperty-centerPointY: 13.8;
qproperty-lineWidth: 3;
}

View File

@@ -97,6 +97,11 @@ organicInstrument::organicInstrument( instrumentTrack * _channel_track ) :
m_osc[i], SLOT( updateVolume() ) );
connect( &m_osc[i]->m_detuneModel, SIGNAL( dataChanged() ),
m_osc[i], SLOT( updateDetuning() ) );
m_osc[i]->m_oscModel.setTrack( _channel_track );
m_osc[i]->m_volModel.setTrack( _channel_track );
m_osc[i]->m_panModel.setTrack( _channel_track );
m_osc[i]->m_detuneModel.setTrack( _channel_track );
m_osc[i]->updateVolume();
@@ -194,7 +199,6 @@ void organicInstrument::playNote( notePlayHandle * _n, bool,
for( Sint8 i = m_numOscillators - 1; i >= 0; --i )
{
// randomize the phaseOffset [0,1)
m_osc[i]->m_phaseOffsetLeft = rand()
/ ( RAND_MAX + 1.0f );
m_osc[i]->m_phaseOffsetRight = rand()
@@ -363,41 +367,17 @@ pluginView * organicInstrument::instantiateView( QWidget * _parent )
template<class BASE>
class organicKnobTemplate : public BASE
class organicKnob : public knob
{
public:
organicKnobTemplate( QWidget * _parent, const QString & _name ) :
BASE( 0, _parent, _name ),
m_midPoint( QPointF( 10.5, 10.5 ) )
organicKnob( QWidget * _parent, const QString & _name ) :
knob( knobStyled, _parent, _name )
{
BASE::setFixedSize( 21, 21 );
}
const QPointF m_midPoint;
protected:
virtual void paintEvent( QPaintEvent * _me )
{
QPainter p( this );
p.setRenderHint( QPainter::Antialiasing );
QLineF ln = BASE::calculateLine( m_midPoint, 8.7, 2 );
QRadialGradient gradient(m_midPoint, 11);
gradient.setColorAt(0.2, QColor( 227, 18, 240 ) );
gradient.setColorAt(1, QColor( 0, 0, 0 ) );
p.setPen( QPen( gradient, 2 ) );
p.drawLine( ln );
setFixedSize( 21, 21 );
}
};
typedef organicKnobTemplate<knob> organicKnob;
typedef organicKnobTemplate<volumeKnob> organicVolumeKnob;
organicInstrumentView::organicInstrumentView( instrument * _instrument,
@@ -413,24 +393,26 @@ organicInstrumentView::organicInstrumentView( instrument * _instrument,
setPalette( pal );
// setup knob for FX1
m_fx1Knob = new knob( knobGreen_17, this, tr( "FX1" ) );
m_fx1Knob->move( 20, 200 );
m_fx1Knob = new organicKnob( this, tr( "FX1" ) );
m_fx1Knob->move( 15, 201 );
m_fx1Knob->setFixedSize( 37, 47 );
m_fx1Knob->setObjectName( "fx1Knob" );
// setup volume-knob
m_volKnob = new knob( knobGreen_17, this, tr( "Osc %1 volume" ).arg(
m_volKnob = new organicKnob( this, tr( "Osc %1 volume" ).arg(
1 ) );
m_volKnob->move( 50, 200 );
m_volKnob->move( 60, 201 );
m_volKnob->setFixedSize( 37, 47 );
m_volKnob->setHintText( tr( "Osc %1 volume:" ).arg( 1 ) + " ", "%" );
m_volKnob->setObjectName( "volKnob" );
// randomise
m_randBtn = new pixmapButton( this, tr( "Randomise" ) );
m_randBtn->move( 100, 200 );
m_randBtn->move( 148, 224 );
m_randBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
"randomise_pressed" ) );
m_randBtn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
"randomise" ) );
//m_randBtn->setMask( QBitmap( PLUGIN_NAME::getIconPixmap( "btn_mask" ).
// createHeuristicMask() ) );
connect( m_randBtn, SIGNAL ( clicked() ),
oi, SLOT( randomiseSettings() ) );
@@ -479,9 +461,10 @@ void organicInstrumentView::modelChanged( void )
i + 1 ) + " ", "%" );
// setup volume-knob
volumeKnob * volKnob = new organicVolumeKnob( this, tr(
volumeKnob * volKnob = new volumeKnob( knobStyled, this, tr(
"Osc %1 volume" ).arg( i + 1 ) );
volKnob->move( x + i * colWidth, y + rowHeight*1 );
volKnob->setFixedSize( 21, 21 );
volKnob->setHintText( tr( "Osc %1 volume:" ).arg(
i + 1 ) + " ", "%" );

View File

@@ -136,6 +136,7 @@ private slots:
class organicInstrumentView : public instrumentView
{
Q_OBJECT
public:
organicInstrumentView( instrument * _instrument, QWidget * _parent );
virtual ~organicInstrumentView();