From 87612a2d13c6c9124203e8468b3137456c98655f Mon Sep 17 00:00:00 2001 From: Javier Serrano Polo Date: Sat, 10 Nov 2007 21:11:32 +0000 Subject: [PATCH] removed specialBgHandlingWidget, style sheet, some cleaning up git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@579 0778d3d1-df1d-0410-868b-ea421aaaa00d --- ChangeLog | 58 ++++++ Makefile.am | 1 - configure.in | 4 +- data/themes/default/style.css | 12 +- include/envelope_and_lfo_widget.h | 8 +- include/pixmap_button.h | 2 - include/spc_bg_hndl_widget.h | 110 ---------- include/tab_widget.h | 4 +- include/track.h | 2 - .../audio_file_processor.cpp | 7 - .../audio_file_processor.h | 3 +- .../bassbooster_control_dialog.cpp | 8 - plugins/bit_invader/bit_invader.cpp | 195 +++++------------- plugins/bit_invader/bit_invader.h | 20 +- plugins/flp_import/unrtf/parse.c | 4 - plugins/organic/organic.cpp | 22 +- plugins/organic/organic.h | 5 +- plugins/patman/patman.cpp | 10 +- plugins/patman/patman.h | 3 +- plugins/vestige/vestige.cpp | 15 +- plugins/vestige/vestige.h | 16 +- plugins/vst_effect/vst_control_dialog.cpp | 12 +- plugins/vst_effect/vst_effect.cpp | 12 +- plugins/vst_effect/vst_subplugin_features.cpp | 15 +- src/core/envelope_and_lfo_widget.cpp | 30 +-- src/core/main_window.cpp | 1 + src/core/track.cpp | 19 +- src/widgets/group_box.cpp | 8 +- src/widgets/knob.cpp | 3 - src/widgets/led_checkbox.cpp | 6 +- src/widgets/pixmap_button.cpp | 17 +- src/widgets/tab_widget.cpp | 6 +- 32 files changed, 189 insertions(+), 449 deletions(-) delete mode 100644 include/spc_bg_hndl_widget.h diff --git a/ChangeLog b/ChangeLog index e22f9e8fd..20aeff5fe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,61 @@ +2007-11-10 Javier Serrano Polo + + * Makefile.am: + * include/envelope_and_lfo_widget.h: + * include/pixmap_button.h: + * include/spc_bg_hndl_widget.h: + * include/tab_widget.h: + * plugins/audio_file_processor/audio_file_processor.cpp: + * plugins/audio_file_processor/audio_file_processor.h: + * plugins/bit_invader/bit_invader.cpp: + * plugins/bit_invader/bit_invader.h: + * plugins/organic/organic.cpp: + * plugins/organic/organic.h: + * plugins/patman/patman.cpp: + * plugins/patman/patman.h: + * plugins/vestige/vestige.cpp: + * plugins/vestige/vestige.h: + * src/core/envelope_and_lfo_widget.cpp: + * src/widgets/group_box.cpp: + * src/widgets/knob.cpp: + * src/widgets/led_checkbox.cpp: + * src/widgets/pixmap_button.cpp: + * src/widgets/tab_widget.cpp: + removed obsolete specialBgHandlingWidget + + * src/core/main_window.cpp: + fixed label in save project dialog + + * data/themes/default/style.css: + * include/track.h: + * src/core/track.cpp: + turned more code into style sheet + + * data/themes/default/style.css: + * src/core/track.cpp: + reverted positioning in style sheet + + * data/themes/default/style.css: + restricted style inheritance + + * plugins/bass_booster/bassbooster_control_dialog.cpp: + * plugins/flp_import/unrtf/parse.c: + * plugins/vestige/vestige.h: + * plugins/vst_effect/vst_control_dialog.cpp: + * plugins/vst_effect/vst_effect.cpp: + * plugins/vst_effect/vst_subplugin_features.cpp: + removed Qt3 code + + * plugins/bit_invader/bit_invader.cpp: + * plugins/bit_invader/bit_invader.h: + * plugins/organic/organic.cpp: + * plugins/organic/organic.h: + * plugins/vestige/vestige.cpp: + reduced dependencies + + * plugins/bit_invader/bit_invader.cpp: + removed deprecated code + 2007-11-06 Javier Serrano Polo * include/track.h: diff --git a/Makefile.am b/Makefile.am index a6c38e1a2..e82dc8942 100644 --- a/Makefile.am +++ b/Makefile.am @@ -322,7 +322,6 @@ lmms_SOURCES = \ $(srcdir)/include/embed.h \ $(srcdir)/include/timeline.h \ $(srcdir)/include/config_mgr.h \ - $(srcdir)/include/spc_bg_hndl_widget.h \ $(srcdir)/include/tab_bar.h \ $(srcdir)/include/tab_button.h \ $(srcdir)/include/project_notes.h \ diff --git a/configure.in b/configure.in index faac962b5..891d22cb3 100644 --- a/configure.in +++ b/configure.in @@ -2,8 +2,8 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.50) -AC_INIT(lmms, 0.4.0-svn20071106, lmms-devel/at/lists/dot/sf/dot/net) -AM_INIT_AUTOMAKE(lmms, 0.4.0-svn20071106) +AC_INIT(lmms, 0.4.0-svn20071110, lmms-devel/at/lists/dot/sf/dot/net) +AM_INIT_AUTOMAKE(lmms, 0.4.0-svn20071110) AM_CONFIG_HEADER(config.h) diff --git a/data/themes/default/style.css b/data/themes/default/style.css index 931661457..2f57a6419 100644 --- a/data/themes/default/style.css +++ b/data/themes/default/style.css @@ -6,18 +6,20 @@ captionMenu::item:disabled { text-align: center; } -trackOperationsWidget QPushButton { - margin-left: 12px; - margin-top: 1px; +trackOperationsWidget > QPushButton { max-height: 26px; max-width: 26px; min-height: 26px; min-width: 26px; } -/*trackOperationsWidget QPushButton::menu-indicator { +trackOperationsWidget#automationDisabled > QPushButton::menu-indicator { + image: url(resources:track_op_menu_disabled.png); +} + +trackOperationsWidget#automationEnabled > QPushButton::menu-indicator { image: url(resources:track_op_menu.png); -}*/ +} QWidget#mainToolbar { background-image: url(resources:main_toolbar_bg.png); diff --git a/include/envelope_and_lfo_widget.h b/include/envelope_and_lfo_widget.h index 8e9d67354..4edd51795 100644 --- a/include/envelope_and_lfo_widget.h +++ b/include/envelope_and_lfo_widget.h @@ -28,14 +28,13 @@ #ifndef _ENVELOPE_AND_LFO_WIDGET_H #define _ENVELOPE_AND_LFO_WIDGET_H -#include #include +#include #include "journalling_object.h" -#include "types.h" -#include "spc_bg_hndl_widget.h" #include "sample_buffer.h" +#include "types.h" class QPaintEvent; @@ -53,8 +52,7 @@ class track; class flpImport; -class envelopeAndLFOWidget : public QWidget, public journallingObject, - public specialBgHandlingWidget +class envelopeAndLFOWidget : public QWidget, public journallingObject { Q_OBJECT public: diff --git a/include/pixmap_button.h b/include/pixmap_button.h index d34fe7c98..4af5a91dd 100644 --- a/include/pixmap_button.h +++ b/include/pixmap_button.h @@ -41,7 +41,6 @@ public: void setActiveGraphic( const QPixmap & _pm ); void setInactiveGraphic( const QPixmap & _pm, bool _update = TRUE ); - void setBgGraphic( const QPixmap & _pm ); signals: @@ -58,7 +57,6 @@ protected: private: QPixmap m_activePixmap; QPixmap m_inactivePixmap; - QPixmap m_bgPixmap; } ; diff --git a/include/spc_bg_hndl_widget.h b/include/spc_bg_hndl_widget.h deleted file mode 100644 index 9d1d67e0d..000000000 --- a/include/spc_bg_hndl_widget.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * spc_bg_hndl_widget.h - class specialBgHandlingWidget - * - * Copyright (c) 2005-2007 Tobias Doerffel - * - * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net - * - * 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 _SPC_BG_HNDL_WIDGET_H -#define _SPC_BG_HNDL_WIDGET_H - -#include -#include -#include - - - -class specialBgHandlingWidget -{ -public: - specialBgHandlingWidget( const QPixmap & _pm ) : - m_backgroundPixmap( _pm ), - m_backgroundColor( QColor( 0, 0, 0 ) ) - { - } - - specialBgHandlingWidget( const QColor & _c ) : - m_backgroundPixmap(), - m_backgroundColor( _c ) - { - } - - ~specialBgHandlingWidget() - { - } - - const QPixmap & backgroundPixmap( void ) const - { - return( m_backgroundPixmap ); - } - const QColor & backgroundColor( void ) const - { - return( m_backgroundColor ); - } - - static QPixmap getBackground( const QWidget * _w ) - { - QPixmap pm( _w->size() ); - const QWidget * pw = _w->parentWidget(); - if( dynamic_cast( pw ) ) - { - const specialBgHandlingWidget * s = dynamic_cast< - const specialBgHandlingWidget *>( pw ); - if( s->backgroundPixmap().isNull() == FALSE ) - { - QPainter p( &pm ); - p.drawPixmap( 0, 0, s->backgroundPixmap(), - _w->x(), _w->y(), _w->width(), - _w->height() ); - } - else - { - pm.fill( s->backgroundColor() ); - } - } - else - { - QPainter p( &pm ); - const QBrush & br = pw->palette().brush( - pw->backgroundRole() ); - if( br.style() == Qt::TexturePattern ) - { - p.drawPixmap( 0, 0, br.texture(), - _w->x(), _w->y(), - _w->width(), _w->height() ); - } - else - { - pm.fill( br.color() ); - } - } - return( pm ); - } - - - -private: - QPixmap m_backgroundPixmap; - QColor m_backgroundColor; - -} ; - -#endif diff --git a/include/tab_widget.h b/include/tab_widget.h index 9b8583bdb..cb3b67e16 100644 --- a/include/tab_widget.h +++ b/include/tab_widget.h @@ -29,10 +29,8 @@ #include #include -#include "spc_bg_hndl_widget.h" - -class tabWidget : public QWidget, public specialBgHandlingWidget +class tabWidget : public QWidget { Q_OBJECT public: diff --git a/include/track.h b/include/track.h index eb92199fd..5b0c9a319 100644 --- a/include/track.h +++ b/include/track.h @@ -266,8 +266,6 @@ private: static QPixmap * s_muteOffEnabled; static QPixmap * s_muteOnDisabled; static QPixmap * s_muteOnEnabled; - static QPixmap * s_trackOpsDisabled; - static QPixmap * s_trackOpsEnabled; trackWidget * m_trackWidget; diff --git a/plugins/audio_file_processor/audio_file_processor.cpp b/plugins/audio_file_processor/audio_file_processor.cpp index aa88e4454..95647047c 100644 --- a/plugins/audio_file_processor/audio_file_processor.cpp +++ b/plugins/audio_file_processor/audio_file_processor.cpp @@ -76,7 +76,6 @@ QPixmap * audioFileProcessor::s_artwork = NULL; audioFileProcessor::audioFileProcessor( instrumentTrack * _channel_track ) : instrument( _channel_track, &audiofileprocessor_plugin_descriptor ), - specialBgHandlingWidget( PLUGIN_NAME::getIconPixmap( "artwork" ) ), m_drawMethod( sampleBuffer::LINE_CONNECT ) { connect( &m_sampleBuffer, SIGNAL( sampleUpdated() ), this, @@ -96,8 +95,6 @@ audioFileProcessor::audioFileProcessor( instrumentTrack * _channel_track ) : "project_open_down" ) ); m_openAudioFileButton->setInactiveGraphic( embed::getIconPixmap( "project_open" ) ); - m_openAudioFileButton->setBgGraphic( getBackground( - m_openAudioFileButton ) ); connect( m_openAudioFileButton, SIGNAL( clicked() ), this, SLOT( openAudioFile() ) ); toolTip::add( m_openAudioFileButton, tr( "Open other sample" ) ); @@ -117,7 +114,6 @@ audioFileProcessor::audioFileProcessor( instrumentTrack * _channel_track ) : "reverse_on" ) ); m_reverseButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "reverse_off" ) ); - m_reverseButton->setBgGraphic( getBackground( m_reverseButton ) ); connect( m_reverseButton, SIGNAL( toggled( bool ) ), this, SLOT( reverseBtnToggled( bool ) ) ); toolTip::add( m_reverseButton, tr( "Reverse sample" ) ); @@ -133,7 +129,6 @@ audioFileProcessor::audioFileProcessor( instrumentTrack * _channel_track ) : "loop_on" ) ); m_loopButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "loop_off" ) ); - m_loopButton->setBgGraphic( getBackground( m_loopButton ) ); toolTip::add( m_loopButton, tr( "Loop sample at start- and end-point" ) ); m_loopButton->setWhatsThis( @@ -191,7 +186,6 @@ audioFileProcessor::audioFileProcessor( instrumentTrack * _channel_track ) : m_viewLinesPB = new pixmapButton( this, NULL, NULL ); m_viewLinesPB->move( 154, 158 ); - m_viewLinesPB->setBgGraphic( getBackground( m_viewLinesPB ) ); if( m_drawMethod == sampleBuffer::LINE_CONNECT ) { m_viewLinesPB->setChecked( TRUE ); @@ -206,7 +200,6 @@ audioFileProcessor::audioFileProcessor( instrumentTrack * _channel_track ) : m_viewDotsPB = new pixmapButton( this, NULL, NULL ); m_viewDotsPB->move( 204, 158 ); - m_viewDotsPB->setBgGraphic( getBackground( m_viewDotsPB ) ); if( m_drawMethod == sampleBuffer::DOTS ) { m_viewDotsPB->setChecked( TRUE ); diff --git a/plugins/audio_file_processor/audio_file_processor.h b/plugins/audio_file_processor/audio_file_processor.h index 7bde61318..b284e1a13 100644 --- a/plugins/audio_file_processor/audio_file_processor.h +++ b/plugins/audio_file_processor/audio_file_processor.h @@ -31,7 +31,6 @@ #include "instrument.h" #include "sample_buffer.h" -#include "spc_bg_hndl_widget.h" class knob; @@ -39,7 +38,7 @@ class pixmapButton; class volumeKnob; -class audioFileProcessor : public instrument, public specialBgHandlingWidget +class audioFileProcessor : public instrument { Q_OBJECT public: diff --git a/plugins/bass_booster/bassbooster_control_dialog.cpp b/plugins/bass_booster/bassbooster_control_dialog.cpp index 9de8af121..93bc8cdb3 100644 --- a/plugins/bass_booster/bassbooster_control_dialog.cpp +++ b/plugins/bass_booster/bassbooster_control_dialog.cpp @@ -23,16 +23,8 @@ */ -#ifndef QT3 - #include -#else - -#include - -#endif - #include "bass_booster.h" #include "knob.h" diff --git a/plugins/bit_invader/bit_invader.cpp b/plugins/bit_invader/bit_invader.cpp index 1e65d5b61..f6112d172 100644 --- a/plugins/bit_invader/bit_invader.cpp +++ b/plugins/bit_invader/bit_invader.cpp @@ -23,30 +23,26 @@ */ -#include -#include -#include +#include "bit_invader.h" + + +#include -#include -#include -#include -#include "math.h" using namespace std; -#include "bit_invader.h" -#include "base64.h" #include "engine.h" +#include "graph.h" #include "instrument_track.h" -#include "note_play_handle.h" -#include "templates.h" #include "knob.h" -#include "pixmap_button.h" -#include "tooltip.h" -#include "song_editor.h" +#include "led_checkbox.h" +#include "note_play_handle.h" #include "oscillator.h" -#include "sample_buffer.h" +#include "pixmap_button.h" +#include "song_editor.h" +#include "templates.h" +#include "tooltip.h" #undef SINGLE_SOURCE_COMPILE #include "embed.cpp" @@ -72,7 +68,8 @@ plugin::descriptor bitinvader_plugin_descriptor = QPixmap * bitInvader::s_artwork = NULL; -bSynth::bSynth(float* shape, int length, float _pitch, bool _interpolation, float factor, const sample_rate_t _sample_rate ) +bSynth::bSynth( float * shape, int length, float _pitch, bool _interpolation, + float factor, const sample_rate_t _sample_rate ) { interpolation = _interpolation; @@ -155,8 +152,7 @@ sample_t bSynth::nextStringSample( void ) bitInvader::bitInvader( instrumentTrack * _channel_track ) : instrument( _channel_track, - &bitinvader_plugin_descriptor ), - specialBgHandlingWidget( PLUGIN_NAME::getIconPixmap( "artwork" ) ) + &bitinvader_plugin_descriptor ) { @@ -336,24 +332,25 @@ bitInvader::bitInvader( instrumentTrack * _channel_track ) : void bitInvader::sinWaveClicked( void ) { // generate a Sinus wave using static oscillator-method - for (int i=0; i < sample_length; i++) - { - sample_shape[i] = oscillator::sinSample( i/static_cast(sample_length) ); - } - + for (int i=0; i < sample_length; i++) + { + sample_shape[i] = oscillator::sinSample( i / static_cast( + sample_length ) ); + } + sampleChanged(); } void bitInvader::triangleWaveClicked( void ) { // generate a Triangle wave using static oscillator-method - for (int i=0; i < sample_length; i++) - { - sample_shape[i] = oscillator::triangleSample( i/static_cast(sample_length) ); - } - - sampleChanged(); + for (int i=0; i < sample_length; i++) + { + sample_shape[i] = oscillator::triangleSample( i / + static_cast( sample_length) ); + } + sampleChanged(); } @@ -361,35 +358,36 @@ void bitInvader::sawWaveClicked( void ) { // generate a Saw wave using static oscillator-method for (int i=0; i < sample_length; i++) - { - sample_shape[i] = oscillator::sawSample( i/static_cast(sample_length) ); - } - - sampleChanged(); + { + sample_shape[i] = oscillator::sawSample( i / static_cast( + sample_length ) ); + } + + sampleChanged(); } void bitInvader::sqrWaveClicked( void ) { // generate a Sqr wave using static oscillator-method for (int i=0; i < sample_length; i++) - { - sample_shape[i] = oscillator::squareSample( i/static_cast(sample_length) ); - } - - sampleChanged(); + { + sample_shape[i] = oscillator::squareSample( i / + static_cast( sample_length ) ); + } + sampleChanged(); } void bitInvader::noiseWaveClicked( void ) { // generate a Noise wave using static oscillator-method for (int i=0; i < sample_length; i++) - { - sample_shape[i] = oscillator::noiseSample( i/static_cast(sample_length) ); - } - - sampleChanged(); + { + sample_shape[i] = oscillator::noiseSample( i / + static_cast( sample_length ) ); + } + sampleChanged(); } void bitInvader::usrWaveClicked( void ) @@ -408,119 +406,19 @@ void bitInvader::usrWaveClicked( void ) buffer.setAudioFile( af ); // copy buffer data - sample_length = min( sample_length, static_cast(buffer.frames()) ); + sample_length = min( sample_length, static_cast( + buffer.frames() ) ); for ( int i = 0; i < sample_length; i++ ) { sample_shape[i] = (float)*buffer.data()[i]; } } - + sampleChanged(); - } -/* - - deprecated code - - was replaced by static oscillator methods - -void bitInvader::sinWaveClicked( void ) -{ - // generate sample data - for (int i=0; i < sample_length; i++) - { - // sin(x) - sample_shape[i] = sinf(i * 6.2831853 / sample_length); - } - - sampleChanged(); -} - -void bitInvader::triangleWaveClicked( void ) -{ - int half_sample_length = sample_length / 2; - - if ((sample_length % 2) == 0) { - - for (int i=0; i < half_sample_length; i++) - { - // triangle - sample_shape[i] = (((float)i) / half_sample_length * 2) - 1; - } - for (int i=half_sample_length; i < sample_length; i++) - { - // triangle - sample_shape[i] = - (((float)(i-half_sample_length)) / half_sample_length * 2) + 1; - } - - } else { - for (int i=0; i < half_sample_length; i++) - { - // triangle - sample_shape[i] = (((float)i) / half_sample_length * 2) - 1; - } - sample_shape[half_sample_length] = 1; - for (int i=half_sample_length+1; i < sample_length; i++) - { - // triangle - sample_shape[i] = - (((float)(i-half_sample_length)) / half_sample_length * 2) + 1; - } - - } - - sampleChanged(); -} - -void bitInvader::sawWaveClicked( void ) -{ - for (int i=0; i < sample_length; i++) - { - // saw - sample_shape[i] = (((float)i) / sample_length * 2) - 1; - } - - sampleChanged(); -} - -void bitInvader::sqrWaveClicked( void ) -{ - int half_sample_length = sample_length / 2; - - for (int i=0; i < half_sample_length; i++) - { - // triangle - sample_shape[i] = 1; - } - for (int i=half_sample_length; i < sample_length; i++) - { - // triangle - sample_shape[i] = -1; - } - - sampleChanged(); - - -} - -void bitInvader::noiseWaveClicked( void) -{ - srand(time(NULL)); - - for (int i=0; i < sample_length; i++) - { - sample_shape[i]= ((float)rand() / RAND_MAX * 2.0) - 1.0; - } - - sampleChanged(); - -} - - -*/ - bitInvader::~bitInvader() { @@ -769,3 +667,6 @@ plugin * lmms_plugin_main( void * _data ) } + + +#include "bit_invader.moc" diff --git a/plugins/bit_invader/bit_invader.h b/plugins/bit_invader/bit_invader.h index f86ae9112..db278c588 100644 --- a/plugins/bit_invader/bit_invader.h +++ b/plugins/bit_invader/bit_invader.h @@ -2,7 +2,7 @@ * bit_invader.h - declaration of class bitInvader and bSynth which * are a wavetable synthesizer * - * Copyright (c) 2006 Andreas Brandmaier + * Copyright (c) 2006-2007 Andreas Brandmaier * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -29,28 +29,27 @@ #include "instrument.h" -#include "spc_bg_hndl_widget.h" -#include "graph.h" -#include "led_checkbox.h" -#include "oscillator.h" +#include "types.h" class QPixmap; +class graph; class knob; -class notePlayHandle; +class ledCheckBox; +class oscillator; class pixmapButton; class bSynth { public: - bSynth(float* sample, int length, float _pitch, bool _interpolation, float factor, const sample_rate_t _sample_rate); + bSynth( float * sample, int length, float _pitch, bool _interpolation, + float factor, const sample_rate_t _sample_rate ); virtual ~bSynth(); - sample_t nextStringSample(); + sample_t nextStringSample(); private: - int sample_index; float sample_realindex; int sample_length; @@ -61,7 +60,7 @@ private: } ; -class bitInvader : public instrument, public specialBgHandlingWidget +class bitInvader : public instrument { Q_OBJECT public: @@ -132,7 +131,6 @@ private: } ; -#include "bit_invader.moc" #endif diff --git a/plugins/flp_import/unrtf/parse.c b/plugins/flp_import/unrtf/parse.c index cff6275b4..949f0c302 100644 --- a/plugins/flp_import/unrtf/parse.c +++ b/plugins/flp_import/unrtf/parse.c @@ -156,11 +156,7 @@ static int my_getchar (QBuffer* f) error_handler("Cannot allocate read buffer"); } } -#ifndef QT3 read_buf_end = f->read(read_buf, buffer_size); -#else - read_buf_end = f->readBlock(read_buf, buffer_size); -#endif read_buf_index = 0; if (!read_buf_end) return EOF; diff --git a/plugins/organic/organic.cpp b/plugins/organic/organic.cpp index fb04a8f02..3241a12ef 100644 --- a/plugins/organic/organic.cpp +++ b/plugins/organic/organic.cpp @@ -23,19 +23,12 @@ */ -#include -#include -#include - -#include -#include -#include -#include "math.h" - -using namespace std; - - #include "organic.h" + + +#include + + #include "engine.h" #include "instrument_track.h" #include "knob.h" @@ -83,7 +76,6 @@ QPixmap * organicInstrument::s_artwork = NULL; organicInstrument::organicInstrument( instrumentTrack * _channel_track ) : instrument( _channel_track, &organic_plugin_descriptor ), - specialBgHandlingWidget( PLUGIN_NAME::getIconPixmap( "artwork" ) ), m_modulationAlgo( oscillator::MIX ) { m_num_oscillators = 8; @@ -525,3 +517,7 @@ plugin * lmms_plugin_main( void * _data ) * - randomize preset */ + + + +#include "organic.moc" diff --git a/plugins/organic/organic.h b/plugins/organic/organic.h index 41a6c2485..9af047547 100644 --- a/plugins/organic/organic.h +++ b/plugins/organic/organic.h @@ -28,8 +28,6 @@ #include "instrument.h" -#include "spc_bg_hndl_widget.h" -#include "led_checkbox.h" #include "oscillator.h" class QPixmap; @@ -77,7 +75,7 @@ private slots: -class organicInstrument : public instrument, public specialBgHandlingWidget +class organicInstrument : public instrument { Q_OBJECT public: @@ -137,7 +135,6 @@ private slots: } ; -#include "organic.moc" #endif diff --git a/plugins/patman/patman.cpp b/plugins/patman/patman.cpp index 7f367b295..922e72885 100644 --- a/plugins/patman/patman.cpp +++ b/plugins/patman/patman.cpp @@ -23,11 +23,12 @@ */ +#include "patman.h" + #include #include #include -#include "patman.h" #include "endian_handling.h" #include "engine.h" #include "gui_templates.h" @@ -72,8 +73,7 @@ plugin * lmms_plugin_main( void * _data ) patmanSynth::patmanSynth( instrumentTrack * _track ) : - instrument( _track, &patman_plugin_descriptor ), - specialBgHandlingWidget( PLUGIN_NAME::getIconPixmap( "artwork" ) ) + instrument( _track, &patman_plugin_descriptor ) { setAutoFillBackground( TRUE ); QPalette pal; @@ -88,8 +88,6 @@ patmanSynth::patmanSynth( instrumentTrack * _track ) : "project_open_down" ) ); m_openFileButton->setInactiveGraphic( embed::getIconPixmap( "project_open" ) ); - m_openFileButton->setBgGraphic( getBackground( - m_openFileButton ) ); connect( m_openFileButton, SIGNAL( clicked() ), this, SLOT( openFile() ) ); toolTip::add( m_openFileButton, tr( "Open other patch" ) ); @@ -105,7 +103,6 @@ patmanSynth::patmanSynth( instrumentTrack * _track ) : "loop_on" ) ); m_loopButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "loop_off" ) ); - m_loopButton->setBgGraphic( getBackground( m_loopButton ) ); toolTip::add( m_loopButton, tr( "Loop mode" ) ); m_loopButton->setWhatsThis( tr( "Here you can toggle the Loop mode. If enabled, PatMan " @@ -120,7 +117,6 @@ patmanSynth::patmanSynth( instrumentTrack * _track ) : "tune_on" ) ); m_tuneButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "tune_off" ) ); - m_tuneButton->setBgGraphic( getBackground( m_tuneButton ) ); toolTip::add( m_tuneButton, tr( "Tune mode" ) ); m_tuneButton->setWhatsThis( tr( "Here you can toggle the Tune mode. If enabled, PatMan " diff --git a/plugins/patman/patman.h b/plugins/patman/patman.h index 51f8d116d..efc7b51ff 100644 --- a/plugins/patman/patman.h +++ b/plugins/patman/patman.h @@ -29,7 +29,6 @@ #include "instrument.h" #include "sample_buffer.h" -#include "spc_bg_hndl_widget.h" class pixmapButton; @@ -45,7 +44,7 @@ class pixmapButton; #define MODES_CLAMPED ( 1 << 7 ) -class patmanSynth : public instrument, public specialBgHandlingWidget +class patmanSynth : public instrument { Q_OBJECT public: diff --git a/plugins/vestige/vestige.cpp b/plugins/vestige/vestige.cpp index 877b981e8..411cf1adf 100644 --- a/plugins/vestige/vestige.cpp +++ b/plugins/vestige/vestige.cpp @@ -23,25 +23,21 @@ */ -#include -#include +#include "vestige.h" + #include -#include -#include +#include #include -#include +#include #include "engine.h" -#include "vestige.h" #include "gui_templates.h" #include "instrument_play_handle.h" #include "instrument_track.h" #include "lvsl_client.h" -#include "mixer.h" #include "note_play_handle.h" #include "pixmap_button.h" #include "song_editor.h" -#include "spc_bg_hndl_widget.h" #include "text_float.h" #include "tooltip.h" @@ -73,7 +69,6 @@ QPixmap * vestigeInstrument::s_artwork = NULL; vestigeInstrument::vestigeInstrument( instrumentTrack * _instrument_track ) : instrument( _instrument_track, &vestige_plugin_descriptor ), - specialBgHandlingWidget( PLUGIN_NAME::getIconPixmap( "artwork" ) ), m_plugin( NULL ), m_pluginMutex() { @@ -91,8 +86,6 @@ vestigeInstrument::vestigeInstrument( instrumentTrack * _instrument_track ) : "project_open_down" ) ); m_openPluginButton->setInactiveGraphic( embed::getIconPixmap( "project_open" ) ); - m_openPluginButton->setBgGraphic( getBackground( - m_openPluginButton ) ); connect( m_openPluginButton, SIGNAL( clicked() ), this, SLOT( openPlugin() ) ); toolTip::add( m_openPluginButton, tr( "Open other VST-plugin" ) ); diff --git a/plugins/vestige/vestige.h b/plugins/vestige/vestige.h index 6574baee6..8045e1fc5 100644 --- a/plugins/vestige/vestige.h +++ b/plugins/vestige/vestige.h @@ -27,30 +27,22 @@ #define _VESTIGE_H -#ifndef QT3 - #include -#else - -#include - -#endif - #include "instrument.h" #include "midi.h" #include "note.h" -#include "spc_bg_hndl_widget.h" +class QPixmap; +class QPushButton; + class pixmapButton; -class QPushButton; class remoteVSTPlugin; -class QPixmap; -class vestigeInstrument : public instrument, public specialBgHandlingWidget +class vestigeInstrument : public instrument { Q_OBJECT public: diff --git a/plugins/vst_effect/vst_control_dialog.cpp b/plugins/vst_effect/vst_control_dialog.cpp index 378b57d1c..9b686d5d0 100644 --- a/plugins/vst_effect/vst_control_dialog.cpp +++ b/plugins/vst_effect/vst_control_dialog.cpp @@ -23,16 +23,10 @@ */ -#ifndef QT3 +#include "vst_control_dialog.h" #include -#else - -#include - -#endif - #include "vst_effect.h" @@ -45,11 +39,7 @@ vstControlDialog::vstControlDialog( QWidget * _parent, QWidget * pw = m_effect->m_plugin->pluginWidget(); if( pw ) { -#ifndef QT3 pw->setParent( this ); -#else - pw->reparent( this, QPoint( 0, 0 ) ); -#endif pw->show(); l->addWidget( pw ); } diff --git a/plugins/vst_effect/vst_effect.cpp b/plugins/vst_effect/vst_effect.cpp index dab3f7439..31f5d09d3 100644 --- a/plugins/vst_effect/vst_effect.cpp +++ b/plugins/vst_effect/vst_effect.cpp @@ -23,21 +23,13 @@ */ -#ifndef QT3 +#include "vst_effect.h" #include -#else - -#include - -#endif - - -#include "vst_effect.h" -#include "vst_subplugin_features.h" #include "song_editor.h" #include "text_float.h" +#include "vst_subplugin_features.h" #undef SINGLE_SOURCE_COMPILE diff --git a/plugins/vst_effect/vst_subplugin_features.cpp b/plugins/vst_effect/vst_subplugin_features.cpp index d9eacbc00..d815487ea 100644 --- a/plugins/vst_effect/vst_subplugin_features.cpp +++ b/plugins/vst_effect/vst_subplugin_features.cpp @@ -25,20 +25,11 @@ */ -#ifndef QT3 +#include "vst_subplugin_features.h" #include #include -#else - -#include -#include - -#endif - - -#include "vst_subplugin_features.h" #include "config_mgr.h" @@ -64,12 +55,8 @@ void vstSubPluginFeatures::listSubPluginKeys( plugin::descriptor * _desc, keyList & _kl ) { QStringList dlls = QDir( configManager::inst()->vstDir() ). -#ifndef QT3 entryList( QStringList() << "*.dll", QDir::Files, QDir::Name ); -#else - entryList( "*.dll", QDir::Files, QDir::Name ); -#endif // TODO: eval m_type for( QStringList::const_iterator it = dlls.begin(); it != dlls.end(); ++it ) diff --git a/src/core/envelope_and_lfo_widget.cpp b/src/core/envelope_and_lfo_widget.cpp index c8fc97546..9151e7138 100644 --- a/src/core/envelope_and_lfo_widget.cpp +++ b/src/core/envelope_and_lfo_widget.cpp @@ -26,27 +26,28 @@ */ -#include -#include -#include -#include - - #include "envelope_and_lfo_widget.h" -#include "song_editor.h" + + +#include +#include +#include + + +#include "debug.h" #include "embed.h" #include "engine.h" -#include "knob.h" -#include "pixmap_button.h" -#include "oscillator.h" -#include "debug.h" -#include "tooltip.h" #include "gui_templates.h" +#include "knob.h" #include "led_checkbox.h" -#include "tempo_sync_knob.h" -#include "string_pair_drag.h" #include "mmp.h" +#include "oscillator.h" +#include "pixmap_button.h" +#include "song_editor.h" +#include "string_pair_drag.h" +#include "tempo_sync_knob.h" #include "text_float.h" +#include "tooltip.h" @@ -95,7 +96,6 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount, QWidget * _parent, track * _track ) : QWidget( _parent ), - specialBgHandlingWidget( palette().color( backgroundRole() ) ), m_used( FALSE ), m_valueForZeroAmount( _value_for_zero_amount ), m_pahdEnv( NULL ), diff --git a/src/core/main_window.cpp b/src/core/main_window.cpp index 1e0f7110f..4d139787a 100644 --- a/src/core/main_window.cpp +++ b/src/core/main_window.cpp @@ -671,6 +671,7 @@ bool mainWindow::saveProjectAs( void ) QFileDialog sfd( this, tr( "Save project" ), "", tr( "MultiMedia Project (*.mmp *.mmpz);;" "MultiMedia Project Template (*.mpt)" ) ); + sfd.setAcceptMode( QFileDialog::AcceptSave ); sfd.setFileMode( QFileDialog::AnyFile ); QString f = engine::getSongEditor()->projectFileName(); if( f != "" ) diff --git a/src/core/track.cpp b/src/core/track.cpp index ed70a7449..3719779e7 100644 --- a/src/core/track.cpp +++ b/src/core/track.cpp @@ -921,8 +921,6 @@ QPixmap * trackOperationsWidget::s_muteOffDisabled; QPixmap * trackOperationsWidget::s_muteOffEnabled; QPixmap * trackOperationsWidget::s_muteOnDisabled; QPixmap * trackOperationsWidget::s_muteOnEnabled; -QPixmap * trackOperationsWidget::s_trackOpsDisabled; -QPixmap * trackOperationsWidget::s_trackOpsEnabled; trackOperationsWidget::trackOperationsWidget( trackWidget * _parent ) : @@ -942,10 +940,6 @@ trackOperationsWidget::trackOperationsWidget( trackWidget * _parent ) : "mute_on_disabled" ) ); s_muteOnEnabled = new QPixmap( embed::getIconPixmap( "mute_on" ) ); - s_trackOpsDisabled = new QPixmap( embed::getIconPixmap( - "track_op_menu_disabled" ) ); - s_trackOpsEnabled = new QPixmap( embed::getIconPixmap( - "track_op_menu" ) ); } toolTip::add( this, tr( "Press while clicking on move-grip " @@ -956,8 +950,11 @@ trackOperationsWidget::trackOperationsWidget( trackWidget * _parent ) : connect( to_menu, SIGNAL( aboutToShow() ), this, SLOT( updateMenu() ) ); + setObjectName( "automationEnabled" ); + + m_trackOps = new QPushButton( this ); - m_trackOps->setIcon( *s_trackOpsEnabled ); + m_trackOps->move( 12, 1 ); m_trackOps->setMenu( to_menu ); toolTip::add( m_trackOps, tr( "Actions for this track" ) ); @@ -1052,8 +1049,8 @@ void trackOperationsWidget::paintEvent( QPaintEvent * _pe ) if( !m_automationDisabled ) { m_automationDisabled = TRUE; - m_trackOps->setIcon( - *s_trackOpsDisabled ); + setObjectName( "automationDisabled" ); + setStyle( NULL ); m_muteBtn->setActiveGraphic( *s_muteOnDisabled ); m_muteBtn->setInactiveGraphic( @@ -1065,8 +1062,8 @@ void trackOperationsWidget::paintEvent( QPaintEvent * _pe ) if( m_automationDisabled ) { m_automationDisabled = FALSE; - m_trackOps->setIcon( - *s_trackOpsEnabled ); + setObjectName( "automationEnabled" ); + setStyle( NULL ); m_muteBtn->setActiveGraphic( *s_muteOnEnabled ); m_muteBtn->setInactiveGraphic( diff --git a/src/widgets/group_box.cpp b/src/widgets/group_box.cpp index f84f845f7..fbec80267 100644 --- a/src/widgets/group_box.cpp +++ b/src/widgets/group_box.cpp @@ -25,9 +25,12 @@ */ +#include "group_box.h" + + #include -#include #include +#include #ifndef __USE_XOPEN @@ -37,9 +40,7 @@ #include -#include "group_box.h" #include "embed.h" -#include "spc_bg_hndl_widget.h" #include "gui_templates.h" @@ -68,7 +69,6 @@ groupBox::groupBox( const QString & _caption, QWidget * _parent, m_led->move( 2, 3 ); m_led->setActiveGraphic( embed::getIconPixmap( "led_green" ) ); m_led->setInactiveGraphic( embed::getIconPixmap( "led_off" ) ); - m_led->setBgGraphic( specialBgHandlingWidget::getBackground( m_led ) ); connect( m_led, SIGNAL( toggled( bool ) ), this, SLOT( setState( bool ) ) ); } diff --git a/src/widgets/knob.cpp b/src/widgets/knob.cpp index 10370ce36..2028fa328 100644 --- a/src/widgets/knob.cpp +++ b/src/widgets/knob.cpp @@ -51,7 +51,6 @@ #include "engine.h" #include "gui_templates.h" #include "main_window.h" -#include "spc_bg_hndl_widget.h" #include "string_pair_drag.h" #include "templates.h" #include "text_float.h" @@ -160,8 +159,6 @@ void knob::setTotalAngle( float _angle ) void knob::drawKnob( QPainter * _p ) { - _p->drawPixmap( 0, 0, specialBgHandlingWidget::getBackground( this ) ); - const float radius = m_knobPixmap->width() / 2 - 1; const float xm = m_knobPixmap->width() / 2;//radius + 1; const float ym = m_knobPixmap->height() / 2;//radius+1; diff --git a/src/widgets/led_checkbox.cpp b/src/widgets/led_checkbox.cpp index 8f58bdfe4..f841bc0a8 100644 --- a/src/widgets/led_checkbox.cpp +++ b/src/widgets/led_checkbox.cpp @@ -25,15 +25,15 @@ */ +#include "led_checkbox.h" + #include #include #include -#include "led_checkbox.h" #include "automatable_object_templates.h" #include "embed.h" #include "gui_templates.h" -#include "spc_bg_hndl_widget.h" static const QString names[ledCheckBox::TOTAL_COLORS] = @@ -81,8 +81,6 @@ void ledCheckBox::paintEvent( QPaintEvent * ) { QPainter p( this ); - p.drawPixmap( 0, 0, specialBgHandlingWidget::getBackground( this ) ); - if( isChecked() == TRUE ) { p.drawPixmap( 0, 0, *m_ledOnPixmap ); diff --git a/src/widgets/pixmap_button.cpp b/src/widgets/pixmap_button.cpp index bce5a1bab..17ee9b534 100644 --- a/src/widgets/pixmap_button.cpp +++ b/src/widgets/pixmap_button.cpp @@ -39,13 +39,10 @@ pixmapButton::pixmapButton( QWidget * _parent, const QString & _name, track * _track ) : automatableButton( _parent, _name, _track ), m_activePixmap(), - m_inactivePixmap(), - m_bgPixmap() + m_inactivePixmap() { setActiveGraphic( embed::getIconPixmap( "led_yellow" ) ); setInactiveGraphic( embed::getIconPixmap( "led_off" ), FALSE ); - - //setCheckable( TRUE ); } @@ -62,11 +59,6 @@ void pixmapButton::paintEvent( QPaintEvent * ) { QPainter p( this ); - if( !m_bgPixmap.isNull() ) - { - p.drawPixmap( 0, 0, m_bgPixmap ); - } - if( isChecked() ) { if( !m_activePixmap.isNull() ) @@ -130,13 +122,6 @@ void pixmapButton::setInactiveGraphic( const QPixmap & _pm, bool _update ) -void pixmapButton::setBgGraphic( const QPixmap & _pm ) -{ - m_bgPixmap = _pm; -} - - - #include "pixmap_button.moc" diff --git a/src/widgets/tab_widget.cpp b/src/widgets/tab_widget.cpp index 7d22a9a97..a93af227d 100644 --- a/src/widgets/tab_widget.cpp +++ b/src/widgets/tab_widget.cpp @@ -3,7 +3,7 @@ /* * tab_widget.cpp - tabwidget for LMMS * - * Copyright (c) 2005-2006 Tobias Doerffel + * Copyright (c) 2005-2007 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -25,19 +25,19 @@ */ +#include "tab_widget.h" + #include #include #include #include -#include "tab_widget.h" #include "gui_templates.h" tabWidget::tabWidget( const QString & _caption, QWidget * _parent ) : QWidget( _parent ), - specialBgHandlingWidget( QColor( 96, 96, 96 ) ), m_activeTab( 0 ), m_caption( _caption ) {