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:
@@ -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 );
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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() );
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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 )
|
||||
{
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 )
|
||||
{
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
@@ -361,7 +361,7 @@ setupDialog::setupDialog( configTabs _tab_to_open ) :
|
||||
midi_layout->addStretch();
|
||||
|
||||
|
||||
#ifndef QT
|
||||
#ifndef QT4
|
||||
#define setIcon setPixmap
|
||||
#endif
|
||||
|
||||
|
||||
@@ -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() );
|
||||
|
||||
@@ -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" )
|
||||
);
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <Qt/QtXml>
|
||||
#include <QApplication>
|
||||
#include <QProgressDialog>
|
||||
#include <QWheelEvent>
|
||||
|
||||
#else
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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 ) );
|
||||
|
||||
@@ -86,7 +86,7 @@ midiALSARaw::midiALSARaw( void ) :
|
||||
|
||||
midiALSARaw::~midiALSARaw()
|
||||
{
|
||||
if( running() )
|
||||
if( isRunning() )
|
||||
{
|
||||
m_quit = TRUE;
|
||||
wait( 1000 );
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -81,7 +81,7 @@ midiOSS::midiOSS( void ) :
|
||||
|
||||
midiOSS::~midiOSS()
|
||||
{
|
||||
if( running() )
|
||||
if( isRunning() )
|
||||
{
|
||||
m_quit = TRUE;
|
||||
wait( 1000 );
|
||||
|
||||
@@ -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() ) );
|
||||
|
||||
}
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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 );
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 )
|
||||
{
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user