From 437c15c643380cec863ac98dca032d884775ab12 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Mon, 27 Aug 2007 18:25:01 +0000 Subject: [PATCH] more Qt4 changes git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@548 0778d3d1-df1d-0410-868b-ea421aaaa00d --- Makefile.am | 6 +-- include/audio_device.h | 7 +--- include/automatable_object_templates.h | 22 +--------- include/automatable_slider.h | 11 ----- include/custom_events.h | 8 +--- include/effect.h | 13 +----- include/effect_control_dialog.h | 8 ---- include/engine.h | 8 ---- include/fifo_buffer.h | 33 --------------- include/meter_dialog.h | 9 ----- include/project_version.h | 11 ----- include/rack_plugin.h | 12 ------ include/rubberband.h | 12 +----- include/tab_button.h | 15 ------- include/tempo_sync_knob.h | 8 ---- include/tool.h | 10 ----- include/tool_button.h | 17 -------- include/update_event.h | 12 ------ plugins/bit_invader/bit_invader.cpp | 24 ----------- .../plucked_string_synth.cpp | 11 ----- plugins/vst_effect/vst_effect.cpp | 7 ---- src/audio/audio_alsa.cpp | 10 +---- src/audio/audio_device.cpp | 8 +--- src/audio/audio_sdl.cpp | 40 +------------------ src/core/about_dialog.cpp | 3 -- src/core/effect.cpp | 9 ----- src/core/meter_dialog.cpp | 10 ----- src/core/tool.cpp | 2 - src/lib/project_journal.cpp | 10 ----- src/widgets/effect_label.cpp | 19 ++------- 30 files changed, 17 insertions(+), 358 deletions(-) diff --git a/Makefile.am b/Makefile.am index f189d6183..60c987d9b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -418,11 +418,7 @@ if HAVE_LIBSF LIB_SF_LDADD = -lsndfile endif -if LADSPA_SUPPORT -LIB_LADSPABASE_LDADD = -Lplugins/ladspa_base -lladspabase -endif - -lmms_LDADD = $(QT_LDADD) $(LIB_SDL_LDADD) $(LIB_ASOUND_LDADD) $(LIB_JACK_LDADD) $(LIB_SDL_SOUND_LDADD) $(LIB_VORBIS_LDADD) $(LIB_SRC_LDADD) $(LIB_SF_LDADD) $(LIB_LADSPABASE_LDADD) +lmms_LDADD = $(QT_LDADD) $(LIB_SDL_LDADD) $(LIB_ASOUND_LDADD) $(LIB_JACK_LDADD) $(LIB_SDL_SOUND_LDADD) $(LIB_VORBIS_LDADD) $(LIB_SRC_LDADD) $(LIB_SF_LDADD) if BUILD_LINUX lmms_LDFLAGS = -rdynamic endif diff --git a/include/audio_device.h b/include/audio_device.h index 627290b27..1ee430028 100644 --- a/include/audio_device.h +++ b/include/audio_device.h @@ -102,11 +102,8 @@ public: public: setupWidget( const QString & _caption, QWidget * _parent ) : tabWidget( tabWidget::tr( "Settings for %1" ).arg( - tabWidget::tr( _caption -#ifndef QT3 - .toAscii() -#endif - ) ).toUpper(), _parent ) + tabWidget::tr( _caption.toAscii() ) ). + toUpper(), _parent ) { } diff --git a/include/automatable_object_templates.h b/include/automatable_object_templates.h index 76149f936..9328351ef 100644 --- a/include/automatable_object_templates.h +++ b/include/automatable_object_templates.h @@ -26,6 +26,7 @@ #ifndef _AUTOMATABLE_OBJECT_TEMPLATES_H #define _AUTOMATABLE_OBJECT_TEMPLATES_H +#include #include "automatable_object.h" #include "automation_editor.h" @@ -33,15 +34,6 @@ #include "engine.h" #include "templates.h" -#ifndef QT3 - -#include - -#else - -#include - -#endif template @@ -329,13 +321,8 @@ template void automatableObject::redoStep( journalEntry & _je ) { bool journalling = testAndSetJournalling( FALSE ); -/*#ifndef QT3 - setValue( static_cast( value() + - _je.data().value() ) ); -#else*/ setValue( static_cast( value() + static_cast( _je.data().toDouble() ) ) ); -//#endif setJournalling( journalling ); } @@ -346,12 +333,7 @@ template void automatableObject::undoStep( journalEntry & _je ) { journalEntry je( _je.actionID(), -/*#ifndef QT3 - -_je.data().value() -#else*/ - static_cast( -_je.data().toDouble() ) -//#endif - ); + static_cast( -_je.data().toDouble() ) ); redoStep( je ); } diff --git a/include/automatable_slider.h b/include/automatable_slider.h index 3af21d45d..cdd6a67c9 100644 --- a/include/automatable_slider.h +++ b/include/automatable_slider.h @@ -58,17 +58,6 @@ public: return( m_show_status ); } -#ifdef QT3 - inline int minimum( void ) const - { - return( minValue() ); - } - inline int maximum( void ) const - { - return( maxValue() ); - } -#endif - signals: void logicValueChanged( int _value ); diff --git a/include/custom_events.h b/include/custom_events.h index ec732759c..0050a791a 100644 --- a/include/custom_events.h +++ b/include/custom_events.h @@ -27,13 +27,7 @@ #define _CUSTOM_EVENTS_H -#ifdef QT3 - -#include - -#endif - - +#include namespace customEvents diff --git a/include/effect.h b/include/effect.h index 11fcb44b3..a07cafa65 100644 --- a/include/effect.h +++ b/include/effect.h @@ -31,17 +31,8 @@ #include #endif -#ifndef QT3 - #include -#else - -#include - -#endif - - #include "plugin.h" #include "mixer.h" @@ -136,7 +127,7 @@ public: return( m_gate ); } - void FASTCALL setGate( float _level ); + void setGate( float _level ); inline Uint32 getBufferCount( void ) { @@ -170,7 +161,7 @@ public: virtual effectControlDialog * createControlDialog( track * _track ) = 0; - static effect * FASTCALL instantiate( const QString & _plugin_name, + static effect * instantiate( const QString & _plugin_name, descriptor::subPluginFeatures::key * _key ); diff --git a/include/effect_control_dialog.h b/include/effect_control_dialog.h index a65f6909d..9e3746584 100644 --- a/include/effect_control_dialog.h +++ b/include/effect_control_dialog.h @@ -26,16 +26,8 @@ #ifndef _EFFECT_CONTROL_DIALOG_H #define _EFFECT_CONTROL_DIALOG_H -#ifndef QT3 - #include -#else - -#include - -#endif - #include "journalling_object.h" diff --git a/include/engine.h b/include/engine.h index f130fafc7..12b910c22 100644 --- a/include/engine.h +++ b/include/engine.h @@ -30,16 +30,8 @@ #include #endif -#ifndef QT3 - #include -#else - -#include - -#endif - class automationEditor; class bbEditor; class projectJournal; diff --git a/include/fifo_buffer.h b/include/fifo_buffer.h index c614d9afc..4dc636b12 100644 --- a/include/fifo_buffer.h +++ b/include/fifo_buffer.h @@ -25,17 +25,8 @@ #ifndef _FIFO_BUFFER_H #define _FIFO_BUFFER_H - -#ifndef QT3 - #include -#else - -#include - -#endif - template class fifoBuffer @@ -49,53 +40,29 @@ public: m_size( _size ) { m_buffer = new T[_size]; -#ifndef QT3 m_reader_sem.acquire( _size ); -#else - m_reader_sem += _size; -#endif } ~fifoBuffer() { delete[] m_buffer; -#ifndef QT3 m_reader_sem.release( m_size ); -#else - m_reader_sem -= m_size; -#endif } void write( T _element ) { -#ifndef QT3 m_writer_sem.acquire(); -#else - m_writer_sem++; -#endif m_buffer[m_writer_index++] = _element; m_writer_index %= m_size; -#ifndef QT3 m_reader_sem.release(); -#else - m_reader_sem--; -#endif } T read( void ) { -#ifndef QT3 m_reader_sem.acquire(); -#else - m_reader_sem++; -#endif T element = m_buffer[m_reader_index++]; m_reader_index %= m_size; -#ifndef QT3 m_writer_sem.release(); -#else - m_writer_sem--; -#endif return( element ); } diff --git a/include/meter_dialog.h b/include/meter_dialog.h index 4015cb4eb..de446843f 100644 --- a/include/meter_dialog.h +++ b/include/meter_dialog.h @@ -25,17 +25,8 @@ #ifndef _METER_DIALOG_H #define _METER_DIALOG_H -#ifndef QT3 - #include -#else - -#include - -#endif - - #include "lcd_spinbox.h" diff --git a/include/project_version.h b/include/project_version.h index 00de70448..b6721db25 100644 --- a/include/project_version.h +++ b/include/project_version.h @@ -26,19 +26,8 @@ #ifndef _PROJECT_VERSION_H #define _PROJECT_VERSION_H - -#ifndef QT3 - #include -#else - -#include - -#endif - - - class projectVersion : public QString { diff --git a/include/rack_plugin.h b/include/rack_plugin.h index 7cef2057f..6606e4452 100644 --- a/include/rack_plugin.h +++ b/include/rack_plugin.h @@ -25,23 +25,11 @@ #ifndef _RACK_PLUGIN_H #define _RACK_PLUGIN_H -#ifndef QT3 - #include #include #include #include -#else - -#include -#include -#include -#include - -#endif - - #include "journalling_object.h" diff --git a/include/rubberband.h b/include/rubberband.h index 01f0f6418..e56f0307e 100644 --- a/include/rubberband.h +++ b/include/rubberband.h @@ -35,16 +35,8 @@ class selectableObject : public QWidget { Q_OBJECT public: - selectableObject( QWidget * _parent -#ifdef QT3 - , WFlags _f -#endif - ) : - QWidget( _parent -#ifdef QT3 - , NULL, _f -#endif - ), + selectableObject( QWidget * _parent ) : + QWidget( _parent ), m_selected( FALSE ) { } diff --git a/include/tab_button.h b/include/tab_button.h index 54d65aadf..8c7c0b229 100644 --- a/include/tab_button.h +++ b/include/tab_button.h @@ -37,11 +37,7 @@ public: QPushButton( _text, _parent ), m_id( _id ) { -#ifndef QT3 setCheckable( TRUE ); -#else - setToggleButton( TRUE ); -#endif connect( this, SIGNAL( clicked() ), this, SLOT( slotClicked() ) ); } @@ -50,17 +46,6 @@ public: { } -#ifdef QT3 - inline void setChecked( bool _on ) - { - setOn( _on ); - } - - inline bool isChecked( void ) const - { - return( isOn() ); - } -#endif signals: void clicked( int ); diff --git a/include/tempo_sync_knob.h b/include/tempo_sync_knob.h index 01465698e..dc3f2bc3c 100644 --- a/include/tempo_sync_knob.h +++ b/include/tempo_sync_knob.h @@ -26,16 +26,8 @@ #ifndef _TEMPO_SYNC_KNOB_H #define _TEMPO_SYNC_KNOB_H -#ifndef QT3 - #include -#else - -#include - -#endif - #include "knob.h" diff --git a/include/tool.h b/include/tool.h index 3fcd5ccf8..4c26f2690 100644 --- a/include/tool.h +++ b/include/tool.h @@ -26,18 +26,8 @@ #ifndef _TOOL_H #define _TOOL_H - -#ifndef QT3 - #include -#else - -#include - -#endif - - #include "plugin.h" diff --git a/include/tool_button.h b/include/tool_button.h index a440790e9..3a908f97e 100644 --- a/include/tool_button.h +++ b/include/tool_button.h @@ -59,23 +59,6 @@ public: m_colorHighlighted = _color; } -#ifdef QT3 - inline void setIcon( const QPixmap & _icon ) - { - setIconSet( _icon ); - } - - inline void setChecked( bool _on ) - { - setOn( _on ); - } - - inline bool isChecked( void ) const - { - return( isOn() ); - } -#endif - protected: virtual void enterEvent( QEvent * _ev ); diff --git a/include/update_event.h b/include/update_event.h index f16250ad7..a31cb2d81 100644 --- a/include/update_event.h +++ b/include/update_event.h @@ -26,31 +26,19 @@ #ifndef _UPDATE_EVENT_H #define _UPDATE_EVENT_H - #include "custom_events.h" - -#ifndef QT3 class updateEvent : public QEvent -#else -class updateEvent : public QCustomEvent -#endif { public: updateEvent( void ) : -#ifndef QT3 QEvent( (QEvent::Type)customEvents::GUI_UPDATE ) -#else - QCustomEvent( customEvents::GUI_UPDATE ) -#endif { } } ; - - #endif diff --git a/plugins/bit_invader/bit_invader.cpp b/plugins/bit_invader/bit_invader.cpp index 4b793cf31..1e65d5b61 100644 --- a/plugins/bit_invader/bit_invader.cpp +++ b/plugins/bit_invader/bit_invader.cpp @@ -331,31 +331,7 @@ bitInvader::bitInvader( instrumentTrack * _channel_track ) : } -/* -void bitInvader::paintEvent( QPaintEvent * ) -{ -#ifdef QT4 - QPainter p( this ); -#else - QPixmap pm( rect().size() ); - pm.fill( this, rect().topLeft() ); - QPainter p( &pm, this ); -#endif - p.drawPixmap( 0, 0, *s_artwork ); - - p.setPen( QColor( 255, 255, 255 ) ); -// p.setPen( QColor( 0xFF, 0xAA, 0x00 ) ); - -// p.drawLine(0,0,200,200); - -#ifndef QT4 - bitBlt( this, rect().topLeft(), &pm ); -#endif - - -} -*/ void bitInvader::sinWaveClicked( void ) { diff --git a/plugins/plucked_string_synth/plucked_string_synth.cpp b/plugins/plucked_string_synth/plucked_string_synth.cpp index 0e18c4a7c..271deccb1 100644 --- a/plugins/plucked_string_synth/plucked_string_synth.cpp +++ b/plugins/plucked_string_synth/plucked_string_synth.cpp @@ -23,19 +23,8 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include -#else - -#include - -#endif - - #include "plucked_string_synth.h" #include "engine.h" #include "instrument_track.h" diff --git a/plugins/vst_effect/vst_effect.cpp b/plugins/vst_effect/vst_effect.cpp index ad936c353..dab3f7439 100644 --- a/plugins/vst_effect/vst_effect.cpp +++ b/plugins/vst_effect/vst_effect.cpp @@ -172,13 +172,6 @@ void vstEffect::openPlugin( const QString & _plugin ) m_plugin->setTempo( engine::getSongEditor()->getTempo() ); if( m_plugin->pluginWidget() != NULL ) { -/*#ifdef QT4 - m_plugin->pluginWidget()->setWindowIcon( - getInstrumentTrack()->windowIcon() ); -#else - m_plugin->pluginWidget()->setWindowIcon( - *( getInstrumentTrack()->windowIcon() ) ); -#endif*/ m_plugin->hideEditor(); } m_pluginMutex.unlock(); diff --git a/src/audio/audio_alsa.cpp b/src/audio/audio_alsa.cpp index 9b2d68d54..009d6cac7 100644 --- a/src/audio/audio_alsa.cpp +++ b/src/audio/audio_alsa.cpp @@ -167,15 +167,7 @@ void audioALSA::startProcessing( void ) { if( !isRunning() ) { - start( -#ifdef QT4 - QThread::HighPriority -#else -#if QT_VERSION >= 0x030505 - QThread::HighestPriority -#endif -#endif - ); + start( QThread::HighPriority ); } } diff --git a/src/audio/audio_device.cpp b/src/audio/audio_device.cpp index 100a54a2a..4a594274f 100644 --- a/src/audio/audio_device.cpp +++ b/src/audio/audio_device.cpp @@ -65,15 +65,9 @@ audioDevice::~audioDevice() { src_delete( m_srcState ); delete[] m_buffer; -#ifdef QT3 - if( m_devMutex.locked() ) - { - unlock(); - } -#else + m_devMutex.tryLock(); unlock(); -#endif } diff --git a/src/audio/audio_sdl.cpp b/src/audio/audio_sdl.cpp index ab58b342c..64bb482e5 100644 --- a/src/audio/audio_sdl.cpp +++ b/src/audio/audio_sdl.cpp @@ -30,19 +30,9 @@ #ifdef SDL_AUDIO_SUPPORT -#ifdef QT4 - #include #include -#else - -#include -#include - -#endif - - #include "debug.h" #include "config_mgr.h" #include "gui_templates.h" @@ -65,19 +55,6 @@ audioSDL::audioSDL( const sample_rate_t _sample_rate, bool & _success_ful, * sizeof( int_sample_t ); m_convertedBuf = new Uint8[m_convertedBuf_size]; -/* // if device is set, we set AUDIODEV-environment-variable, so that - // SDL can evaluate and use it - QString dev = configManager::inst()->value( "audiosdl", "device" ); - if( dev != "" ) - { - putenv( const_cast( ( "AUDIODEV=" + dev ). -#ifdef QT4 - toAscii().constData() ) ); -#else - ascii() ) ); -#endif - }*/ - if( SDL_Init( SDL_INIT_AUDIO | SDL_INIT_NOPARACHUTE ) < 0 ) { @@ -105,11 +82,7 @@ audioSDL::audioSDL( const sample_rate_t _sample_rate, bool & _success_ful, } m_convertEndian = ( m_audioHandle.format != actual.format ); -#ifndef QT3 m_stop_semaphore.acquire(); -#else - m_stop_semaphore++; -#endif _success_ful = TRUE; } @@ -120,11 +93,8 @@ audioSDL::audioSDL( const sample_rate_t _sample_rate, bool & _success_ful, audioSDL::~audioSDL() { stopProcessing(); -#ifndef QT3 m_stop_semaphore.release(); -#else - m_stop_semaphore--; -#endif + SDL_CloseAudio(); SDL_Quit(); delete[] m_convertedBuf; @@ -149,11 +119,7 @@ void audioSDL::stopProcessing( void ) { if( SDL_GetAudioStatus() == SDL_AUDIO_PLAYING ) { -#ifndef QT3 m_stop_semaphore.acquire(); -#else - m_stop_semaphore++; -#endif SDL_LockAudio(); SDL_PauseAudio( 1 ); @@ -194,11 +160,7 @@ void audioSDL::sdlAudioCallback( Uint8 * _buf, int _len ) if( !frames ) { m_stopped = TRUE; -#ifndef QT3 m_stop_semaphore.release(); -#else - m_stop_semaphore--; -#endif memset( _buf, 0, _len ); return; } diff --git a/src/core/about_dialog.cpp b/src/core/about_dialog.cpp index d71827578..5a069bbf9 100644 --- a/src/core/about_dialog.cpp +++ b/src/core/about_dialog.cpp @@ -63,9 +63,6 @@ aboutDialog::aboutDialog() : "Copyright (c) 2004-2007 " "LMMS-Developers\n\n" "http://lmms.sourceforge.net" ) -#ifndef QT4 - , m_aboutTabs -#endif ); about_lbl->setAlignment( Qt::AlignVCenter | Qt::AlignLeft ); about_lbl->setIndent( 30 ); diff --git a/src/core/effect.cpp b/src/core/effect.cpp index 75ed1244f..1a091b204 100644 --- a/src/core/effect.cpp +++ b/src/core/effect.cpp @@ -25,17 +25,8 @@ * */ -#ifdef QT4 - #include -#else - -#include "qmessagebox.h" - -#endif - - #include "effect.h" #include "engine.h" #include "dummy_effect.h" diff --git a/src/core/meter_dialog.cpp b/src/core/meter_dialog.cpp index c928c5b87..8f462d3b0 100644 --- a/src/core/meter_dialog.cpp +++ b/src/core/meter_dialog.cpp @@ -24,20 +24,10 @@ * */ -#ifdef QT4 - #include #include #include -#else - -#include -#include -#include - -#endif - #include "meter_dialog.h" #include "embed.h" #include "gui_templates.h" diff --git a/src/core/tool.cpp b/src/core/tool.cpp index 3a6517ce1..9b232ee95 100644 --- a/src/core/tool.cpp +++ b/src/core/tool.cpp @@ -28,9 +28,7 @@ #include "tool.h" #include "main_window.h" -#ifndef QT3 #include -#endif diff --git a/src/lib/project_journal.cpp b/src/lib/project_journal.cpp index 15c085b41..23a185650 100644 --- a/src/lib/project_journal.cpp +++ b/src/lib/project_journal.cpp @@ -32,11 +32,6 @@ #include "journalling_object.h" #include "song_editor.h" -#ifdef QT3 -#define value data -#endif - - projectJournal::projectJournal( void ) : m_joIDs(), @@ -175,9 +170,4 @@ void projectJournal::clearInvalidJournallingObjects( void ) -#ifdef QT3 -#undef value -#endif - - #endif diff --git a/src/widgets/effect_label.cpp b/src/widgets/effect_label.cpp index 34c79255b..497aa0c96 100644 --- a/src/widgets/effect_label.cpp +++ b/src/widgets/effect_label.cpp @@ -26,18 +26,10 @@ */ -#include "effect_label.h" - -#ifndef QT3 - #include +#include -#else - -#include - -#endif - +#include "effect_label.h" #include "effect_tab_widget.h" #include "sample_track.h" #include "embed.h" @@ -46,9 +38,6 @@ #include "rename_dialog.h" #include "main_window.h" -#ifndef QT3 -#include -#endif effectLabel::effectLabel( const QString & _initial_name, QWidget * _parent, @@ -72,9 +61,9 @@ effectLabel::effectLabel( const QString & _initial_name, QWidget * _parent, m_effWidget = new effectTabWidget( engine::getMainWindow()->workspace(), m_track, m_track->getAudioPort() ); -#ifndef QT3 + engine::getMainWindow()->workspace()->addWindow( m_effWidget ); -#endif + m_effWidget->setFixedSize( 240, 242 ); m_effWidget->hide(); connect( m_effWidget, SIGNAL( closed() ),