made LMMS working with Qt4 again

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@33 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2005-12-14 10:19:04 +00:00
parent 746ec155a5
commit 6ca71a2637
42 changed files with 652 additions and 142 deletions

View File

@@ -273,10 +273,10 @@ lmms_SOURCES = \
$(srcdir)/include/ladspa_manager.h \
$(srcdir)/include/midi_tab_widget.h \
$(srcdir)/include/audio_port.h \
$(srcdir)/include/qxembed.h \
$(srcdir)/include/tool_button.h \
$(srcdir)/include/cpuload_widget.h \
$(srcdir)/include/midi_alsa_seq.h
$(srcdir)/include/midi_alsa_seq.h \
$(srcdir)/include/qxembed.h

View File

@@ -2,8 +2,8 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.50)
AC_INIT(lmms, 0.1.1-cvs20051211, tobydox/at/users.sourceforge.net)
AM_INIT_AUTOMAKE(lmms, 0.1.1-cvs20051211)
AC_INIT(lmms, 0.1.1-cvs20051213, tobydox/at/users.sourceforge.net)
AM_INIT_AUTOMAKE(lmms, 0.1.1-cvs20051213)
AM_CONFIG_HEADER(config.h)
@@ -377,7 +377,6 @@ AC_CONFIG_FILES([Makefile
midi-maps/Makefile
plugins/Makefile
plugins/audio_file_processor/Makefile
plugins/midi_out/Makefile
plugins/plucked_string_synth/Makefile
plugins/triple_oscillator/Makefile
plugins/vestige/Makefile

View File

@@ -30,7 +30,6 @@
#ifdef QT4
#include <QPaintDevice>
#include <QApplication>
#include <QFont>
#include <QDesktopWidget>
@@ -53,7 +52,7 @@ inline QFont pointSize( QFont _f )
static const int DPI = 96;
#ifdef QT4
_f.setPointSizeF( SIZE * DPI /
QPaintDevice( QApplication::desktop() ).logicalDpiY() );
QApplication::desktop()->logicalDpiY() );
#else
_f.setPointSizeFloat( SIZE * DPI /
QPaintDeviceMetrics( qApp->desktop() ).logicalDpiY() );

View File

@@ -36,6 +36,8 @@
#define ALSA_SUPPORT
#endif
#endif
#include <alsa/asoundlib.h>
#include "qt3support.h"
@@ -147,7 +149,7 @@ private slots:
private:
virtual void run( void );
#ifdef ALSA_SUPPORT
snd_seq_t * m_seqHandle;
struct ports
@@ -161,7 +163,7 @@ private:
int m_queueID;
volatile bool m_quit;
#endif
QTimer m_portListUpdateTimer;
QStringList m_readablePorts;
@@ -176,4 +178,3 @@ signals:
#endif
#endif

View File

@@ -48,6 +48,7 @@
class QMenu;
class QPixmap;
class QAction;
class channelTrack;
class tabWidget;
@@ -80,6 +81,9 @@ protected slots:
void midiPortModeToggled( bool );
void readablePortsChanged( void );
void writeablePortsChanged( void );
void activatedReadablePort( QAction * _item );
void activatedWriteablePort( QAction * _item );
// Qt3-version
void activatedReadablePort( int _id );
void activatedWriteablePort( int _id );

View File

@@ -53,9 +53,10 @@
#include "mixer.h"
class QAction;
class QPixmap;
class QProgressBar;
class QPushButton;
class QPixmap;
class channelTrack;
class patternFreezeThread;
@@ -167,6 +168,8 @@ protected slots:
void unfreeze( void );
void abortFreeze( void );
void addSteps( QAction * _item );
void removeSteps( QAction * _item );
void addSteps( int _n );
void removeSteps( int _n );

View File

@@ -71,6 +71,14 @@ inline QString baseName( const QString & _file )
#define QAbstractButton QButton
#define QScrollArea QScrollView
#define Q3ListView QListView
#define Q3ListViewItem QListViewItem
#define Q3ScrollView QScrollView
#define QMatrix QWMatrix
#define QIcon QIconSet
// QWidget
#define setWindowTitle setCaption
#define setWindowIcon setIcon
@@ -108,6 +116,7 @@ inline QString baseName( const QString & _file )
// QAbstractButton/QButton
#define setCheckable setToggleButton
#define setShortcut setAccel
// QInputEvent/QKeyEvent
@@ -150,6 +159,10 @@ inline QString baseName( const QString & _file )
#define rootPath rootDirPath
// QFileInfo
#define absoluteFilePath absFilePath
// QToolButton
#define setMenu setPopup
@@ -158,16 +171,17 @@ inline QString baseName( const QString & _file )
#define transformed xForm
#define Q3ListView QListView
#define Q3ListViewItem QListViewItem
#define Q3ScrollView QScrollView
// QGridLayout
#define setColumnStretch setColStretch
#define columnCount numCols
#define setColumnMinimumWidth setColSpacing
#define QMatrix QWMatrix
#define QIcon QIconSet
// Qt-namespace
#define ShiftModifier ShiftButton
#define ControlModifier ControlButton
typedef unsigned int csize;
// some compat-stuff for older qt-versions...

View File

@@ -22,6 +22,10 @@
#ifndef QXEMBED_H
#define QXEMBED_H
#include "qt3support.h"
#ifndef QT4
#include <qwidget.h>
/*#include <kdelibs_export.h>*/
@@ -232,3 +236,4 @@ private:
#endif
#endif
#endif

View File

@@ -38,16 +38,13 @@
#include <qwidget.h>
#include <qmap.h>
#endif
#include "spc_bg_hndl_widget.h"
#endif
class tabWidget : public QWidget
#ifndef QT4
, public specialBgHandlingWidget
#endif
class tabWidget : public QWidget, public specialBgHandlingWidget
{
Q_OBJECT
public:

View File

@@ -28,7 +28,7 @@
#ifdef QT4
#include <QPixmap.h>
#include <QPixmap>
#else
@@ -39,23 +39,26 @@
#include "knob.h"
enum tempoSyncMode
{
NO_SYNC,
DOUBLE_WHOLE_NOTE,
WHOLE_NOTE,
HALF_NOTE,
QUARTER_NOTE,
EIGHTH_NOTE,
SIXTEENTH_NOTE,
THIRTYSECOND_NOTE
} ;
class QAction;
class tempoSyncKnob : public knob
{
Q_OBJECT
public:
enum tempoSyncMode
{
NO_SYNC,
DOUBLE_WHOLE_NOTE,
WHOLE_NOTE,
HALF_NOTE,
QUARTER_NOTE,
EIGHTH_NOTE,
SIXTEENTH_NOTE,
THIRTYSECOND_NOTE
} ;
tempoSyncKnob( int _knob_num, QWidget * _parent, const QString & _name,
float _scale = 1.0f );
virtual ~tempoSyncKnob();
@@ -82,6 +85,7 @@ signals:
public slots:
void setTempoSync( int _note_type );
void setTempoSync( QAction * _item );
protected:

View File

@@ -66,7 +66,12 @@ public:
{
m_colorHighlighted = _color;
}
#ifndef QT4
inline void setIcon( const QPixmap & _icon )
{
setIconSet( _icon );
}
#endif
protected:
virtual void enterEvent( QEvent * _ev );
@@ -83,3 +88,4 @@ private:
} ;
#endif

View File

@@ -486,9 +486,14 @@ void audioFileProcessor::paintEvent( QPaintEvent * )
void audioFileProcessor::sampleUpdated( void )
{
m_graph = QPixmap( 245, 75 );
#ifdef QT4
QPainter p( &m_graph );
p.drawPixmap( 2, 172, m_graph );
#else
copyBlt( &m_graph, 0, 0, s_artwork, 2, 172, m_graph.width(),
m_graph.height() );
QPainter p( &m_graph );
#endif
m_sampleBuffer.drawWaves( p, QRect( 2, 2, m_graph.width() - 4,
m_graph.height() - 4 ),
m_drawMethod );

View File

@@ -105,7 +105,7 @@ vestigeInstrument::vestigeInstrument( channelTrack * _channel_track ) :
m_openPluginButton = new pixmapButton( this );
m_openPluginButton->setCheckable( FALSE );
m_openPluginButton->setCursor( PointingHandCursor );
m_openPluginButton->setCursor( Qt::PointingHandCursor );
m_openPluginButton->move( 200, 70 );
m_openPluginButton->setActiveGraphic( embed::getIconPixmap(
"project_open_down" ) );

View File

@@ -31,7 +31,7 @@
#ifdef QT4
#include <qvector>
#include <QVector>
#else

View File

@@ -179,7 +179,7 @@ int audioALSA::handleError( int _err )
void audioALSA::startProcessing( void )
{
if( !running() )
if( !isRunning() )
{
start();
}
@@ -190,7 +190,7 @@ void audioALSA::startProcessing( void )
void audioALSA::stopProcessing( void )
{
if( running() )
if( isRunning() )
{
m_quit = TRUE;
wait( 1000 );

View File

@@ -282,7 +282,7 @@ QString audioOSS::probeDevice( void )
void audioOSS::startProcessing( void )
{
if( !running() )
if( !isRunning() )
{
start();
}
@@ -293,7 +293,7 @@ void audioOSS::startProcessing( void )
void audioOSS::stopProcessing( void )
{
if( running() )
if( isRunning() )
{
m_quit = TRUE;
wait( 1000 );

View File

@@ -667,7 +667,8 @@ void arpAndChordsTabWidget::loadSettings( const QDomElement & _this )
m_arpDirection = static_cast<arpDirections>(
_this.attribute( "arpdir" ).toInt() );
m_arpTimeKnob->setSyncMode(
( tempoSyncMode ) _this.attribute( "arpsyncmode" ).toInt() );
( tempoSyncKnob::tempoSyncMode ) _this.attribute(
"arpsyncmode" ).toInt() );
m_arpGroupBox->setState( m_arpDirection != OFF &&
!_this.attribute( "arpdisabled" ).toInt() );

View File

@@ -68,8 +68,14 @@ bbEditor::bbEditor() :
m_toolBar = new QWidget( this );
m_toolBar->setFixedHeight( 32 );
m_toolBar->move( 0, 0 );
m_toolBar->setPaletteBackgroundPixmap( embed::getIconPixmap(
"toolbar_bg" ) );
#ifdef QT4
QPalette pal;
pal.setBrush( m_toolBar->backgroundRole(), QBrush(
embed::getIconPixmap( "toolbar_bg" ) ) );
m_toolBar->setPalette( pal );
#else
m_toolBar->setErasePixmap( embed::getIconPixmap( "toolbar_bg" ) );
#endif
QHBoxLayout * tb_layout = new QHBoxLayout( m_toolBar );
@@ -320,24 +326,24 @@ void bbEditor::play( void )
{
songEditor::inst()->stop();
songEditor::inst()->playBB();
m_playButton->setPixmap( embed::getIconPixmap(
m_playButton->setIcon( embed::getIconPixmap(
"pause" ) );
}
else
{
songEditor::inst()->pause();
m_playButton->setPixmap( embed::getIconPixmap(
m_playButton->setIcon( embed::getIconPixmap(
"play" ) );
}
}
else if( songEditor::inst()->paused() )
{
songEditor::inst()->resumeFromPause();
m_playButton->setPixmap( embed::getIconPixmap( "pause" ) );
m_playButton->setIcon( embed::getIconPixmap( "pause" ) );
}
else
{
m_playButton->setPixmap( embed::getIconPixmap( "pause" ) );
m_playButton->setIcon( embed::getIconPixmap( "pause" ) );
songEditor::inst()->playBB();
}
@@ -349,7 +355,7 @@ void bbEditor::play( void )
void bbEditor::stop( void )
{
songEditor::inst()->stop();
m_playButton->setPixmap( embed::getIconPixmap( "play" ) );
m_playButton->setIcon( embed::getIconPixmap( "play" ) );
m_playButton->update();
}

View File

@@ -611,8 +611,9 @@ void envelopeAndLFOWidget::loadSettings( const QDomElement & _this )
m_x100Cb->setChecked( _this.attribute( "x100" ).toInt() );
m_controlEnvAmountCb->setChecked( _this.attribute(
"ctlenvamt" ).toInt() );
m_lfoSpeedKnob->setSyncMode( ( tempoSyncMode ) _this.attribute(
"lfosyncmode" ).toInt() );
m_lfoSpeedKnob->setSyncMode(
( tempoSyncKnob::tempoSyncMode ) _this.attribute(
"lfosyncmode" ).toInt() );
switch( m_lfoShape )
{

View File

@@ -595,7 +595,7 @@ void directory::setOpen( bool _o )
if( cur_file[0] != '.' && !QFileInfo(
thisDir.absolutePath() + "/" +
cur_file ).isDir() &&
thisDir.match( m_filter, cur_file.lower() )
thisDir.match( m_filter, cur_file.toLower() )
/*QDir::match( FILE_FILTER, cur_file )*/ )
#else
if( cur_file[0] != '.' && !QFileInfo(

View File

@@ -29,7 +29,6 @@
#ifdef QT4
#include <Qt/QtXml>
#include <QListBox>
#include <QMenu>
#include <QToolButton>
@@ -40,6 +39,9 @@
#include <qpopupmenu.h>
#include <qtoolbutton.h>
#define setIcon setPixmap
#define setText setTextLabel
#endif
@@ -118,34 +120,52 @@ midiTabWidget::midiTabWidget( channelTrack * _channel_track,
if( mc->isRaw() == FALSE )
{
m_readablePorts = new QMenu( m_setupTabWidget );
#ifdef QT4
connect( m_readablePorts, SIGNAL( triggered( QAction * ) ),
this, SLOT( activatedReadablePort( QAction * ) ) );
#else
m_readablePorts->setCheckable( TRUE );
connect( m_readablePorts, SIGNAL( activated( int ) ),
this, SLOT( activatedReadablePort( int ) ) );
#endif
m_writeablePorts = new QMenu( m_setupTabWidget );
#ifdef QT4
connect( m_writeablePorts, SIGNAL( triggered( QAction * ) ),
this, SLOT( activatedWriteablePort( QAction * ) ) );
#else
m_writeablePorts->setCheckable( TRUE );
connect( m_writeablePorts, SIGNAL( activated( int ) ),
this, SLOT( activatedWriteablePort( int ) ) );
#endif
// fill menus
readablePortsChanged();
writeablePortsChanged();
QToolButton * rp_btn = new QToolButton( m_setupTabWidget );
rp_btn->setTextLabel( tr( "MIDI-devices to receive "
rp_btn->setText( tr( "MIDI-devices to receive "
"MIDI-events from" ) );
rp_btn->setIconSet( embed::getIconPixmap( "midi_in" ) );
rp_btn->setIcon( embed::getIconPixmap( "midi_in" ) );
rp_btn->setGeometry( 186, 34, 40, 40 );
rp_btn->setPopup( m_readablePorts );
rp_btn->setMenu( m_readablePorts );
#ifdef QT4
rp_btn->setPopupMode( QToolButton::InstantPopup );
#else
rp_btn->setPopupDelay( 1 );
#endif
QToolButton * wp_btn = new QToolButton( m_setupTabWidget );
wp_btn->setTextLabel( tr( "MIDI-devices to send MIDI-events "
wp_btn->setText( tr( "MIDI-devices to send MIDI-events "
"to" ) );
wp_btn->setPixmap( embed::getIconPixmap( "midi_out" ) );
wp_btn->setIcon( embed::getIconPixmap( "midi_out" ) );
wp_btn->setGeometry( 186, 94, 40, 40 );
wp_btn->setPopup( m_writeablePorts );
wp_btn->setMenu( m_writeablePorts );
#ifdef QT4
wp_btn->setPopupMode( QToolButton::InstantPopup );
#else
wp_btn->setPopupDelay( 1 );
#endif
// we want to get informed about port-changes!
mc->connectRPChanged( this, SLOT( readablePortsChanged() ) );
@@ -179,6 +199,17 @@ void midiTabWidget::saveSettings( QDomDocument & _doc, QDomElement & _parent )
if( m_readablePorts != NULL && m_receiveCheckBox->isChecked() == TRUE )
{
QString rp;
#ifdef QT4
QList<QAction *> actions = m_readablePorts->actions();
for( QList<QAction *>::iterator it = actions.begin();
it != actions.end(); ++it )
{
if( ( *it )->isChecked() )
{
rp += ( *it )->text() + ",";
}
}
#else
for( csize i = 0; i < m_readablePorts->count(); ++i )
{
int id = m_readablePorts->idAt( i );
@@ -187,6 +218,7 @@ void midiTabWidget::saveSettings( QDomDocument & _doc, QDomElement & _parent )
rp += m_readablePorts->text( id ) + ",";
}
}
#endif
// cut off comma
if( rp.length() > 0 )
{
@@ -198,6 +230,17 @@ void midiTabWidget::saveSettings( QDomDocument & _doc, QDomElement & _parent )
if( m_writeablePorts != NULL && m_sendCheckBox->isChecked() == TRUE )
{
QString wp;
#ifdef QT4
QList<QAction *> actions = m_writeablePorts->actions();
for( QList<QAction *>::iterator it = actions.begin();
it != actions.end(); ++it )
{
if( ( *it )->isChecked() )
{
wp += ( *it )->text() + ",";
}
}
#else
for( csize i = 0; i < m_writeablePorts->count(); ++i )
{
int id = m_writeablePorts->idAt( i );
@@ -206,6 +249,7 @@ void midiTabWidget::saveSettings( QDomDocument & _doc, QDomElement & _parent )
wp += m_writeablePorts->text( id ) + ",";
}
}
#endif
// cut off comma
if( wp.length() > 0 )
{
@@ -231,10 +275,23 @@ void midiTabWidget::loadSettings( const QDomElement & _this )
// restore connections
QStringList rp = QStringList::split( ',', _this.attribute(
"inports" ) );
if( m_readablePorts != NULL && m_receiveCheckBox->isChecked() == TRUE )
{
#ifdef QT4
QStringList rp = _this.attribute( "inports" ).split( ',' );
QList<QAction *> actions = m_readablePorts->actions();
for( QList<QAction *>::iterator it = actions.begin();
it != actions.end(); ++it )
{
if( ( *it )->isChecked() !=
( rp.indexOf( ( *it )->text() ) != -1 ) )
{
activatedReadablePort( *it );
}
}
#else
QStringList rp = QStringList::split( ',',
_this.attribute( "inports" ) );
for( csize i = 0; i < m_readablePorts->count(); ++i )
{
int id = m_readablePorts->idAt( i );
@@ -245,12 +302,26 @@ void midiTabWidget::loadSettings( const QDomElement & _this )
activatedReadablePort( id );
}
}
#endif
}
QStringList wp = QStringList::split( ',', _this.attribute(
"outports" ) );
if( m_writeablePorts != NULL && m_sendCheckBox->isChecked() == TRUE )
{
#ifdef QT4
QStringList wp = _this.attribute( "outports" ).split( ',' );
QList<QAction *> actions = m_writeablePorts->actions();
for( QList<QAction *>::iterator it = actions.begin();
it != actions.end(); ++it )
{
if( ( *it )->isChecked() !=
( wp.indexOf( ( *it )->text() ) != -1 ) )
{
activatedWriteablePort( *it );
}
}
#else
QStringList wp = QStringList::split( ',',
_this.attribute( "outports" ) );
for( csize i = 0; i < m_writeablePorts->count(); ++i )
{
int id = m_writeablePorts->idAt( i );
@@ -261,6 +332,7 @@ void midiTabWidget::loadSettings( const QDomElement & _this )
activatedWriteablePort( id );
}
}
#endif
}
}
@@ -299,25 +371,49 @@ void midiTabWidget::midiPortModeToggled( bool )
// check whether we have to dis-check items in connection-menu
if( m_readablePorts != NULL && m_receiveCheckBox->isChecked() == FALSE )
{
#ifdef QT4
QList<QAction *> actions = m_readablePorts->actions();
for( QList<QAction *>::iterator it = actions.begin();
it != actions.end(); ++it )
{
if( ( *it )->isChecked() == TRUE )
{
activatedReadablePort( *it );
}
}
#else
for( csize i = 0; i < m_readablePorts->count(); ++i )
{
int id = m_readablePorts->idAt( i );
if( m_readablePorts->isItemChecked( id ) )
if( m_readablePorts->isItemChecked( id ) == TRUE )
{
activatedReadablePort( id );
}
}
#endif
}
if( m_writeablePorts != NULL && m_sendCheckBox->isChecked() == FALSE )
{
#ifdef QT4
QList<QAction *> actions = m_writeablePorts->actions();
for( QList<QAction *>::iterator it = actions.begin();
it != actions.end(); ++it )
{
if( ( *it )->isChecked() == TRUE )
{
activatedWriteablePort( *it );
}
}
#else
for( csize i = 0; i < m_writeablePorts->count(); ++i )
{
int id = m_writeablePorts->idAt( i );
if( m_writeablePorts->isItemChecked( id ) )
if( m_writeablePorts->isItemChecked( id ) == TRUE )
{
activatedWriteablePort( id );
}
}
#endif
}
songEditor::inst()->setModified();
}
@@ -329,14 +425,26 @@ void midiTabWidget::readablePortsChanged( void )
{
// first save all selected ports
QStringList selected_ports;
#ifdef QT4
QList<QAction *> actions = m_readablePorts->actions();
for( QList<QAction *>::iterator it = actions.begin();
it != actions.end(); ++it )
{
if( ( *it )->isChecked() == TRUE )
{
selected_ports.push_back( ( *it )->text() );
}
}
#else
for( csize i = 0; i < m_readablePorts->count(); ++i )
{
int id = m_readablePorts->idAt( i );
if( m_readablePorts->isItemChecked( id ) )
if( m_readablePorts->isItemChecked( id ) == TRUE )
{
selected_ports.push_back( m_readablePorts->text( id ) );
}
}
#endif
m_readablePorts->clear();
const QStringList & rp = mixer::inst()->getMIDIClient()->
@@ -344,11 +452,19 @@ void midiTabWidget::readablePortsChanged( void )
// now insert new ports and restore selections
for( QStringList::const_iterator it = rp.begin(); it != rp.end(); ++it )
{
#ifdef QT4
QAction * item = m_readablePorts->addAction( *it );
if( selected_ports.indexOf( *it ) != -1 )
{
item->setChecked( TRUE );
}
#else
int id = m_readablePorts->insertItem( *it );
if( selected_ports.find( *it ) != selected_ports.end() )
{
m_readablePorts->setItemChecked( id, TRUE );
}
#endif
}
}
@@ -359,15 +475,27 @@ void midiTabWidget::writeablePortsChanged( void )
{
// first save all selected ports
QStringList selected_ports;
#ifdef QT4
QList<QAction *> actions = m_writeablePorts->actions();
for( QList<QAction *>::iterator it = actions.begin();
it != actions.end(); ++it )
{
if( ( *it )->isChecked() == TRUE )
{
selected_ports.push_back( ( *it )->text() );
}
}
#else
for( csize i = 0; i < m_writeablePorts->count(); ++i )
{
int id = m_writeablePorts->idAt( i );
if( m_writeablePorts->isItemChecked( id ) )
if( m_writeablePorts->isItemChecked( id ) == TRUE )
{
selected_ports.push_back( m_writeablePorts->text(
id ) );
}
}
#endif
m_writeablePorts->clear();
const QStringList & wp = mixer::inst()->getMIDIClient()->
@@ -375,17 +503,64 @@ void midiTabWidget::writeablePortsChanged( void )
// now insert new ports and restore selections
for( QStringList::const_iterator it = wp.begin(); it != wp.end(); ++it )
{
#ifdef QT4
QAction * item = m_writeablePorts->addAction( *it );
if( selected_ports.indexOf( *it ) != -1 )
{
item->setChecked( TRUE );
}
#else
int id = m_writeablePorts->insertItem( *it );
if( selected_ports.find( *it ) != selected_ports.end() )
{
m_writeablePorts->setItemChecked( id, TRUE );
}
#endif
}
}
#ifdef QT4
void midiTabWidget::activatedReadablePort( QAction * _item )
{
// make sure, MIDI-port is configured for input
if( _item->isChecked() == FALSE &&
m_midiPort->mode() != midiPort::INPUT &&
m_midiPort->mode() != midiPort::DUPLEX )
{
m_receiveCheckBox->setChecked( TRUE );
}
_item->setChecked( !_item->isChecked() );
mixer::inst()->getMIDIClient()->subscribeReadablePort( m_midiPort,
_item->text(), !_item->isChecked() );
}
void midiTabWidget::activatedWriteablePort( QAction * _item )
{
// make sure, MIDI-port is configured for output
if( _item->isChecked() == FALSE &&
m_midiPort->mode() != midiPort::OUTPUT &&
m_midiPort->mode() != midiPort::DUPLEX )
{
m_sendCheckBox->setChecked( TRUE );
}
_item->setChecked( !_item->isChecked() );
mixer::inst()->getMIDIClient()->subscribeWriteablePort( m_midiPort,
_item->text(), !_item->isChecked() );
}
void midiTabWidget::activatedReadablePort( int ) { }
void midiTabWidget::activatedWriteablePort( int ) { }
#else
void midiTabWidget::activatedReadablePort( int _id )
{
// make sure, MIDI-port is configured for input
@@ -422,5 +597,11 @@ void midiTabWidget::activatedWriteablePort( int _id )
}
void midiTabWidget::activatedReadablePort( QAction * ) { }
void midiTabWidget::activatedWriteablePort( QAction * ) { }
#endif
#include "midi_tab_widget.moc"

View File

@@ -204,8 +204,15 @@ pianoRoll::pianoRoll( void ) :
m_toolBar = new QWidget( this );
m_toolBar->setFixedHeight( 32 );
m_toolBar->move( 0, 0 );
#ifdef QT4
QPalette pal;
pal.setBrush( m_toolBar->backgroundRole(), QBrush(
embed::getIconPixmap( "toolbar_bg" ) ) );
m_toolBar->setPalette( pal );
#else
m_toolBar->setPaletteBackgroundPixmap( embed::getIconPixmap(
"toolbar_bg" ) );
#endif
QHBoxLayout * tb_layout = new QHBoxLayout( m_toolBar );
@@ -387,11 +394,16 @@ pianoRoll::pianoRoll( void ) :
m_zoomingComboBox->setGeometry( 580, 4, 80, 24 );
for( int i = 0; i < 6; ++i )
{
m_zoomingComboBox->insertItem( QString::number( 25 *
m_zoomingComboBox->addItem( QString::number( 25 *
static_cast<int>( powf( 2.0f, i ) ) ) +
"%" );
}
#ifdef QT4
m_zoomingComboBox->setCurrentIndex( m_zoomingComboBox->findText(
"100%" ) );
#else
m_zoomingComboBox->setCurrentText( "100%" );
#endif
connect( m_zoomingComboBox, SIGNAL( activated( const QString & ) ),
this, SLOT( zoomingChanged( const QString & ) ) );
@@ -1928,10 +1940,18 @@ void pianoRoll::wheelEvent( QWheelEvent * _we )
{
m_ppt /= 2;
}
#ifdef QT4
// update combobox with zooming-factor
m_zoomingComboBox->setCurrentIndex(
m_zoomingComboBox->findText( QString::number(
static_cast<int>( m_ppt * 100 /
DEFAULT_PR_PPT ) ) +"%" ) );
#else
// update combobox with zooming-factor
m_zoomingComboBox->setCurrentText( QString::number(
static_cast<int>( m_ppt * 100 /
DEFAULT_PR_PPT ) ) +"%" );
#endif
// update timeline
m_timeLine->setPixelsPerTact( m_ppt );
update();
@@ -1964,24 +1984,23 @@ void pianoRoll::play( void )
{
songEditor::inst()->stop();
songEditor::inst()->playPattern( m_pattern );
m_playButton->setPixmap( embed::getIconPixmap(
m_playButton->setIcon( embed::getIconPixmap(
"pause" ) );
}
else
{
songEditor::inst()->pause();
m_playButton->setPixmap( embed::getIconPixmap(
"play" ) );
m_playButton->setIcon( embed::getIconPixmap( "play" ) );
}
}
else if( songEditor::inst()->paused() )
{
songEditor::inst()->resumeFromPause();
m_playButton->setPixmap( embed::getIconPixmap( "pause" ) );
m_playButton->setIcon( embed::getIconPixmap( "pause" ) );
}
else
{
m_playButton->setPixmap( embed::getIconPixmap( "pause" ) );
m_playButton->setIcon( embed::getIconPixmap( "pause" ) );
songEditor::inst()->playPattern( m_pattern );
}
}
@@ -2010,7 +2029,7 @@ void pianoRoll::record( void )
void pianoRoll::stop( void )
{
songEditor::inst()->stop();
m_playButton->setPixmap( embed::getIconPixmap( "play" ) );
m_playButton->setIcon( embed::getIconPixmap( "play" ) );
m_playButton->update();
m_recording = FALSE;
m_scrollBack = TRUE;

View File

@@ -133,15 +133,33 @@ plugin * plugin::instantiate( const QString & _plugin_name, void * _data )
void plugin::getDescriptorsOfAvailPlugins( vvector<descriptor> & _plugin_descs )
{
QDir directory( configManager::inst()->pluginDir() );
const QFileInfoList * list = directory.entryInfoList( "lib*.so" );
if( list == NULL )
#ifdef QT4
QFileInfoList list = directory.entryInfoList( QStringList(
"lib*.so" ) );
#else
const QFileInfoList * lp = directory.entryInfoList( "lib*.so" );
// if directory doesn't exist or isn't readable, we get NULL which would
// crash LMMS...
if( lp == NULL )
{
return;
}
for( QFileInfoList::iterator file = list->begin();
file != list->end(); ++file )
QFileInfoList list = *lp;
#endif
for( QFileInfoList::iterator file = list.begin();
file != list.end(); ++file )
{
void * handle = dlopen( ( *file )->absFilePath().latin1(),
#ifdef QT4
const QFileInfo & f = *file;
#else
const QFileInfo & f = **file;
#endif
void * handle = dlopen( f.absoluteFilePath().
#ifdef QT4
toAscii().constData(),
#else
ascii(),
#endif
RTLD_NOW );
char * msg = dlerror();
if( msg != NULL || handle == NULL )
@@ -156,10 +174,16 @@ void plugin::getDescriptorsOfAvailPlugins( vvector<descriptor> & _plugin_descs )
printf( "plugin-loader: %s\n", msg );
continue;
}
QString desc_name = ( *file )->fileName().mid( 3 ).section(
'.', 0, 0 ) + "_plugin_descriptor";
QString desc_name = f.fileName().mid( 3 ).section( '.', 0, 0 ) +
"_plugin_descriptor";
descriptor * plugin_desc =
(descriptor *) dlsym( handle, desc_name.ascii() );
(descriptor *) dlsym( handle, desc_name.
#ifdef QT4
toAscii().constData()
#else
ascii()
#endif
);
msg = dlerror();
if( msg != NULL || plugin_desc == NULL )
{

View File

@@ -29,14 +29,13 @@
#include <QLabel>
#include <QPainter>
/*#include <QScrollArea>*/
#include <QCursor>
#include <QMouseEvent>
#else
#include <qlabel.h>
#include <qpainter.h>
/*#include <qscrollview.h>*/
#include <qcursor.h>
#endif
@@ -60,7 +59,9 @@ pluginBrowser::pluginBrowser( QWidget * _parent ) :
addContentWidget( m_view );
QVBoxLayout * view_layout = new QVBoxLayout( m_view, 5, 10 );
QVBoxLayout * view_layout = new QVBoxLayout( m_view );
view_layout->setMargin( 5 );
view_layout->setSpacing( 10 );
QLabel * hint = new QLabel( tr( "You can drag an instrument-plugin "
@@ -70,7 +71,11 @@ pluginBrowser::pluginBrowser( QWidget * _parent ) :
"corresponding channel-button." ),
m_view );
hint->setFont( pointSize<8>( hint->font() ) );
hint->setAlignment( hint->alignment() | WordBreak );
#ifdef QT4
hint->setWordWrap( TRUE );
#else
hint->setAlignment( hint->alignment() | Qt::WordBreak );
#endif
view_layout->addWidget( hint );
plugin::getDescriptorsOfAvailPlugins( m_pluginDescriptors );
@@ -113,7 +118,7 @@ pluginDescWidget::pluginDescWidget( const plugin::descriptor & _pd,
#ifndef QT4
setBackgroundMode( Qt::NoBackground );
#endif
setCursor( PointingHandCursor );
setCursor( Qt::PointingHandCursor );
}
@@ -156,19 +161,32 @@ void pluginDescWidget::paintEvent( QPaintEvent * )
f.setBold( FALSE );
p.setFont( pointSize<7>( f ) );
#ifdef QT4
QStringList words = pluginBrowser::tr(
m_pluginDescriptor.description ).split( ' ' );
#else
QStringList words = QStringList::split( ' ',
pluginBrowser::tr( m_pluginDescriptor.description ) );
#endif
for( QStringList::iterator it = words.begin(); it != words.end(); ++it )
{
if( ( *it ).contains( '-' ) )
{
#ifdef QT4
QStringList splitted_word = it->split( '-' );
#else
QStringList splitted_word = QStringList::split( '-',
*it );
#endif
QStringList::iterator orig_it = it;
for( QStringList::iterator it2 = splitted_word.begin();
it2 != splitted_word.end(); ++it2 )
{
#ifdef QT4
if( it2 == --splitted_word.end() )
#else
if( it2 == splitted_word.fromLast() )
#endif
{
words.insert( it, *it2 );
}

View File

@@ -361,7 +361,7 @@ setupDialog::setupDialog( configTabs _tab_to_open ) :
midi_layout->addStretch();
#ifndef QT
#ifndef QT4
#define setIcon setPixmap
#endif

View File

@@ -185,7 +185,7 @@ songEditor::songEditor() :
toolButton * hq_btn = new toolButton( embed::getIconPixmap( "hq_mode" ),
tr( "High quality mode" ),
NULL, NULL, tb );
hq_btn->setToggleButton( TRUE );
hq_btn->setCheckable( TRUE );
connect( hq_btn, SIGNAL( toggled( bool ) ), mixer::inst(),
SLOT( setHighQuality( bool ) ) );
hq_btn->setFixedWidth( 42 );
@@ -276,8 +276,15 @@ songEditor::songEditor() :
m_toolBar = new QWidget( cw );
m_toolBar->setFixedHeight( 32 );
m_toolBar->move( 0, 0 );
#ifdef QT4
QPalette pal;
pal.setBrush( m_toolBar->backgroundRole(), QBrush(
embed::getIconPixmap( "toolbar_bg" ) ) );
m_toolBar->setPalette( pal );
#else
m_toolBar->setPaletteBackgroundPixmap( embed::getIconPixmap(
"toolbar_bg" ) );
#endif
QHBoxLayout * tb_layout = new QHBoxLayout( m_toolBar );
@@ -355,11 +362,16 @@ songEditor::songEditor() :
m_zoomingComboBox->setGeometry( 580, 4, 80, 24 );
for( int i = 0; i < 7; ++i )
{
m_zoomingComboBox->insertItem( QString::number( 25 *
m_zoomingComboBox->addItem( QString::number( 25 *
static_cast<int>( powf( 2.0f, i ) ) ) +
"%" );
}
#ifdef QT4
m_zoomingComboBox->setCurrentIndex( m_zoomingComboBox->findText(
"100%" ) );
#else
m_zoomingComboBox->setCurrentText( "100%" );
#endif
connect( m_zoomingComboBox, SIGNAL( activated( const QString & ) ),
this, SLOT( zoomingChanged( const QString & ) ) );
@@ -568,10 +580,18 @@ void songEditor::wheelEvent( QWheelEvent * _we )
{
setPixelsPerTact( (int) pixelsPerTact() / 2 );
}
#ifdef QT4
// update combobox with zooming-factor
m_zoomingComboBox->setCurrentIndex(
m_zoomingComboBox->findText( QString::number(
static_cast<int>( pixelsPerTact() *
100 / DEFAULT_PIXELS_PER_TACT ) ) +"%" ) );
#else
// update combobox with zooming-factor
m_zoomingComboBox->setCurrentText( QString::number(
static_cast<int>( pixelsPerTact() *
100 / DEFAULT_PIXELS_PER_TACT ) ) +"%" );
#endif
// update timeline
m_playPos[PLAY_SONG].m_timeLine->setPixelsPerTact(
pixelsPerTact() );

View File

@@ -131,7 +131,6 @@ timeLine::~timeLine()
void timeLine::addToolButtons( QWidget * _tool_bar )
{
nStateButton * m_autoScroll = new nStateButton( _tool_bar );
m_autoScroll->setPaletteBackgroundColor( QColor( 224, 224, 224 ) );
m_autoScroll->setGeneralToolTip( tr( "Enable/disable "
"auto-scrolling" ) );
m_autoScroll->addState( embed::getIconPixmap( "autoscroll_on" ) );
@@ -140,7 +139,6 @@ void timeLine::addToolButtons( QWidget * _tool_bar )
SLOT( toggleAutoScroll( int ) ) );
nStateButton * m_loopPoints = new nStateButton( _tool_bar );
m_loopPoints->setPaletteBackgroundColor( QColor( 224, 224, 224 ) );
m_loopPoints->setGeneralToolTip( tr( "Enable/disable loop-points" ) );
m_loopPoints->addState( embed::getIconPixmap( "loop_points_off" ) );
m_loopPoints->addState( embed::getIconPixmap( "loop_points_on" ) );
@@ -148,7 +146,6 @@ void timeLine::addToolButtons( QWidget * _tool_bar )
SLOT( toggleLoopPoints( int ) ) );
nStateButton * m_behaviourAtStop = new nStateButton( _tool_bar );
m_behaviourAtStop->setPaletteBackgroundColor( QColor( 224, 224, 224 ) );
m_behaviourAtStop ->addState( embed::getIconPixmap( "back_to_zero" ),
tr( "After stopping go back to begin" )
);

View File

@@ -31,6 +31,7 @@
#include <Qt/QtXml>
#include <QApplication>
#include <QProgressDialog>
#include <QWheelEvent>
#else

View File

@@ -39,6 +39,8 @@
#include <qdir.h>
#include <qfileinfo.h>
#define value data
#endif
@@ -59,10 +61,15 @@ ladspaManager::ladspaManager( void )
LADSPA_Descriptor_Function descriptorFunction;
void * pluginHandle;
// TODO Need to move the search path definition to the config file to have
// more control over where it tries to find the plugins.
// TODO Need to move the search path definition to the config file to
// have more control over where it tries to find the plugins.
#ifdef QT4
QStringList ladspaDirectories = QString( getenv( "LADSPA_PATH" ) ).
split( ' ' );
#else
QStringList ladspaDirectories = QStringList::split( ':',
QString( getenv( "LADSPA_PATH" ) ) );
#endif
// set default-directory if nothing is specified...
if( ladspaDirectories.isEmpty() )
{
@@ -73,18 +80,33 @@ ladspaManager::ladspaManager( void )
it != ladspaDirectories.end(); ++it )
{
QDir directory( ( *it ) );
const QFileInfoList * list = directory.entryInfoList();
// if directory doesn't exist or isn't readable, we get NULL which
// would crash LMMS...
if( list == NULL )
#ifdef QT4
QFileInfoList list = directory.entryInfoList();
#else
const QFileInfoList * lp = directory.entryInfoList();
// if directory doesn't exist or isn't readable, we get NULL
// which would crash LMMS...
if( lp == NULL )
{
continue;
}
for( QFileInfoList::iterator file = list->begin();
file != list->end(); ++file )
QFileInfoList list = *lp;
#endif
for( QFileInfoList::iterator file = list.begin();
file != list.end(); ++file )
{
pluginHandle = dlopen( ( *file )->absFilePath().latin1(),
RTLD_LAZY );
#ifdef QT4
const QFileInfo & f = *file;
#else
const QFileInfo & f = **file;
#endif
pluginHandle = dlopen( f.absoluteFilePath().
#ifdef QT4
toAscii().constData(),
#else
ascii(),
#endif
RTLD_LAZY );
if( pluginHandle )
{
dlerror();
@@ -95,14 +117,19 @@ ladspaManager::ladspaManager( void )
if( dlerror() == NULL && descriptorFunction )
{
addPlugins( pluginHandle,
descriptorFunction,
( *file )->fileName() );
descriptorFunction,
f.fileName() );
}
else
{
dlclose( ( void * )
( *file )->absFilePath().latin1()
);
f.absoluteFilePath().
#ifdef QT4
toAscii().constData()
#else
ascii()
#endif
);
}
}
}
@@ -117,7 +144,7 @@ ladspaManager::~ladspaManager()
for( ladspaManagerMapType::Iterator it = m_ladspaManagerMap.begin();
it != m_ladspaManagerMap.end(); ++it )
{
dlclose( it.data()->pluginHandle );
dlclose( it.value()->pluginHandle );
}
m_ladspaManagerMap.clear();
}
@@ -855,5 +882,8 @@ void FASTCALL ladspaManager::cleanup( const ladspaKey & _plugin,
}
#undef value
#endif

View File

@@ -26,6 +26,13 @@
#include "string_pair_drag.h"
#ifdef QT4
#include <QMimeData>
#include <QDragEnterEvent>
#include <QDropEvent>
#endif
stringPairDrag::stringPairDrag( const QString & _key, const QString & _value,
@@ -68,21 +75,17 @@ void stringPairDrag::processDragEnterEvent( QDragEnterEvent * _dee,
{
return;
}
QString txt = _dee->mimeData()->data();
#else
QString txt = _dee->encodedData( "lmms/stringpair" );
#endif
bool accepted = QStringList::split( ',', _allowed_keys ).contains(
txt.section( ':', 0, 0 ) );
#ifdef QT4
if( accepted )
QString txt = _dee->mimeData()->data( "lmms/stringpair" );
if( _allowed_keys.split( ',' ).contains( txt.section( ':', 0, 0 ) ) )
{
_dee->acceptProposedAction();
}
#else
QString txt = _dee->encodedData( "lmms/stringpair" );
bool accepted = QStringList::split( ',', _allowed_keys ).contains(
txt.section( ':', 0, 0 ) );
_dee->accept( accepted );
#endif
}
@@ -91,7 +94,8 @@ void stringPairDrag::processDragEnterEvent( QDragEnterEvent * _dee,
QString stringPairDrag::decodeKey( QDropEvent * _de )
{
#ifdef QT4
return( QString( _de->mimeData()->data() ).section( ':', 0, 0 ) );
return( QString( _de->mimeData()->data( "lmms/stringpair"
) ).section( ':', 0, 0 ) );
#else
return( QString( _de->encodedData( "lmms/stringpair" ) ).section(
':', 0, 0 ) );
@@ -104,7 +108,8 @@ QString stringPairDrag::decodeKey( QDropEvent * _de )
QString stringPairDrag::decodeValue( QDropEvent * _de )
{
#ifdef QT4
return( QString( _de->mimeData()->data() ).section( ':', 1, 1 ) );
return( QString( _de->mimeData()->data( "lmms/stringpair"
) ).section( ':', 1, 1 ) );
#else
return( QString( _de->encodedData( "lmms/stringpair" ) ).section(
':', 1, 1 ) );

View File

@@ -86,7 +86,7 @@ midiALSARaw::midiALSARaw( void ) :
midiALSARaw::~midiALSARaw()
{
if( running() )
if( isRunning() )
{
m_quit = TRUE;
wait( 1000 );

View File

@@ -111,7 +111,7 @@ midiALSASeq::midiALSASeq( void ) :
midiALSASeq::~midiALSASeq()
{
if( running() )
if( isRunning() )
{
m_quit = TRUE;
wait( 1000 );
@@ -251,7 +251,11 @@ void midiALSASeq::applyPortMode( midiPort * _port )
m_portIDs[_port][i] =
snd_seq_create_simple_port(
m_seqHandle,
#ifdef QT4
_port->name().toAscii().constData(),
#else
_port->name().ascii(),
#endif
caps[i],
SND_SEQ_PORT_TYPE_MIDI_GENERIC |
SND_SEQ_PORT_TYPE_APPLICATION );
@@ -300,7 +304,13 @@ void midiALSASeq::applyPortName( midiPort * _port )
snd_seq_get_port_info( m_seqHandle, m_portIDs[_port][i],
port_info );
snd_seq_port_info_set_name( port_info,
_port->name().ascii() );
_port->name().
#ifdef QT4
toAscii().constData()
#else
ascii()
#endif
);
snd_seq_set_port_info( m_seqHandle, m_portIDs[_port][i],
port_info );
snd_seq_port_info_free( port_info );
@@ -342,7 +352,13 @@ void midiALSASeq::subscribeReadablePort( midiPort * _port,
}
snd_seq_addr_t sender;
if( snd_seq_parse_address( m_seqHandle, &sender,
_dest.section( ' ', 0, 0 ).ascii() ) )
_dest.section( ' ', 0, 0 ).
#ifdef QT4
toAscii().constData()
#else
ascii()
#endif
) )
{
printf( "error parsing sender-address!!\n" );
return;
@@ -381,7 +397,13 @@ void midiALSASeq::subscribeWriteablePort( midiPort * _port,
}
snd_seq_addr_t dest;
if( snd_seq_parse_address( m_seqHandle, &dest,
_dest.section( ' ', 0, 0 ).ascii() ) )
_dest.section( ' ', 0, 0 ).
#ifdef QT4
toAscii().constData()
#else
ascii()
#endif
) )
{
printf( "error parsing dest-address!!\n" );
return;

View File

@@ -81,7 +81,7 @@ midiOSS::midiOSS( void ) :
midiOSS::~midiOSS()
{
if( running() )
if( isRunning() )
{
m_quit = TRUE;
wait( 1000 );

View File

@@ -231,27 +231,44 @@ void pattern::constructContextMenu( QMenu * _cm )
_cm->addSeparator();
#ifdef QT4
QMenu * add_step_menu = _cm->addMenu(
embed::getIconPixmap( "step_btn_add" ),
tr( "Add steps" ) );
QMenu * remove_step_menu = _cm->addMenu(
embed::getIconPixmap( "step_btn_remove" ),
tr( "Remove steps" ) );
connect( add_step_menu, SIGNAL( triggered( QAction * ) ),
this, SLOT( addSteps( QAction * ) ) );
connect( remove_step_menu, SIGNAL( triggered( QAction * ) ),
this, SLOT( removeSteps( QAction * ) ) );
#else
QMenu * add_step_menu = new QMenu( this );
QMenu * remove_step_menu = new QMenu( this );
#endif
for( int i = 1; i <= 16; i *= 2 )
{
const QString label = ( i == 1 ) ?
tr( "1 step" ) :
tr( "%1 steps" ).arg( i );
#ifdef QT4
add_step_menu->addAction( label );
remove_step_menu->addAction( label );
#else
int menu_id = add_step_menu->addAction( label, this,
SLOT( addSteps( int ) ) );
add_step_menu->setItemParameter( menu_id, i );
menu_id = remove_step_menu->addAction( label, this,
SLOT( removeSteps( int ) ) );
remove_step_menu->setItemParameter( menu_id, i );
#endif
}
#ifndef QT4
_cm->addMenu( embed::getIconPixmap( "step_btn_add" ),
tr( "Add steps" ), add_step_menu );
_cm->addMenu( embed::getIconPixmap( "step_btn_remove" ),
tr( "Remove steps" ), remove_step_menu );
#endif
}
@@ -638,6 +655,32 @@ void pattern::abortFreeze( void )
#ifdef QT4
void pattern::addSteps( QAction * _item )
{
addSteps( _item->text().toInt() );
}
void pattern::removeSteps( QAction * _item )
{
removeSteps( _item->text().toInt() );
}
#else
void pattern::addSteps( QAction * ) { }
void pattern::removeSteps( QAction * ) { }
#endif
void pattern::addSteps( int _n )
{
m_steps += _n;
@@ -978,8 +1021,11 @@ patternFreezeStatusDialog::patternFreezeStatusDialog( QThread * _thread ) :
this, SLOT( updateProgress() ) );
update_timer->start( 100 );
#ifdef QT4
setAttribute( Qt::WA_DeleteOnClose, TRUE );
#else
setWFlags( getWFlags() | Qt::WDestructiveClose );
#endif
connect( this, SIGNAL( aborted() ), this, SLOT( reject() ) );
}

View File

@@ -24,6 +24,19 @@
*/
#include "qt3support.h"
#ifdef QT4
#include <QPainter>
#else
#include <qpainter.h>
#endif
#include "cpuload_widget.h"
#include "embed.h"
#include "mixer.h"
@@ -40,7 +53,7 @@ cpuloadWidget::cpuloadWidget( QWidget * _parent ) :
{
setFixedSize( m_background.width(), m_background.height() );
m_temp.resize( width(), height() );
m_temp = QPixmap( width(), height() );
connect( &m_updateTimer, SIGNAL( timeout() ),
this, SLOT( updateCpuLoad() ) );
@@ -63,7 +76,7 @@ cpuloadWidget::~cpuloadWidget()
void cpuloadWidget::paintEvent( QPaintEvent * )
{
if( m_changed == TRUE )
/* if( m_changed == TRUE )
{
m_changed = FALSE;
@@ -76,7 +89,22 @@ void cpuloadWidget::paintEvent( QPaintEvent * )
( m_leds.width() * m_currentLoad / 300 ) * 3,
m_leds.height(), CopyROP );
}
bitBlt( this, 0, 0, &m_temp, 0, 0, width(), height(), CopyROP );
bitBlt( this, 0, 0, &m_temp, 0, 0, width(), height(), CopyROP );*/
if( m_changed == TRUE )
{
m_changed = FALSE;
QPainter p( &m_temp );
// background
p.drawPixmap( 0, 0, m_background );
// leds
p.drawPixmap( 23, 3, m_leds, 0, 0,
( m_leds.width() * m_currentLoad / 300 ) * 3,
m_leds.height() );
}
QPainter p( this );
p.drawPixmap( 0, 0, m_temp );
}

View File

@@ -754,12 +754,20 @@ void knob::pasteValue( void )
void knob::enterValue( void )
{
bool ok;
float new_val = QInputDialog::getDouble( accessibleName(),
float new_val = QInputDialog::getDouble(
#ifdef QT4
this,
#endif
accessibleName(),
tr( "Please enter a new value between "
"%1 and %2:" ).arg(
minValue() ).arg( maxValue() ),
value(), minValue(), maxValue(),
4, &ok, this );
4, &ok
#ifndef QT4
, this
#endif
);
if( ok )
{
setValue( new_val );

View File

@@ -88,7 +88,7 @@ void nStateButton::changeState( int _n )
m_generalToolTip;
toolTip::add( this, _tooltip );
setPixmap( *m_states[m_curState].first );
setIcon( *m_states[m_curState].first );
emit changedState( m_curState );

View File

@@ -36,6 +36,7 @@
#include <QFontDatabase>
#include <QComboBox>
#include <QColorDialog>
#include <QTextCursor>
#else
@@ -115,9 +116,15 @@ projectNotes::projectNotes() :
void projectNotes::clear( void )
{
m_edit->setHtml( tr( "Put down your project notes here." ) );
#ifdef QT4
m_edit->selectAll();
m_edit->setTextColor( QColor( 224, 224, 224 ) );
m_edit->setTextCursor( QTextCursor() );
#else
m_edit->selectAll( TRUE );
m_edit->setTextColor( QColor( 224, 224, 224 ) );
m_edit->selectAll( FALSE );
#endif
}

View File

@@ -45,6 +45,10 @@
// <http://lists.kde.org/?l=kfm-devel&w=2&r=1&s=qxembed&q=b>
//
#include "qt3support.h"
#ifndef QT4
#include <qapplication.h>
#include <qptrlist.h>
@@ -1356,4 +1360,5 @@ void QXEmbed::reparent( QWidget * parent, WFlags f, const QPoint & p, bool showI
// for KDE
#include "qxembed.moc"
#endif
#endif // Q_WS_X11

View File

@@ -47,9 +47,7 @@
tabWidget::tabWidget( const QString & _caption, QWidget * _parent ) :
QWidget( _parent ),
#ifndef QT4
specialBgHandlingWidget( QColor( 96, 96, 96 ) ),
#endif
m_activeTab( 0 ),
m_caption( _caption )
{

View File

@@ -109,7 +109,35 @@ void tempoSyncKnob::contextMenuEvent( QContextMenuEvent * )
m_hintTextAfterValue ),
this, SLOT( pasteValue() ) );
contextMenu.addSeparator();
#ifdef QT4
QMenu * syncMenu = contextMenu.addMenu( m_tempoSyncIcon,
m_tempoSyncDescription );
connect( syncMenu, SIGNAL( triggered( QAction * ) ),
this, SLOT( setTempoSync( QAction * ) ) );
syncMenu->addAction( embed::getIconPixmap( "note_none" ),
tr( "No Sync" ) )->setData( (int) NO_SYNC );
syncMenu->addAction( embed::getIconPixmap( "note_double_whole" ),
tr( "Eight beats" ) )->setData(
(int) DOUBLE_WHOLE_NOTE );
syncMenu->addAction( embed::getIconPixmap( "note_whole" ),
tr( "Whole note" ) )->setData(
(int) WHOLE_NOTE );
syncMenu->addAction( embed::getIconPixmap( "note_half" ),
tr( "Half note" ) )->setData(
(int) HALF_NOTE );
syncMenu->addAction( embed::getIconPixmap( "note_quarter" ),
tr( "Quarter note" ) )->setData(
(int) QUARTER_NOTE );
syncMenu->addAction( embed::getIconPixmap( "note_eighth" ),
tr( "8th note" ) )->setData(
(int) EIGHTH_NOTE );
syncMenu->addAction( embed::getIconPixmap( "note_sixteenth" ),
tr( "16th note" ) )->setData(
(int) SIXTEENTH_NOTE );
syncMenu->addAction( embed::getIconPixmap( "note_thirtysecond" ),
tr( "32nd note" ) )->setData(
(int) THIRTYSECOND_NOTE );
#else
QMenu * syncMenu = new QMenu( this );
int menuId;
menuId = syncMenu->addAction( embed::getIconPixmap( "note_none" ),
@@ -149,6 +177,8 @@ void tempoSyncKnob::contextMenuEvent( QContextMenuEvent * )
contextMenu.addMenu( m_tempoSyncIcon, m_tempoSyncDescription,
syncMenu );
#endif
contextMenu.addSeparator();
contextMenu.addAction( tr( "Connect to MIDI-device" ), this,
@@ -183,6 +213,19 @@ void tempoSyncKnob::wheelEvent( QWheelEvent * _we )
#ifdef QT4
void tempoSyncKnob::setTempoSync( QAction * _item )
{
setTempoSync( _item->data().toInt() );
}
#else
void tempoSyncKnob::setTempoSync( QAction * ) { }
#endif
void tempoSyncKnob::setTempoSync( int _note_type )
{
@@ -278,7 +321,7 @@ void tempoSyncKnob::calculateTempoSyncTime( int _bpm )
tempoSyncMode tempoSyncKnob::getSyncMode( void )
tempoSyncKnob::tempoSyncMode tempoSyncKnob::getSyncMode( void )
{
return( m_tempoSyncMode );
}

View File

@@ -46,7 +46,7 @@ toolButton::toolButton( const QPixmap & _pixmap, const QString & _tooltip,
}
toolTip::add( this, _tooltip );
setFixedSize( 30, 30 );
setPixmap( _pixmap );
setIcon( _pixmap );
leaveEvent( NULL );
}
@@ -59,9 +59,16 @@ toolButton::~toolButton()
void toolButton::enterEvent( QEvent * )
{
#ifdef QT4
QPalette pal;
pal.setColor( backgroundRole(), m_colorHighlighted );
setPalette( pal );
#else
setPaletteBackgroundColor( m_colorHighlighted );
#endif
}
@@ -69,6 +76,12 @@ void toolButton::enterEvent( QEvent * )
void toolButton::leaveEvent( QEvent * )
{
#ifdef QT4
QPalette pal;
pal.setColor( backgroundRole(), m_colorStandard );
setPalette( pal );
#else
setPaletteBackgroundColor( m_colorStandard );
#endif
}