more Qt4 changes

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@548 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2007-08-27 18:25:01 +00:00
parent e24f094c62
commit 437c15c643
30 changed files with 17 additions and 358 deletions

View File

@@ -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

View File

@@ -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 )
{
}

View File

@@ -26,6 +26,7 @@
#ifndef _AUTOMATABLE_OBJECT_TEMPLATES_H
#define _AUTOMATABLE_OBJECT_TEMPLATES_H
#include <QtXml/QDomElement>
#include "automatable_object.h"
#include "automation_editor.h"
@@ -33,15 +34,6 @@
#include "engine.h"
#include "templates.h"
#ifndef QT3
#include <QtXml/QDomElement>
#else
#include <qdom.h>
#endif
template<typename T, typename EDIT_STEP_TYPE>
@@ -329,13 +321,8 @@ template<typename T, typename EDIT_STEP_TYPE>
void automatableObject<T, EDIT_STEP_TYPE>::redoStep( journalEntry & _je )
{
bool journalling = testAndSetJournalling( FALSE );
/*#ifndef QT3
setValue( static_cast<T>( value() +
_je.data().value<EDIT_STEP_TYPE>() ) );
#else*/
setValue( static_cast<T>( value() + static_cast<EDIT_STEP_TYPE>(
_je.data().toDouble() ) ) );
//#endif
setJournalling( journalling );
}
@@ -346,12 +333,7 @@ template<typename T, typename EDIT_STEP_TYPE>
void automatableObject<T, EDIT_STEP_TYPE>::undoStep( journalEntry & _je )
{
journalEntry je( _je.actionID(),
/*#ifndef QT3
-_je.data().value<EDIT_STEP_TYPE>()
#else*/
static_cast<EDIT_STEP_TYPE>( -_je.data().toDouble() )
//#endif
);
static_cast<EDIT_STEP_TYPE>( -_je.data().toDouble() ) );
redoStep( je );
}

View File

@@ -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 );

View File

@@ -27,13 +27,7 @@
#define _CUSTOM_EVENTS_H
#ifdef QT3
#include <qevent.h>
#endif
#include <QtCore/QEvent>
namespace customEvents

View File

@@ -31,17 +31,8 @@
#include <config.h>
#endif
#ifndef QT3
#include <Qt/QtXml>
#else
#include <qdom.h>
#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 );

View File

@@ -26,16 +26,8 @@
#ifndef _EFFECT_CONTROL_DIALOG_H
#define _EFFECT_CONTROL_DIALOG_H
#ifndef QT3
#include <QtGui/QWidget>
#else
#include <qwidget.h>
#endif
#include "journalling_object.h"

View File

@@ -30,16 +30,8 @@
#include <config.h>
#endif
#ifndef QT3
#include <QtCore/QMap>
#else
#include <qmap.h>
#endif
class automationEditor;
class bbEditor;
class projectJournal;

View File

@@ -25,17 +25,8 @@
#ifndef _FIFO_BUFFER_H
#define _FIFO_BUFFER_H
#ifndef QT3
#include <QtCore/QSemaphore>
#else
#include <qsemaphore.h>
#endif
template<typename T>
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 );
}

View File

@@ -25,17 +25,8 @@
#ifndef _METER_DIALOG_H
#define _METER_DIALOG_H
#ifndef QT3
#include <QtGui/QWidget>
#else
#include <qwidget.h>
#endif
#include "lcd_spinbox.h"

View File

@@ -26,19 +26,8 @@
#ifndef _PROJECT_VERSION_H
#define _PROJECT_VERSION_H
#ifndef QT3
#include <QtCore/QString>
#else
#include <qstring.h>
#endif
class projectVersion : public QString
{

View File

@@ -25,23 +25,11 @@
#ifndef _RACK_PLUGIN_H
#define _RACK_PLUGIN_H
#ifndef QT3
#include <QtGui/QWidget>
#include <QtGui/QGroupBox>
#include <QtGui/QPushButton>
#include <QtGui/QLabel>
#else
#include <qwidget.h>
#include <qgroupbox.h>
#include <qpushbutton.h>
#include <qlabel.h>
#endif
#include "journalling_object.h"

View File

@@ -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 )
{
}

View File

@@ -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 );

View File

@@ -26,16 +26,8 @@
#ifndef _TEMPO_SYNC_KNOB_H
#define _TEMPO_SYNC_KNOB_H
#ifndef QT3
#include <QtGui/QPixmap>
#else
#include <qpixmap.h>
#endif
#include "knob.h"

View File

@@ -26,18 +26,8 @@
#ifndef _TOOL_H
#define _TOOL_H
#ifndef QT3
#include <QtGui/QWidget>
#else
#include <qwidget.h>
#endif
#include "plugin.h"

View File

@@ -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 );

View File

@@ -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

View File

@@ -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 )
{

View File

@@ -23,19 +23,8 @@
*/
#include "qt3support.h"
#ifdef QT4
#include <Qt/QtXml>
#else
#include <qdom.h>
#endif
#include "plucked_string_synth.h"
#include "engine.h"
#include "instrument_track.h"

View File

@@ -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();

View File

@@ -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 );
}
}

View File

@@ -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
}

View File

@@ -30,19 +30,9 @@
#ifdef SDL_AUDIO_SUPPORT
#ifdef QT4
#include <QtGui/QLabel>
#include <QtGui/QLineEdit>
#else
#include <qlineedit.h>
#include <qlabel.h>
#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<char *>( ( "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;
}

View File

@@ -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 );

View File

@@ -25,17 +25,8 @@
*
*/
#ifdef QT4
#include <QtGui/QMessageBox>
#else
#include "qmessagebox.h"
#endif
#include "effect.h"
#include "engine.h"
#include "dummy_effect.h"

View File

@@ -24,20 +24,10 @@
*
*/
#ifdef QT4
#include <QtGui/QLayout>
#include <QtGui/QPushButton>
#include <QtGui/QLabel>
#else
#include <qlayout.h>
#include <qpushbutton.h>
#include <qlabel.h>
#endif
#include "meter_dialog.h"
#include "embed.h"
#include "gui_templates.h"

View File

@@ -28,9 +28,7 @@
#include "tool.h"
#include "main_window.h"
#ifndef QT3
#include <QtGui/QIcon>
#endif

View File

@@ -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

View File

@@ -26,18 +26,10 @@
*/
#include "effect_label.h"
#ifndef QT3
#include <QtXml/QDomElement>
#include <QtGui/QMouseEvent>
#else
#include <qdom.h>
#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 <QtGui/QMouseEvent>
#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() ),