dropped Qt3-support and improved Qt4-support

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@547 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2007-08-26 19:02:51 +00:00
parent 5ae2896e05
commit e24f094c62
217 changed files with 859 additions and 10666 deletions

View File

@@ -1,7 +1,7 @@
/*
* about_dialog.h - declaration of class aboutDialog
*
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -26,19 +26,8 @@
#ifndef _ABOUT_DIALOG_H
#define _ABOUT_DIALOG_H
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QDialog>
#else
#include <qdialog.h>
#endif
class QPushButton;
class QLabel;
class QTabWidget;

View File

@@ -27,22 +27,8 @@
#ifndef _ARP_AND_CHORDS_TAB_WIDGET_H
#define _ARP_AND_CHORDS_TAB_WIDGET_H
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QWidget>
#else
#include <qwidget.h>
#endif
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "journalling_object.h"
#include "types.h"

View File

@@ -26,22 +26,10 @@
#ifndef _AUDIO_DEVICE_H
#define _AUDIO_DEVICE_H
#include "qt3support.h"
#ifdef QT4
#include <QtCore/QPair>
#include <QtCore/QMutex>
#include <QtCore/QThread>
#else
#include <qpair.h>
#include <qmutex.h>
#include <qthread.h>
#endif
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

View File

@@ -27,19 +27,8 @@
#define _AUDIO_FILE_DEVICE_H
#include "qt3support.h"
#ifdef QT4
#include <QtCore/QFile>
#else
#include <qfile.h>
#endif
#include "audio_device.h"

View File

@@ -37,22 +37,10 @@
#include <jack/jack.h>
#include "qt3support.h"
#ifdef QT4
#include <QtCore/QVector>
#include <QtCore/QList>
#include <QtCore/QMap>
#else
#include <qvaluevector.h>
#include <qvaluelist.h>
#include <qmap.h>
#endif
#include "audio_device.h"
@@ -109,7 +97,7 @@ private:
QSemaphore m_stop_semaphore;
vvector<jack_port_t *> m_outputPorts;
QVector<jack_port_t *> m_outputPorts;
surroundSampleFrame * m_outBuf;

View File

@@ -26,18 +26,8 @@
#ifndef _AUDIO_PORT_H
#define _AUDIO_PORT_H
#include "qt3support.h"
#ifdef QT4
#include <QtCore/QString>
#else
#include <qstring.h>
#endif
#include "effect_chain.h"

View File

@@ -29,21 +29,9 @@
#define _AUDIO_SAMPLE_RECORDER_H
#include "qt3support.h"
#ifdef QT4
#include <QtCore/QList>
#include <QtCore/QPair>
#else
#include <qvaluelist.h>
#include <qpair.h>
#endif
#include "audio_device.h"
@@ -67,7 +55,7 @@ private:
const fpp_t _frames,
const float _master_gain );
typedef vlist<QPair<sampleFrame *, fpp_t> > bufferList;
typedef QList<QPair<sampleFrame *, fpp_t> > bufferList;
bufferList m_buffers;
} ;

View File

@@ -26,19 +26,8 @@
#ifndef _AUTOMATABLE_BUTTON_H
#define _AUTOMATABLE_BUTTON_H
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QWidget>
#else
#include <qwidget.h>
#endif
#include "automatable_object.h"
@@ -121,7 +110,7 @@ public:
private:
vlist<automatableButton *> m_buttons;
QList<automatableButton *> m_buttons;
signals:

View File

@@ -28,19 +28,11 @@
#include <math.h>
#include "qt3support.h"
#include "journalling_object.h"
#include "level_object.h"
#ifndef QT3
#include <QtCore/QPointer>
#else
#include <qguardedptr.h>
#endif
class automationPattern;
@@ -175,7 +167,7 @@ private:
T m_oldValue;
bool m_journalEntryReady;
typedef vvector<autoObj *> autoObjVector;
typedef QVector<autoObj *> autoObjVector;
autoObjVector m_linkedObjects;
inline void linkObject( autoObj * _object );

View File

@@ -147,7 +147,7 @@ void automatableObject<T, EDIT_STEP_TYPE>::setValue( const T _value )
// for( autoObjVector::iterator it =
// m_linkedObjects.begin();
// it != m_linkedObjects.end(); ++it )
for( csize i = 0; i < m_linkedObjects.size(); ++i )
for( int i = 0; i < m_linkedObjects.size(); ++i )
{
autoObj * it = m_linkedObjects[i];
if( value() != it->value() && it->fittedValue( value() )
@@ -437,7 +437,7 @@ void automatableObject<T, EDIT_STEP_TYPE>::unlinkObject( autoObj * _object )
template<typename T, typename EDIT_STEP_TYPE>
void automatableObject<T, EDIT_STEP_TYPE>::syncAutomationPattern( void )
{
for( csize i = 0; i < m_linkedObjects.size(); ++i )
for( int i = 0; i < m_linkedObjects.size(); ++i )
{
autoObj * it = m_linkedObjects[i];
if( m_automation_pattern != it->m_automation_pattern )

View File

@@ -26,25 +26,13 @@
#ifndef _AUTOMATABLE_SLIDER_H
#define _AUTOMATABLE_SLIDER_H
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QSlider>
#include <QtXml/QDomElement>
#else
#include <qdom.h>
#include <qslider.h>
#endif
class knob;
class automatableSlider : public QSlider
{
Q_OBJECT

View File

@@ -27,19 +27,7 @@
#ifndef _AUTOMATION_EDITOR_H
#define _AUTOMATION_EDITOR_H
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QWidget>
#include <QtCore/QVector>
#else
#include <qwidget.h>
#include <qvaluevector.h>
#endif
#include "types.h"
#include "journalling_object.h"

View File

@@ -27,17 +27,10 @@
#ifndef _AUTOMATION_PATTERN_H
#define _AUTOMATION_PATTERN_H
#include <qobject.h>
#include <QtCore/QObject>
#include "qt3support.h"
#include "journalling_object.h"
#ifdef QT3
#include "xqmap.h"
#endif
class levelObject;
class midiTime;
@@ -50,12 +43,7 @@ class automationPattern : public QObject, public journallingObject
{
Q_OBJECT
public:
// map negative midiTime to level
#ifdef QT3
typedef XQMap<int, int> timeMap;
#else
typedef QMap<int, int> timeMap;
#endif
automationPattern( track * _track, levelObject * _object );
automationPattern( const automationPattern & _pat_to_copy );

View File

@@ -27,21 +27,14 @@
#ifndef _BASE64_H
#define _BASE64_H
#include "qt3support.h"
#ifndef QT3
#include <QtCore/QByteArray>
#endif
#include <QtCore/QString>
class QVariant;
namespace base64
{
#ifndef QT3
inline void encode( const char * _data, const int _size,
QString & _dst )
{
@@ -55,10 +48,6 @@ namespace base64
*_data = new char[*_size];
memcpy( *_data, data.constData(), *_size );
}
#else
void encode( const char * _data, const int _size, QString & _dst );
void decode( const QString & _b64, char * * _data, int * _size );
#endif
QString encode( const QVariant & _data );
QVariant decode( const QString & _b64 );

View File

@@ -26,7 +26,6 @@
#ifndef _BB_EDITOR_H
#define _BB_EDITOR_H
#include "qt3support.h"
#include "track_container.h"
@@ -59,16 +58,16 @@ public:
return( TRUE );
}
csize currentBB( void ) const;
tact FASTCALL lengthOfBB( const csize _bb );
int currentBB( void ) const;
tact FASTCALL lengthOfBB( const int _bb );
inline tact lengthOfCurrentBB( void )
{
return( lengthOfBB( currentBB() ) );
}
void FASTCALL removeBB( const csize _bb );
csize numOfBBs( void ) const;
void FASTCALL removeBB( const int _bb );
int numOfBBs( void ) const;
void FASTCALL swapBB( const csize _bb1, const csize _bb2 );
void FASTCALL swapBB( const int _bb1, const int _bb2 );
void updateBBTrack( trackContentObject * _tco );
@@ -93,7 +92,7 @@ private:
//bbEditor( const bbEditor & );
virtual ~bbEditor();
void FASTCALL createTCOsForBB( const csize _bb );
void FASTCALL createTCOsForBB( const int _bb );
QWidget * m_toolBar;

View File

@@ -27,21 +27,9 @@
#ifndef _BB_TRACK_H
#define _BB_TRACK_H
#include "qt3support.h"
#ifdef QT4
#include <QtCore/QObject>
#include <QtCore/QMap>
#else
#include <qobject.h>
#include <qmap.h>
#endif
#include "track.h"
class nameLabel;
@@ -113,8 +101,8 @@ public:
virtual void FASTCALL loadTrackSpecificSettings( const QDomElement &
_this );
static bbTrack * FASTCALL findBBTrack( csize _bb_num );
static csize FASTCALL numOfBBTrack( track * _track );
static bbTrack * FASTCALL findBBTrack( int _bb_num );
static int FASTCALL numOfBBTrack( track * _track );
static void FASTCALL swapBBTracks( track * _track1, track * _track2 );
inline nameLabel * trackLabel( void )
@@ -149,9 +137,9 @@ protected:
private:
nameLabel * m_trackLabel;
vlist<track *> m_disabled_tracks;
QList<track *> m_disabled_tracks;
typedef QMap<bbTrack *, csize> infoMap;
typedef QMap<bbTrack *, int> infoMap;
static infoMap s_infoMap;
} ;

View File

@@ -30,21 +30,9 @@
#include <config.h>
#endif
#include "qt3support.h"
#ifdef QT4
#include <QtCore/QMap>
#include <Qt/QtXml>
#else
#include <qmap.h>
#include <qdom.h>
#endif
class journallingObject;

View File

@@ -26,26 +26,12 @@
#ifndef _COMBOBOX_H
#define _COMBOBOX_H
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QWidget>
#include <QtCore/QVector>
#include <QtGui/QMenu>
#include <QtGui/QPixmap>
#include <QtCore/QPair>
#else
#include <qwidget.h>
#include <qvaluevector.h>
#include <qpopupmenu.h>
#include <qpixmap.h>
#include <qpair.h>
#endif
#include "automatable_object.h"
@@ -95,14 +81,13 @@ private:
typedef QPair<QString, QPixmap> item;
vvector<item> m_items;
QVector<item> m_items;
bool m_pressed;
private slots:
void setItem( QAction * _item );
void setItem( int _item );
signals:

View File

@@ -31,25 +31,11 @@
#endif
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QDialog>
#include <QtCore/QMap>
#include <QtCore/QVector>
#include <QtCore/QPair>
#else
#include <qdialog.h>
#include <qmap.h>
#include <qvaluevector.h>
#include <qpair.h>
#endif
class QLineEdit;
class QLabel;
@@ -201,7 +187,7 @@ protected slots:
void backButtonClicked( void );
void nextButtonClicked( void );
void switchPage( csize _pg );
void switchPage( int _pg );
void switchPage( QWidget * _pg );
@@ -237,7 +223,7 @@ private:
QStringList m_recentlyOpenedProjects;
typedef vvector<QPair<QString, QString> > stringPairVector;
typedef QVector<QPair<QString, QString> > stringPairVector;
typedef QMap<QString, stringPairVector> settingsMap;
settingsMap m_settings;
@@ -253,8 +239,8 @@ private:
QLineEdit * m_wdLineEdit;
// wizard stuff
vlist<QPair<QWidget *, QString> > m_pages;
csize m_currentPage;
QList<QPair<QWidget *, QString> > m_pages;
int m_currentPage;
QFrame * m_hbar;
QWidget * m_contentWidget;
QLabel * m_title;

View File

@@ -27,22 +27,10 @@
#ifndef _CPULOAD_WIDGET_H
#define _CPULOAD_WIDGET_H
#include "qt3support.h"
#ifdef QT4
#include <QtCore/QTimer>
#include <QtGui/QPixmap>
#include <QtGui/QWidget>
#else
#include <qwidget.h>
#include <qpixmap.h>
#include <qtimer.h>
#endif
#include "types.h"

View File

@@ -25,11 +25,9 @@
#ifndef _EFFECT_CHAIN_H
#define _EFFECT_CHAIN_H
#include "qt3support.h"
#include "effect.h"
typedef vvector<effect *> effect_list_t;
typedef QVector<effect *> effect_list_t;
class effectChain
{

View File

@@ -26,22 +26,10 @@
#ifndef _EFFECT_LABEL_H
#define _EFFECT_LABEL_H
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QWidget>
#include <QtGui/QPushButton>
#include <QtGui/QLabel>
#else
#include <qwidget.h>
#include <qpushbutton.h>
#include <qlabel.h>
#endif
#include "journalling_object.h"

View File

@@ -26,22 +26,8 @@
#ifndef _EFFECT_SELECT_DIALOG_H
#define _EFFECT_SELECT_DIALOG_H
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QDialog>
#include <Qt3Support/Q3ListBox>
#define QListBoxItem Q3ListBoxItem
#else
#include <qdialog.h>
#include <qlistbox.h>
#define Q3ListBox QListBox
#endif
#include "effect.h"
@@ -94,11 +80,11 @@ protected:
protected slots:
void onHighlighted( int _plugin );
void onAddButtonReleased();
void onDoubleClicked( QListBoxItem * _item );
void onDoubleClicked( Q3ListBoxItem * _item );
private:
vvector<plugin::descriptor> m_pluginDescriptors;
QVector<plugin::descriptor> m_pluginDescriptors;
effectKeyList m_effectKeys;
effectKey m_currentSelection;

View File

@@ -27,28 +27,10 @@
#ifndef _EFFECT_TAB_WIDGET_H
#define _EFFECT_TAB_WIDGET_H
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QWidget>
#include <QtGui/QPushButton>
#include <QtGui/QLayout>
#else
#include <qwidget.h>
#include <qpushbutton.h>
#include <qlayout.h>
#include <qscrollview.h>
#include <qvbox.h>
#endif
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "journalling_object.h"
#include "rack_view.h"

View File

@@ -1,7 +1,7 @@
/*
* embed.h - misc. stuff for using embedded data (resources linked into binary)
*
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -26,19 +26,9 @@
#ifndef _EMBED_H
#define _EMBED_H
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QPixmap>
#include <QtCore/QString>
#else
#include <qpixmap.h>
#include <qstring.h>
#endif
namespace embed
{

View File

@@ -28,24 +28,9 @@
#ifndef _ENVELOPE_AND_LFO_WIDGET_H
#define _ENVELOPE_AND_LFO_WIDGET_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QWidget>
#include <QtCore/QVector>
#else
#include <qwidget.h>
#include <qvaluevector.h>
#endif
#include "journalling_object.h"
#include "types.h"
@@ -129,7 +114,7 @@ private:
static QPixmap * s_envGraph;
static QPixmap * s_lfoGraph;
static vvector<envelopeAndLFOWidget *> s_EaLWidgets;
static QVector<envelopeAndLFOWidget *> s_EaLWidgets;
bool m_used;

View File

@@ -28,19 +28,8 @@
#ifndef _ENVELOPE_TAB_WIDGET_H
#define _ENVELOPE_TAB_WIDGET_H
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QWidget>
#else
#include <qwidget.h>
#endif
#include "mixer.h"

View File

@@ -27,22 +27,8 @@
#ifndef _EXPORT_PROJECT_DIALOG_H
#define _EXPORT_PROJECT_DIALOG_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QDialog>
#else
#include <qdialog.h>
#endif
#include "export.h"
@@ -81,8 +67,7 @@ private:
void finishProjectExport( void );
void abortProjectExport( void );
static fileTypes FASTCALL getFileTypeFromExtension( const QString &
_ext );
static fileTypes getFileTypeFromExtension( const QString & _ext );
static Sint16 s_availableBitrates[];

View File

@@ -26,21 +26,9 @@
#ifndef _FADE_BUTTON_H
#define _FADE_BUTTON_H
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QAbstractButton>
#include <QtGui/QColor>
#else
#include <qbutton.h>
#include <qcolor.h>
#endif
class fadeButton : public QAbstractButton
{
@@ -58,11 +46,7 @@ public slots:
protected:
#ifndef QT3
virtual void customEvent( QEvent * );
#else
virtual void customEvent( QCustomEvent * );
#endif
virtual void paintEvent( QPaintEvent * _pe );

View File

@@ -26,37 +26,16 @@
#ifndef _FILE_BROWSER_H
#define _FILE_BROWSER_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "qt3support.h"
#ifdef QT4
#include <QtCore/QDir>
#include <QtCore/QMutex>
#else
#include <qlistview.h>
#include <qdir.h>
#include <qmutex.h>
#define cleanPath cleanDirPath
#endif
class QColorGroup;
#include <Qt3Support/Q3ListView>
#include "side_bar_widget.h"
#ifndef QT3
class QListViewItem;
#else
class Q3ListViewItem;
#endif
class QPixmap;
class fileItem;
@@ -138,16 +117,7 @@ private:
class directory :
#ifndef QT3
public Q3ListViewItem
// trick moc
#if 0
,
#endif
#else
public QListViewItem
#endif
class directory : public Q3ListViewItem
{
public:
directory( Q3ListView * _parent, const QString & _filename,
@@ -182,7 +152,7 @@ public:
private:
void initPixmapStuff( void );
void FASTCALL setPixmap( const QPixmap * _px );
void setPixmap( const QPixmap * _px );
bool addItems( const QString & _path );
@@ -201,27 +171,13 @@ private:
class fileItem :
#ifndef QT3
public Q3ListViewItem
// trick moc
#if 0
,
#endif
#else
public QListViewItem
#endif
class fileItem : public Q3ListViewItem
{
public:
fileItem( Q3ListView * _parent, const QString & _name,
const QString & _path );
#ifndef QT3
fileItem( Q3ListViewItem * _parent, const QString & _name,
const QString & _path );
#else
fileItem( QListViewItem * _parent, const QString & _name,
const QString & _path );
#endif
inline QString fullName( void ) const
{
@@ -265,9 +221,5 @@ private:
} ;
#ifdef QT3
#undef cleanPath
#endif
#endif

View File

@@ -26,18 +26,8 @@
#ifndef _GROUP_BOX_H
#define _GROUP_BOX_H
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QWidget>
#else
#include <qwidget.h>
#endif
#include "pixmap_button.h"

View File

@@ -1,7 +1,7 @@
/*
* gui_templates.h - GUI-specific templates
*
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2005-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -26,22 +26,10 @@
#ifndef _GUI_TEMPLATES_H
#define _GUI_TEMPLATES_H
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QApplication>
#include <QtGui/QFont>
#include <QtGui/QDesktopWidget>
#else
#include <qpaintdevicemetrics.h>
#include <qfont.h>
#include <qapplication.h>
#include <qdesktopwidget.h>
#endif
// return DPI-independent font-size - font with returned font-size has always
@@ -50,13 +38,8 @@ template<int SIZE>
inline QFont pointSize( QFont _f )
{
static const int DPI = 96;
#ifdef QT4
_f.setPointSizeF( (float) SIZE * DPI /
QApplication::desktop()->logicalDpiY() );
#else
_f.setPointSizeFloat( (float) SIZE * DPI /
QPaintDeviceMetrics( qApp->desktop() ).logicalDpiY() );
#endif
return( _f );
}
@@ -64,13 +47,8 @@ inline QFont pointSize( QFont _f )
inline QFont pointSizeF( QFont _f, float SIZE )
{
static const int DPI = 96;
#ifdef QT4
_f.setPointSizeF( SIZE * DPI /
QApplication::desktop()->logicalDpiY() );
#else
_f.setPointSizeFloat( SIZE * DPI /
QPaintDeviceMetrics( qApp->desktop() ).logicalDpiY() );
#endif
return( _f );
}

View File

@@ -27,23 +27,8 @@
#ifndef _IMPORT_FILTER_H
#define _IMPORT_FILTER_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "qt3support.h"
#ifdef QT4
#include <QtCore/QFile>
#else
#include <qfile.h>
#endif
#include "plugin.h"
@@ -82,34 +67,22 @@ protected:
inline int readByte( void )
{
#ifdef QT4
char c;
if( m_file.getChar( &c ) )
{
return( static_cast<int>( c ) );
}
return( -1 );
#else
return( m_file.getch() );
#endif
}
inline int readBlock( char * _data, int _len )
{
#ifndef QT3
return( m_file.read( _data, _len ) );
#else
return( m_file.readBlock( _data, _len ) );
#endif
}
inline void ungetChar( int _ch )
{
#ifndef QT3
m_file.ungetChar( _ch );
#else
m_file.ungetch( _ch );
#endif
}
virtual void FASTCALL saveSettings( QDomDocument &,

View File

@@ -28,26 +28,9 @@
#define _INSTRUMENT_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QWidget>
#include <QtCore/QVector>
#else
#include <qwidget.h>
#include <qvaluevector.h>
#endif
#include "plugin.h"
#include "mixer.h"

View File

@@ -27,22 +27,10 @@
#ifndef _INSTRUMENT_TRACK_H
#define _INSTRUMENT_TRACK_H
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QApplication>
#include <QtGui/QPushButton>
#include <QtGui/QPainter>
#else
#include <qapplication.h>
#include <qpushbutton.h>
#include <qpainter.h>
#endif
#include "midi_event_processor.h"
#include "mixer.h"
#include "tab_widget.h"
@@ -220,7 +208,7 @@ private:
tones m_baseTone;
octaves m_baseOctave;
vlist<notePlayHandle *> m_processHandles;
QList<notePlayHandle *> m_processHandles;
// widgets on the top of a instrument-track-window
@@ -248,14 +236,10 @@ private:
volumeKnob * m_tswVolumeKnob;
fadeButton * m_tswActivityIndicator;
instrumentTrackButton * m_tswInstrumentTrackButton;
QMenu * m_tswMidiMenu;
#ifdef QT4
QAction * m_midiInputAction;
QAction * m_midiOutputAction;
#else
int m_midiInputID;
int m_midiOutputID;
#endif
friend class instrumentTrackButton;
friend class notePlayHandle;
@@ -277,23 +261,6 @@ public:
instrumentTrackButton( instrumentTrack * _instrument_track );
virtual ~instrumentTrackButton();
#ifdef QT3
inline void setChecked( bool _on )
{
setOn( _on );
}
inline bool isChecked( void ) const
{
return( isOn() );
}
inline void setCheckable( bool _on )
{
QPushButton::setToggleButton( _on );
}
#endif
protected:
// since we want to draw a special label (instrument- and instrument-

View File

@@ -31,21 +31,11 @@
#endif
#include "types.h"
#include "qt3support.h"
#ifndef QT3
#include <QtCore/QVariant>
#include <QtCore/QVector>
#include <QtCore/QStack>
#else
#include <qvariant.h>
#include <qvaluevector.h>
#include <qvaluestack.h>
#endif
class QDomDocument;
@@ -105,7 +95,7 @@ private:
} ;
typedef vvector<journalEntry> journalEntryVector;
typedef QVector<journalEntry> journalEntryVector;
@@ -209,7 +199,7 @@ private:
bool m_journalling;
vstack<bool> m_journallingStateStack;
QStack<bool> m_journallingStateStack;
} ;

View File

@@ -1,296 +0,0 @@
/***************************************************************************
kmultitabbar.h - description
-------------------
begin : 2001
copyright : (C) 2001,2002,2003 by Joseph Wenninger <jowenn@kde.org>
***************************************************************************/
/***************************************************************************
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301 USA.
***************************************************************************/
#ifndef _KMultitabbar_qt3_h_
#define _KMultitabbar_qt3_h_
#include "qt3support.h"
#include <qscrollview.h>
#include <qvbox.h>
#include <qhbox.h>
#include <qabstractlayout.h>
#include <qstring.h>
#include <qptrlist.h>
#include <qpushbutton.h>
class KMultiTabBarButton;
class KMultiTabBarTab;
typedef QPtrList<KMultiTabBarButton> buttonList;
typedef QPtrList<KMultiTabBarTab> tabList;
class QPixmap;
class QPainter;
class QFrame;
class KMultiTabBarPrivate;
class KMultiTabBarTabPrivate;
class KMultiTabBarButtonPrivate;
class KMultiTabBarInternal;
/**
* A Widget for horizontal and vertical tabs.
* It is possible to add normal buttons to the top/left
* The handling if only one tab at a time or multiple tabs
* should be raisable is left to the "user".
*@author Joseph Wenninger
*/
class KMultiTabBar: public QWidget
{
Q_OBJECT
public:
enum KMultiTabBarMode{ Horizontal, Vertical };
enum KMultiTabBarPosition{Left, Right, Top, Bottom};
/**
* VSNET == Visual Studio .Net like (only show the text of active tabs
* KDEV3 == Kdevelop 3 like (always show the text)
* KONQSBC == konqy's classic sidebar style (unthemed), this one is disabled
* at the moment, but will be renabled soon too
*/
enum KMultiTabBarStyle{VSNET=0, KDEV3=1, KONQSBC=2, KDEV3ICON=3,STYLELAST=0xffff};
KMultiTabBar(KMultiTabBarMode m,QWidget *parent=0);
virtual ~KMultiTabBar();
/**
* append a new button to the button area. The button can later on be accessed with button(ID)
* eg for connecting signals to it
* @param pic a pixmap for the button
* @param id an arbitraty ID value. It will be emitted in the clicked signal for identifying the button
* if more than one button is connected to a signals.
* @param popup A popup menu which should be displayed if the button is clicked
* @param not_used_yet will be used for a popup text in the future
*/
int appendButton(const QPixmap &pic,int id=-1,QMenu* popup=0,const QString& not_used_yet=QString::null);
/**
* remove a button with the given ID
*/
void removeButton(int id);
/**
* append a new tab to the tab area. It can be accessed lateron with tabb(id);
* @param pic a bitmap for the tab
* @param id an arbitrary ID which can be used later on to identify the tab
* @param text if a mode with text is used it will be the tab text, otherwise a mouse over hint
*/
int appendTab(const QPixmap &pic,int id=-1,const QString& text=QString::null);
/**
* remove a tab with a given ID
*/
void removeTab(int id);
/**
* set a tab to "raised"
* @param id The ID of the tab to manipulate
* @param state true == activated/raised, false == not active
*/
void setTab(int id ,bool state);
/**
* return the state of a tab, identified by it's ID
*/
bool isTabRaised(int id) const;
/**
* get a pointer to a button within the button area identified by its ID
*/
class KMultiTabBarButton *button(int id) const;
/**
* get a pointer to a tab within the tab area, identiifed by its ID
*/
class KMultiTabBarTab *tab(int id) const;
/**
* set the real position of the widget.
* @param pos if the mode is horizontal, only use top, bottom, if it is vertical use left or right
*/
void setPosition(KMultiTabBarPosition pos);
/**
* set the display style of the tabs
*/
void setStyle(KMultiTabBarStyle style);
/**
* be carefull, don't delete tabs yourself and don't delete the list itself
*/
tabList * tabs();
/**
* be carefull, don't delete buttons yourself and don't delete the list itself
*/
buttonList * buttons();
/**
* might vanish, not sure yet
*/
void showActiveTabTexts(bool show=true);
protected:
friend class KMultiTabBarButton;
virtual void fontChange( const QFont& );
void updateSeparator();
private:
class KMultiTabBarInternal *m_internal;
QBoxLayout *m_l;
QFrame *m_btnTabSep;
buttonList m_buttons;
KMultiTabBarPosition m_position;
KMultiTabBarPrivate *d;
};
/**
* This class should never be created except with the appendButton call of KMultiTabBar
*/
class KMultiTabBarButton: public QPushButton
{
Q_OBJECT
public:
KMultiTabBarButton(const QPixmap& pic,const QString&, QMenu *popup,
int id,QWidget *parent, KMultiTabBar::KMultiTabBarPosition pos, KMultiTabBar::KMultiTabBarStyle style);
KMultiTabBarButton(const QString&, QMenu *popup,
int id,QWidget *parent, KMultiTabBar::KMultiTabBarPosition pos, KMultiTabBar::KMultiTabBarStyle style);
virtual ~KMultiTabBarButton();
int id() const;
public slots:
/**
* this is used internaly, but can be used by the user, if (s)he wants to
* It the according call of KMultiTabBar is invoked though this modifications will be overwritten
*/
void setPosition(KMultiTabBar::KMultiTabBarPosition);
/**
* this is used internaly, but can be used by the user, if (s)he wants to
* It the according call of KMultiTabBar is invoked though this modifications will be overwritten
*/
void setStyle(KMultiTabBar::KMultiTabBarStyle);
/**
* modify the text of the button
*/
void setText(const QString &);
QSize sizeHint() const;
protected:
KMultiTabBar::KMultiTabBarPosition m_position;
KMultiTabBar::KMultiTabBarStyle m_style;
QString m_text;
virtual void hideEvent( class QHideEvent*);
virtual void showEvent( class QShowEvent*);
private:
int m_id;
KMultiTabBarButtonPrivate *d;
signals:
/**
* this is emitted if the button is clicked
* @param id the ID identifying the button
*/
void clicked(int id);
protected slots:
virtual void slotClicked();
};
/**
* This class should never be created except with the appendTab call of KMultiTabBar
*/
class KMultiTabBarTab: public KMultiTabBarButton
{
Q_OBJECT
public:
KMultiTabBarTab(const QPixmap& pic,const QString&,int id,QWidget *parent,
KMultiTabBar::KMultiTabBarPosition pos,KMultiTabBar::KMultiTabBarStyle style);
virtual ~KMultiTabBarTab();
/**
* set the active state of the tab
* @param state true==active false==not active
*/
void setState(bool state);
/**
* choose if the text should always be displayed
* this is only used in classic mode if at all
*/
void showActiveTabText(bool show);
void resize(){ setSize( neededSize() ); }
virtual inline const QColorGroup & palette( void ) const
{
return( colorGroup() );
}
private:
bool m_showActiveTabText;
int m_expandedSize;
KMultiTabBarTabPrivate *d;
protected:
friend class KMultiTabBarInternal;
void setSize(int);
int neededSize();
void updateState();
virtual void drawButton(QPainter *);
virtual void drawButtonLabel(QPainter *);
void drawButtonStyled(QPainter *);
void drawButtonClassic(QPainter *);
protected slots:
virtual void slotClicked();
void setTabsPosition(KMultiTabBar::KMultiTabBarPosition);
public slots:
virtual void setIcon(const QString&);
virtual void setIcon(const QPixmap&);
};
class KMultiTabBarInternal: public Q3ScrollView
{
Q_OBJECT
public:
KMultiTabBarInternal(QWidget *parent, KMultiTabBar::KMultiTabBarMode m);
int appendTab(const QPixmap &,int=-1,const QString& =QString::null);
KMultiTabBarTab *tab(int) const;
void removeTab(int);
void setPosition(enum KMultiTabBar::KMultiTabBarPosition pos);
void setStyle(enum KMultiTabBar::KMultiTabBarStyle style);
void showActiveTabTexts(bool show);
tabList * tabs(){return &m_tabs;}
virtual inline const QColorGroup & palette( void ) const
{
return( colorGroup() );
}
private:
friend class KMultiTabBar;
QWidget *box;
QBoxLayout *mainLayout;
tabList m_tabs;
enum KMultiTabBar::KMultiTabBarPosition m_position;
bool m_showActiveTabTexts;
enum KMultiTabBar::KMultiTabBarStyle m_style;
int m_expandedTabSize;
int m_lines;
protected:
/**
* [contentsM|m]ousePressEvent are reimplemented from QScrollView
* in order to ignore all mouseEvents on the viewport, so that the
* parent can handle them.
*/
virtual void contentsMousePressEvent(QMouseEvent *);
virtual void mousePressEvent(QMouseEvent *);
virtual void resizeEvent(QResizeEvent *);
};
#endif

View File

@@ -25,8 +25,6 @@
#ifndef _KMultitabbar_h_
#define _KMultitabbar_h_
#ifndef QT3
#include <QtCore/QString>
#include <QtCore/QList>
#include <QtGui/QLayout>
@@ -307,10 +305,5 @@ protected:
};
#else
#include "kmultitabbar-qt3.h"
#endif
#endif

View File

@@ -29,21 +29,9 @@
#ifndef _KNOB_H
#define _KNOB_H
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QWidget>
#include <QtCore/QPoint>
#else
#include <qwidget.h>
#include <qpoint.h>
#endif
#include "automatable_object.h"

View File

@@ -26,21 +26,9 @@
#ifndef _LCD_SPINBOX_H
#define _LCD_SPINBOX_H
#include "qt3support.h"
#ifdef QT4
#include <QtCore/QMap>
#include <QtGui/QLCDNumber>
#else
#include <qlcdnumber.h>
#include <qmap.h>
#endif
#include "automatable_object.h"

View File

@@ -26,28 +26,11 @@
#ifndef _MAIN_WINDOW_H
#define _MAIN_WINDOW_H
#include "qt3support.h"
#ifdef QT4
#include <QtCore/QList>
#include <QtGui/QMainWindow>
#include <QtGui/QWorkspace>
#include <QtGui/QWhatsThis>
#else
#include <qmainwindow.h>
#include <qworkspace.h>
#include <qwhatsthis.h>
#endif
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
class QAction;
class QDomElement;
class QGridLayout;
@@ -75,7 +58,7 @@ public:
int addWidgetToToolBar( QWidget * _w, int _row = -1, int _col = -1 );
void addSpacingToToolBar( int _size );
void FASTCALL resetWindowTitle( const QString & _add = "" );
void resetWindowTitle( const QString & _add = "" );
void clearKeyModifiers( void );
@@ -110,7 +93,6 @@ public slots:
}
void createNewProject( void );
void createNewProjectFromTemplate( QAction * _idx );
void createNewProjectFromTemplate( int _id );
void openProject( void );
void updateRecentlyOpenedProjectsMenu( void );
void openRecentlyOpenedProject( int );
@@ -169,7 +151,7 @@ private:
} m_keyMods;
QMenu * m_tools_menu;
vlist<tool *> m_tools;
QList<tool *> m_tools;
friend class engine;
@@ -179,7 +161,6 @@ private slots:
void browseHelp( void );
void fillTemplatesMenu( void );
void showTool( QAction * _idx );
void showTool( int _idx );
} ;

View File

@@ -38,19 +38,8 @@
#include <alsa/asoundlib.h>
#include "qt3support.h"
#ifdef QT4
#include <QtCore/QThread>
#else
#include <qthread.h>
#endif
#include "midi_client.h"

View File

@@ -40,21 +40,9 @@
#endif
#include "qt3support.h"
#ifdef QT4
#include <QtCore/QThread>
#include <QtCore/QTimer>
#else
#include <qobject.h>
#include <qthread.h>
#include <qtimer.h>
#endif
#include "midi_client.h"
@@ -63,11 +51,7 @@ struct pollfd;
class QLineEdit;
class midiALSASeq :
#ifndef QT4
public QObject,
#endif
public midiClient, public QThread
class midiALSASeq : public QThread, public midiClient
{
Q_OBJECT
public:

View File

@@ -26,20 +26,9 @@
#ifndef _MIDI_CLIENT_H
#define _MIDI_CLIENT_H
#include "qt3support.h"
#ifdef QT4
#include <QtCore/QStringList>
#include <QtCore/QVector>
#else
#include <qvaluevector.h>
#include <qstringlist.h>
#endif
#include "midi.h"
#include "midi_event_processor.h"
@@ -116,11 +105,7 @@ public:
public:
setupWidget( const QString & _caption, QWidget * _parent ) :
tabWidget( tabWidget::tr( "Settings for %1" ).arg(
tr( _caption
#ifndef QT3
.toAscii()
#endif
) ).toUpper(), _parent )
tr( _caption.toAscii() ) ).toUpper(), _parent )
{
}
@@ -142,7 +127,7 @@ public:
protected:
vvector<midiPort *> m_midiPorts;
QVector<midiPort *> m_midiPorts;
} ;

View File

@@ -1,7 +1,7 @@
/*
* midi_mapper.h - MIDI-mapper for any midiDevice
*
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2005-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -26,25 +26,13 @@
#ifndef _MIDI_MAPPER_H
#define _MIDI_MAPPER_H
#include "qt3support.h"
#ifdef QT4
#include <QtCore/QPair>
#include <QtCore/QFile>
#else
#include <qmap.h>
#include <qpair.h>
#include <qfile.h>
#endif
#include "types.h"
#include "midi.h"
const Uint8 MIDI_PROGRAMS = 128;
const Uint8 MIDI_KEYS = 128;

View File

@@ -27,18 +27,8 @@
#ifndef _MIDI_PORT_H
#define _MIDI_PORT_H
#include "qt3support.h"
#ifdef QT4
#include <QtCore/QString>
#else
#include <qstring.h>
#endif
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

View File

@@ -27,22 +27,8 @@
#ifndef _MIDI_TAB_WIDGET_H
#define _MIDI_TAB_WIDGET_H
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QWidget>
#else
#include <qwidget.h>
#endif
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "journalling_object.h"
@@ -87,9 +73,6 @@ protected slots:
void writeablePortsChanged( void );
void activatedReadablePort( QAction * _item );
void activatedWriteablePort( QAction * _item );
// Qt3-version
void activatedReadablePort( int _id );
void activatedWriteablePort( int _id );
private:
instrumentTrack * m_instrumentTrack;

View File

@@ -30,23 +30,10 @@
#include <config.h>
#endif
#include "qt3support.h"
#ifdef QT4
#include <QtCore/QMutex>
#include <QtCore/QThread>
#include <QtCore/QVector>
#else
#include <qobject.h>
#include <qmutex.h>
#include <qthread.h>
#include <qvaluevector.h>
#endif
#include "types.h"
#include "note.h"
@@ -138,7 +125,7 @@ public:
inline void removeAudioPort( audioPort * _port )
{
lock();
vvector<audioPort *>::iterator it = qFind( m_audioPorts.begin(),
QVector<audioPort *>::iterator it = qFind( m_audioPorts.begin(),
m_audioPorts.end(),
_port );
if( it != m_audioPorts.end() )
@@ -352,14 +339,14 @@ private:
const surroundSampleFrame * renderNextBuffer( void );
vvector<audioPort *> m_audioPorts;
QVector<audioPort *> m_audioPorts;
fpp_t m_framesPerPeriod;
surroundSampleFrame * m_readBuf;
surroundSampleFrame * m_writeBuf;
vvector<surroundSampleFrame *> m_bufferPool;
QVector<surroundSampleFrame *> m_bufferPool;
Uint8 m_readBuffer;
Uint8 m_writeBuffer;
Uint8 m_analBuffer;

View File

@@ -26,24 +26,8 @@
#ifndef _MMP_H
#define _MMP_H
#include "qt3support.h"
#ifdef QT4
#include <Qt/QtXml>
#else
#include <qdom.h>
#endif
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "types.h"
@@ -73,7 +57,7 @@ public:
multimediaProject( projectTypes _project_type );
~multimediaProject();
bool FASTCALL writeFile( QString & _fn, bool _overwrite_check = TRUE );
bool writeFile( QString & _fn, bool _overwrite_check = TRUE );
inline QDomElement & content( void )
{
@@ -89,12 +73,12 @@ public:
return( m_type );
}
static projectTypes FASTCALL typeOfFile( const QString & _fn );
static projectTypes typeOfFile( const QString & _fn );
private:
static projectTypes FASTCALL type( const QString & _type_name );
static QString FASTCALL typeName( projectTypes _project_type );
static projectTypes type( const QString & _type_name );
static QString typeName( projectTypes _project_type );
void cleanMetaNodes( QDomElement _de );

View File

@@ -27,20 +27,9 @@
#ifndef _NAME_LABEL_H
#define _NAME_LABEL_H
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QLabel>
#include <QtGui/QPixmap>
#else
#include <qlabel.h>
#include <qpixmap.h>
#endif
class nameLabel : public QLabel
{

View File

@@ -27,22 +27,8 @@
#ifndef _NOTE_H
#define _NOTE_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "qt3support.h"
#ifdef QT4
#include <QtCore/QVector>
#else
#include <qvaluevector.h>
#endif
#include "volume.h"
#include "panning.h"
#include "midi_time.h"
@@ -216,7 +202,7 @@ private:
} ;
typedef vvector<note *> noteVector;
typedef QVector<note *> noteVector;
#endif

View File

@@ -38,8 +38,8 @@
class notePlayHandle;
typedef vvector<notePlayHandle *> notePlayHandleVector;
typedef vvector<const notePlayHandle *> constNotePlayHandleVector;
typedef QVector<notePlayHandle *> notePlayHandleVector;
typedef QVector<const notePlayHandle *> constNotePlayHandleVector;
class notePlayHandle : public playHandle, public note

View File

@@ -30,22 +30,10 @@
#include <config.h>
#endif
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QPixmap>
#include <QtCore/QVector>
#include <QtCore/QPair>
#else
#include <qpixmap.h>
#include <qvaluevector.h>
#include <qpair.h>
#endif
#include "tool_button.h"
@@ -81,7 +69,7 @@ protected:
private:
vvector<QPair<QPixmap, QString> > m_states;
QVector<QPair<QPixmap, QString> > m_states;
QString m_generalToolTip;
int m_curState;

View File

@@ -27,26 +27,12 @@
#ifndef _PATTERN_H
#define _PATTERN_H
#include "qt3support.h"
#ifdef QT4
#include <QtCore/QVector>
#include <QtGui/QWidget>
#include <QtGui/QDialog>
#include <QtCore/QThread>
#include <QtGui/QPixmap>
#else
#include <qvaluevector.h>
#include <qwidget.h>
#include <qdialog.h>
#include <qthread.h>
#include <qpixmap.h>
#endif
#include "note.h"
#include "track.h"

View File

@@ -27,19 +27,7 @@
#ifndef _PIANO_ROLL_H
#define _PIANO_ROLL_H
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QWidget>
#include <QtCore/QVector>
#else
#include <qwidget.h>
#include <qvaluevector.h>
#endif
#include "types.h"
#include "note.h"

View File

@@ -27,22 +27,10 @@
#ifndef _PIANO_WIDGET_H
#define _PIANO_WIDGET_H
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QWidget>
#include <QtGui/QPixmap>
#include <QtGui/QScrollBar>
#else
#include <qwidget.h>
#include <qpixmap.h>
#include <qscrollbar.h>
#endif
#include "note.h"
@@ -81,11 +69,7 @@ public:
protected:
virtual void contextMenuEvent( QContextMenuEvent * _me );
#ifndef QT3
virtual void customEvent( QEvent * );
#else
virtual void customEvent( QCustomEvent * );
#endif
virtual void paintEvent( QPaintEvent * );
virtual void mousePressEvent( QMouseEvent * me );
virtual void mouseReleaseEvent( QMouseEvent * me );

View File

@@ -26,19 +26,8 @@
#ifndef _PIXMAP_BUTTON_H
#define _PIXMAP_BUTTON_H
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QPixmap>
#else
#include <qpixmap.h>
#endif
#include "automatable_button.h"

View File

@@ -27,22 +27,8 @@
#ifndef _PLAY_HANDLE_H
#define _PLAY_HANDLE_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "qt3support.h"
#ifdef QT4
#include <QtCore/QVector>
#else
#include <qvaluevector.h>
#endif
#include "types.h"
class track;
@@ -109,8 +95,8 @@ private:
} ;
typedef vvector<playHandle *> playHandleVector;
typedef vvector<const playHandle *> constPlayHandleVector;
typedef QVector<playHandle *> playHandleVector;
typedef QVector<const playHandle *> constPlayHandleVector;
#endif

View File

@@ -27,25 +27,10 @@
#define _PLUGIN_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "qt3support.h"
#ifdef QT4
#include <QtCore/QString>
#include <QtCore/QStringList>
#include <QtCore/QVector>
#else
#include <qstring.h>
#include <qvaluevector.h>
#endif
#include "journalling_object.h"
#include "base64.h"
@@ -105,7 +90,7 @@ public:
:
desc( NULL )
{
const vlist<QVariant> l =
const QList<QVariant> l =
base64::decode( _dump_data ).
toList();
name = l[0].toString();
@@ -114,14 +99,14 @@ public:
inline QString dumpBase64( void ) const
{
return( base64::encode(
vlist<QVariant>()
QList<QVariant>()
<< name << user ) );
}
plugin::descriptor * desc;
QString name;
QVariant user;
};
typedef vlist<key> keyList;
typedef QList<key> keyList;
subPluginFeatures( plugin::pluginTypes _type ) :
m_type( _type )
@@ -208,7 +193,7 @@ public:
// fills given vector with descriptors of all available plugins
static void FASTCALL getDescriptorsOfAvailPlugins(
vvector<descriptor> & _plugin_descs );
QVector<descriptor> & _plugin_descs );
private:
const descriptor * m_descriptor;

View File

@@ -26,27 +26,10 @@
#ifndef _PLUGIN_BROWSER_H
#define _PLUGIN_BROWSER_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "qt3support.h"
#ifdef QT4
#include <QtCore/QTimer>
#include <QtCore/QVector>
#include <QtGui/QPixmap>
#else
#include <qvaluevector.h>
#include <qpixmap.h>
#include <qtimer.h>
#endif
#include "side_bar_widget.h"
#include "plugin.h"
@@ -64,7 +47,7 @@ public:
private:
vvector<plugin::descriptor> m_pluginDescriptors;
QVector<plugin::descriptor> m_pluginDescriptors;
QWidget * m_view;

View File

@@ -27,9 +27,6 @@
#ifndef _PRESET_PREVIEW_PLAY_HANDLE_H
#define _PRESET_PREVIEW_PLAY_HANDLE_H
#include "qt3support.h"
#include "note_play_handle.h"

View File

@@ -26,22 +26,11 @@
#ifndef _PROJECT_JOURNAL_H
#define _PROJECT_JOURNAL_H
#include "types.h"
#include "qt3support.h"
#ifndef QT3
#include <QtCore/QHash>
#include <QtCore/QVariant>
#include <QtCore/QVector>
#else
#include <qvariant.h>
#include <qvaluevector.h>
#include <qmap.h>
#endif
#include "types.h"
class journallingObject;
@@ -108,12 +97,8 @@ public:
private:
#ifndef QT3
typedef QHash<jo_id_t, journallingObject *> joIDMap;
#else
typedef QMap<jo_id_t, journallingObject *> joIDMap;
#endif
typedef vvector<jo_id_t> journalEntryVector;
typedef QVector<jo_id_t> journalEntryVector;
joIDMap m_joIDs;

View File

@@ -26,19 +26,8 @@
#ifndef _PROJECT_NOTES_H
#define _PROJECT_NOTES_H
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QMainWindow>
#else
#include <qmainwindow.h>
#define textColor color
#endif
#include "journalling_object.h"

View File

@@ -1,254 +0,0 @@
/*
* qt3support.h - layer for supporting Qt3
*
* Copyright (c) 2005-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* 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 _QT3SUPPORT_H
#define _QT3SUPPORT_H
#include <qglobal.h>
#include <qpair.h>
#if QT_VERSION >= 0x040000
#ifndef QT4
#define QT4
#endif
#else
#ifndef QT3
#define QT3
#endif
#endif
#ifdef QT4
class QColorGroup;
#include <Qt3Support/Q3ListView>
typedef int csize;
#define vlist QList
#define vstack QStack
#define vvector QVector
#include <QtCore/QFileInfo>
inline QString baseName( const QString & _file )
{
return( QFileInfo( _file ).absolutePath() + "/" +
QFileInfo( _file ).completeBaseName() );
}
#else /* QT3 */
#define vlist QValueList
#define vstack QValueStack
#define vvector QValueVector
#define qSort qHeapSort
#define QMenu QPopupMenu
#define QAbstractButton QButton
#define QScrollArea QScrollView
#define Q3ListView QListView
#define Q3ScrollView QScrollView
#define QMatrix QWMatrix
#define QIcon QIconSet
#define QAbstractButton QButton
// QWidget
#define setWindowTitle setCaption
#define setWindowIcon setIcon
#define windowIcon icon
#define isExplicitlyHidden isHidden
#define accessibleName name
#define ensurePolished constPolish
// QMenu/QPopupMenu
#define addAction insertItem
// QFile/QIODevice
#define seek at
// QFileDialog
#define setFileMode setMode
#define setDirectory setDir
#define selectFile setSelection
// QThread
#define isRunning running
// QScrollView/QScrollArea
#define setHorizontalScrollBarPolicy setHScrollBarMode
#define setVerticalScrollBarPolicy setVScrollBarMode
// QScrollBar
#define setMaximum setMaxValue
#define setMinimum setMinValue
// QAbstractButton/QButton
#define setShortcut setAccel
// QInputEvent/QKeyEvent
#define modifiers state
// QProgressBar
#define setTextVisible setPercentageVisible
// QComboBox
#define addItem insertItem
// QString
#define toLower lower
#define toUpper upper
// QTextEdit
#define setLineWrapMode setWordWrap
#define setPlainText setText
// QSlider
#define setTickPosition setTickmarks
// QStatusBar/QSplashScreen
#define showMessage message
#define clearMessage clear
// QDir
#define NoFilter DefaultFilter
#define homePath homeDirPath
#define rootPath rootDirPath
// QFileInfo
#define absoluteFilePath absFilePath
// QToolButton
#define setMenu setPopup
// QPixmap
#define transformed xForm
// QList
#define removeAll remove
// QGridLayout
#define setColumnStretch setColStretch
#define columnCount numCols
#define setColumnMinimumWidth setColSpacing
// QPointer
#define QPointer QGuardedPtr
// QRect
#define normalized normalize
// Qt-namespace
#define ShiftModifier ShiftButton
#define ControlModifier ControlButton
#define Alignment AlignmentFlags
#define TextWordWrap WordBreak
typedef unsigned int csize;
// some compat-stuff for older qt-versions...
#if QT_VERSION < 0x030200
#define wasCanceled wasCancelled
#endif
#include <qfileinfo.h>
inline QString baseName( const QString & _file )
{
return( QFileInfo( _file ).dirPath() + "/" +
QFileInfo( _file ).baseName( TRUE ) );
}
#if QT_VERSION < 0x030100
#include <qmutex.h>
// Qt 3.0.x doesn't have QMutexLocker, so we implement it on our own...
class QMutexLocker
{
public:
QMutexLocker( QMutex * _m ) :
m_mutex( _m )
{
m_mutex->lock();
}
~QMutexLocker()
{
m_mutex->unlock();
}
private:
QMutex * m_mutex;
} ;
#endif
#endif
#endif

View File

@@ -1,238 +0,0 @@
/****************************************************************************
Definition of QXEmbed class
Copyright (C) 1999-2000 Troll Tech AS
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*****************************************************************************/
#ifndef QXEMBED_H
#define QXEMBED_H
#include "qt3support.h"
#ifndef QT4
#include <qwidget.h>
#ifdef Q_WS_X11
class QXEmbedData;
/**
* A QXEmbed widget serves as an embedder that can manage one single embedded
* X-window. These so-called client windows can be arbitrary Qt or non Qt
* applications.
*
* There are two different ways of using QXEmbed,
* from the client side or from the embedder's side.
*
* Embedding from the client's side requires that the client knows the
* window identifier of the respective embedder widget. Use either
* embedClientIntoWindow() or the high-level wrapper processClientCmdline().
* This is only possible when the client is a Qt application.
*
* When using it from the embedder's side, you must know the window
* identifier of the window that should be embedded. Simply call embed()
* with this identifier as parameter. If the client is a Qt application,
* make sure it has called QXEmbed::initialize(). Otherwise you should
* probably call setProtocol(XPLAIN) before embed().
*
* Reimplement the change handler windowChanged() to catch embedding or
* the destruction of embedded windows. In the latter case, the
* embedder also emits a signal embeddedWindowDestroyed() for
* convenience.
*
* @short The QXEmbed widget is a graphical socket that can embed an external X-Window.
*/
class QXEmbed : public QWidget
{
Q_OBJECT
public:
/**
*
* Constructs a xembed widget.
*
* The parent, name and f arguments are passed to the QFrame
* constructor.
*/
QXEmbed( QWidget *parent=0, const char *name=0, WFlags f = 0 );
/**
* Destructor. Cleans up the focus if necessary.
*/
~QXEmbed();
/**
* Embedded applications should call this function to make sure
* they support the XEMBED protocol. It is called automatically
* when you use embedClientIntoWindow() or
* processClientCmdline(). Clients might have to call it
* manually when you use embed().
*/
static void initialize();
enum Protocol { XEMBED, XPLAIN };
/**
* Sets the protocol used for embedding windows.
* This function must be called before embedding a window.
* Protocol XEMBED provides maximal functionality (focus, tabs, etc)
* but requires explicit cooperation from the embedded window.
* Protocol XPLAIN provides maximal compatibility with
* embedded applications that do not support the XEMBED protocol.
* The default is XEMBED.
*
* Non KDE applications should be embedded with protocol XPLAIN.
* This does not happen automatically yet.
* You must call setProtocol() explicitly.
*/
void setProtocol( Protocol proto );
/**
* Returns the protocol used for embedding the current window.
*
* @return the protocol used by QXEmbed.
*/
Protocol protocol();
/**
* Embeds the window with the identifier w into this xembed widget.
*
* This function is useful if the embedder knows about the client window
* that should be embedded. Often it is vice versa: the client knows
* about its target embedder. In that case, it is not necessary to call
* embed(). Instead, the client will call the static function
* embedClientIntoWindow().
*
* @param w the identifier of the window to embed
* @see embeddedWinId()
*/
void embed( WId w );
/**
* Returns the window identifier of the embedded window, or 0 if no
* window is embedded yet.
*
* @return the id of the embedded window (0 if no window is embedded)
*/
WId embeddedWinId() const;
/**
* A function for clients that embed themselves. The widget
* client will be embedded in the window window. The application has
* to ensure that window is the handle of the window identifier of
* an QXEmbed widget.
*
* @short #processClientCmdline()
*/
static void embedClientIntoWindow( QWidget* client, WId window );
/**
* A utility function for clients that embed theirselves. The widget
* client will be embedded in the window that is passed as
* -embed command line argument.
*
* The function returns true on success or false if no such command line
* parameter is specified.
*
* @see embedClientIntoWindow()
*/
static bool processClientCmdline( QWidget* client, int& argc, char ** argv );
/**
* Sends a WM_DELETE_WINDOW message to the embedded window. This is what
* typically happens when you click on the close button of a window
* manager decoration. This should cause the embedded application to
* cleanly close the window. Signal embeddedWindowDestroyed() can be used
* to monitor the status of the embedded window.
*/
void sendDelete( void );
/**
* Selects what shoud be done with the embedded window when the embedding
* window is destroyed. When the argument is true, the embedded window is
* kept alive, is hidden, and receives a WM_DELETE_WINDOW message using
* sendDelete(). This is the default. Otherwise, the destruction of the
* QXEmbed object simply destroys the embedded window.
*
* @see sendDelete()
*/
void setAutoDelete( bool );
/**
* Returns the value of flag indicating what shoud be done with the
* embedded window when the embedding window is destroyed.
*
* @see setAutoDelete()
*/
bool autoDelete() const;
/* Reimp */
QSize sizeHint() const;
QSize minimumSizeHint() const;
QSizePolicy sizePolicy() const;
bool eventFilter( QObject *, QEvent * );
bool customWhatsThis() const;
void enterWhatsThisMode(); // temporary, fix in Qt (Matthias, Mon Jul 17 15:20:55 CEST 2000 )
virtual void reparent( QWidget * parent, WFlags f, const QPoint & p, bool showIt = false );
signals:
/**
* This signal is emitted when the embedded window has been lost (destroyed or reparented away)
*
* @see embeddedWinId()
*/
// KDE4 rename to embeddedWindowLost()
void embeddedWindowDestroyed();
protected:
bool event( QEvent * );
void keyPressEvent( QKeyEvent * );
void keyReleaseEvent( QKeyEvent * );
void focusInEvent( QFocusEvent * );
void focusOutEvent( QFocusEvent * );
void resizeEvent(QResizeEvent *);
void showEvent( QShowEvent * );
bool x11Event( XEvent* );
/**
* A change handler that indicates that the embedded window has been
* changed. The window handle can also be retrieved with
* embeddedWinId().
*
* @param w the handle of the window that changed
*/
virtual void windowChanged( WId w );
bool focusNextPrevChild( bool next );
private:
WId window;
QXEmbedData* d;
void checkGrab();
void sendSyntheticConfigureNotifyEvent();
};
#endif
#endif
#endif

View File

@@ -25,24 +25,11 @@
#ifndef _RACK_VIEW_H
#define _RACK_VIEW_H
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QWidget>
#include <QtGui/QLayout>
#include <QtGui/QScrollArea>
#include <QtGui/QVBoxLayout>
#else
#include <qwidget.h>
#include <qlayout.h>
#include <qscrollview.h>
#include <qvbox.h>
#endif
#include "types.h"
#include "journalling_object.h"
@@ -85,7 +72,7 @@ private:
void redraw();
vvector<rackPlugin *> m_rackInserts;
QVector<rackPlugin *> m_rackInserts;
QVBoxLayout * m_mainLayout;
QScrollArea * m_scrollArea;

View File

@@ -27,18 +27,8 @@
#ifndef _RENAME_DIALOG_H
#define _RENAME_DIALOG_H
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QDialog>
#else
#include <qdialog.h>
#endif
class QLineEdit;

View File

@@ -27,20 +27,9 @@
#ifndef _RUBBERBAND_H
#define _RUBBERBAND_H
#include "qt3support.h"
#ifndef QT3
#include <QtGui/QRubberBand>
#include <QtCore/QVector>
#else
#include <qwidget.h>
#include <qvaluevector.h>
#endif
class selectableObject : public QWidget
{
@@ -90,33 +79,21 @@ private:
typedef
#ifndef QT3
QRubberBand
#else
QWidget
#endif
rubberBandBase;
class rubberBand : public rubberBandBase
class rubberBand : public QRubberBand
{
public:
rubberBand( QWidget * _parent );
virtual ~rubberBand();
vvector<selectableObject *> selectedObjects( void ) const;
QVector<selectableObject *> selectedObjects( void ) const;
protected:
virtual void resizeEvent( QResizeEvent * _re );
#ifdef QT3
virtual bool event( QEvent * _e );
void updateMask( void );
#endif
private:
vvector<selectableObject *> selectableObjects( void ) const;
QVector<selectableObject *> selectableObjects( void ) const;
};

View File

@@ -26,19 +26,8 @@
#ifndef _SAMPLE_BUFFER_H
#define _SAMPLE_BUFFER_H
#include "qt3support.h"
#ifdef QT4
#include <QtCore/QObject>
#else
#include <qobject.h>
#endif
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

View File

@@ -27,19 +27,8 @@
#ifndef _SAMPLE_TRACK_H
#define _SAMPLE_TRACK_H
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QDialog>
#else
#include <qdialog.h>
#endif
#include "track.h"
class QLabel;

View File

@@ -26,21 +26,9 @@
#ifndef _SETUP_DIALOG_H
#define _SETUP_DIALOG_H
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QDialog>
#include <QtCore/QMap>
#else
#include <qdialog.h>
#include <qmap.h>
#endif
#include "audio_device.h"
#include "midi_client.h"

View File

@@ -26,19 +26,8 @@
#ifndef _SIDE_BAR_H
#define _SIDE_BAR_H
#include "qt3support.h"
#ifdef QT4
#include <QtCore/QMap>
#else
#include <qmap.h>
#endif
#include "kmultitabbar.h"

View File

@@ -1,7 +1,7 @@
/*
* side_bar_widget.h - base-class for all side-bar-widgets
*
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -26,22 +26,10 @@
#ifndef _SIDE_BAR_WIDGET_H
#define _SIDE_BAR_WIDGET_H
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QPixmap>
#include <QtGui/QVBoxLayout>
#include <QtGui/QWidget>
#else
#include <qwidget.h>
#include <qlayout.h>
#include <qpixmap.h>
#endif
class sideBarWidget : public QWidget
{

View File

@@ -301,7 +301,7 @@ private:
ACT_STOP_PLAY, ACT_PLAY_SONG, ACT_PLAY_TRACK, ACT_PLAY_BB,
ACT_PLAY_PATTERN, ACT_PAUSE, ACT_RESUME_FROM_PAUSE
} ;
vvector<ACTIONS> m_actions;
QVector<ACTIONS> m_actions;
friend class engine;

View File

@@ -1,7 +1,7 @@
/*
* spc_bg_hndl_widget.h - class specialBgHandlingWidget
*
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2005-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -26,20 +26,10 @@
#ifndef _SPC_BG_HNDL_WIDGET_H
#define _SPC_BG_HNDL_WIDGET_H
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QWidget>
#include <QtGui/QPainter>
#include <QtGui/QPixmap>
#else
#include <qwidget.h>
#include <qpixmap.h>
#endif
class specialBgHandlingWidget
@@ -80,16 +70,10 @@ public:
const specialBgHandlingWidget *>( pw );
if( s->backgroundPixmap().isNull() == FALSE )
{
#ifdef QT4
QPainter p( &pm );
p.drawPixmap( 0, 0, s->backgroundPixmap(),
_w->x(), _w->y(), _w->width(),
_w->height() );
#else
bitBlt( &pm, 0, 0, &s->backgroundPixmap(),
_w->x(), _w->y(), _w->width(),
_w->height() );
#endif
}
else
{
@@ -98,7 +82,6 @@ public:
}
else
{
#ifdef QT4
QPainter p( &pm );
const QBrush & br = pw->palette().brush(
pw->backgroundRole() );
@@ -112,22 +95,6 @@ public:
{
pm.fill( br.color() );
}
#else
const QPixmap * pbp = pw->paletteBackgroundPixmap();
if( pbp == NULL )
{
pbp = pw->erasePixmap();
}
if( pbp )
{
bitBlt( &pm, 0, 0, pbp, _w->x(), _w->y(),
_w->width(), _w->height() );
}
else
{
pm.fill( pw->paletteBackgroundColor() );
}
#endif
}
return( pm );
}

View File

@@ -26,28 +26,15 @@
#ifndef _STRING_PAIR_DRAG_H
#define _STRING_PAIR_DRAG_H
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QDrag>
#else
#include <qdragobject.h>
#endif
#include <QtGui/QDragEnterEvent>
#include <QtGui/QDropEvent>
class QPixmap;
class stringPairDrag : public
#ifdef QT4
QDrag
#else
QStoredDrag
#endif
class stringPairDrag : public QDrag
{
public:
stringPairDrag( const QString & _key, const QString & _value,

View File

@@ -28,19 +28,8 @@
#ifndef _SURROUND_AREA_H
#define _SURROUND_AREA_H
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QWidget>
#else
#include <qwidget.h>
#endif
#include "mixer.h"

View File

@@ -1,7 +1,7 @@
/*
* tab_bar.h - class tabBar
*
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -30,23 +30,10 @@
#include <config.h>
#endif
#include "qt3support.h"
#ifdef QT4
#include <QtCore/QMap>
#include <QtGui/QLayout>
#include <QtGui/QWidget>
#else
#include <qwidget.h>
#include <qmap.h>
#include <qlayout.h>
#endif
class tabButton;

View File

@@ -1,7 +1,7 @@
/*
* tab_button.h - declaration of class tabButton
*
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2005-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -26,19 +26,8 @@
#ifndef _TAB_BUTTON_H
#define _TAB_BUTTON_H
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QPushButton>
#else
#include <qpushbutton.h>
#endif
class tabButton : public QPushButton
{

View File

@@ -1,7 +1,7 @@
/*
* tab_widget.h - LMMS-tabwidget
*
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2005-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -26,26 +26,9 @@
#ifndef _TAB_WIDGET_H
#define _TAB_WIDGET_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QWidget>
#include <QtCore/QMap>
#else
#include <qwidget.h>
#include <qmap.h>
#endif
#include "spc_bg_hndl_widget.h"
@@ -56,10 +39,10 @@ public:
tabWidget( const QString & _caption, QWidget * _parent );
~tabWidget();
void FASTCALL addTab( QWidget * _w, const QString & _name,
void addTab( QWidget * _w, const QString & _name,
int _idx = -1 );
void FASTCALL setActiveTab( int _idx );
void setActiveTab( int _idx );
inline int activeTab( void ) const
{

View File

@@ -1,7 +1,7 @@
/*
* templates.h - miscellanous templates and algorithms
*
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -26,18 +26,8 @@
#ifndef _TEMPLATES_H
#define _TEMPLATES_H
#include "qt3support.h"
#ifdef QT4
#include <QtCore/QtAlgorithms>
#else
#include <qtl.h>
#endif
template<class T>
inline T tAbs( const T & x )

View File

@@ -26,20 +26,9 @@
#ifndef _TEXT_FLOAT
#define _TEXT_FLOAT
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QWidget>
#include <QtGui/QPixmap>
#else
#include <qwidget.h>
#include <qpixmap.h>
#endif
class textFloat : public QWidget
{

View File

@@ -26,19 +26,8 @@
#ifndef _TIMELINE_H
#define _TIMELINE_H
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QWidget>
#else
#include <qwidget.h>
#endif
#include "song_editor.h"

View File

@@ -26,20 +26,9 @@
#ifndef _TOOL_BUTTON_H
#define _TOOL_BUTTON_H
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QToolButton>
#include <QtGui/QColor>
#else
#include <qtoolbutton.h>
#include <qcolor.h>
#endif
class toolButton : public QToolButton
{

View File

@@ -31,22 +31,10 @@
#include <config.h>
#endif
#include "qt3support.h"
#ifdef QT4
#include <QtCore/QVector>
#include <QtCore/QList>
#include <QtGui/QWidget>
#else
#include <qwidget.h>
#include <qvaluevector.h>
#include <qvaluelist.h>
#endif
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -179,14 +167,14 @@ public:
trackContentWidget( trackWidget * _parent );
virtual ~trackContentWidget();
trackContentObject * FASTCALL getTCO( csize _tco_num );
csize numOfTCOs( void );
trackContentObject * FASTCALL getTCO( int _tco_num );
int numOfTCOs( void );
trackContentObject * FASTCALL addTCO( trackContentObject * _tco );
void FASTCALL removeTCO( csize _tco_num, bool _also_delete = TRUE );
void FASTCALL removeTCO( int _tco_num, bool _also_delete = TRUE );
void FASTCALL removeTCO( trackContentObject * _tco,
bool _also_delete = TRUE );
void removeAllTCOs( void );
void FASTCALL swapPositionOfTCOs( csize _tco_num1, csize _tco_num2 );
void FASTCALL swapPositionOfTCOs( int _tco_num1, int _tco_num2 );
inline Uint16 pixelsPerTact( void ) const
{
@@ -232,7 +220,7 @@ private:
track * getTrack( void );
midiTime getPosition( int _mouse_x );
typedef vvector<trackContentObject *> tcoVector;
typedef QVector<trackContentObject *> tcoVector;
tcoVector m_trackContentObjects;
trackWidget * m_trackWidget;
@@ -451,14 +439,14 @@ public:
trackContentObject * FASTCALL addTCO( trackContentObject * _tco );
void FASTCALL removeTCO( csize _tco_num );
csize numOfTCOs( void );
trackContentObject * FASTCALL getTCO( csize _tco_num );
csize FASTCALL getTCONum( trackContentObject * _tco );
void FASTCALL getTCOsInRange( vlist<trackContentObject *> & _tco_v,
void FASTCALL removeTCO( int _tco_num );
int numOfTCOs( void );
trackContentObject * FASTCALL getTCO( int _tco_num );
int FASTCALL getTCONum( trackContentObject * _tco );
void FASTCALL getTCOsInRange( QList<trackContentObject *> & _tco_v,
const midiTime & _start,
const midiTime & _end );
void FASTCALL swapPositionOfTCOs( csize _tco_num1, csize _tco_num2 );
void FASTCALL swapPositionOfTCOs( int _tco_num1, int _tco_num2 );
inline trackWidget * getTrackWidget( void )
{
@@ -512,13 +500,13 @@ protected:
private:
trackContainer * m_trackContainer;
trackWidget * m_trackWidget;
vlist<automationPattern *> m_automation_patterns;
QList<automationPattern *> m_automation_patterns;
} ;
typedef vvector<track *> trackVector;
typedef vvector<const track *> constTrackVector;
typedef QVector<track *> trackVector;
typedef QVector<const track *> constTrackVector;
#endif

View File

@@ -27,22 +27,10 @@
#ifndef _TRACK_CONTAINER_H
#define _TRACK_CONTAINER_H
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QScrollArea>
#include <QtCore/QVector>
#include <QtGui/QMainWindow>
#else
#include <qscrollview.h>
#include <qvaluevector.h>
#include <qmainwindow.h>
#endif
#include "track.h"
#include "journalling_object.h"
@@ -118,15 +106,15 @@ public:
return( m_rubberBand->isVisible() );
}
inline vvector<selectableObject *> selectedObjects( void )
inline QVector<selectableObject *> selectedObjects( void )
{
if( allowRubberband() == TRUE )
{
return( m_rubberBand->selectedObjects() );
}
//return( vvector<selectableObject *>() );
vvector<selectableObject *> foo;
return( foo );
return( QVector<selectableObject *>() );
/* QVector<selectableObject *> foo;
return( foo );*/
}
trackVector tracks( void );
@@ -184,7 +172,7 @@ private:
scrollArea * m_scrollArea;
typedef vvector<trackWidget *> trackWidgetVector;
typedef QVector<trackWidget *> trackWidgetVector;
trackWidgetVector m_trackWidgets;
float m_ppt;

View File

@@ -26,21 +26,9 @@
#ifndef _VISUALIZATION_WIDGET
#define _VISUALIZATION_WIDGET
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QWidget>
#include <QtGui/QPixmap>
#else
#include <qwidget.h>
#include <qpixmap.h>
#endif
#include "mixer.h"

View File

@@ -1,519 +0,0 @@
/*
* XQMap.h - eXtended QMap template for Qt3
*
* Copyright (c) 2006 Javier Serrano Polo <jasp00/at/users.sourceforge.net>
*
* 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 XQMAP_H
#define XQMAP_H
#include <qmap.h>
template<class Key, class T>
class XQMapPrivate : public QMapPrivate<Key, T>
{
public:
typedef QMapConstIterator<Key, T> ConstIterator;
typedef QMapNode<Key, T> * NodePtr;
XQMapPrivate( void );
XQMapPrivate( const XQMapPrivate<Key, T> * _map );
ConstIterator lowerBound( const Key & _k ) const;
};
template<class Key, class T>
Q_INLINE_TEMPLATES XQMapPrivate<Key, T>::XQMapPrivate( void )
{
}
template<class Key, class T>
Q_INLINE_TEMPLATES XQMapPrivate<Key, T>::XQMapPrivate(
const XQMapPrivate<Key, T> * _map ) :
QMapPrivate<Key, T>( _map )
{
}
template<class Key, class T>
Q_INLINE_TEMPLATES Q_TYPENAME XQMapPrivate<Key, T>::ConstIterator
XQMapPrivate<Key, T>::lowerBound( const Key & _k ) const
{
QMapNodeBase * y = QMapPrivate<Key, T>::header; // Last node
QMapNodeBase * x = QMapPrivate<Key, T>::header->parent; // Root node
while( x != 0 ) {
// If as k <= key(x) go left
if( !( QMapPrivate<Key, T>::key( x ) < _k ) )
{
y = x;
x = x->left;
}
else
{
x = x->right;
}
}
// Was _k bigger then the biggest element of the tree? Return end()
if( y == QMapPrivate<Key, T>::header )
{
return( ConstIterator( QMapPrivate<Key, T>::header ) );
}
return( ConstIterator( (NodePtr)y ) );
}
template<class Key, class T>
class XQMap
{
public:
/**
* Typedefs
*/
typedef Key key_type;
typedef T mapped_type;
typedef QPair<const key_type, mapped_type> value_type;
typedef value_type * pointer;
typedef const value_type * const_pointer;
typedef value_type & reference;
typedef const value_type & const_reference;
#ifndef QT_NO_STL
typedef ptrdiff_t difference_type;
#else
typedef int difference_type;
#endif
typedef size_t size_type;
typedef QMapIterator<Key, T> iterator;
typedef QMapConstIterator<Key, T> const_iterator;
typedef QPair<iterator, bool> insert_pair;
typedef QMapIterator<Key, T> Iterator;
typedef QMapConstIterator<Key, T> ConstIterator;
typedef T ValueType;
typedef XQMapPrivate<Key, T> Priv;
/**
* API
*/
XQMap( void )
{
m_sh = new XQMapPrivate<Key, T>;
}
XQMap( const XQMap<Key, T> & _m )
{
m_sh = _m.m_sh;
m_sh->ref();
}
#ifndef QT_NO_STL
XQMap( const std::map<Key, T> & _m )
{
m_sh = new XQMapPrivate<Key, T>;
Q_TYPENAME std::map<Key, T>::const_iterator it = _m.begin();
for( ; it != _m.end(); ++it )
{
value_type p( ( *it ).first, ( *it ).second );
insert( p );
}
}
#endif
~XQMap()
{
if( m_sh->deref() )
{
delete m_sh;
}
}
XQMap<Key, T> & operator=( const XQMap<Key, T> & _m );
#ifndef QT_NO_STL
XQMap<Key, T> & operator=( const std::map<Key, T> & _m )
{
clear();
Q_TYPENAME std::map<Key, T>::const_iterator it = _m.begin();
for( ; it != _m.end(); ++it )
{
value_type p( ( *it ).first, ( *it ).second );
insert( p );
}
return( *this );
}
#endif
iterator begin( void )
{
detach();
return( m_sh->begin() );
}
iterator end( void )
{
detach();
return( m_sh->end() );
}
const_iterator begin( void ) const
{
return( ( (const Priv *)m_sh )->begin() );
}
const_iterator end( void ) const
{
return( ( (const Priv *)m_sh )->end() );
}
const_iterator constBegin( void ) const
{
return( begin() );
}
const_iterator constEnd( void ) const
{
return( end() );
}
iterator replace( const Key & _k, const T & _v )
{
remove( _k );
return( insert( _k, _v ) );
}
size_type size( void ) const
{
return( m_sh->node_count );
}
bool empty( void ) const
{
return( m_sh->node_count == 0 );
}
QPair<iterator, bool> insert( const value_type & _x );
void erase( iterator _it )
{
detach();
m_sh->remove( _it );
}
void erase( const key_type & _k );
size_type count( const key_type & _k ) const;
T & operator[]( const Key & _k );
void clear( void );
iterator find( const Key & _k )
{
detach();
return( iterator( m_sh->find( _k ).node ) );
}
iterator lowerBound( const Key & _k )
{
detach();
return( iterator( m_sh->lowerBound( _k ).node ) );
}
const_iterator find( const Key & _k ) const
{
return( m_sh->find( _k ) );
}
const_iterator lowerBound( const Key & _k ) const
{
return( m_sh->lowerBound( _k ) );
}
const T & operator[]( const Key & _k ) const
{
QT_CHECK_INVALID_MAP_ELEMENT;
return( m_sh->find( _k ).data() );
}
bool contains( const Key & _k ) const
{
return( find( _k ) != end() );
}
size_type count( void ) const
{
return( m_sh->node_count );
}
QValueList<Key> keys( void ) const
{
QValueList<Key> r;
for( const_iterator i = begin(); i != end(); ++i )
{
r.append( i.key() );
}
return( r );
}
QValueList<T> values( void ) const
{
QValueList<T> r;
for( const_iterator i = begin(); i != end(); ++i )
r.append( *i );
return( r );
}
bool isEmpty( void ) const
{
return( m_sh->node_count == 0 );
}
iterator insert( const Key & _key, const T & _value,
bool _overwrite = TRUE );
void remove( iterator _it )
{
detach();
m_sh->remove( _it );
}
void remove( const Key & _k );
#if defined( Q_FULL_TEMPLATE_INSTANTIATION )
bool operator==( const XQMap<Key, T> & ) const
{
return( FALSE );
}
#ifndef QT_NO_STL
bool operator==( const std::map<Key, T> & ) const
{
return( FALSE );
}
#endif
#endif
protected:
/**
* Helpers
*/
void detach( void )
{
if( m_sh->count > 1 )
{
detachInternal();
}
}
Priv * m_sh;
private:
void detachInternal( void );
friend class QDeepCopy< XQMap<Key, T> >;
} ;
template<class Key, class T>
Q_INLINE_TEMPLATES XQMap<Key, T> & XQMap<Key, T>::operator=(
const XQMap<Key, T> & _m )
{
_m.m_sh->ref();
if( m_sh->deref() )
{
delete m_sh;
}
m_sh = _m.m_sh;
return( *this );
}
template<class Key, class T>
Q_INLINE_TEMPLATES Q_TYPENAME XQMap<Key, T>::insert_pair
XQMap<Key, T>::insert( const Q_TYPENAME XQMap<Key, T>::value_type & _x )
{
detach();
size_type n = size();
iterator it = m_sh->insertSingle( _x.first );
bool inserted = FALSE;
if( n < size() )
{
inserted = TRUE;
it.data() = _x.second;
}
return( QPair<iterator, bool>( it, inserted ) );
}
template<class Key, class T>
Q_INLINE_TEMPLATES void XQMap<Key, T>::erase( const Key & _k )
{
detach();
iterator it( m_sh->find( _k ).node );
if( it != end() )
{
m_sh->remove( it );
}
}
template<class Key, class T>
Q_INLINE_TEMPLATES Q_TYPENAME XQMap<Key, T>::size_type
XQMap<Key, T>::count( const Key & _k ) const
{
const_iterator it( m_sh->find( _k ).node );
if( it != end() )
{
size_type c = 0;
while( it != end() )
{
++it;
++c;
}
return( c );
}
return( 0 );
}
template<class Key, class T>
Q_INLINE_TEMPLATES T & XQMap<Key, T>::operator[]( const Key & _k )
{
detach();
QMapNode<Key, T> * p = m_sh->find( _k ).node;
if( p != m_sh->end().node )
{
return( p->data );
}
return( insert( _k, T() ).data() );
}
template<class Key, class T>
Q_INLINE_TEMPLATES void XQMap<Key, T>::clear( void )
{
if( m_sh->count == 1 )
{
m_sh->clear();
}
else
{
m_sh->deref();
m_sh = new XQMapPrivate<Key, T>;
}
}
template<class Key, class T>
Q_INLINE_TEMPLATES Q_TYPENAME XQMap<Key, T>::iterator XQMap<Key, T>::insert(
const Key & _key, const T & _value, bool _overwrite )
{
detach();
size_type n = size();
iterator it = m_sh->insertSingle( _key );
if( _overwrite || n < size() )
{
it.data() = _value;
}
return( it );
}
template<class Key, class T>
Q_INLINE_TEMPLATES void XQMap<Key, T>::remove( const Key & _k )
{
detach();
iterator it( m_sh->find( _k ).node );
if( it != end() )
{
m_sh->remove( it );
}
}
template<class Key, class T>
Q_INLINE_TEMPLATES void XQMap<Key, T>::detachInternal( void )
{
m_sh->deref();
m_sh = new XQMapPrivate<Key, T>( m_sh );
}
#ifndef QT_NO_DATASTREAM
template<class Key, class T>
Q_INLINE_TEMPLATES QDataStream & operator>>( QDataStream & _s,
XQMap<Key, T> & _m )
{
_m.clear();
Q_UINT32 c;
_s >> c;
for( Q_UINT32 i = 0; i < c; ++i )
{
Key k;
T t;
_s >> k >> t;
_m.insert( k, t );
if( _s.atEnd() )
{
break;
}
}
return( _s );
}
template<class Key, class T>
Q_INLINE_TEMPLATES QDataStream & operator<<( QDataStream & _s,
const XQMap<Key, T> & _m )
{
_s << (Q_UINT32)_m.size();
QMapConstIterator<Key, T> it = _m.begin();
for( ; it != _m.end(); ++it )
{
_s << it.key() << it.data();
}
return( _s );
}
#endif
#endif