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:
@@ -26,21 +26,9 @@
|
||||
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtGui/QLineEdit>
|
||||
#include <QtGui/QLabel>
|
||||
|
||||
#else
|
||||
|
||||
#include <qpair.h>
|
||||
#include <qlineedit.h>
|
||||
#include <qlabel.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "audio_alsa.h"
|
||||
|
||||
@@ -71,11 +59,7 @@ audioALSA::audioALSA( const sample_rate_t _sample_rate, bool & _success_ful,
|
||||
int err;
|
||||
|
||||
if( ( err = snd_pcm_open( &m_handle,
|
||||
#ifdef QT4
|
||||
probeDevice().toAscii().constData(),
|
||||
#else
|
||||
probeDevice().ascii(),
|
||||
#endif
|
||||
SND_PCM_STREAM_PLAYBACK,
|
||||
0 ) ) < 0 )
|
||||
{
|
||||
|
||||
@@ -26,18 +26,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtGui/QMessageBox>
|
||||
|
||||
#else
|
||||
|
||||
#include <qmessagebox.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "audio_file_device.h"
|
||||
#include "export_project_dialog.h"
|
||||
@@ -58,11 +48,7 @@ audioFileDevice::audioFileDevice( const sample_rate_t _sample_rate,
|
||||
m_minBitrate( _min_bitrate ),
|
||||
m_maxBitrate( _max_bitrate )
|
||||
{
|
||||
#ifdef QT4
|
||||
if( m_outputFile.open( QFile::WriteOnly | QFile::Truncate ) == FALSE )
|
||||
#else
|
||||
if( m_outputFile.open( IO_WriteOnly | IO_Truncate ) == FALSE )
|
||||
#endif
|
||||
{
|
||||
QMessageBox::critical( NULL,
|
||||
exportProjectDialog::tr( "Could not open file" ),
|
||||
@@ -91,11 +77,7 @@ audioFileDevice::~audioFileDevice()
|
||||
|
||||
Sint32 audioFileDevice::writeData( const void * _data, Sint32 _len )
|
||||
{
|
||||
#ifdef QT4
|
||||
return( m_outputFile.write( (const char *) _data, _len ) );
|
||||
#else
|
||||
return( m_outputFile.writeBlock( (const char *) _data, _len ) );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -30,20 +30,10 @@
|
||||
|
||||
#ifdef JACK_SUPPORT
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtGui/QLineEdit>
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QMessageBox>
|
||||
|
||||
#else
|
||||
|
||||
#include <qlineedit.h>
|
||||
#include <qlabel.h>
|
||||
#include <qmessagebox.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -83,12 +73,7 @@ audioJACK::audioJACK( const sample_rate_t _sample_rate, bool & _success_ful,
|
||||
#ifndef OLD_JACK
|
||||
const char * server_name = NULL;
|
||||
jack_status_t status;
|
||||
m_client = jack_client_open( client_name.
|
||||
#ifdef QT4
|
||||
toAscii().constData(),
|
||||
#else
|
||||
ascii(),
|
||||
#endif
|
||||
m_client = jack_client_open( client_name.toAscii().constData(),
|
||||
JackNullOption, &status,
|
||||
server_name );
|
||||
if( m_client == NULL )
|
||||
@@ -104,23 +89,13 @@ audioJACK::audioJACK( const sample_rate_t _sample_rate, bool & _success_ful,
|
||||
{
|
||||
printf( "there's already a client with name '%s', so unique "
|
||||
"name '%s' was assigned\n", client_name.
|
||||
#ifdef QT4
|
||||
toAscii().constData(),
|
||||
#else
|
||||
ascii(),
|
||||
#endif
|
||||
jack_get_client_name( m_client ) );
|
||||
}
|
||||
|
||||
#else /* OLD_JACK */
|
||||
|
||||
m_client = jack_client_new( client_name.
|
||||
#ifdef QT4
|
||||
toAscii().constData()
|
||||
#else
|
||||
ascii()
|
||||
#endif
|
||||
);
|
||||
m_client = jack_client_new( client_name.toAscii().constData() );
|
||||
if( m_client == NULL )
|
||||
{
|
||||
printf( "jack_client_new() failed\n" );
|
||||
@@ -150,11 +125,7 @@ audioJACK::audioJACK( const sample_rate_t _sample_rate, bool & _success_ful,
|
||||
( ( ch % 2 ) ? "R" : "L" ) +
|
||||
QString::number( ch / 2 + 1 );
|
||||
m_outputPorts.push_back( jack_port_register( m_client,
|
||||
#ifdef QT4
|
||||
name.toAscii().constData(),
|
||||
#else
|
||||
name.ascii(),
|
||||
#endif
|
||||
JACK_DEFAULT_AUDIO_TYPE,
|
||||
JackPortIsOutput, 0 ) );
|
||||
if( m_outputPorts.back() == NULL )
|
||||
@@ -164,12 +135,7 @@ audioJACK::audioJACK( const sample_rate_t _sample_rate, bool & _success_ful,
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef QT3
|
||||
m_stop_semaphore.acquire();
|
||||
#else
|
||||
m_stop_semaphore++;
|
||||
#endif
|
||||
|
||||
|
||||
_success_ful = TRUE;
|
||||
}
|
||||
@@ -179,11 +145,7 @@ audioJACK::audioJACK( const sample_rate_t _sample_rate, bool & _success_ful,
|
||||
|
||||
audioJACK::~audioJACK()
|
||||
{
|
||||
#ifndef QT3
|
||||
m_stop_semaphore.release();
|
||||
#else
|
||||
m_stop_semaphore--;
|
||||
#endif
|
||||
|
||||
while( m_portMap.size() )
|
||||
{
|
||||
@@ -267,11 +229,7 @@ void audioJACK::startProcessing( void )
|
||||
|
||||
void audioJACK::stopProcessing( void )
|
||||
{
|
||||
#ifndef QT3
|
||||
m_stop_semaphore.acquire();
|
||||
#else
|
||||
m_stop_semaphore++;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -288,14 +246,9 @@ void audioJACK::registerPort( audioPort * _port )
|
||||
for( Uint8 ch = 0; ch < DEFAULT_CHANNELS; ++ch )
|
||||
{
|
||||
m_portMap[_port].ports[ch] = jack_port_register( m_client,
|
||||
name[ch].
|
||||
#ifdef QT4
|
||||
toAscii().constData(),
|
||||
#else
|
||||
ascii(),
|
||||
#endif
|
||||
JACK_DEFAULT_AUDIO_TYPE,
|
||||
JackPortIsOutput, 0 );
|
||||
name[ch].toAscii().constData(),
|
||||
JACK_DEFAULT_AUDIO_TYPE,
|
||||
JackPortIsOutput, 0 );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -334,13 +287,7 @@ void audioJACK::renamePort( audioPort * _port )
|
||||
for( Uint8 ch = 0; ch < DEFAULT_CHANNELS; ++ch )
|
||||
{
|
||||
jack_port_set_name( m_portMap[_port].ports[ch],
|
||||
name[ch].
|
||||
#ifdef QT4
|
||||
toAscii().constData()
|
||||
#else
|
||||
ascii()
|
||||
#endif
|
||||
) ;
|
||||
name[ch].toAscii().constData() );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -361,10 +308,10 @@ int audioJACK::processCallback( jack_nframes_t _nframes, void * _udata )
|
||||
jack_transport_state_t ts = jack_transport_query( _this->m_client,
|
||||
NULL );
|
||||
|
||||
vvector<jack_default_audio_sample_t *> outbufs( _this->channels(),
|
||||
QVector<jack_default_audio_sample_t *> outbufs( _this->channels(),
|
||||
NULL );
|
||||
Uint8 chnl = 0;
|
||||
for( vvector<jack_default_audio_sample_t *>::iterator it =
|
||||
for( QVector<jack_default_audio_sample_t *>::iterator it =
|
||||
outbufs.begin(); it != outbufs.end(); ++it, ++chnl )
|
||||
{
|
||||
*it = (jack_default_audio_sample_t *) jack_port_get_buffer(
|
||||
@@ -424,11 +371,7 @@ int audioJACK::processCallback( jack_nframes_t _nframes, void * _udata )
|
||||
if( !_this->m_framesToDoInCurBuf )
|
||||
{
|
||||
_this->m_stopped = TRUE;
|
||||
#ifndef QT3
|
||||
_this->m_stop_semaphore.release();
|
||||
#else
|
||||
_this->m_stop_semaphore--;
|
||||
#endif
|
||||
}
|
||||
_this->m_framesDoneInCurBuf = 0;
|
||||
}
|
||||
|
||||
@@ -30,23 +30,10 @@
|
||||
|
||||
#ifdef OSS_SUPPORT
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QLineEdit>
|
||||
|
||||
#else
|
||||
|
||||
#include <qfileinfo.h>
|
||||
#include <qlineedit.h>
|
||||
#include <qlabel.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "endian_handling.h"
|
||||
#include "lcd_spinbox.h"
|
||||
#include "gui_templates.h"
|
||||
@@ -102,13 +89,7 @@ audioOSS::audioOSS( const sample_rate_t _sample_rate, bool & _success_ful,
|
||||
{
|
||||
_success_ful = FALSE;
|
||||
|
||||
m_audioFD = open(
|
||||
#ifdef QT4
|
||||
probeDevice().toAscii().constData(),
|
||||
#else
|
||||
probeDevice().ascii(),
|
||||
#endif
|
||||
O_WRONLY, 0 );
|
||||
m_audioFD = open( probeDevice().toAscii().constData(), O_WRONLY, 0 );
|
||||
|
||||
if( m_audioFD == -1 )
|
||||
{
|
||||
@@ -286,15 +267,7 @@ void audioOSS::startProcessing( void )
|
||||
{
|
||||
if( !isRunning() )
|
||||
{
|
||||
start(
|
||||
#ifdef QT4
|
||||
QThread::HighPriority
|
||||
#else
|
||||
#if QT_VERSION >= 0x030505
|
||||
QThread::HighestPriority
|
||||
#endif
|
||||
#endif
|
||||
);
|
||||
start( QThread::HighPriority );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,25 +25,12 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QPushButton>
|
||||
#include <QtGui/QResizeEvent>
|
||||
#include <QtGui/QTabWidget>
|
||||
#include <QtGui/QTextEdit>
|
||||
|
||||
#else
|
||||
|
||||
#include <qtextedit.h>
|
||||
#include <qtabwidget.h>
|
||||
#include <qlabel.h>
|
||||
#include <qpushbutton.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
|
||||
@@ -26,21 +26,9 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <Qt/QtXml>
|
||||
#include <QtGui/QLabel>
|
||||
|
||||
#else
|
||||
|
||||
#include <qdom.h>
|
||||
#include <qlabel.h>
|
||||
#include <qwhatsthis.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "arp_and_chords_tab_widget.h"
|
||||
#include "combobox.h"
|
||||
@@ -208,10 +196,7 @@ arpAndChordsTabWidget::arpAndChordsTabWidget(
|
||||
for( int i = 0; s_chords[i].interval[0] != -1; ++i )
|
||||
{
|
||||
m_chordsComboBox->addItem( tr( s_chords[i].name
|
||||
#ifdef QT4
|
||||
.toAscii().constData()
|
||||
#endif
|
||||
) );
|
||||
.toAscii().constData() ) );
|
||||
}
|
||||
|
||||
m_chordRangeKnob = new knob( knobBright_26, m_chordsGroupBox,
|
||||
@@ -223,11 +208,7 @@ arpAndChordsTabWidget::arpAndChordsTabWidget(
|
||||
m_chordRangeKnob->move( 164, 24 );
|
||||
m_chordRangeKnob->setHintText( tr( "Chord range:" ) + " ", " " +
|
||||
tr( "octave(s)" ) );
|
||||
#ifdef QT4
|
||||
m_chordRangeKnob->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_chordRangeKnob,
|
||||
#endif
|
||||
tr( "Use this knob for setting the chord range in octaves. "
|
||||
"The selected chord will be played within specified "
|
||||
"amount of octaves." ) );
|
||||
@@ -241,11 +222,7 @@ arpAndChordsTabWidget::arpAndChordsTabWidget(
|
||||
ARP_GROUPBOX_WIDTH,
|
||||
ARP_GROUPBOX_HEIGHT );
|
||||
|
||||
#ifdef QT4
|
||||
m_arpGroupBox->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_arpGroupBox,
|
||||
#endif
|
||||
tr( "An arpeggio is a type of playing (especially plucked) "
|
||||
"instruments, which makes the music much livelier. "
|
||||
"The strings of such instruments (e.g. harps) are "
|
||||
@@ -262,10 +239,7 @@ arpAndChordsTabWidget::arpAndChordsTabWidget(
|
||||
for( int i = 0; s_chords[i].interval[0] != -1; ++i )
|
||||
{
|
||||
m_arpComboBox->addItem( tr( s_chords[i].name
|
||||
#ifdef QT4
|
||||
.toAscii().constData()
|
||||
#endif
|
||||
) );
|
||||
.toAscii().constData() ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -278,11 +252,7 @@ arpAndChordsTabWidget::arpAndChordsTabWidget(
|
||||
m_arpRangeKnob->move( 164, 24 );
|
||||
m_arpRangeKnob->setHintText( tr( "Arpeggio range:" ) + " ", " " +
|
||||
tr( "octave(s)" ) );
|
||||
#ifdef QT4
|
||||
m_arpRangeKnob->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_arpRangeKnob,
|
||||
#endif
|
||||
tr( "Use this knob for setting the arpeggio range in octaves. "
|
||||
"The selected arpeggio will be played within specified "
|
||||
"amount of octaves." ) );
|
||||
@@ -296,11 +266,7 @@ arpAndChordsTabWidget::arpAndChordsTabWidget(
|
||||
m_arpTimeKnob->move( 164, 70 );
|
||||
m_arpTimeKnob->setHintText( tr( "Arpeggio time:" ) + " ", " " +
|
||||
tr( "ms" ) );
|
||||
#ifdef QT4
|
||||
m_arpTimeKnob->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_arpTimeKnob,
|
||||
#endif
|
||||
tr( "Use this knob for setting the arpeggio time in "
|
||||
"milliseconds. The arpeggio time specifies how long "
|
||||
"each arpeggio-tone should be played." ) );
|
||||
@@ -313,11 +279,7 @@ arpAndChordsTabWidget::arpAndChordsTabWidget(
|
||||
m_arpGateKnob->setInitValue( 100.0f );
|
||||
m_arpGateKnob->move( 204, 70 );
|
||||
m_arpGateKnob->setHintText( tr( "Arpeggio gate:" ) + " ", tr( "%" ) );
|
||||
#ifdef QT4
|
||||
m_arpGateKnob->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_arpGateKnob,
|
||||
#endif
|
||||
tr( "Use this knob for setting the arpeggio gate. The "
|
||||
"arpeggio gate specifies the percent of a whole "
|
||||
"arpeggio-tone that should be played. With this you "
|
||||
@@ -334,9 +296,6 @@ arpAndChordsTabWidget::arpAndChordsTabWidget(
|
||||
arp_up_btn->move( 10, 74 );
|
||||
arp_up_btn->setActiveGraphic( embed::getIconPixmap( "arp_up_on" ) );
|
||||
arp_up_btn->setInactiveGraphic( embed::getIconPixmap( "arp_up_off" ) );
|
||||
#ifdef QT3
|
||||
arp_up_btn->setBackgroundMode( Qt::PaletteBackground );
|
||||
#endif
|
||||
toolTip::add( arp_up_btn, tr( "arpeggio direction = up" ) );
|
||||
|
||||
|
||||
@@ -346,9 +305,6 @@ arpAndChordsTabWidget::arpAndChordsTabWidget(
|
||||
arp_down_btn->setActiveGraphic( embed::getIconPixmap( "arp_down_on" ) );
|
||||
arp_down_btn->setInactiveGraphic( embed::getIconPixmap(
|
||||
"arp_down_off" ) );
|
||||
#ifdef QT3
|
||||
arp_down_btn->setBackgroundMode( Qt::PaletteBackground );
|
||||
#endif
|
||||
toolTip::add( arp_down_btn, tr( "arpeggio direction = down" ) );
|
||||
|
||||
|
||||
@@ -359,9 +315,6 @@ arpAndChordsTabWidget::arpAndChordsTabWidget(
|
||||
"arp_up_and_down_on" ) );
|
||||
arp_up_and_down_btn->setInactiveGraphic( embed::getIconPixmap(
|
||||
"arp_up_and_down_off" ) );
|
||||
#ifdef QT3
|
||||
arp_up_and_down_btn->setBackgroundMode( Qt::PaletteBackground );
|
||||
#endif
|
||||
toolTip::add( arp_up_and_down_btn,
|
||||
tr( "arpeggio direction = up and down" ) );
|
||||
|
||||
@@ -373,9 +326,6 @@ arpAndChordsTabWidget::arpAndChordsTabWidget(
|
||||
"arp_random_on" ) );
|
||||
arp_random_btn->setInactiveGraphic( embed::getIconPixmap(
|
||||
"arp_random_off" ) );
|
||||
#ifdef QT3
|
||||
arp_random_btn->setBackgroundMode( Qt::PaletteBackground );
|
||||
#endif
|
||||
toolTip::add( arp_random_btn, tr( "arpeggio direction = random" ) );
|
||||
|
||||
m_arpDirectionBtnGrp = new automatableButtonGroup( this,
|
||||
|
||||
@@ -26,10 +26,6 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <Qt/QtXml>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QButtonGroup>
|
||||
@@ -38,20 +34,7 @@
|
||||
#include <QtGui/QWheelEvent>
|
||||
#include <QtGui/QLayout>
|
||||
#include <QtGui/QLabel>
|
||||
|
||||
#else
|
||||
|
||||
#include <qapplication.h>
|
||||
#include <qbuttongroup.h>
|
||||
#include <qpainter.h>
|
||||
#include <qlayout.h>
|
||||
#include <qlabel.h>
|
||||
#include <qdom.h>
|
||||
|
||||
#define addButton insert
|
||||
#define setCheckable setToggleButton
|
||||
|
||||
#endif
|
||||
#include <QtGui/QScrollBar>
|
||||
|
||||
|
||||
#ifndef __USE_XOPEN
|
||||
@@ -127,10 +110,8 @@ automationEditor::automationEditor( void ) :
|
||||
"edit_move" ) );
|
||||
}
|
||||
|
||||
#ifdef QT4
|
||||
// add us to workspace
|
||||
engine::getMainWindow()->workspace()->addWindow( this );
|
||||
#endif
|
||||
|
||||
// add time-line
|
||||
m_timeLine = new timeLine( VALUES_WIDTH, 32, m_ppt,
|
||||
@@ -146,16 +127,11 @@ automationEditor::automationEditor( void ) :
|
||||
m_toolBar = new QWidget( this );
|
||||
m_toolBar->setFixedHeight( 32 );
|
||||
m_toolBar->move( 0, 0 );
|
||||
#ifdef QT4
|
||||
m_toolBar->setAutoFillBackground( TRUE );
|
||||
QPalette pal;
|
||||
pal.setBrush( m_toolBar->backgroundRole(),
|
||||
embed::getIconPixmap( "toolbar_bg" ) );
|
||||
m_toolBar->setPalette( pal );
|
||||
#else
|
||||
m_toolBar->setPaletteBackgroundPixmap( embed::getIconPixmap(
|
||||
"toolbar_bg" ) );
|
||||
#endif
|
||||
|
||||
QHBoxLayout * tb_layout = new QHBoxLayout( m_toolBar );
|
||||
tb_layout->setMargin( 0 );
|
||||
@@ -172,19 +148,11 @@ automationEditor::automationEditor( void ) :
|
||||
tr( "Stop playing of current pattern (Space)" ),
|
||||
this, SLOT( stop() ), m_toolBar );
|
||||
|
||||
#ifdef QT4
|
||||
m_playButton->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_playButton,
|
||||
#endif
|
||||
tr( "Click here, if you want to play the current pattern. "
|
||||
"This is useful while editing it. The pattern is "
|
||||
"automatically looped when its end is reached." ) );
|
||||
#ifdef QT4
|
||||
m_stopButton->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_stopButton,
|
||||
#endif
|
||||
tr( "Click here, if you want to stop playing of current "
|
||||
"pattern." ) );
|
||||
|
||||
@@ -233,43 +201,24 @@ automationEditor::automationEditor( void ) :
|
||||
tool_button_group->addButton( m_selectButton );
|
||||
tool_button_group->addButton( m_moveButton );
|
||||
tool_button_group->setExclusive( TRUE );
|
||||
#ifndef QT4
|
||||
tool_button_group->hide();
|
||||
#endif
|
||||
|
||||
#ifdef QT4
|
||||
m_drawButton->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_drawButton,
|
||||
#endif
|
||||
tr( "If you click here, draw-mode will be activated. In this "
|
||||
"mode you can add and move single values. This "
|
||||
"is the default-mode which is used most of the time. "
|
||||
"You can also press 'Shift+D' on your keyboard to "
|
||||
"activate this mode." ) );
|
||||
#ifdef QT4
|
||||
m_eraseButton->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_eraseButton,
|
||||
#endif
|
||||
tr( "If you click here, erase-mode will be activated. In this "
|
||||
"mode you can erase single values. You can also press "
|
||||
"'Shift+E' on your keyboard to activate this mode." ) );
|
||||
#ifdef QT4
|
||||
m_selectButton->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_selectButton,
|
||||
#endif
|
||||
tr( "If you click here, select-mode will be activated. In this "
|
||||
"mode you can select values. This is neccessary "
|
||||
"if you want to cut, copy, paste, delete or move "
|
||||
"values. You can also press 'Shift+S' on your keyboard "
|
||||
"to activate this mode." ) );
|
||||
#ifdef QT4
|
||||
m_moveButton->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_moveButton,
|
||||
#endif
|
||||
tr( "If you click here, move-mode will be activated. In this "
|
||||
"mode you can move the values you selected in select-"
|
||||
"mode. You can also press 'Shift+M' on your keyboard "
|
||||
@@ -291,27 +240,15 @@ automationEditor::automationEditor( void ) :
|
||||
this, SLOT( pasteValues() ),
|
||||
m_toolBar );
|
||||
|
||||
#ifdef QT4
|
||||
m_cutButton->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_cutButton,
|
||||
#endif
|
||||
tr( "If you click here, selected values will be cut into the "
|
||||
"clipboard. You can paste them anywhere in any pattern "
|
||||
"by clicking on the paste-button." ) );
|
||||
#ifdef QT4
|
||||
m_copyButton->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_copyButton,
|
||||
#endif
|
||||
tr( "If you click here, selected values will be copied into "
|
||||
"the clipboard. You can paste them anywhere in any "
|
||||
"pattern by clicking on the paste-button." ) );
|
||||
#ifdef QT4
|
||||
m_pasteButton->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_pasteButton,
|
||||
#endif
|
||||
tr( "If you click here, the values from the clipboard will be "
|
||||
"pasted at the first visible tact." ) );
|
||||
|
||||
@@ -393,9 +330,6 @@ automationEditor::automationEditor( void ) :
|
||||
resize( INITIAL_WIDTH, INITIAL_HEIGHT );
|
||||
setCurrentPattern( NULL );
|
||||
|
||||
#ifndef QT4
|
||||
setBackgroundMode( Qt::NoBackground );
|
||||
#endif
|
||||
setMouseTracking( TRUE );
|
||||
|
||||
hide();
|
||||
@@ -439,11 +373,7 @@ void automationEditor::setCurrentPattern( automationPattern * _new_pattern )
|
||||
for( timeMap::iterator it = time_map.begin();
|
||||
it != time_map.end(); ++it )
|
||||
{
|
||||
#ifdef QT3
|
||||
central_key += it.data();
|
||||
#else
|
||||
central_key += it.value();
|
||||
#endif
|
||||
++total_values;
|
||||
}
|
||||
|
||||
@@ -679,11 +609,7 @@ void automationEditor::updatePaintPixmap( QPixmap & _p )
|
||||
--it;
|
||||
Sint32 len_tact_64th = 4;
|
||||
|
||||
#ifdef QT3
|
||||
const int level = it.data();
|
||||
#else
|
||||
const int level = it.value();
|
||||
#endif
|
||||
|
||||
Sint32 pos_tact_64th = -it.key();
|
||||
|
||||
@@ -813,12 +739,8 @@ void automationEditor::updatePaintPixmap( QPixmap & _p )
|
||||
|
||||
// reset scroll-range
|
||||
m_leftRightScroll->setRange( 0, l );
|
||||
#ifdef QT4
|
||||
m_leftRightScroll->setSingleStep( 1 );
|
||||
m_leftRightScroll->setPageStep( l );
|
||||
#else
|
||||
m_leftRightScroll->setSteps( 1, l );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -1048,11 +970,7 @@ void automationEditor::mousePressEvent( QMouseEvent * _me )
|
||||
if( pos_tact_64th >= -it.key() &&
|
||||
len > 0 &&
|
||||
pos_tact_64th <= -it.key() + len &&
|
||||
#ifdef QT3
|
||||
it.data() == level )
|
||||
#else
|
||||
it.value() == level )
|
||||
#endif
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -1187,13 +1105,7 @@ void automationEditor::mouseMoveEvent( QMouseEvent * _me )
|
||||
}
|
||||
x -= VALUES_WIDTH;
|
||||
|
||||
if(
|
||||
#ifdef QT4
|
||||
_me->buttons() &
|
||||
#else
|
||||
_me->state() ==
|
||||
#endif
|
||||
Qt::LeftButton && m_editMode == DRAW )
|
||||
if( _me->buttons() & Qt::LeftButton && m_editMode == DRAW )
|
||||
{
|
||||
if( m_action == MOVE_VALUE )
|
||||
{
|
||||
@@ -1221,13 +1133,7 @@ void automationEditor::mouseMoveEvent( QMouseEvent * _me )
|
||||
engine::getSongEditor()->setModified();
|
||||
|
||||
}
|
||||
else if(
|
||||
#ifdef QT4
|
||||
_me->buttons() &
|
||||
#else
|
||||
_me->state() ==
|
||||
#endif
|
||||
Qt::NoButton && m_editMode == DRAW )
|
||||
else if( _me->buttons() & Qt::NoButton && m_editMode == DRAW )
|
||||
{
|
||||
// set move- or resize-cursor
|
||||
|
||||
@@ -1249,12 +1155,7 @@ void automationEditor::mouseMoveEvent( QMouseEvent * _me )
|
||||
if( pos_tact_64th >= -it.key() &&
|
||||
pos_tact_64th <= -it.key() +
|
||||
//TODO: Add constant
|
||||
4 &&
|
||||
#ifdef QT3
|
||||
it.data() == level )
|
||||
#else
|
||||
it.value() == level )
|
||||
#endif
|
||||
4 && it.value() == level )
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -1295,13 +1196,7 @@ void automationEditor::mouseMoveEvent( QMouseEvent * _me )
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(
|
||||
#ifdef QT4
|
||||
_me->buttons() &
|
||||
#else
|
||||
_me->modifiers() ==
|
||||
#endif
|
||||
Qt::LeftButton &&
|
||||
else if( _me->buttons() & Qt::LeftButton &&
|
||||
m_editMode == SELECT &&
|
||||
m_action == SELECT_VALUES )
|
||||
{
|
||||
@@ -1350,13 +1245,7 @@ void automationEditor::mouseMoveEvent( QMouseEvent * _me )
|
||||
--m_selectedLevels;
|
||||
}
|
||||
}
|
||||
else if(
|
||||
#ifdef QT4
|
||||
_me->buttons() &
|
||||
#else
|
||||
_me->modifiers() ==
|
||||
#endif
|
||||
Qt::LeftButton &&
|
||||
else if( _me->buttons() & Qt::LeftButton &&
|
||||
m_editMode == MOVE &&
|
||||
m_action == MOVE_SELECTION )
|
||||
{
|
||||
@@ -1452,19 +1341,11 @@ void automationEditor::mouseMoveEvent( QMouseEvent * _me )
|
||||
new_value_pos = midiTime( value_tact,
|
||||
value_tact_64th );
|
||||
}
|
||||
#ifdef QT3
|
||||
new_selValuesForMove[
|
||||
-m_pattern->putValue( new_value_pos,
|
||||
it.data () + level_diff,
|
||||
FALSE )]
|
||||
= it.data() + level_diff;
|
||||
#else
|
||||
new_selValuesForMove[
|
||||
-m_pattern->putValue( new_value_pos,
|
||||
it.value () + level_diff,
|
||||
FALSE )]
|
||||
= it.value() + level_diff;
|
||||
#endif
|
||||
}
|
||||
m_selValuesForMove = new_selValuesForMove;
|
||||
|
||||
@@ -1474,13 +1355,7 @@ void automationEditor::mouseMoveEvent( QMouseEvent * _me )
|
||||
}
|
||||
else
|
||||
{
|
||||
if(
|
||||
#ifdef QT4
|
||||
_me->buttons() &
|
||||
#else
|
||||
_me->modifiers() ==
|
||||
#endif
|
||||
Qt::LeftButton &&
|
||||
if( _me->buttons() & Qt::LeftButton &&
|
||||
m_editMode == SELECT &&
|
||||
m_action == SELECT_VALUES )
|
||||
{
|
||||
@@ -1581,14 +1456,7 @@ void automationEditor::paintEvent( QPaintEvent * )
|
||||
{
|
||||
QPixmap paintPixmap( size() );
|
||||
updatePaintPixmap( paintPixmap );
|
||||
#ifdef QT4
|
||||
QPainter p( this );
|
||||
#else
|
||||
QPixmap draw_pm( size() );
|
||||
draw_pm.fill( QColor( 0, 0, 0 ) );
|
||||
|
||||
QPainter p( &draw_pm, this );
|
||||
#endif
|
||||
p.drawPixmap( 0, 0, paintPixmap );
|
||||
|
||||
p.setClipRect( VALUES_WIDTH, TOP_MARGIN, width() - VALUES_WIDTH,
|
||||
@@ -1611,10 +1479,6 @@ void automationEditor::paintEvent( QPaintEvent * )
|
||||
p.drawPixmap( mapFromGlobal( QCursor::pos() ) + QPoint( 8, 8 ),
|
||||
*cursor );
|
||||
|
||||
#ifndef QT4
|
||||
// and blit all the drawn stuff on the screen...
|
||||
bitBlt( this, rect().topLeft(), &draw_pm );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -1646,12 +1510,8 @@ void automationEditor::resizeEvent( QResizeEvent * )
|
||||
m_topBottomScroll->setRange( m_scroll_level, m_scroll_level );
|
||||
}
|
||||
|
||||
#ifdef QT4
|
||||
m_topBottomScroll->setSingleStep( 1 );
|
||||
m_topBottomScroll->setPageStep( 20 );
|
||||
#else
|
||||
m_topBottomScroll->setSteps( 1, 20 );
|
||||
#endif
|
||||
|
||||
m_topBottomScroll->setValue( m_scroll_level );
|
||||
|
||||
@@ -1915,20 +1775,12 @@ void automationEditor::selectAll( void )
|
||||
timeMap::iterator it = time_map.begin();
|
||||
m_selectStartTact64th = 0;
|
||||
m_selectedTact64th = -it.key() + len_tact_64th;
|
||||
#ifdef QT3
|
||||
m_selectStartLevel = it.data();
|
||||
#else
|
||||
m_selectStartLevel = it.value();
|
||||
#endif
|
||||
m_selectedLevels = 1;
|
||||
|
||||
while( ++it != time_map.end() )
|
||||
{
|
||||
#ifdef QT3
|
||||
const int level = it.data();
|
||||
#else
|
||||
const int level = it.value();
|
||||
#endif
|
||||
if( level < m_selectStartLevel )
|
||||
{
|
||||
// if we move start-level down, we have to add
|
||||
@@ -1978,11 +1830,7 @@ void automationEditor::getSelectedValues( timeMap & _selected_values )
|
||||
//TODO: Add constant
|
||||
Sint32 len_tact_64th = 4;
|
||||
|
||||
#ifdef QT3
|
||||
int level = it.data();
|
||||
#else
|
||||
int level = it.value();
|
||||
#endif
|
||||
Sint32 pos_tact_64th = -it.key();
|
||||
|
||||
if( level >= sel_level_start && level <= sel_level_end &&
|
||||
@@ -2009,11 +1857,7 @@ void automationEditor::copySelectedValues( void )
|
||||
for( timeMap::iterator it = selected_values.begin();
|
||||
it != selected_values.end(); ++it )
|
||||
{
|
||||
#ifdef QT3
|
||||
m_valuesToCopy[it.key()] = it.data();
|
||||
#else
|
||||
m_valuesToCopy[it.key()] = it.value();
|
||||
#endif
|
||||
}
|
||||
textFloat::displayMessage( tr( "Values copied" ),
|
||||
tr( "All selected values were copied to the "
|
||||
@@ -2044,11 +1888,7 @@ void automationEditor::cutSelectedValues( void )
|
||||
for( timeMap::iterator it = selected_values.begin();
|
||||
it != selected_values.end(); ++it )
|
||||
{
|
||||
#ifdef QT3
|
||||
m_valuesToCopy[it.key()] = it.data();
|
||||
#else
|
||||
m_valuesToCopy[it.key()] = it.value();
|
||||
#endif
|
||||
m_pattern->removeValue( -it.key() );
|
||||
}
|
||||
}
|
||||
@@ -2073,11 +1913,7 @@ void automationEditor::pasteValues( void )
|
||||
it != m_valuesToCopy.end(); ++it )
|
||||
{
|
||||
m_pattern->putValue( -it.key() + m_currentPosition,
|
||||
#ifdef QT3
|
||||
it.data() );
|
||||
#else
|
||||
it.value() );
|
||||
#endif
|
||||
}
|
||||
|
||||
// we only have to do the following lines if we pasted at
|
||||
@@ -2247,10 +2083,4 @@ void automationEditor::update( void )
|
||||
#include "automation_editor.moc"
|
||||
|
||||
|
||||
#ifdef QT3
|
||||
#undef addButton
|
||||
#undef setCheckable
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -26,19 +26,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <Qt/QtXml>
|
||||
|
||||
#else
|
||||
|
||||
#include <qdom.h>
|
||||
#define value data
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "automation_pattern.h"
|
||||
#include "automation_editor.h"
|
||||
|
||||
@@ -25,23 +25,11 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtGui/QKeyEvent>
|
||||
#include <QtGui/QCloseEvent>
|
||||
#include <QtGui/QLayout>
|
||||
|
||||
#else
|
||||
|
||||
#include <qpainter.h>
|
||||
#include <qlayout.h>
|
||||
#include <qwhatsthis.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "bb_editor.h"
|
||||
#include "song_editor.h"
|
||||
@@ -69,16 +57,11 @@ bbEditor::bbEditor( void )
|
||||
m_toolBar = new QWidget( this );
|
||||
m_toolBar->setFixedHeight( 32 );
|
||||
m_toolBar->move( 0, 0 );
|
||||
#ifdef QT4
|
||||
m_toolBar->setAutoFillBackground( TRUE );
|
||||
QPalette pal;
|
||||
pal.setBrush( m_toolBar->backgroundRole(),
|
||||
embed::getIconPixmap( "toolbar_bg" ) );
|
||||
m_toolBar->setPalette( pal );
|
||||
#else
|
||||
m_toolBar->setPaletteBackgroundPixmap( embed::getIconPixmap(
|
||||
"toolbar_bg" ) );
|
||||
#endif
|
||||
|
||||
QHBoxLayout * tb_layout = new QHBoxLayout( m_toolBar );
|
||||
tb_layout->setMargin( 0 );
|
||||
@@ -121,19 +104,11 @@ bbEditor::bbEditor( void )
|
||||
m_toolBar );
|
||||
|
||||
|
||||
#ifdef QT4
|
||||
m_playButton->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_playButton,
|
||||
#endif
|
||||
tr( "Click here, if you want to play the current "
|
||||
"beat/bassline. The beat/bassline is automatically "
|
||||
"looped when its end is reached." ) );
|
||||
#ifdef QT4
|
||||
m_stopButton->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_stopButton,
|
||||
#endif
|
||||
tr( "Click here, if you want to stop playing of current "
|
||||
"beat/bassline." ) );
|
||||
|
||||
@@ -169,9 +144,9 @@ bbEditor::~bbEditor()
|
||||
|
||||
|
||||
|
||||
csize bbEditor::currentBB( void ) const
|
||||
int bbEditor::currentBB( void ) const
|
||||
{
|
||||
return( static_cast<csize>( currentPosition().getTact() ) );
|
||||
return( static_cast<int>( currentPosition().getTact() ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -185,25 +160,25 @@ void bbEditor::setCurrentBB( int _bb )
|
||||
}
|
||||
|
||||
// first make sure, all channels have a TCO at current BB
|
||||
createTCOsForBB( static_cast<csize>( _bb ) );
|
||||
createTCOsForBB( static_cast<int>( _bb ) );
|
||||
|
||||
realignTracks();
|
||||
|
||||
// now update all track-labels (the current one has to become white,
|
||||
// the others green)
|
||||
for( csize i = 0; i < numOfBBs(); ++i )
|
||||
for( int i = 0; i < numOfBBs(); ++i )
|
||||
{
|
||||
bbTrack::findBBTrack( i )->trackLabel()->update();
|
||||
}
|
||||
|
||||
emit positionChanged( m_currentPosition = midiTime(
|
||||
static_cast<csize>( _bb ), 0 ) );
|
||||
static_cast<int>( _bb ), 0 ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
tact bbEditor::lengthOfBB( csize _bb )
|
||||
tact bbEditor::lengthOfBB( int _bb )
|
||||
{
|
||||
midiTime max_length;
|
||||
|
||||
@@ -255,7 +230,7 @@ bool FASTCALL bbEditor::play( midiTime _start, fpp_t _frames,
|
||||
|
||||
|
||||
|
||||
csize bbEditor::numOfBBs( void ) const
|
||||
int bbEditor::numOfBBs( void ) const
|
||||
{
|
||||
return( engine::getSongEditor()->countTracks( track::BB_TRACK ) );
|
||||
}
|
||||
@@ -263,7 +238,7 @@ csize bbEditor::numOfBBs( void ) const
|
||||
|
||||
|
||||
|
||||
void bbEditor::removeBB( csize _bb )
|
||||
void bbEditor::removeBB( int _bb )
|
||||
{
|
||||
trackVector tv = tracks();
|
||||
for( trackVector::iterator it = tv.begin(); it != tv.end(); ++it )
|
||||
@@ -296,11 +271,11 @@ void bbEditor::updateComboBox( void )
|
||||
disconnect( m_bbComboBox, SIGNAL( valueChanged( int ) ),
|
||||
this, SLOT( setCurrentBB( int ) ) );
|
||||
|
||||
csize current_bb = currentBB();
|
||||
int current_bb = currentBB();
|
||||
|
||||
m_bbComboBox->clear();
|
||||
|
||||
for( csize i = 0; i < numOfBBs(); ++i )
|
||||
for( int i = 0; i < numOfBBs(); ++i )
|
||||
{
|
||||
bbTrack * bbt = bbTrack::findBBTrack( i );
|
||||
m_bbComboBox->addItem( bbt->trackLabel()->text(),
|
||||
@@ -451,7 +426,7 @@ void bbEditor::loadSettings( const QDomElement & _this )
|
||||
void bbEditor::updateAfterTrackAdd( void )
|
||||
{
|
||||
// make sure, new track(s) have TCOs for every beat/bassline
|
||||
for( csize i = 0; i < tMax<csize>( 1, numOfBBs() ); ++i )
|
||||
for( int i = 0; i < tMax<int>( 1, numOfBBs() ); ++i )
|
||||
{
|
||||
createTCOsForBB( i );
|
||||
}
|
||||
@@ -460,7 +435,7 @@ void bbEditor::updateAfterTrackAdd( void )
|
||||
|
||||
|
||||
|
||||
void bbEditor::createTCOsForBB( csize _bb )
|
||||
void bbEditor::createTCOsForBB( int _bb )
|
||||
{
|
||||
if( numOfBBs() == 0 )
|
||||
{
|
||||
@@ -484,7 +459,7 @@ void bbEditor::createTCOsForBB( csize _bb )
|
||||
|
||||
|
||||
|
||||
void bbEditor::swapBB( csize _bb1, csize _bb2 )
|
||||
void bbEditor::swapBB( int _bb1, int _bb2 )
|
||||
{
|
||||
trackVector tv = tracks();
|
||||
for( trackVector::iterator it = tv.begin(); it != tv.end(); ++it )
|
||||
|
||||
@@ -29,10 +29,6 @@
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <Qt/QtXml>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QFile>
|
||||
@@ -46,34 +42,6 @@
|
||||
#include <QtGui/QButtonGroup>
|
||||
#include <QtGui/QApplication>
|
||||
|
||||
#else
|
||||
|
||||
#include <qdir.h>
|
||||
#include <qdom.h>
|
||||
#include <qfile.h>
|
||||
#include <qmessagebox.h>
|
||||
#include <qlabel.h>
|
||||
#include <qlayout.h>
|
||||
#include <qlineedit.h>
|
||||
#include <qpushbutton.h>
|
||||
#include <qfiledialog.h>
|
||||
#include <qbuttongroup.h>
|
||||
#include <qradiobutton.h>
|
||||
#include <qapplication.h>
|
||||
|
||||
#define absolutePath absPath
|
||||
#define addButton insert
|
||||
|
||||
#ifndef __USE_XOPEN_EXTENDED
|
||||
#define __USE_XOPEN_EXTENDED
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "config_mgr.h"
|
||||
#include "embed.h"
|
||||
@@ -81,29 +49,11 @@
|
||||
|
||||
|
||||
|
||||
void mkPath( const QString & _path )
|
||||
inline void mkPath( const QString & _path )
|
||||
{
|
||||
#ifdef QT4
|
||||
#warning TODO: directly integrate
|
||||
// simple clean solution with Qt4...
|
||||
QDir().mkpath( _path );
|
||||
#else
|
||||
// ...but Qt3 needs additional code...
|
||||
QDir d( _path );
|
||||
vlist<QString> dirs;
|
||||
dirs.push_front( _path );
|
||||
QString dir = _path;
|
||||
while( !QDir( dir ).exists() )
|
||||
{
|
||||
dir = dir.section( '/', 0, -2 );
|
||||
dirs.push_front( dir );
|
||||
}
|
||||
while( !dirs.isEmpty() )
|
||||
{
|
||||
d.mkdir( dirs.front() );
|
||||
d.setPath( dirs.front() );
|
||||
dirs.erase( dirs.begin() );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -160,25 +110,11 @@ configManager::configManager( void ) :
|
||||
QDialog(),
|
||||
m_lmmsRcFile( QDir::home().absolutePath() + "/.lmmsrc.xml" ),
|
||||
m_workingDir( QDir::home().absolutePath() + "/lmms" ),
|
||||
#if QT_VERSION >= 0x030200
|
||||
m_dataDir( qApp->applicationDirPath().section( '/', 0, -2 ) +
|
||||
"/share/lmms/" ),
|
||||
#else
|
||||
// hardcode since qt < 3.2 doesn't know something like
|
||||
// applicationDirPath and implementing own function would be senseless
|
||||
// since real support for qt < 3.2 is senseless too ;-)
|
||||
m_dataDir( "/usr/share/lmms/" ),
|
||||
#endif
|
||||
m_artworkDir( defaultArtworkDir() ),
|
||||
#if QT_VERSION >= 0x030200
|
||||
m_pluginDir( qApp->applicationDirPath().section( '/', 0, -2 ) +
|
||||
"/lib/lmms/" ),
|
||||
#else
|
||||
// hardcode since qt < 3.2 doesn't know something like
|
||||
// applicationDirPath and implementing own function would be senseless
|
||||
// since real support for qt < 3.2 is senseless too ;-)
|
||||
m_pluginDir( "/usr/lib/lmms" ),
|
||||
#endif
|
||||
m_vstDir( QDir::home().absolutePath() ),
|
||||
m_flDir( QDir::home().absolutePath() ),
|
||||
m_currentPage( 0 ),
|
||||
@@ -203,18 +139,14 @@ void configManager::createWidgets( void )
|
||||
m_mainLayout->setMargin( 0 );
|
||||
m_mainLayout->setSpacing( 10 );
|
||||
m_mainLayout->addSpacing( 8 );
|
||||
#ifdef QT4
|
||||
setLayout( m_mainLayout );
|
||||
#endif
|
||||
|
||||
m_contentWidget = new QWidget( this );
|
||||
m_contentLayout = new QVBoxLayout( m_contentWidget );
|
||||
m_contentLayout->setMargin( 0 );
|
||||
m_contentLayout->setSpacing( 10 );
|
||||
m_contentLayout->addSpacing( 8 );
|
||||
#ifdef QT4
|
||||
m_contentWidget->setLayout( m_contentLayout );
|
||||
#endif
|
||||
m_mainLayout->addWidget( m_contentWidget );
|
||||
m_mainLayout->addSpacing( 8 );
|
||||
|
||||
@@ -235,9 +167,7 @@ void configManager::createWidgets( void )
|
||||
m_buttonLayout->setMargin( 0 );
|
||||
m_buttonLayout->setSpacing( 0 );
|
||||
m_buttonLayout->addStretch( 1 );
|
||||
#ifdef QT4
|
||||
button_widget->setLayout( m_buttonLayout );
|
||||
#endif
|
||||
|
||||
m_cancelButton = new QPushButton( tr( "&Cancel" ), button_widget );
|
||||
m_backButton = new QPushButton( tr( "< &Back" ), button_widget );
|
||||
@@ -270,9 +200,7 @@ void configManager::createWidgets( void )
|
||||
QHBoxLayout * intro_layout = new QHBoxLayout( m_pageIntro );
|
||||
intro_layout->setMargin( 0 );
|
||||
intro_layout->setSpacing( 15 );
|
||||
#ifdef QT4
|
||||
m_pageIntro->setLayout( intro_layout );
|
||||
#endif
|
||||
|
||||
QLabel * intro_logo_lbl = new QLabel( m_pageIntro );
|
||||
intro_logo_lbl->setPixmap( embed::getIconPixmap( "wizard_intro" ) );
|
||||
@@ -292,11 +220,7 @@ void configManager::createWidgets( void )
|
||||
"Now click on 'Next' to get to "
|
||||
"the next page." ),
|
||||
m_pageIntro );
|
||||
#ifdef QT4
|
||||
intro_txt_lbl->setWordWrap( TRUE );
|
||||
#else
|
||||
intro_txt_lbl->setAlignment( intro_txt_lbl->alignment() | WordBreak );
|
||||
#endif
|
||||
|
||||
intro_layout->addWidget( intro_logo_lbl );
|
||||
intro_layout->addWidget( intro_txt_lbl );
|
||||
@@ -326,12 +250,7 @@ void configManager::createWidgets( void )
|
||||
"projects, presets, samples etc.\n\n\n"
|
||||
"Please select a directory:" ),
|
||||
workingdir_content );
|
||||
#ifdef QT4
|
||||
workingdir_txt_lbl->setWordWrap( TRUE );
|
||||
#else
|
||||
workingdir_txt_lbl->setAlignment( workingdir_txt_lbl->alignment() |
|
||||
WordBreak );
|
||||
#endif
|
||||
|
||||
QWidget * workingdir_input_fields = new QWidget( workingdir_content );
|
||||
QHBoxLayout * workingdir_input_fields_layout = new QHBoxLayout(
|
||||
@@ -413,7 +332,7 @@ void configManager::createWidgets( void )
|
||||
samples_txt_lbl->setFixedWidth( 144 );
|
||||
|
||||
QButtonGroup * samples_bg = new QButtonGroup( samples_widget );
|
||||
#ifndef QT4
|
||||
#ifndef qt4
|
||||
samples_bg->hide();
|
||||
#endif
|
||||
m_samplesCopyRB = new QRadioButton( tr( "copy" ), samples_widget );
|
||||
@@ -509,7 +428,7 @@ void configManager::createWidgets( void )
|
||||
addPage( m_pageIntro, tr( "Welcome to LMMS" ) );
|
||||
addPage( m_pageWorkingDir, tr( "Select working directory" ) );
|
||||
//addPage( m_pageFiles, tr( "Copy or link files" ) );
|
||||
switchPage( static_cast<csize>( 0 ) );
|
||||
switchPage( static_cast<int>( 0 ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -517,15 +436,9 @@ void configManager::createWidgets( void )
|
||||
|
||||
void configManager::openWorkingDir( void )
|
||||
{
|
||||
#ifdef QT4
|
||||
QString new_dir = QFileDialog::getExistingDirectory( this,
|
||||
tr( "Choose LMMS working directory" ),
|
||||
m_workingDir );
|
||||
#else
|
||||
QString new_dir = QFileDialog::getExistingDirectory( m_workingDir, 0, 0,
|
||||
tr( "Choose LMMS working directory" ),
|
||||
TRUE );
|
||||
#endif
|
||||
if( new_dir != QString::null )
|
||||
{
|
||||
m_wdLineEdit->setText( new_dir );
|
||||
@@ -595,12 +508,7 @@ void configManager::accept( void )
|
||||
}
|
||||
if( !QDir( m_workingDir ).exists() )
|
||||
{
|
||||
if( QMessageBox::
|
||||
#if QT_VERSION >= 0x030200
|
||||
question
|
||||
#else
|
||||
information
|
||||
#endif
|
||||
if( QMessageBox::question
|
||||
( 0, tr( "Directory not existing" ),
|
||||
tr( "The directory you "
|
||||
"specified does not "
|
||||
@@ -659,24 +567,12 @@ void configManager::nextButtonClicked( void )
|
||||
|
||||
|
||||
|
||||
void configManager::switchPage( csize _pg )
|
||||
void configManager::switchPage( int _pg )
|
||||
{
|
||||
#ifdef QT4
|
||||
if( m_currentPage >= 0 && m_currentPage < m_pages.size() )
|
||||
#else
|
||||
if( m_currentPage < m_pages.size() )
|
||||
#endif
|
||||
{
|
||||
m_pages[m_currentPage].first->hide();
|
||||
#ifdef QT4
|
||||
m_contentLayout->removeWidget( m_pages[m_currentPage].first );
|
||||
#else
|
||||
#if QT_VERSION >= 0x030100
|
||||
m_contentLayout->remove( m_pages[m_currentPage].first );
|
||||
#else
|
||||
m_pages[m_currentPage].first->hide();
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
if( _pg < m_pages.size() )
|
||||
{
|
||||
@@ -707,7 +603,7 @@ void configManager::switchPage( csize _pg )
|
||||
|
||||
void configManager::switchPage( QWidget * _pg )
|
||||
{
|
||||
for( csize i = 0; i < m_pages.size(); ++i )
|
||||
for( int i = 0; i < m_pages.size(); ++i )
|
||||
{
|
||||
if( m_pages[i].first == _pg )
|
||||
{
|
||||
@@ -731,16 +627,10 @@ void configManager::addPage( QWidget * _w, const QString & _title )
|
||||
|
||||
void configManager::addRecentlyOpenedProject( const QString & _file )
|
||||
{
|
||||
m_recentlyOpenedProjects.removeAll( _file );
|
||||
if( m_recentlyOpenedProjects.size() > 15 )
|
||||
{
|
||||
m_recentlyOpenedProjects.remove(
|
||||
m_recentlyOpenedProjects.last() );
|
||||
}
|
||||
QStringList::iterator it;
|
||||
while( ( it = m_recentlyOpenedProjects.find( _file ) ) !=
|
||||
m_recentlyOpenedProjects.end() )
|
||||
{
|
||||
m_recentlyOpenedProjects.remove( it );
|
||||
m_recentlyOpenedProjects.removeLast();
|
||||
}
|
||||
m_recentlyOpenedProjects.push_front( _file );
|
||||
}
|
||||
@@ -802,17 +692,9 @@ bool configManager::loadConfigFile( void )
|
||||
|
||||
// read the XML file and create DOM tree
|
||||
QFile cfg_file( m_lmmsRcFile );
|
||||
#ifdef QT4
|
||||
if( !cfg_file.open( QIODevice::ReadOnly ) )
|
||||
#else
|
||||
if( !cfg_file.open( IO_ReadOnly ) )
|
||||
#endif
|
||||
{
|
||||
#ifdef QT4
|
||||
if( !( exec() && cfg_file.open( QIODevice::ReadOnly ) ) )
|
||||
#else
|
||||
if( !( exec() && cfg_file.open( IO_ReadOnly ) ) )
|
||||
#endif
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
@@ -852,7 +734,7 @@ bool configManager::loadConfigFile( void )
|
||||
stringPairVector attr;
|
||||
QDomNamedNodeMap node_attr =
|
||||
node.toElement().attributes();
|
||||
for( csize i = 0; i < node_attr.count(); ++i )
|
||||
for( int i = 0; i < node_attr.count(); ++i )
|
||||
{
|
||||
QDomNode n = node_attr.item( i );
|
||||
if( n.isAttr() )
|
||||
@@ -934,12 +816,7 @@ bool configManager::loadConfigFile( void )
|
||||
QString cfg_file_ver = root.toElement().attribute( "version" );
|
||||
if( ( cfg_file_ver.length() == 0 || cfg_file_ver != VERSION ) &&
|
||||
value( "app", "nowizard" ).toInt() == FALSE &&
|
||||
QMessageBox::
|
||||
#if QT_VERSION >= 0x030200
|
||||
question
|
||||
#else
|
||||
information
|
||||
#endif
|
||||
QMessageBox::question
|
||||
( 0, tr( "Version mismatches" ),
|
||||
tr( "Accordingly to the information in "
|
||||
"your LMMS-configuration-file "
|
||||
@@ -1011,18 +888,10 @@ void configManager::saveConfigFile( void )
|
||||
}
|
||||
lmms_config.appendChild( recent_files );
|
||||
|
||||
#if QT_VERSION >= 0x030100
|
||||
QString xml = "<?xml version=\"1.0\"?>\n" + doc.toString( 2 );
|
||||
#else
|
||||
QString xml = "<?xml version=\"1.0\"?>\n" + doc.toString();
|
||||
#endif
|
||||
|
||||
QFile outfile( m_lmmsRcFile );
|
||||
#ifdef QT4
|
||||
if( !outfile.open( QIODevice::WriteOnly | QIODevice::Truncate ) )
|
||||
#else
|
||||
if( !outfile.open( IO_WriteOnly | IO_Truncate ) )
|
||||
#endif
|
||||
{
|
||||
QMessageBox::critical( NULL, tr( "Could not save config-file" ),
|
||||
tr( "Could not save configuration "
|
||||
@@ -1036,12 +905,7 @@ void configManager::saveConfigFile( void )
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef QT4
|
||||
outfile.write( xml.toUtf8().constData(), xml.length() );
|
||||
#else
|
||||
QCString xml_utf8 = xml.utf8();
|
||||
outfile.writeBlock( xml_utf8.data(), xml_utf8.length() );
|
||||
#endif
|
||||
outfile.close();
|
||||
}
|
||||
|
||||
|
||||
@@ -26,29 +26,15 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtGui/QMessageBox>
|
||||
#include <QtGui/QCloseEvent>
|
||||
|
||||
#else
|
||||
|
||||
#include <qmessagebox.h>
|
||||
|
||||
#endif
|
||||
|
||||
#include "effect_control_dialog.h"
|
||||
#include "effect.h"
|
||||
|
||||
|
||||
effectControlDialog::effectControlDialog( QWidget * _parent, effect * _eff ) :
|
||||
QWidget( _parent
|
||||
#ifdef QT3
|
||||
, "effectControlDialog"
|
||||
#endif
|
||||
),
|
||||
QWidget( _parent ),
|
||||
m_effect( _eff )
|
||||
{
|
||||
setWindowTitle( m_effect->publicName() );
|
||||
|
||||
@@ -25,24 +25,11 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtGui/QGroupBox>
|
||||
#include <QtGui/QLayout>
|
||||
#include <QtGui/QPushButton>
|
||||
#include <QtGui/QScrollArea>
|
||||
|
||||
#else
|
||||
|
||||
#include <qgroupbox.h>
|
||||
#include <qlayout.h>
|
||||
#include <qpushbutton.h>
|
||||
#include <qvbox.h>
|
||||
|
||||
#endif
|
||||
|
||||
#include "effect_select_dialog.h"
|
||||
|
||||
#include "gui_templates.h"
|
||||
@@ -166,7 +153,7 @@ effectList::effectList( QWidget * _parent ) :
|
||||
{
|
||||
plugin::getDescriptorsOfAvailPlugins( m_pluginDescriptors );
|
||||
|
||||
for( vvector<plugin::descriptor>::iterator it =
|
||||
for( QVector<plugin::descriptor>::iterator it =
|
||||
m_pluginDescriptors.begin();
|
||||
it != m_pluginDescriptors.end(); ++it )
|
||||
{
|
||||
@@ -207,26 +194,14 @@ effectList::effectList( QWidget * _parent ) :
|
||||
m_pluginList->insertStringList( plugin_names );
|
||||
connect( m_pluginList, SIGNAL( highlighted( int ) ),
|
||||
SLOT( onHighlighted( int ) ) );
|
||||
connect( m_pluginList, SIGNAL( doubleClicked( QListBoxItem * ) ),
|
||||
SLOT( onDoubleClicked( QListBoxItem * ) ) );
|
||||
connect( m_pluginList, SIGNAL( doubleClicked( Q3ListBoxItem * ) ),
|
||||
SLOT( onDoubleClicked( Q3ListBoxItem * ) ) );
|
||||
|
||||
#ifndef QT3
|
||||
QGroupBox * groupbox = new QGroupBox( tr( "Description" ), this );
|
||||
#else
|
||||
QGroupBox * groupbox = new QGroupBox( 1, Qt::Vertical,
|
||||
tr( "Description" ), this );
|
||||
#endif
|
||||
groupbox->setFixedHeight( 200 );
|
||||
#ifdef QT3
|
||||
groupbox->setInsideMargin( 2 );
|
||||
#endif
|
||||
|
||||
QScrollArea * scrollArea = new QScrollArea( groupbox );
|
||||
scrollArea->setFrameStyle( 0 );
|
||||
#ifdef QT3
|
||||
scrollArea->setMargin( 10 );
|
||||
#endif
|
||||
#ifndef QT3
|
||||
m_descriptionWidget = new QWidget;
|
||||
QVBoxLayout * l = new QVBoxLayout( m_descriptionWidget );
|
||||
l->setMargin( 0 );
|
||||
@@ -235,10 +210,6 @@ effectList::effectList( QWidget * _parent ) :
|
||||
scrollArea->setWidget( m_descriptionWidget );
|
||||
m_descriptionWidget->show();
|
||||
m_descriptionWidget->setFixedSize( 200, 200 );
|
||||
#else
|
||||
m_descriptionWidget = new QVBox( scrollArea->viewport() );
|
||||
scrollArea->addChild( m_descriptionWidget );
|
||||
#endif
|
||||
|
||||
QVBoxLayout * vboxl = new QVBoxLayout( this );
|
||||
vboxl->setMargin( 0 );
|
||||
@@ -265,19 +236,11 @@ effectList::~effectList()
|
||||
|
||||
void effectList::onHighlighted( int _pluginIndex )
|
||||
{
|
||||
#ifndef QT3
|
||||
QLayoutItem * i;
|
||||
while( ( i = m_descriptionWidget->layout() ) != 0 )
|
||||
{
|
||||
delete i;
|
||||
}
|
||||
#else
|
||||
QLayoutIterator it = m_descriptionWidget->layout()->iterator();
|
||||
while( it.current() )
|
||||
{
|
||||
it.deleteCurrent();
|
||||
}
|
||||
#endif
|
||||
m_descriptionWidget->hide();
|
||||
|
||||
m_currentSelection = m_effectKeys[_pluginIndex];
|
||||
@@ -295,7 +258,7 @@ void effectList::onHighlighted( int _pluginIndex )
|
||||
|
||||
|
||||
|
||||
void effectList::onDoubleClicked( QListBoxItem * _item )
|
||||
void effectList::onDoubleClicked( Q3ListBoxItem * _item )
|
||||
{
|
||||
emit( doubleClicked( m_currentSelection ) );
|
||||
}
|
||||
|
||||
@@ -26,23 +26,11 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <Qt/QtXml>
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QToolButton>
|
||||
#include <QtGui/QCloseEvent>
|
||||
|
||||
#else
|
||||
|
||||
#include <qdom.h>
|
||||
#include <qlistbox.h>
|
||||
#include <qtoolbutton.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "effect_tab_widget.h"
|
||||
#include "instrument_track.h"
|
||||
|
||||
@@ -137,9 +137,9 @@ void engine::updateFramesPerTact64th( void )
|
||||
|
||||
void engine::load_extensions( void )
|
||||
{
|
||||
vvector<plugin::descriptor> pluginDescriptors;
|
||||
QVector<plugin::descriptor> pluginDescriptors;
|
||||
plugin::getDescriptorsOfAvailPlugins( pluginDescriptors );
|
||||
for( vvector<plugin::descriptor>::iterator it =
|
||||
for( QVector<plugin::descriptor>::iterator it =
|
||||
pluginDescriptors.begin();
|
||||
it != pluginDescriptors.end(); ++it )
|
||||
{
|
||||
|
||||
@@ -26,25 +26,11 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtGui/QPaintEvent>
|
||||
#include <Qt/QtXml>
|
||||
#include <QtGui/QLabel>
|
||||
|
||||
#else
|
||||
|
||||
#include <qwhatsthis.h>
|
||||
#include <qpainter.h>
|
||||
#include <qpen.h>
|
||||
#include <qdom.h>
|
||||
#include <qlabel.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "envelope_and_lfo_widget.h"
|
||||
#include "song_editor.h"
|
||||
@@ -101,7 +87,7 @@ const int LFO_SHAPES_Y = LFO_GRAPH_Y + 50;
|
||||
QPixmap * envelopeAndLFOWidget::s_envGraph = NULL;
|
||||
QPixmap * envelopeAndLFOWidget::s_lfoGraph = NULL;
|
||||
|
||||
vvector<envelopeAndLFOWidget *> envelopeAndLFOWidget::s_EaLWidgets;
|
||||
QVector<envelopeAndLFOWidget *> envelopeAndLFOWidget::s_EaLWidgets;
|
||||
|
||||
|
||||
|
||||
@@ -109,11 +95,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
|
||||
QWidget * _parent,
|
||||
track * _track ) :
|
||||
QWidget( _parent ),
|
||||
#ifdef QT4
|
||||
specialBgHandlingWidget( palette().color( backgroundRole() ) ),
|
||||
#else
|
||||
specialBgHandlingWidget( paletteBackgroundColor() ),
|
||||
#endif
|
||||
m_used( FALSE ),
|
||||
m_valueForZeroAmount( _value_for_zero_amount ),
|
||||
m_pahdEnv( NULL ),
|
||||
@@ -143,11 +125,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
|
||||
m_predelayKnob->setInitValue( 0.0 );
|
||||
m_predelayKnob->move( PREDELAY_KNOB_X, ENV_KNOBS_Y );
|
||||
m_predelayKnob->setHintText( tr( "Predelay:" ) + " ", "" );
|
||||
#ifdef QT4
|
||||
m_predelayKnob->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_predelayKnob,
|
||||
#endif
|
||||
tr( "Use this knob for setting predelay of the current "
|
||||
"envelope. The bigger this value the longer the time "
|
||||
"before start of actual envelope." ) );
|
||||
@@ -161,11 +139,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
|
||||
m_attackKnob->setInitValue( 0.0 );
|
||||
m_attackKnob->move( ATTACK_KNOB_X, ENV_KNOBS_Y );
|
||||
m_attackKnob->setHintText( tr( "Attack:" )+" ", "" );
|
||||
#ifdef QT4
|
||||
m_attackKnob->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_attackKnob,
|
||||
#endif
|
||||
tr( "Use this knob for setting attack-time of the current "
|
||||
"envelope. The bigger this value the longer the "
|
||||
"envelope needs to increase to attack-level. "
|
||||
@@ -180,11 +154,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
|
||||
m_holdKnob->setInitValue( 0.5 );
|
||||
m_holdKnob->move( HOLD_KNOB_X, ENV_KNOBS_Y );
|
||||
m_holdKnob->setHintText( tr( "Hold:" ) + " ", "" );
|
||||
#ifdef QT4
|
||||
m_holdKnob->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_holdKnob,
|
||||
#endif
|
||||
tr( "Use this knob for setting hold-time of the current "
|
||||
"envelope. The bigger this value the longer the "
|
||||
"envelope holds attack-level before it begins to "
|
||||
@@ -199,11 +169,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
|
||||
m_decayKnob->setInitValue( 0.5 );
|
||||
m_decayKnob->move( DECAY_KNOB_X, ENV_KNOBS_Y );
|
||||
m_decayKnob->setHintText( tr( "Decay:" ) + " ", "" );
|
||||
#ifdef QT4
|
||||
m_decayKnob->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_decayKnob,
|
||||
#endif
|
||||
tr( "Use this knob for setting decay-time of the current "
|
||||
"envelope. The bigger this value the longer the "
|
||||
"envelope needs to decrease from attack-level to "
|
||||
@@ -219,11 +185,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
|
||||
m_sustainKnob->setInitValue( 0.5 );
|
||||
m_sustainKnob->move( SUSTAIN_KNOB_X, ENV_KNOBS_Y );
|
||||
m_sustainKnob->setHintText( tr( "Sustain:" ) + " ", "" );
|
||||
#ifdef QT4
|
||||
m_sustainKnob->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_sustainKnob,
|
||||
#endif
|
||||
tr( "Use this knob for setting sustain-level of the current "
|
||||
"envelope. The bigger this value the higher the level "
|
||||
"on which the envelope stays before going down to "
|
||||
@@ -238,11 +200,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
|
||||
m_releaseKnob->setInitValue( 0.1 );
|
||||
m_releaseKnob->move( RELEASE_KNOB_X, ENV_KNOBS_Y );
|
||||
m_releaseKnob->setHintText( tr( "Release:" ) + " ", "" );
|
||||
#ifdef QT4
|
||||
m_releaseKnob->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_releaseKnob,
|
||||
#endif
|
||||
tr( "Use this knob for setting release-time of the current "
|
||||
"envelope. The bigger this value the longer the "
|
||||
"envelope needs to decrease from sustain-level to "
|
||||
@@ -259,11 +217,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
|
||||
m_amountKnob->setInitValue( 0.0 );
|
||||
m_amountKnob->move( AMOUNT_KNOB_X, ENV_GRAPH_Y );
|
||||
m_amountKnob->setHintText( tr( "Modulation amount:" ) + " ", "" );
|
||||
#ifdef QT4
|
||||
m_amountKnob->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_amountKnob,
|
||||
#endif
|
||||
tr( "Use this knob for setting modulation amount of the "
|
||||
"current envelope. The bigger this value the more the "
|
||||
"according size (e.g. volume or cutoff-frequency) "
|
||||
@@ -281,11 +235,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
|
||||
m_lfoPredelayKnob->setInitValue( 0.0 );
|
||||
m_lfoPredelayKnob->move( LFO_PREDELAY_KNOB_X, LFO_KNOB_Y );
|
||||
m_lfoPredelayKnob->setHintText( tr( "LFO-predelay:" ) + " ", "" );
|
||||
#ifdef QT4
|
||||
m_lfoPredelayKnob->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_lfoPredelayKnob,
|
||||
#endif
|
||||
tr( "Use this knob for setting predelay-time of the current "
|
||||
"LFO. The bigger this value the the time until the "
|
||||
"LFO starts to oscillate." ) );
|
||||
@@ -300,11 +250,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
|
||||
m_lfoAttackKnob->setInitValue( 0.0 );
|
||||
m_lfoAttackKnob->move( LFO_ATTACK_KNOB_X, LFO_KNOB_Y );
|
||||
m_lfoAttackKnob->setHintText( tr( "LFO-attack:" ) + " ", "" );
|
||||
#ifdef QT4
|
||||
m_lfoAttackKnob->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_lfoAttackKnob,
|
||||
#endif
|
||||
tr( "Use this knob for setting attack-time of the current LFO. "
|
||||
"The bigger this value the longer the LFO needs to "
|
||||
"increase its amplitude to maximum." ) );
|
||||
@@ -319,11 +265,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
|
||||
m_lfoSpeedKnob->setInitValue( 0.1 );
|
||||
m_lfoSpeedKnob->move( LFO_SPEED_KNOB_X, LFO_KNOB_Y );
|
||||
m_lfoSpeedKnob->setHintText( tr( "LFO-speed:" ) + " ", "" );
|
||||
#ifdef QT4
|
||||
m_lfoSpeedKnob->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_lfoSpeedKnob,
|
||||
#endif
|
||||
tr( "Use this knob for setting speed of the current LFO. The "
|
||||
"bigger this value the faster the LFO oscillates and "
|
||||
"the faster will be your effect." ) );
|
||||
@@ -338,11 +280,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
|
||||
m_lfoAmountKnob->setInitValue( 0.0 );
|
||||
m_lfoAmountKnob->move( LFO_AMOUNT_KNOB_X, LFO_KNOB_Y );
|
||||
m_lfoAmountKnob->setHintText( tr( "Modulation amount:" ) + " ", "" );
|
||||
#ifdef QT4
|
||||
m_lfoAmountKnob->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_lfoAmountKnob,
|
||||
#endif
|
||||
tr( "Use this knob for setting modulation amount of the "
|
||||
"current LFO. The bigger this value the more the "
|
||||
"selected size (e.g. volume or cutoff-frequency) will "
|
||||
@@ -357,11 +295,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
|
||||
"sin_wave_active" ) );
|
||||
sin_lfo_btn->setInactiveGraphic( embed::getIconPixmap(
|
||||
"sin_wave_inactive" ) );
|
||||
#ifdef QT4
|
||||
sin_lfo_btn->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( sin_lfo_btn,
|
||||
#endif
|
||||
tr( "Click here if you want a sine-wave for current "
|
||||
"oscillator." ) );
|
||||
|
||||
@@ -371,11 +305,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
|
||||
"triangle_wave_active" ) );
|
||||
triangle_lfo_btn->setInactiveGraphic( embed::getIconPixmap(
|
||||
"triangle_wave_inactive" ) );
|
||||
#ifdef QT4
|
||||
triangle_lfo_btn->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( triangle_lfo_btn,
|
||||
#endif
|
||||
tr( "Click here if you want a triangle-wave for current "
|
||||
"oscillator." ) );
|
||||
|
||||
@@ -385,11 +315,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
|
||||
"saw_wave_active" ) );
|
||||
saw_lfo_btn->setInactiveGraphic( embed::getIconPixmap(
|
||||
"saw_wave_inactive" ) );
|
||||
#ifdef QT4
|
||||
saw_lfo_btn->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( saw_lfo_btn,
|
||||
#endif
|
||||
tr( "Click here if you want a saw-wave for current "
|
||||
"oscillator." ) );
|
||||
|
||||
@@ -399,11 +325,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
|
||||
"square_wave_active" ) );
|
||||
sqr_lfo_btn->setInactiveGraphic( embed::getIconPixmap(
|
||||
"square_wave_inactive" ) );
|
||||
#ifdef QT4
|
||||
sqr_lfo_btn->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( sqr_lfo_btn,
|
||||
#endif
|
||||
tr( "Click here if you want a square-wave for current "
|
||||
"oscillator." ) );
|
||||
|
||||
@@ -413,11 +335,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
|
||||
"usr_wave_active" ) );
|
||||
m_userLfoBtn->setInactiveGraphic( embed::getIconPixmap(
|
||||
"usr_wave_inactive" ) );
|
||||
#ifdef QT4
|
||||
m_userLfoBtn->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_userLfoBtn,
|
||||
#endif
|
||||
tr( "Click here if you want a user-defined wave for current "
|
||||
"oscillator. Afterwards drag an according sample-"
|
||||
"file into LFO-graph." ) );
|
||||
@@ -442,11 +360,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
|
||||
tr( "Freq x 100" ), _track );
|
||||
m_x100Cb->setFont( pointSize<6>( m_x100Cb->font() ) );
|
||||
m_x100Cb->move( LFO_PREDELAY_KNOB_X, LFO_GRAPH_Y + 36 );
|
||||
#ifdef QT4
|
||||
m_x100Cb->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_x100Cb,
|
||||
#endif
|
||||
tr( "Click here if the frequency of this LFO should be "
|
||||
"multiplied with 100." ) );
|
||||
toolTip::add( m_x100Cb, tr( "multiply LFO-frequency with 100" ) );
|
||||
@@ -460,21 +374,13 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
|
||||
m_controlEnvAmountCb->move( LFO_PREDELAY_KNOB_X, LFO_GRAPH_Y + 54 );
|
||||
m_controlEnvAmountCb->setFont( pointSize<6>(
|
||||
m_controlEnvAmountCb->font() ) );
|
||||
#ifdef QT4
|
||||
m_controlEnvAmountCb ->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_controlEnvAmountCb,
|
||||
#endif
|
||||
tr( "Click here to make the envelope-amount controlled by this "
|
||||
"LFO." ) );
|
||||
toolTip::add( m_controlEnvAmountCb,
|
||||
tr( "control envelope-amount by this LFO" ) );
|
||||
|
||||
|
||||
#ifndef QT4
|
||||
// set background-mode for flicker-free redraw
|
||||
setBackgroundMode( Qt::NoBackground );
|
||||
#endif
|
||||
setAcceptDrops( TRUE );
|
||||
|
||||
connect( engine::getMixer(), SIGNAL( sampleRateChanged() ), this,
|
||||
@@ -494,7 +400,7 @@ envelopeAndLFOWidget::~envelopeAndLFOWidget()
|
||||
delete[] m_rEnv;
|
||||
delete[] m_lfoShapeData;
|
||||
|
||||
vvector<envelopeAndLFOWidget *> & v = s_EaLWidgets;
|
||||
QVector<envelopeAndLFOWidget *> & v = s_EaLWidgets;
|
||||
if( qFind( v.begin(), v.end(), this ) != v.end() )
|
||||
{
|
||||
v.erase( qFind( v.begin(), v.end(), this ) );
|
||||
@@ -550,8 +456,8 @@ void envelopeAndLFOWidget::updateLFOShapeData( void )
|
||||
|
||||
void envelopeAndLFOWidget::triggerLFO( void )
|
||||
{
|
||||
vvector<envelopeAndLFOWidget *> & v = s_EaLWidgets;
|
||||
for( vvector<envelopeAndLFOWidget *>::iterator it = v.begin();
|
||||
QVector<envelopeAndLFOWidget *> & v = s_EaLWidgets;
|
||||
for( QVector<envelopeAndLFOWidget *>::iterator it = v.begin();
|
||||
it != v.end(); ++it )
|
||||
{
|
||||
( *it )->m_lfoFrame +=
|
||||
@@ -565,8 +471,8 @@ void envelopeAndLFOWidget::triggerLFO( void )
|
||||
|
||||
void envelopeAndLFOWidget::resetLFO( void )
|
||||
{
|
||||
vvector<envelopeAndLFOWidget *> & v = s_EaLWidgets;
|
||||
for( vvector<envelopeAndLFOWidget *>::iterator it = v.begin();
|
||||
QVector<envelopeAndLFOWidget *> & v = s_EaLWidgets;
|
||||
for( QVector<envelopeAndLFOWidget *>::iterator it = v.begin();
|
||||
it != v.end(); ++it )
|
||||
{
|
||||
( *it )->m_lfoFrame = 0;
|
||||
@@ -783,17 +689,8 @@ void envelopeAndLFOWidget::dropEvent( QDropEvent * _de )
|
||||
|
||||
void envelopeAndLFOWidget::paintEvent( QPaintEvent * )
|
||||
{
|
||||
#ifdef QT4
|
||||
QPainter p( this );
|
||||
p.setRenderHint( QPainter::Antialiasing );
|
||||
#else
|
||||
// create pixmap for whole widget
|
||||
QPixmap pm( size() );
|
||||
pm.fill( this, rect().topLeft() );
|
||||
|
||||
// and a painter for it
|
||||
QPainter p( &pm, this );
|
||||
#endif
|
||||
|
||||
// set smaller font
|
||||
p.setFont( pointSize<6>( p.font() ) );
|
||||
@@ -886,11 +783,7 @@ void envelopeAndLFOWidget::paintEvent( QPaintEvent * )
|
||||
osc_frames *= 100.0f;
|
||||
}
|
||||
|
||||
#ifdef QT4
|
||||
float old_y = 0;
|
||||
#else
|
||||
int old_y = 0;
|
||||
#endif
|
||||
for( int x = 0; x <= LFO_GRAPH_W; ++x )
|
||||
{
|
||||
float val = 0.0;
|
||||
@@ -924,16 +817,10 @@ void envelopeAndLFOWidget::paintEvent( QPaintEvent * )
|
||||
val *= cur_sample / m_lfoAttackFrames;
|
||||
}
|
||||
}
|
||||
#ifdef QT4
|
||||
float cur_y = -LFO_GRAPH_H / 2.0f * val;
|
||||
p.drawLine( QLineF( graph_x_base + x - 1, graph_y_base + old_y,
|
||||
graph_x_base + x,
|
||||
graph_y_base + cur_y ) );
|
||||
#else
|
||||
int cur_y = static_cast<int>( -LFO_GRAPH_H / 2.0f * val );
|
||||
p.drawLine( graph_x_base + x - 1, graph_y_base + old_y,
|
||||
graph_x_base + x, graph_y_base + cur_y );
|
||||
#endif
|
||||
old_y = cur_y;
|
||||
}
|
||||
|
||||
@@ -946,10 +833,6 @@ void envelopeAndLFOWidget::paintEvent( QPaintEvent * )
|
||||
p.drawText( LFO_GRAPH_X + 52, LFO_GRAPH_Y + s_lfoGraph->height() - 6,
|
||||
QString::number( ms_per_osc ) );
|
||||
|
||||
#ifndef QT4
|
||||
// blit drawn pixmap to actual widget
|
||||
bitBlt( this, rect().topLeft(), &pm );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -26,19 +26,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <Qt/QtXml>
|
||||
|
||||
#else
|
||||
|
||||
#include <qdom.h>
|
||||
#include <qwhatsthis.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "envelope_tab_widget.h"
|
||||
#include "combobox.h"
|
||||
@@ -92,11 +81,7 @@ envelopeTabWidget::envelopeTabWidget( instrumentTrack * _instrument_track ) :
|
||||
TARGETS_TABWIDGET_Y,
|
||||
TARGETS_TABWIDGET_WIDTH,
|
||||
TARGETS_TABWIDGET_HEIGTH );
|
||||
#ifdef QT4
|
||||
m_targetsTabWidget->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_targetsTabWidget,
|
||||
#endif
|
||||
tr( "These tabs contain envelopes. They're very important for "
|
||||
"modifying a sound, for not saying that they're almost "
|
||||
"always neccessary for substractive synthesis. For "
|
||||
@@ -124,15 +109,7 @@ envelopeTabWidget::envelopeTabWidget( instrumentTrack * _instrument_track ) :
|
||||
_instrument_track );
|
||||
m_targetsTabWidget->addTab( m_envLFOWidgets[i],
|
||||
tr( targetNames[i][0]
|
||||
#ifdef QT4
|
||||
.toAscii().constData()
|
||||
#endif
|
||||
) );
|
||||
/*
|
||||
#ifdef QT4
|
||||
.toAscii().constData()
|
||||
#endif
|
||||
) );*/
|
||||
.toAscii().constData() ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -165,11 +142,7 @@ envelopeTabWidget::envelopeTabWidget( instrumentTrack * _instrument_track ) :
|
||||
m_filterComboBox->addItem( tr( "2x LowPass" ),
|
||||
embed::getIconPixmap( "filter_2lp" ) );
|
||||
|
||||
#ifdef QT4
|
||||
m_filterComboBox->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_filterComboBox,
|
||||
#endif
|
||||
tr( "Here you can select the built-in filter you want to use "
|
||||
"for this instrument-track. Filters are very important "
|
||||
"for changing the characteristics of a sound." ) );
|
||||
@@ -184,11 +157,7 @@ envelopeTabWidget::envelopeTabWidget( instrumentTrack * _instrument_track ) :
|
||||
m_filterCutKnob->setInitValue( 16000.0 );
|
||||
m_filterCutKnob->setHintText( tr( "cutoff-frequency:" ) + " ", " " +
|
||||
tr( "Hz" ) );
|
||||
#ifdef QT4
|
||||
m_filterCutKnob->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_filterCutKnob,
|
||||
#endif
|
||||
tr( "Use this knob for setting the cutoff-frequency for the "
|
||||
"selected filter. The cutoff-frequency specifies the "
|
||||
"frequency for cutting the signal by a filter. For "
|
||||
@@ -204,11 +173,7 @@ envelopeTabWidget::envelopeTabWidget( instrumentTrack * _instrument_track ) :
|
||||
m_filterResKnob->move( 190, 18 );
|
||||
m_filterResKnob->setInitValue( 0.5 );
|
||||
m_filterResKnob->setHintText( tr( "Q/Resonance:" ) + " ", "" );
|
||||
#ifdef QT4
|
||||
m_filterResKnob->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_filterResKnob,
|
||||
#endif
|
||||
tr( "Use this knob for setting Q/Resonance for the selected "
|
||||
"filter. Q/Resonance tells the filter, how much it "
|
||||
"should amplify frequencies near Cutoff-frequency." ) );
|
||||
|
||||
@@ -25,10 +25,6 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtGui/QFileDialog>
|
||||
#include <QtGui/QMessageBox>
|
||||
#include <QtGui/QProgressBar>
|
||||
@@ -37,17 +33,6 @@
|
||||
#include <QtGui/QCloseEvent>
|
||||
#include <QtGui/QApplication>
|
||||
|
||||
#else
|
||||
|
||||
#include <qfiledialog.h>
|
||||
#include <qmessagebox.h>
|
||||
#include <qprogressbar.h>
|
||||
#include <qlabel.h>
|
||||
#include <qpushbutton.h>
|
||||
#include <qapplication.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "export_project_dialog.h"
|
||||
#include "song_editor.h"
|
||||
@@ -136,14 +121,9 @@ exportProjectDialog::exportProjectDialog( const QString & _file_name,
|
||||
m_hourglassLbl( NULL ),
|
||||
m_deleteFile( FALSE )
|
||||
{
|
||||
#ifdef QT4
|
||||
m_fileType = getFileTypeFromExtension( "." +
|
||||
QFileInfo( _file_name
|
||||
).completeSuffix() );
|
||||
#else
|
||||
m_fileType = getFileTypeFromExtension( "." + QFileInfo( _file_name
|
||||
).extension() );
|
||||
#endif
|
||||
setWindowTitle( tr( "Export project to %1" ).arg(
|
||||
QFileInfo( _file_name ).fileName() ) );
|
||||
|
||||
@@ -358,11 +338,7 @@ void exportProjectDialog::exportBtnClicked( void )
|
||||
|
||||
m_exportProgressBar = new QProgressBar( this );
|
||||
m_exportProgressBar->setGeometry( EPB_X, EPB_Y, EPB_WIDTH, EPB_HEIGHT );
|
||||
#ifdef QT4
|
||||
m_exportProgressBar->setMaximum( 100 );
|
||||
#else
|
||||
m_exportProgressBar->setTotalSteps( 100 );
|
||||
#endif
|
||||
m_exportProgressBar->show();
|
||||
|
||||
m_hourglassLbl = new QLabel( this );
|
||||
@@ -391,11 +367,7 @@ void exportProjectDialog::exportBtnClicked( void )
|
||||
int pval = pp * 100 /
|
||||
( ( engine::getSongEditor()->lengthInTacts() + 1 )
|
||||
* 64 );
|
||||
#ifdef QT4
|
||||
m_exportProgressBar->setValue( pval );
|
||||
#else
|
||||
m_exportProgressBar->setProgress( pval );
|
||||
#endif
|
||||
// update lmms-main-win-caption
|
||||
engine::getMainWindow()->setWindowTitle( tr( "Rendering:" )
|
||||
+ " " + QString::number( pval ) + "%" );
|
||||
|
||||
@@ -26,26 +26,13 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtGui/QPushButton>
|
||||
#include <QtGui/QKeyEvent>
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QCursor>
|
||||
class QColorGroup;
|
||||
#include <Qt3Support/Q3Header>
|
||||
|
||||
#else
|
||||
|
||||
#include <qpushbutton.h>
|
||||
#include <qpopupmenu.h>
|
||||
#include <qheader.h>
|
||||
#include <qcursor.h>
|
||||
#include <qworkspace.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "file_browser.h"
|
||||
#include "bb_editor.h"
|
||||
@@ -78,17 +65,10 @@ fileBrowser::fileBrowser( const QString & _directories, const QString & _filter,
|
||||
m_l = new listView( contentParent() );
|
||||
addContentWidget( m_l );
|
||||
|
||||
#ifdef QT4
|
||||
connect( m_l, SIGNAL( contextMenuRequested( Q3ListViewItem *,
|
||||
const QPoint &, int ) ),
|
||||
this, SLOT( contextMenuRequest( Q3ListViewItem *,
|
||||
const QPoint &, int ) ) );
|
||||
#else
|
||||
connect( m_l, SIGNAL( contextMenuRequested( QListViewItem *,
|
||||
const QPoint &, int ) ),
|
||||
this, SLOT( contextMenuRequest( QListViewItem *,
|
||||
const QPoint &, int ) ) );
|
||||
#endif
|
||||
|
||||
|
||||
QPushButton * reload_btn = new QPushButton( embed::getIconPixmap(
|
||||
@@ -113,21 +93,13 @@ fileBrowser::~fileBrowser()
|
||||
void fileBrowser::reloadTree( void )
|
||||
{
|
||||
m_l->clear();
|
||||
#ifndef QT3
|
||||
QStringList paths = m_directories.split( '*' );
|
||||
#else
|
||||
QStringList paths = QStringList::split( '*', m_directories );
|
||||
#endif
|
||||
for( QStringList::iterator it = paths.begin(); it != paths.end(); ++it )
|
||||
{
|
||||
addItems( *it );
|
||||
}
|
||||
|
||||
#ifndef QT3
|
||||
Q3ListViewItem * item = m_l->firstChild();
|
||||
#else
|
||||
QListViewItem * item = m_l->firstChild();
|
||||
#endif
|
||||
bool resort = FALSE;
|
||||
|
||||
// sort merged directories
|
||||
@@ -140,11 +112,7 @@ void fileBrowser::reloadTree( void )
|
||||
}
|
||||
else if( resort == TRUE )
|
||||
{
|
||||
#ifndef QT3
|
||||
Q3ListViewItem * i2 = m_l->firstChild();
|
||||
#else
|
||||
QListViewItem * i2 = m_l->firstChild();
|
||||
#endif
|
||||
d->moveItem( i2 );
|
||||
i2->moveItem( d );
|
||||
directory * d2 = NULL;
|
||||
@@ -174,14 +142,15 @@ void fileBrowser::addItems( const QString & _path )
|
||||
// which makes it possible to travel through the list in reverse
|
||||
// direction
|
||||
|
||||
for( csize i = 0; i < files.size(); ++i )
|
||||
for( int i = 0; i < files.size(); ++i )
|
||||
{
|
||||
QString cur_file = files[files.size() - i - 1];
|
||||
if( cur_file[0] != '.'
|
||||
#warning TODO: add match here
|
||||
#ifdef QT4
|
||||
// TBD
|
||||
#else
|
||||
&& QDir::match( m_filter, cur_file.lower() )
|
||||
// && QDir::match( m_filter, cur_file.lower() )
|
||||
#endif
|
||||
)
|
||||
{
|
||||
@@ -192,18 +161,14 @@ void fileBrowser::addItems( const QString & _path )
|
||||
}
|
||||
|
||||
files = cdir.entryList( QDir::Dirs, QDir::Name );
|
||||
for( csize i = 0; i < files.size(); ++i )
|
||||
for( int i = 0; i < files.size(); ++i )
|
||||
{
|
||||
QString cur_file = files[files.size() - i - 1];
|
||||
if( cur_file[0] != '.' &&
|
||||
isDirWithContent( _path + QDir::separator() + cur_file,
|
||||
m_filter ) )
|
||||
{
|
||||
#ifdef QT4
|
||||
Q3ListViewItem * item = m_l->findItem( cur_file, 0 );
|
||||
#else
|
||||
QListViewItem * item = m_l->findItem( cur_file, 0 );
|
||||
#endif
|
||||
if( item == NULL )
|
||||
{
|
||||
(void) new directory( m_l, cur_file, _path,
|
||||
@@ -230,10 +195,11 @@ bool fileBrowser::isDirWithContent( const QString & _path,
|
||||
{
|
||||
QString cur_file = *it;
|
||||
if( cur_file[0] != '.'
|
||||
#warning TODO: add match here
|
||||
#ifdef QT4
|
||||
// TBD
|
||||
#else
|
||||
&& QDir::match( _filter, cur_file.lower() )
|
||||
// && QDir::match( _filter, cur_file.lower() )
|
||||
#endif
|
||||
)
|
||||
{
|
||||
@@ -274,11 +240,7 @@ void fileBrowser::keyPressEvent( QKeyEvent * _ke )
|
||||
|
||||
|
||||
|
||||
#ifdef QT4
|
||||
void fileBrowser::contextMenuRequest( Q3ListViewItem * i, const QPoint &, int )
|
||||
#else
|
||||
void fileBrowser::contextMenuRequest( QListViewItem * i, const QPoint &, int )
|
||||
#endif
|
||||
{
|
||||
fileItem * f = dynamic_cast<fileItem *>( i );
|
||||
if( f != NULL && ( f->type() == fileItem::SAMPLE_FILE ||
|
||||
@@ -307,11 +269,7 @@ void fileBrowser::contextMenuRequest( QListViewItem * i, const QPoint &, int )
|
||||
|
||||
|
||||
|
||||
#ifdef QT4
|
||||
void fileBrowser::contextMenuRequest( QListViewItem * i, const QPoint &, int )
|
||||
#else
|
||||
void fileBrowser::contextMenuRequest( Q3ListViewItem * i, const QPoint &, int )
|
||||
#endif
|
||||
{
|
||||
}
|
||||
|
||||
@@ -327,11 +285,7 @@ void fileBrowser::sendToActiveInstrumentTrack( void )
|
||||
|
||||
// get all windows opened in the workspace
|
||||
QWidgetList pl = engine::getMainWindow()->workspace()->windowList(
|
||||
#if QT_VERSION >= 0x030200
|
||||
QWorkspace::StackingOrder
|
||||
#endif
|
||||
);
|
||||
#ifdef QT4
|
||||
QWorkspace::StackingOrder );
|
||||
QListIterator<QWidget *> w( pl );
|
||||
w.toBack();
|
||||
// now we travel through the window-list until we find an
|
||||
@@ -340,14 +294,6 @@ void fileBrowser::sendToActiveInstrumentTrack( void )
|
||||
{
|
||||
instrumentTrack * ct = dynamic_cast<instrumentTrack *>(
|
||||
w.previous() );
|
||||
#else
|
||||
QWidget * w = pl.last();
|
||||
// now we travel through the window-list until we find an
|
||||
// instrument-track
|
||||
while( w != NULL )
|
||||
{
|
||||
instrumentTrack * ct = dynamic_cast<instrumentTrack *>( w );
|
||||
#endif
|
||||
if( ct != NULL && ct->isHidden() == FALSE )
|
||||
{
|
||||
// ok, it's an instrument-track, so we can apply the
|
||||
@@ -378,9 +324,6 @@ void fileBrowser::sendToActiveInstrumentTrack( void )
|
||||
engine::getMixer()->unlock();
|
||||
break;
|
||||
}
|
||||
#ifndef QT4
|
||||
w = pl.prev();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -540,11 +483,7 @@ void listView::contentsMousePressEvent( QMouseEvent * _me )
|
||||
}
|
||||
|
||||
QPoint p( contentsToViewport( _me->pos() ) );
|
||||
#ifndef QT3
|
||||
Q3ListViewItem * i = itemAt( p );
|
||||
#else
|
||||
QListViewItem * i = itemAt( p );
|
||||
#endif
|
||||
if ( i )
|
||||
{
|
||||
if ( p.x() > header()->cellPos( header()->mapToActual( 0 ) ) +
|
||||
@@ -579,11 +518,7 @@ void listView::contentsMousePressEvent( QMouseEvent * _me )
|
||||
"preview..." ),
|
||||
embed::getIconPixmap( "sound_file",
|
||||
24, 24 ), 0 );
|
||||
#ifdef QT4
|
||||
qApp->processEvents( QEventLoop::AllEvents );
|
||||
#else
|
||||
qApp->processEvents();
|
||||
#endif
|
||||
samplePlayHandle * s = new samplePlayHandle(
|
||||
f->fullName() );
|
||||
s->setDoneMayReturnTrue( FALSE );
|
||||
@@ -699,11 +634,7 @@ QPixmap * directory::s_folderLockedPixmap = NULL;
|
||||
|
||||
directory::directory( directory * _parent, const QString & _name,
|
||||
const QString & _path, const QString & _filter ) :
|
||||
#ifndef QT3
|
||||
Q3ListViewItem( _parent, _name ),
|
||||
#else
|
||||
QListViewItem( _parent, _name ),
|
||||
#endif
|
||||
m_p( _parent ),
|
||||
m_pix( NULL ),
|
||||
m_directories( _path ),
|
||||
@@ -717,11 +648,7 @@ directory::directory( directory * _parent, const QString & _name,
|
||||
|
||||
directory::directory( Q3ListView * _parent, const QString & _name,
|
||||
const QString & _path, const QString & _filter ) :
|
||||
#ifndef QT3
|
||||
Q3ListViewItem( _parent, _name ),
|
||||
#else
|
||||
QListViewItem( _parent, _name ),
|
||||
#endif
|
||||
m_p( NULL ),
|
||||
m_pix( NULL ),
|
||||
m_directories( _path ),
|
||||
@@ -799,21 +726,13 @@ void directory::setOpen( bool _o )
|
||||
( *it ).contains(
|
||||
configManager::inst()->dataDir() ) )
|
||||
{
|
||||
#ifndef QT3
|
||||
( new Q3ListViewItem( this,
|
||||
#else
|
||||
( new QListViewItem( this,
|
||||
#endif
|
||||
listView::tr( "--- Factory files ---" ) ) )->setPixmap( 0,
|
||||
embed::getIconPixmap( "factory_files" ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifndef QT3
|
||||
Q3ListViewItem::setOpen( _o );
|
||||
#else
|
||||
QListViewItem::setOpen( _o );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -822,11 +741,7 @@ void directory::setOpen( bool _o )
|
||||
void directory::setup( void )
|
||||
{
|
||||
setExpandable( TRUE );
|
||||
#ifndef QT3
|
||||
Q3ListViewItem::setup();
|
||||
#else
|
||||
QListViewItem::setup();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -847,15 +762,11 @@ bool directory::addItems( const QString & _path )
|
||||
bool added_something = FALSE;
|
||||
|
||||
QStringList files = thisDir.entryList( QDir::Files, QDir::Name );
|
||||
for( csize i = 0; i < files.size(); ++i )
|
||||
for( int i = 0; i < files.size(); ++i )
|
||||
{
|
||||
QString cur_file = files[files.size() - i - 1];
|
||||
if( cur_file[0] != '.'
|
||||
#ifdef QT4
|
||||
&& thisDir.match( m_filter, cur_file.toLower() )
|
||||
#else
|
||||
&& thisDir.match( m_filter, cur_file.lower() )
|
||||
#endif
|
||||
/*QDir::match( FILE_FILTER, cur_file )*/ )
|
||||
{
|
||||
(void) new fileItem( this, cur_file, _path );
|
||||
@@ -864,15 +775,11 @@ bool directory::addItems( const QString & _path )
|
||||
}
|
||||
|
||||
files = thisDir.entryList( QDir::Dirs, QDir::Name );
|
||||
for( csize i = 0; i < files.size(); ++i )
|
||||
for( int i = 0; i < files.size(); ++i )
|
||||
{
|
||||
QString cur_file = files[files.size() - i - 1];
|
||||
if( cur_file[0] != '.' && fileBrowser::isDirWithContent(
|
||||
#ifdef QT4
|
||||
thisDir.absolutePath() + QDir::separator() +
|
||||
#else
|
||||
thisDir.absPath() + QDir::separator() +
|
||||
#endif
|
||||
cur_file, m_filter ) )
|
||||
{
|
||||
new directory( this, cur_file, _path, m_filter );
|
||||
@@ -922,11 +829,7 @@ QPixmap * fileItem::s_unknownFilePixmap = NULL;
|
||||
|
||||
fileItem::fileItem( Q3ListView * _parent, const QString & _name,
|
||||
const QString & _path ) :
|
||||
#ifndef QT3
|
||||
Q3ListViewItem( _parent, _name ),
|
||||
#else
|
||||
QListViewItem( _parent, _name ),
|
||||
#endif
|
||||
m_pix( NULL ),
|
||||
m_path( _path )
|
||||
{
|
||||
@@ -938,15 +841,9 @@ fileItem::fileItem( Q3ListView * _parent, const QString & _name,
|
||||
|
||||
|
||||
|
||||
#ifndef QT3
|
||||
fileItem::fileItem( Q3ListViewItem * _parent, const QString & _name,
|
||||
const QString & _path ) :
|
||||
Q3ListViewItem( _parent, _name ),
|
||||
#else
|
||||
fileItem::fileItem( QListViewItem * _parent, const QString & _name,
|
||||
const QString & _path ) :
|
||||
QListViewItem( _parent, _name ),
|
||||
#endif
|
||||
m_pix( NULL ),
|
||||
m_path( _path )
|
||||
{
|
||||
@@ -1072,11 +969,7 @@ QString fileItem::extension( void )
|
||||
|
||||
QString fileItem::extension( const QString & _file )
|
||||
{
|
||||
#ifdef QT4
|
||||
return( QFileInfo( _file ).suffix().toLower() );
|
||||
#else
|
||||
return( QFileInfo( _file ).extension( FALSE ).toLower() );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -25,22 +25,13 @@
|
||||
*/
|
||||
|
||||
|
||||
#include <QtGui/QMessageBox>
|
||||
|
||||
#include "import_filter.h"
|
||||
#include "engine.h"
|
||||
#include "track_container.h"
|
||||
#include "project_journal.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtGui/QMessageBox>
|
||||
|
||||
#else
|
||||
|
||||
#include <qmessagebox.h>
|
||||
|
||||
#define fileName name
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
importFilter::importFilter( const QString & _file_name,
|
||||
@@ -63,24 +54,18 @@ importFilter::~importFilter()
|
||||
void importFilter::import( const QString & _file_to_import,
|
||||
trackContainer * _tc )
|
||||
{
|
||||
vvector<descriptor> d;
|
||||
QVector<descriptor> d;
|
||||
plugin::getDescriptorsOfAvailPlugins( d );
|
||||
|
||||
bool successful = FALSE;
|
||||
|
||||
char * s = qstrdup( _file_to_import.
|
||||
#ifndef QT3
|
||||
toAscii().constData()
|
||||
#else
|
||||
ascii()
|
||||
#endif
|
||||
);
|
||||
char * s = qstrdup( _file_to_import.toAscii().constData() );
|
||||
|
||||
// do not record changes while importing files
|
||||
const bool j = engine::getProjectJournal()->isJournalling();
|
||||
engine::getProjectJournal()->setJournalling( FALSE );
|
||||
|
||||
for( vvector<plugin::descriptor>::iterator it = d.begin();
|
||||
for( QVector<plugin::descriptor>::iterator it = d.begin();
|
||||
it != d.end(); ++it )
|
||||
{
|
||||
if( it->type == plugin::ImportFilter )
|
||||
@@ -122,11 +107,7 @@ void importFilter::import( const QString & _file_to_import,
|
||||
|
||||
bool importFilter::openFile( void )
|
||||
{
|
||||
#ifdef QT4
|
||||
if( m_file.open( QFile::ReadOnly ) == FALSE )
|
||||
#else
|
||||
if( m_file.open( IO_ReadOnly ) == FALSE )
|
||||
#endif
|
||||
{
|
||||
QMessageBox::critical( NULL,
|
||||
trackContainer::tr( "Couldn't open file" ),
|
||||
|
||||
@@ -25,26 +25,12 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QLocale>
|
||||
#include <QtCore/QTranslator>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QSplashScreen>
|
||||
|
||||
#else
|
||||
|
||||
#include <qapplication.h>
|
||||
#include <qtextcodec.h>
|
||||
#if QT_VERSION >= 0x030200
|
||||
#include <qsplashscreen.h>
|
||||
#endif
|
||||
#include <qtranslator.h>
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SCHED_H
|
||||
#include <sched.h>
|
||||
#endif
|
||||
@@ -58,13 +44,17 @@
|
||||
#include "song_editor.h"
|
||||
#include "gui_templates.h"
|
||||
|
||||
#warning TODO: move somewhere else
|
||||
static inline QString baseName( const QString & _file )
|
||||
{
|
||||
return( QFileInfo( _file ).absolutePath() + "/" +
|
||||
QFileInfo( _file ).completeBaseName() );
|
||||
}
|
||||
|
||||
QString file_to_render;
|
||||
|
||||
|
||||
#if QT_VERSION >= 0x030100
|
||||
int splash_alignment_flags = Qt::AlignTop | Qt::AlignLeft;
|
||||
#endif
|
||||
|
||||
inline void loadTranslation( const QString & _tname,
|
||||
const QString & _dir = configManager::inst()->localeDir() )
|
||||
@@ -168,12 +158,7 @@ int main( int argc, char * * argv )
|
||||
}
|
||||
|
||||
|
||||
QString pos =
|
||||
#ifdef QT4
|
||||
QLocale::system().name().left( 2 );
|
||||
#else
|
||||
QString( QTextCodec::locale() ).section( '_', 0, 0 );
|
||||
#endif
|
||||
QString pos = QLocale::system().name().left( 2 );
|
||||
// load translation for Qt-widgets/-dialogs
|
||||
#ifdef QT_TRANSLATIONS_DIR
|
||||
loadTranslation( QString( "qt_" ) + pos,
|
||||
@@ -184,9 +169,7 @@ int main( int argc, char * * argv )
|
||||
// load actual translation for LMMS
|
||||
loadTranslation( pos );
|
||||
|
||||
#ifdef QT4
|
||||
app.setFont( pointSize<10>( app.font() ) );
|
||||
#endif
|
||||
|
||||
|
||||
if( !configManager::inst()->loadConfigFile() )
|
||||
@@ -195,7 +178,6 @@ int main( int argc, char * * argv )
|
||||
}
|
||||
|
||||
QPalette pal = app.palette();
|
||||
#ifdef QT4
|
||||
pal.setColor( QPalette::Background, QColor( 128, 128, 128 ) );
|
||||
pal.setColor( QPalette::Foreground, QColor( 240, 240, 240 ) );
|
||||
pal.setColor( QPalette::Base, QColor( 128, 128, 128 ) );
|
||||
@@ -204,20 +186,9 @@ int main( int argc, char * * argv )
|
||||
pal.setColor( QPalette::ButtonText, QColor( 255, 255, 255 ) );
|
||||
pal.setColor( QPalette::Highlight, QColor( 224, 224, 224 ) );
|
||||
pal.setColor( QPalette::HighlightedText, QColor( 0, 0, 0 ) );
|
||||
#else
|
||||
pal.setColor( QColorGroup::Background, QColor( 128, 128, 128 ) );
|
||||
pal.setColor( QColorGroup::Foreground, QColor( 240, 240, 240 ) );
|
||||
pal.setColor( QColorGroup::Base, QColor( 128, 128, 128 ) );
|
||||
pal.setColor( QColorGroup::Text, QColor( 224, 224, 224 ) );
|
||||
pal.setColor( QColorGroup::Button, QColor( 160, 160, 160 ) );
|
||||
pal.setColor( QColorGroup::ButtonText, QColor( 255, 255, 255 ) );
|
||||
pal.setColor( QColorGroup::Highlight, QColor( 224, 224, 224 ) );
|
||||
pal.setColor( QColorGroup::HighlightedText, QColor( 0, 0, 0 ) );
|
||||
#endif
|
||||
app.setPalette( pal );
|
||||
|
||||
|
||||
#if QT_VERSION >= 0x030200
|
||||
// init splash screen
|
||||
QPixmap splash = embed::getIconPixmap( "splash" );
|
||||
mainWindow::s_splashScreen = new QSplashScreen( splash );
|
||||
@@ -229,7 +200,6 @@ int main( int argc, char * * argv )
|
||||
"workspace..." ),
|
||||
splash_alignment_flags,
|
||||
Qt::white );
|
||||
#endif
|
||||
|
||||
engine::init();
|
||||
|
||||
@@ -242,9 +212,7 @@ int main( int argc, char * * argv )
|
||||
{
|
||||
engine::getSongEditor()->createNewProject();
|
||||
}
|
||||
#ifndef QT4
|
||||
app.setMainWidget( engine::getMainWindow() );
|
||||
#endif
|
||||
|
||||
// MDI-mode?
|
||||
if( engine::getMainWindow()->workspace() != NULL )
|
||||
{
|
||||
@@ -260,10 +228,9 @@ int main( int argc, char * * argv )
|
||||
}
|
||||
|
||||
|
||||
#if QT_VERSION >= 0x030200
|
||||
delete mainWindow::s_splashScreen;
|
||||
mainWindow::s_splashScreen = NULL;
|
||||
#endif
|
||||
|
||||
if( file_to_render != "" )
|
||||
{
|
||||
exportProjectDialog * e = new exportProjectDialog(
|
||||
|
||||
@@ -25,10 +25,6 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QFileDialog>
|
||||
#include <QtGui/QCloseEvent>
|
||||
@@ -38,24 +34,6 @@
|
||||
#include <QtGui/QMenuBar>
|
||||
#include <Qt/QtXml>
|
||||
|
||||
#else
|
||||
|
||||
#include <qsplitter.h>
|
||||
#include <qapplication.h>
|
||||
#include <qdir.h>
|
||||
#include <qfiledialog.h>
|
||||
#include <qpopupmenu.h>
|
||||
#include <qmessagebox.h>
|
||||
#include <qmenubar.h>
|
||||
#include <qdom.h>
|
||||
|
||||
#if QT_VERSION >= 0x030200
|
||||
#include <qsplashscreen.h>
|
||||
#endif
|
||||
|
||||
#define addSeparator insertSeparator
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
@@ -84,27 +62,19 @@
|
||||
#include "templates.h"
|
||||
|
||||
|
||||
#if QT_VERSION >= 0x030100
|
||||
QSplashScreen * mainWindow::s_splashScreen = NULL;
|
||||
extern int splash_alignment_flags;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
mainWindow::mainWindow( void ) :
|
||||
QMainWindow(
|
||||
#ifndef QT4
|
||||
0 , NULL, WDestructiveClose
|
||||
#endif
|
||||
),
|
||||
QMainWindow(),
|
||||
m_workspace( NULL ),
|
||||
m_templatesMenu( NULL ),
|
||||
m_recentlyOpenedProjectsMenu( NULL ),
|
||||
m_tools_menu( NULL )
|
||||
{
|
||||
#ifdef QT4
|
||||
setAttribute( Qt::WA_DeleteOnClose );
|
||||
#endif
|
||||
|
||||
bool no_mdi = configManager::inst()->value( "app", "gimplikewindows"
|
||||
).toInt();
|
||||
@@ -125,13 +95,11 @@ mainWindow::mainWindow( void ) :
|
||||
side_bar->setPosition( sideBar::Left );
|
||||
|
||||
QSplitter * splitter = new QSplitter( Qt::Horizontal, w );
|
||||
#if QT_VERSION >= 0x030200
|
||||
splitter->setChildrenCollapsible( FALSE );
|
||||
#endif
|
||||
|
||||
QString sample_filter;
|
||||
vlist<QString> ext_keys = engine::sampleExtensions().keys();
|
||||
for( vlist<QString>::iterator it = ext_keys.begin();
|
||||
QList<QString> ext_keys = engine::sampleExtensions().keys();
|
||||
for( QList<QString>::iterator it = ext_keys.begin();
|
||||
it != ext_keys.end(); ++it )
|
||||
{
|
||||
sample_filter += " *." + *it;
|
||||
@@ -173,13 +141,9 @@ mainWindow::mainWindow( void ) :
|
||||
m_workspace = new QWorkspace( splitter );
|
||||
m_workspace->setScrollBarsEnabled( TRUE );
|
||||
|
||||
#ifdef QT4
|
||||
#warning TODO
|
||||
/* m_workspace->setBackground( embed::getIconPixmap(
|
||||
"background_artwork" ) );*/
|
||||
#else
|
||||
m_workspace->setPaletteBackgroundPixmap( embed::getIconPixmap(
|
||||
"background_artwork" ) );
|
||||
#endif
|
||||
}
|
||||
|
||||
hbox->addWidget( side_bar );
|
||||
@@ -190,16 +154,11 @@ mainWindow::mainWindow( void ) :
|
||||
m_toolBar = new QWidget( main_widget );
|
||||
m_toolBar->setFixedHeight( 64 );
|
||||
m_toolBar->move( 0, 0 );
|
||||
#ifdef QT4
|
||||
m_toolBar->setAutoFillBackground( TRUE );
|
||||
QPalette pal;
|
||||
pal.setBrush( m_toolBar->backgroundRole(),
|
||||
embed::getIconPixmap( "main_toolbar_bg" ) );
|
||||
m_toolBar->setPalette( pal );
|
||||
#else
|
||||
m_toolBar->setPaletteBackgroundPixmap(
|
||||
embed::getIconPixmap( "main_toolbar_bg" ) );
|
||||
#endif
|
||||
|
||||
// add layout for organizing quite complex toolbar-layouting
|
||||
m_toolBarLayout = new QGridLayout( m_toolBar/*, 2, 1*/ );
|
||||
@@ -227,7 +186,6 @@ mainWindow::~mainWindow()
|
||||
|
||||
void mainWindow::finalize( void )
|
||||
{
|
||||
#if QT_VERSION >= 0x030200
|
||||
if( qApp->argc() > 1 )
|
||||
{
|
||||
s_splashScreen->showMessage( tr( "Loading song..." ),
|
||||
@@ -240,14 +198,11 @@ void mainWindow::finalize( void )
|
||||
splash_alignment_flags,
|
||||
Qt::white );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if QT_VERSION >= 0x030200
|
||||
s_splashScreen->showMessage( tr( "Creating GUI..." ),
|
||||
splash_alignment_flags,
|
||||
Qt::white );
|
||||
#endif
|
||||
resetWindowTitle( "" );
|
||||
setWindowIcon( embed::getIconPixmap( "icon" ) );
|
||||
|
||||
@@ -262,19 +217,10 @@ void mainWindow::finalize( void )
|
||||
m_templatesMenu = new QMenu( project_new );
|
||||
connect( m_templatesMenu, SIGNAL( aboutToShow( void ) ),
|
||||
this, SLOT( fillTemplatesMenu( void ) ) );
|
||||
#ifdef QT4
|
||||
connect( m_templatesMenu, SIGNAL( triggered( QAction * ) ),
|
||||
this, SLOT( createNewProjectFromTemplate( QAction * ) ) );
|
||||
#else
|
||||
connect( m_templatesMenu, SIGNAL( activated( int ) ),
|
||||
this, SLOT( createNewProjectFromTemplate( int ) ) );
|
||||
#endif
|
||||
project_new->setMenu( m_templatesMenu );
|
||||
#ifdef QT4
|
||||
project_new->setPopupMode( toolButton::MenuButtonPopup );
|
||||
#else
|
||||
project_new->setPopupDelay( 0 );
|
||||
#endif
|
||||
|
||||
toolButton * project_open = new toolButton(
|
||||
embed::getIconPixmap( "project_open" ),
|
||||
@@ -314,11 +260,7 @@ void mainWindow::finalize( void )
|
||||
this, SLOT( toggleBBEditorWin() ),
|
||||
m_toolBar );
|
||||
bb_editor_window->setShortcut( Qt::Key_F6 );
|
||||
#ifdef QT4
|
||||
bb_editor_window->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( bb_editor_window,
|
||||
#endif
|
||||
tr( "By pressing this button, you can show or hide the "
|
||||
"Beat+Baseline Editor. The Beat+Baseline Editor is "
|
||||
"needed for creating beats, opening, adding and "
|
||||
@@ -334,11 +276,7 @@ void mainWindow::finalize( void )
|
||||
this, SLOT( togglePianoRollWin() ),
|
||||
m_toolBar );
|
||||
piano_roll_window->setShortcut( Qt::Key_F7 );
|
||||
#ifdef QT4
|
||||
piano_roll_window->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( piano_roll_window,
|
||||
#endif
|
||||
tr( "By pressing this button, you can show or hide the "
|
||||
"Piano-Roll. With the help of the Piano-Roll "
|
||||
"you can edit melody-patterns in an easy way."
|
||||
@@ -350,11 +288,7 @@ void mainWindow::finalize( void )
|
||||
this, SLOT( toggleSongEditorWin() ),
|
||||
m_toolBar );
|
||||
song_editor_window->setShortcut( Qt::Key_F8 );
|
||||
#ifdef QT4
|
||||
song_editor_window->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( song_editor_window,
|
||||
#endif
|
||||
tr( "By pressing this button, you can show or hide the "
|
||||
"Song-Editor. With the help of the Song-Editor you can "
|
||||
"edit song-playlist and specify when which track "
|
||||
@@ -371,11 +305,7 @@ void mainWindow::finalize( void )
|
||||
SLOT( toggleAutomationEditorWin() ),
|
||||
m_toolBar );
|
||||
automation_editor_window->setShortcut( Qt::Key_F9 );
|
||||
#ifdef QT4
|
||||
automation_editor_window->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( automation_editor_window,
|
||||
#endif
|
||||
tr( "By pressing this button, you can show or hide the "
|
||||
"Automation Editor. With the help of the "
|
||||
"Automation Editor you can edit dynamic values "
|
||||
@@ -405,11 +335,7 @@ void mainWindow::finalize( void )
|
||||
this, SLOT( toggleProjectNotesWin() ),
|
||||
m_toolBar );
|
||||
project_notes_window->setShortcut( Qt::Key_F10 );
|
||||
#ifdef QT4
|
||||
project_notes_window->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( project_notes_window,
|
||||
#endif
|
||||
tr( "By pressing this button, you can show or hide the "
|
||||
"project notes window. In this window you can put "
|
||||
"down your project notes.") );
|
||||
@@ -432,11 +358,7 @@ void mainWindow::finalize( void )
|
||||
|
||||
// project-popup-menu
|
||||
QMenu * project_menu = new QMenu( this );
|
||||
#ifdef QT4
|
||||
menuBar()->addMenu( project_menu )->setText( tr( "&Project" ) );
|
||||
#else
|
||||
menuBar()->insertItem( tr( "&Project" ), project_menu );
|
||||
#endif
|
||||
project_menu->addAction( embed::getIconPixmap( "project_new" ),
|
||||
tr( "&New" ),
|
||||
this, SLOT( createNewProject() ),
|
||||
@@ -446,10 +368,10 @@ void mainWindow::finalize( void )
|
||||
tr( "&Open..." ),
|
||||
this, SLOT( openProject() ),
|
||||
Qt::CTRL + Qt::Key_O );
|
||||
|
||||
/*
|
||||
project_menu->addAction( embed::getIconPixmap( "project_open" ),
|
||||
tr( "Recently opened projects" ),
|
||||
m_recentlyOpenedProjectsMenu );
|
||||
m_recentlyOpenedProjectsMenu );*/
|
||||
|
||||
project_menu->addAction( embed::getIconPixmap( "project_save" ),
|
||||
tr( "&Save" ),
|
||||
@@ -460,11 +382,7 @@ void mainWindow::finalize( void )
|
||||
tr( "Save &As..." ),
|
||||
this, SLOT( saveProjectAs() ),
|
||||
Qt::CTRL + Qt::SHIFT + Qt::Key_S );
|
||||
#ifdef QT4
|
||||
project_menu->addSeparator();
|
||||
#else
|
||||
project_menu->insertSeparator();
|
||||
#endif
|
||||
project_menu->addAction( /*embed::getIconPixmap( "project_import" ),*/
|
||||
tr( "Import..." ),
|
||||
engine::getSongEditor(),
|
||||
@@ -474,22 +392,14 @@ void mainWindow::finalize( void )
|
||||
engine::getSongEditor(),
|
||||
SLOT( exportProject() ),
|
||||
Qt::CTRL + Qt::Key_E );
|
||||
#ifdef QT4
|
||||
project_menu->addSeparator();
|
||||
#else
|
||||
project_menu->insertSeparator();
|
||||
#endif
|
||||
project_menu->addAction( embed::getIconPixmap( "exit" ), tr( "&Quit" ),
|
||||
qApp, SLOT( closeAllWindows() ),
|
||||
Qt::CTRL + Qt::Key_Q );
|
||||
|
||||
|
||||
QMenu * edit_menu = new QMenu( this );
|
||||
#ifdef QT4
|
||||
menuBar()->addMenu( edit_menu )->setText( tr( "&Edit" ) );
|
||||
#else
|
||||
menuBar()->insertItem( tr( "&Edit" ), edit_menu );
|
||||
#endif
|
||||
edit_menu->addAction( embed::getIconPixmap( "edit_undo" ),
|
||||
tr( "Undo" ),
|
||||
this, SLOT( undo() ),
|
||||
@@ -501,11 +411,7 @@ void mainWindow::finalize( void )
|
||||
|
||||
|
||||
QMenu * settings_menu = new QMenu( this );
|
||||
#ifdef QT4
|
||||
menuBar()->addMenu( settings_menu )->setText( tr( "&Settings" ) );
|
||||
#else
|
||||
menuBar()->insertItem( tr( "&Settings" ), settings_menu );
|
||||
#endif
|
||||
settings_menu->addAction( embed::getIconPixmap( "setup_general" ),
|
||||
tr( "Show settings dialog" ),
|
||||
this, SLOT( showSettingsDialog() ) );
|
||||
@@ -515,9 +421,9 @@ void mainWindow::finalize( void )
|
||||
|
||||
|
||||
m_tools_menu = new QMenu( this );
|
||||
vvector<plugin::descriptor> pluginDescriptors;
|
||||
QVector<plugin::descriptor> pluginDescriptors;
|
||||
plugin::getDescriptorsOfAvailPlugins( pluginDescriptors );
|
||||
for( vvector<plugin::descriptor>::iterator it =
|
||||
for( QVector<plugin::descriptor>::iterator it =
|
||||
pluginDescriptors.begin();
|
||||
it != pluginDescriptors.end(); ++it )
|
||||
{
|
||||
@@ -528,31 +434,17 @@ void mainWindow::finalize( void )
|
||||
this ) );
|
||||
}
|
||||
}
|
||||
#ifndef QT3
|
||||
if( !m_tools_menu->isEmpty() )
|
||||
#else
|
||||
if( m_tools_menu->count() )
|
||||
#endif
|
||||
{
|
||||
#ifdef QT4
|
||||
menuBar()->addMenu( m_tools_menu )->setText( tr( "&Tools" ) );
|
||||
connect( m_tools_menu, SIGNAL( triggered( QAction * ) ),
|
||||
this, SLOT( showTool( QAction * ) ) );
|
||||
#else
|
||||
menuBar()->insertItem( tr( "&Tools" ), m_tools_menu );
|
||||
connect( m_tools_menu, SIGNAL( activated( int ) ),
|
||||
this, SLOT( showTool( int ) ) );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
// help-popup-menu
|
||||
QMenu * help_menu = new QMenu( this );
|
||||
#ifdef QT4
|
||||
menuBar()->addMenu( help_menu )->setText( tr( "&Help" ) );
|
||||
#else
|
||||
menuBar()->insertItem( tr( "&Help" ), help_menu );
|
||||
#endif
|
||||
if( have_www_browser() )
|
||||
{
|
||||
help_menu->addAction( embed::getIconPixmap( "help" ),
|
||||
@@ -569,11 +461,7 @@ void mainWindow::finalize( void )
|
||||
tr( "What's this?" ),
|
||||
this, SLOT( enterWhatsThisMode() ) );
|
||||
|
||||
#ifdef QT4
|
||||
help_menu->addSeparator();
|
||||
#else
|
||||
help_menu->insertSeparator();
|
||||
#endif
|
||||
help_menu->addAction( embed::getIconPixmap( "icon" ), tr( "About" ),
|
||||
this, SLOT( aboutLMMS() ) );
|
||||
|
||||
@@ -602,11 +490,7 @@ int mainWindow::addWidgetToToolBar( QWidget * _w, int _row, int _col )
|
||||
int col = ( _col == -1 ) ? m_toolBarLayout->columnCount() + 6 : _col;
|
||||
if( _w->height() > 32 || _row == -1 )
|
||||
{
|
||||
#ifdef QT4
|
||||
m_toolBarLayout->addWidget( _w, 0, col, 2, 1 );
|
||||
#else
|
||||
m_toolBarLayout->addMultiCellWidget( _w, 0, 1, col, col );
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -633,11 +517,7 @@ void mainWindow::resetWindowTitle( const QString & _add )
|
||||
if( _add == "" && engine::getSongEditor()->projectFileName() != "" )
|
||||
{
|
||||
title = QFileInfo( engine::getSongEditor()->projectFileName()
|
||||
#ifdef QT4
|
||||
).completeBaseName();
|
||||
#else
|
||||
).baseName( TRUE );
|
||||
#endif
|
||||
).completeBaseName();
|
||||
}
|
||||
if( title != "" )
|
||||
{
|
||||
@@ -711,60 +591,30 @@ void mainWindow::createNewProject( void )
|
||||
|
||||
|
||||
|
||||
#ifdef QT4
|
||||
void mainWindow::createNewProjectFromTemplate( QAction * _idx )
|
||||
#else
|
||||
void mainWindow::createNewProjectFromTemplate( int _idx )
|
||||
#endif
|
||||
{
|
||||
if( m_templatesMenu != NULL &&
|
||||
engine::getSongEditor()->mayChangeProject() == TRUE )
|
||||
{
|
||||
#ifdef QT4
|
||||
QString dir_base = m_templatesMenu->actions().indexOf( _idx )
|
||||
#else
|
||||
QString dir_base = m_templatesMenu->indexOf( _idx )
|
||||
#endif
|
||||
>= m_custom_templates_count ?
|
||||
configManager::inst()->factoryProjectsDir() :
|
||||
configManager::inst()->userProjectsDir();
|
||||
engine::getSongEditor()->createNewProjectFromTemplate(
|
||||
dir_base + "templates/" +
|
||||
#ifdef QT4
|
||||
_idx->text() + ".mpt" );
|
||||
#else
|
||||
m_templatesMenu->text( _idx ) + ".mpt" );
|
||||
#endif
|
||||
dir_base + "templates/" + _idx->text() + ".mpt" );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef QT4
|
||||
void mainWindow::createNewProjectFromTemplate( int _idx )
|
||||
#else
|
||||
void mainWindow::createNewProjectFromTemplate( QAction * _idx )
|
||||
#endif
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void mainWindow::openProject( void )
|
||||
{
|
||||
if( engine::getSongEditor()->mayChangeProject() == TRUE )
|
||||
{
|
||||
#ifdef QT4
|
||||
QFileDialog ofd( this, tr( "Open project" ), "",
|
||||
tr( "MultiMedia Project (*.mmp *.mmpz *.xml)" ) );
|
||||
#else
|
||||
QFileDialog ofd( QString::null,
|
||||
tr( "MultiMedia Project (*.mmp *.mmpz *.xml)" ),
|
||||
this, "", TRUE );
|
||||
ofd.setWindowTitle( tr( "Open project" ) );
|
||||
#endif
|
||||
ofd.setDirectory( configManager::inst()->userProjectsDir() );
|
||||
ofd.setFileMode( QFileDialog::ExistingFiles );
|
||||
if( ofd.exec () == QDialog::Accepted &&
|
||||
@@ -794,10 +644,11 @@ void mainWindow::updateRecentlyOpenedProjectsMenu( void )
|
||||
|
||||
void mainWindow::openRecentlyOpenedProject( int _id )
|
||||
{
|
||||
const QString & f = m_recentlyOpenedProjectsMenu->text( _id );
|
||||
#warning TODO
|
||||
/* const QString & f = m_recentlyOpenedProjectsMenu->text( _id );
|
||||
engine::getSongEditor()->loadProject( f );
|
||||
configManager::inst()->addRecentlyOpenedProject( f );
|
||||
updateRecentlyOpenedProjectsMenu();
|
||||
updateRecentlyOpenedProjectsMenu();*/
|
||||
}
|
||||
|
||||
|
||||
@@ -821,27 +672,15 @@ bool mainWindow::saveProject( void )
|
||||
|
||||
bool mainWindow::saveProjectAs( void )
|
||||
{
|
||||
#ifdef QT4
|
||||
QFileDialog sfd( this, tr( "Save project" ), "",
|
||||
tr( "MultiMedia Project (*.mmp *.mmpz);;"
|
||||
"MultiMedia Project Template (*.mpt)" ) );
|
||||
#else
|
||||
QFileDialog sfd( QString::null,
|
||||
tr( "MultiMedia Project (*.mmp *.mmpz);;"
|
||||
"MultiMedia Project Template (*.mpt)" ),
|
||||
this, "", TRUE );
|
||||
sfd.setWindowTitle( tr( "Save project" ) );
|
||||
#endif
|
||||
sfd.setFileMode( QFileDialog::AnyFile );
|
||||
QString f = engine::getSongEditor()->projectFileName();
|
||||
if( f != "" )
|
||||
{
|
||||
sfd.selectFile( QFileInfo( f ).fileName() );
|
||||
#ifdef QT4
|
||||
sfd.setDirectory( QFileInfo( f ).absolutePath() );
|
||||
#else
|
||||
sfd.setDirectory( QFileInfo( f ).dirPath( TRUE ) );
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -849,19 +688,10 @@ bool mainWindow::saveProjectAs( void )
|
||||
}
|
||||
|
||||
if( sfd.exec () == QFileDialog::Accepted &&
|
||||
#ifdef QT4
|
||||
!sfd.selectedFiles().isEmpty() && sfd.selectedFiles()[0] != ""
|
||||
#else
|
||||
sfd.selectedFile() != ""
|
||||
#endif
|
||||
)
|
||||
!sfd.selectedFiles().isEmpty() && sfd.selectedFiles()[0] != "" )
|
||||
{
|
||||
#ifdef QT4
|
||||
engine::getSongEditor()->saveProjectAs(
|
||||
sfd.selectedFiles()[0] );
|
||||
#else
|
||||
engine::getSongEditor()->saveProjectAs( sfd.selectedFile() );
|
||||
#endif
|
||||
return( TRUE );
|
||||
}
|
||||
return( FALSE );
|
||||
@@ -1068,12 +898,7 @@ void mainWindow::fillTemplatesMenu( void )
|
||||
m_templatesMenu->clear();
|
||||
|
||||
QDir user_d( configManager::inst()->userProjectsDir() + "templates" );
|
||||
QStringList templates = user_d.entryList(
|
||||
#ifdef QT4
|
||||
QStringList( "*.mpt" ),
|
||||
#else
|
||||
"*.mpt",
|
||||
#endif
|
||||
QStringList templates = user_d.entryList( QStringList( "*.mpt" ),
|
||||
QDir::Files | QDir::Readable );
|
||||
|
||||
m_custom_templates_count = templates.count();
|
||||
@@ -1086,12 +911,7 @@ void mainWindow::fillTemplatesMenu( void )
|
||||
}
|
||||
|
||||
QDir d( configManager::inst()->factoryProjectsDir() + "templates" );
|
||||
templates = d.entryList(
|
||||
#ifdef QT4
|
||||
QStringList( "*.mpt" ),
|
||||
#else
|
||||
"*.mpt",
|
||||
#endif
|
||||
templates = d.entryList( QStringList( "*.mpt" ),
|
||||
QDir::Files | QDir::Readable );
|
||||
|
||||
|
||||
@@ -1111,17 +931,9 @@ void mainWindow::fillTemplatesMenu( void )
|
||||
|
||||
|
||||
|
||||
#ifndef QT3
|
||||
void mainWindow::showTool( QAction * _idx )
|
||||
#else
|
||||
void mainWindow::showTool( int _idx )
|
||||
#endif
|
||||
{
|
||||
#ifndef QT3
|
||||
tool * t = m_tools[m_tools_menu->actions().indexOf( _idx )];
|
||||
#else
|
||||
tool * t = m_tools[m_tools_menu->indexOf( _idx )];
|
||||
#endif
|
||||
t->show();
|
||||
t->setFocus();
|
||||
}
|
||||
@@ -1129,16 +941,6 @@ void mainWindow::showTool( int _idx )
|
||||
|
||||
|
||||
|
||||
#ifndef QT3
|
||||
void mainWindow::showTool( int _idx )
|
||||
#else
|
||||
void mainWindow::showTool( QAction * _idx )
|
||||
#endif
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
bool mainWindow::have_www_browser( void )
|
||||
{
|
||||
@@ -1160,13 +962,8 @@ void mainWindow::browseHelp( void )
|
||||
{
|
||||
// TODO: use QDesktopService with Qt4
|
||||
QString url = "http://lmms.sf.net/wiki/index.php?title=Main_Page";
|
||||
execlp( "x-www-browser", "x-www-browser", url.
|
||||
#ifdef QT4
|
||||
toAscii().constData(),
|
||||
#else
|
||||
ascii(),
|
||||
#endif
|
||||
NULL );
|
||||
execlp( "x-www-browser", "x-www-browser",
|
||||
url.toAscii().constData(), NULL );
|
||||
perror( "execlp" );
|
||||
exit( EXIT_FAILURE );
|
||||
}
|
||||
@@ -1175,11 +972,6 @@ void mainWindow::browseHelp( void )
|
||||
|
||||
|
||||
|
||||
#ifndef QT4
|
||||
#undef addSeparator
|
||||
#endif
|
||||
|
||||
|
||||
#include "main_window.moc"
|
||||
|
||||
|
||||
|
||||
@@ -26,26 +26,10 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <Qt/QtXml>
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QToolButton>
|
||||
|
||||
#else
|
||||
|
||||
#include <qdom.h>
|
||||
#include <qlistbox.h>
|
||||
#include <qpopupmenu.h>
|
||||
#include <qtoolbutton.h>
|
||||
|
||||
#define setIcon setPixmap
|
||||
#define setText setTextLabel
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "midi_tab_widget.h"
|
||||
#include "embed.h"
|
||||
@@ -156,26 +140,14 @@ midiTabWidget::midiTabWidget( instrumentTrack * _instrument_track,
|
||||
m_readablePorts = new QMenu( m_setupTabWidget );
|
||||
m_readablePorts->setFont( pointSize<9>(
|
||||
m_readablePorts->font() ) );
|
||||
#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 );
|
||||
m_writeablePorts->setFont( pointSize<9>(
|
||||
m_writeablePorts->font() ) );
|
||||
#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();
|
||||
@@ -187,11 +159,7 @@ midiTabWidget::midiTabWidget( instrumentTrack * _instrument_track,
|
||||
rp_btn->setIcon( embed::getIconPixmap( "midi_in" ) );
|
||||
rp_btn->setGeometry( 186, 34, 40, 40 );
|
||||
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->setText( tr( "MIDI-devices to send MIDI-events "
|
||||
@@ -199,11 +167,7 @@ midiTabWidget::midiTabWidget( instrumentTrack * _instrument_track,
|
||||
wp_btn->setIcon( embed::getIconPixmap( "midi_out" ) );
|
||||
wp_btn->setGeometry( 186, 114, 40, 40 );
|
||||
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() ) );
|
||||
@@ -234,7 +198,6 @@ void midiTabWidget::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
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 )
|
||||
@@ -244,16 +207,6 @@ void midiTabWidget::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
rp += ( *it )->text() + ",";
|
||||
}
|
||||
}
|
||||
#else
|
||||
for( csize i = 0; i < m_readablePorts->count(); ++i )
|
||||
{
|
||||
int id = m_readablePorts->idAt( i );
|
||||
if( m_readablePorts->isItemChecked( id ) )
|
||||
{
|
||||
rp += m_readablePorts->text( id ) + ",";
|
||||
}
|
||||
}
|
||||
#endif
|
||||
// cut off comma
|
||||
if( rp.length() > 0 )
|
||||
{
|
||||
@@ -265,7 +218,6 @@ void midiTabWidget::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
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 )
|
||||
@@ -275,16 +227,6 @@ void midiTabWidget::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
wp += ( *it )->text() + ",";
|
||||
}
|
||||
}
|
||||
#else
|
||||
for( csize i = 0; i < m_writeablePorts->count(); ++i )
|
||||
{
|
||||
int id = m_writeablePorts->idAt( i );
|
||||
if( m_writeablePorts->isItemChecked( id ) )
|
||||
{
|
||||
wp += m_writeablePorts->text( id ) + ",";
|
||||
}
|
||||
}
|
||||
#endif
|
||||
// cut off comma
|
||||
if( wp.length() > 0 )
|
||||
{
|
||||
@@ -310,7 +252,6 @@ void midiTabWidget::loadSettings( const QDomElement & _this )
|
||||
|
||||
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();
|
||||
@@ -323,25 +264,10 @@ void midiTabWidget::loadSettings( const QDomElement & _this )
|
||||
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 );
|
||||
if( m_readablePorts->isItemChecked( id ) !=
|
||||
( rp.find( m_readablePorts->text( id ) ) !=
|
||||
rp.end() ) )
|
||||
{
|
||||
activatedReadablePort( id );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
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();
|
||||
@@ -354,20 +280,6 @@ void midiTabWidget::loadSettings( const QDomElement & _this )
|
||||
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 );
|
||||
if( m_writeablePorts->isItemChecked( id ) !=
|
||||
( wp.find( m_writeablePorts->text( id ) ) !=
|
||||
wp.end() ) )
|
||||
{
|
||||
activatedWriteablePort( id );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -422,7 +334,6 @@ 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 )
|
||||
@@ -433,20 +344,9 @@ void midiTabWidget::midiPortModeToggled( bool )
|
||||
activatedReadablePort( *it );
|
||||
}
|
||||
}
|
||||
#else
|
||||
for( csize i = 0; i < m_readablePorts->count(); ++i )
|
||||
{
|
||||
int id = m_readablePorts->idAt( i );
|
||||
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 )
|
||||
@@ -457,16 +357,6 @@ void midiTabWidget::midiPortModeToggled( bool )
|
||||
activatedWriteablePort( *it );
|
||||
}
|
||||
}
|
||||
#else
|
||||
for( csize i = 0; i < m_writeablePorts->count(); ++i )
|
||||
{
|
||||
int id = m_writeablePorts->idAt( i );
|
||||
if( m_writeablePorts->isItemChecked( id ) == TRUE )
|
||||
{
|
||||
activatedWriteablePort( id );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
engine::getSongEditor()->setModified();
|
||||
}
|
||||
@@ -478,7 +368,6 @@ 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 )
|
||||
@@ -488,16 +377,6 @@ void midiTabWidget::readablePortsChanged( void )
|
||||
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 ) == TRUE )
|
||||
{
|
||||
selected_ports.push_back( m_readablePorts->text( id ) );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
m_readablePorts->clear();
|
||||
const QStringList & rp = engine::getMixer()->getMIDIClient()->
|
||||
@@ -505,20 +384,12 @@ 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 );
|
||||
item->setCheckable( TRUE );
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -529,7 +400,6 @@ 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 )
|
||||
@@ -539,17 +409,6 @@ void midiTabWidget::writeablePortsChanged( void )
|
||||
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 ) == TRUE )
|
||||
{
|
||||
selected_ports.push_back( m_writeablePorts->text(
|
||||
id ) );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
m_writeablePorts->clear();
|
||||
const QStringList & wp = engine::getMixer()->getMIDIClient()->
|
||||
@@ -557,27 +416,18 @@ 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 );
|
||||
item->setCheckable( TRUE );
|
||||
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
|
||||
@@ -608,57 +458,6 @@ void midiTabWidget::activatedWriteablePort( QAction * _item )
|
||||
}
|
||||
|
||||
|
||||
void midiTabWidget::activatedReadablePort( int ) { }
|
||||
void midiTabWidget::activatedWriteablePort( int ) { }
|
||||
|
||||
#else
|
||||
|
||||
|
||||
void midiTabWidget::activatedReadablePort( int _id )
|
||||
{
|
||||
// make sure, MIDI-port is configured for input
|
||||
if( m_readablePorts->isItemChecked( _id ) == FALSE &&
|
||||
m_midiPort->mode() != midiPort::INPUT &&
|
||||
m_midiPort->mode() != midiPort::DUPLEX )
|
||||
{
|
||||
m_receiveCheckBox->setChecked( TRUE );
|
||||
}
|
||||
m_readablePorts->setItemChecked( _id,
|
||||
!m_readablePorts->isItemChecked( _id ) );
|
||||
engine::getMixer()->getMIDIClient()->subscribeReadablePort(
|
||||
m_midiPort, m_readablePorts->text( _id ),
|
||||
!m_readablePorts->isItemChecked( _id ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void midiTabWidget::activatedWriteablePort( int _id )
|
||||
{
|
||||
// make sure, MIDI-port is configured for output
|
||||
if( m_writeablePorts->isItemChecked( _id ) == FALSE &&
|
||||
m_midiPort->mode() != midiPort::OUTPUT &&
|
||||
m_midiPort->mode() != midiPort::DUPLEX )
|
||||
{
|
||||
m_sendCheckBox->setChecked( TRUE );
|
||||
}
|
||||
m_writeablePorts->setItemChecked( _id,
|
||||
!m_writeablePorts->isItemChecked( _id ) );
|
||||
engine::getMixer()->getMIDIClient()->subscribeWriteablePort(
|
||||
m_midiPort, m_writeablePorts->text( _id ),
|
||||
!m_writeablePorts->isItemChecked( _id ) );
|
||||
}
|
||||
|
||||
|
||||
void midiTabWidget::activatedReadablePort( QAction * ) { }
|
||||
void midiTabWidget::activatedWriteablePort( QAction * ) { }
|
||||
|
||||
|
||||
#undef setIcon
|
||||
#undef setText
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "midi_tab_widget.moc"
|
||||
|
||||
|
||||
@@ -71,11 +71,7 @@ mixer::mixer( void ) :
|
||||
m_masterGain( 1.0f ),
|
||||
m_audioDev( NULL ),
|
||||
m_oldAudioDev( NULL ),
|
||||
#ifndef QT3
|
||||
m_globalMutex( QMutex::Recursive )
|
||||
#else
|
||||
m_globalMutex( TRUE )
|
||||
#endif
|
||||
{
|
||||
if( configManager::inst()->value( "mixer", "framesperaudiobuffer"
|
||||
).toInt() >= 32 )
|
||||
@@ -294,7 +290,7 @@ const surroundSampleFrame * mixer::renderNextBuffer( void )
|
||||
engine::getSongEditor()->processNextBuffer();
|
||||
|
||||
lockPlayHandles();
|
||||
csize idx = 0;
|
||||
int idx = 0;
|
||||
if( m_parallelizingLevel > 1 )
|
||||
{
|
||||
// TODO: if not enough play-handles are found which are capable of
|
||||
@@ -366,7 +362,7 @@ const surroundSampleFrame * mixer::renderNextBuffer( void )
|
||||
unlockPlayHandles();
|
||||
|
||||
bool more_effects = FALSE;
|
||||
for( vvector<audioPort *>::iterator it = m_audioPorts.begin();
|
||||
for( QVector<audioPort *>::iterator it = m_audioPorts.begin();
|
||||
it != m_audioPorts.end(); ++it )
|
||||
{
|
||||
more_effects = ( *it )->processEffects();
|
||||
|
||||
@@ -26,22 +26,10 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtGui/QFileDialog>
|
||||
#include <QtGui/QMouseEvent>
|
||||
#include <QtGui/QPainter>
|
||||
|
||||
#else
|
||||
|
||||
#include <qpainter.h>
|
||||
#include <qfiledialog.h>
|
||||
#include <qimage.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "name_label.h"
|
||||
#include "rename_dialog.h"
|
||||
@@ -58,9 +46,6 @@ nameLabel::nameLabel( const QString & _initial_name, QWidget * _parent ) :
|
||||
m_pixmap(),
|
||||
m_pixmapFile( "" )
|
||||
{
|
||||
#ifdef QT3
|
||||
setBackgroundMode( Qt::NoBackground );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -107,12 +92,7 @@ void nameLabel::setPixmapFile( const QString & _file )
|
||||
|
||||
void nameLabel::selectPixmap( void )
|
||||
{
|
||||
#ifdef QT4
|
||||
QFileDialog ofd( NULL, tr( "Select icon" ) );
|
||||
#else
|
||||
QFileDialog ofd( QString::null, QString::null, NULL, "", TRUE );
|
||||
ofd.setWindowTitle( tr( "Select icon" ) );
|
||||
#endif
|
||||
|
||||
QString dir;
|
||||
if( m_pixmapFile != "" )
|
||||
@@ -122,11 +102,7 @@ void nameLabel::selectPixmap( void )
|
||||
{
|
||||
f = configManager::inst()->trackIconsDir() + f;
|
||||
}
|
||||
#ifdef QT4
|
||||
dir = QFileInfo( f ).absolutePath();
|
||||
#else
|
||||
dir = QFileInfo( f ).dirPath( TRUE );
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -137,15 +113,9 @@ void nameLabel::selectPixmap( void )
|
||||
// use default QFileDialog::ExistingFile
|
||||
|
||||
// set filters
|
||||
#ifdef QT4
|
||||
QStringList types;
|
||||
types << tr( "All images (*.png *.jpg *.jpeg *.gif *.bmp)" );
|
||||
ofd.setFilters( types );
|
||||
#else
|
||||
ofd.addFilter( tr( "All images (*.png *.jpg *.jpeg *.gif *.bmp)" ) );
|
||||
ofd.setSelectedFilter( tr( "All images (*.png *.jpg *.jpeg *.gif "
|
||||
"*.bmp)" ) );
|
||||
#endif
|
||||
if( m_pixmapFile != "" )
|
||||
{
|
||||
// select previously opened file
|
||||
@@ -153,26 +123,14 @@ void nameLabel::selectPixmap( void )
|
||||
}
|
||||
|
||||
if ( ofd.exec () == QDialog::Accepted
|
||||
#ifndef QT3
|
||||
&& !ofd.selectedFiles().isEmpty()
|
||||
#endif
|
||||
)
|
||||
{
|
||||
QString pf = ofd.
|
||||
#ifdef QT3
|
||||
selectedFile();
|
||||
#else
|
||||
selectedFiles()[0];
|
||||
#endif
|
||||
QString pf = ofd.selectedFiles()[0];
|
||||
if( !QFileInfo( pf ).isRelative() )
|
||||
{
|
||||
#if QT_VERSION >= 0x030100
|
||||
pf = pf.replace( configManager::inst()->trackIconsDir(),
|
||||
"" );
|
||||
#else
|
||||
pf = pf.replace( QRegExp(
|
||||
configManager::inst()->trackIconsDir() ), "" );
|
||||
#endif
|
||||
}
|
||||
setPixmapFile( pf );
|
||||
}
|
||||
@@ -203,11 +161,7 @@ void nameLabel::mousePressEvent( QMouseEvent * _me )
|
||||
if( _me->button() == Qt::RightButton )
|
||||
{
|
||||
QSize s( m_pixmap.width(), m_pixmap.height() );
|
||||
#ifndef QT3
|
||||
s.scale( width(), height(), Qt::KeepAspectRatio );
|
||||
#else
|
||||
s.scale( width(), height(), QSize::ScaleMin );
|
||||
#endif
|
||||
if( _me->x() > 4 + s.width() )
|
||||
{
|
||||
rename();
|
||||
@@ -230,11 +184,7 @@ void nameLabel::mousePressEvent( QMouseEvent * _me )
|
||||
void nameLabel::mouseDoubleClickEvent( QMouseEvent * _me )
|
||||
{
|
||||
QSize s( m_pixmap.width(), m_pixmap.height() );
|
||||
#ifndef QT3
|
||||
s.scale( width(), height(), Qt::KeepAspectRatio );
|
||||
#else
|
||||
s.scale( width(), height(), QSize::ScaleMin );
|
||||
#endif
|
||||
if( _me->x() > 4 + s.width() )
|
||||
{
|
||||
rename();
|
||||
@@ -250,15 +200,8 @@ void nameLabel::mouseDoubleClickEvent( QMouseEvent * _me )
|
||||
|
||||
void nameLabel::paintEvent( QPaintEvent * )
|
||||
{
|
||||
#ifdef QT4
|
||||
QPainter p( this );
|
||||
p.fillRect( rect(), palette().color( backgroundRole() ) );
|
||||
#else
|
||||
QPixmap draw_pm( size() );
|
||||
draw_pm.fill( this, rect().topLeft() );
|
||||
|
||||
QPainter p( &draw_pm, this );
|
||||
#endif
|
||||
p.setFont( pointSize<8>( p.font() ) );
|
||||
|
||||
int x = 4;
|
||||
@@ -267,14 +210,8 @@ void nameLabel::paintEvent( QPaintEvent * )
|
||||
QPixmap pm = m_pixmap;
|
||||
if( pm.height() > height() )
|
||||
{
|
||||
#ifndef QT3
|
||||
pm = pm.scaledToHeight( height(),
|
||||
Qt::SmoothTransformation );
|
||||
#else
|
||||
pm.convertFromImage( pm.convertToImage().smoothScale(
|
||||
pm.width(), height(),
|
||||
QImage::ScaleMin ) );
|
||||
#endif
|
||||
}
|
||||
p.drawPixmap( x, ( height() - pm.height() ) / 2, pm );
|
||||
x += 4 + pm.width();
|
||||
@@ -295,10 +232,6 @@ void nameLabel::paintEvent( QPaintEvent * )
|
||||
p.drawText( x, height() / 2 + p.fontMetrics().height() / 2 - 4,
|
||||
text() );
|
||||
|
||||
#ifndef QT4
|
||||
// and blit all the drawn stuff on the screen...
|
||||
bitBlt( this, rect().topLeft(), &draw_pm );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -25,18 +25,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <Qt/QtXml>
|
||||
|
||||
#else
|
||||
|
||||
#include <qdom.h>
|
||||
|
||||
#endif
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include "note.h"
|
||||
|
||||
@@ -26,10 +26,6 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <Qt/QtXml>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QButtonGroup>
|
||||
@@ -40,22 +36,6 @@
|
||||
#include <QtGui/QLayout>
|
||||
#include <QtGui/QLabel>
|
||||
|
||||
#else
|
||||
|
||||
#include <qapplication.h>
|
||||
#include <qbuttongroup.h>
|
||||
#include <qclipboard.h>
|
||||
#include <qdom.h>
|
||||
#include <qdragobject.h>
|
||||
#include <qlabel.h>
|
||||
#include <qlayout.h>
|
||||
#include <qpainter.h>
|
||||
|
||||
#define addButton insert
|
||||
#define setCheckable setToggleButton
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef __USE_XOPEN
|
||||
#define __USE_XOPEN
|
||||
@@ -202,10 +182,8 @@ pianoRoll::pianoRoll( void ) :
|
||||
"automation" ) );
|
||||
}
|
||||
|
||||
#ifdef QT4
|
||||
// add us to workspace
|
||||
engine::getMainWindow()->workspace()->addWindow( this );
|
||||
#endif
|
||||
|
||||
// add time-line
|
||||
m_timeLine = new timeLine( WHITE_KEY_WIDTH, 32, m_ppt,
|
||||
@@ -221,16 +199,11 @@ pianoRoll::pianoRoll( void ) :
|
||||
m_toolBar = new QWidget( this );
|
||||
m_toolBar->setFixedHeight( 32 );
|
||||
m_toolBar->move( 0, 0 );
|
||||
#ifdef QT4
|
||||
m_toolBar->setAutoFillBackground( TRUE );
|
||||
QPalette pal;
|
||||
pal.setBrush( m_toolBar->backgroundRole(),
|
||||
embed::getIconPixmap( "toolbar_bg" ) );
|
||||
m_toolBar->setPalette( pal );
|
||||
#else
|
||||
m_toolBar->setPaletteBackgroundPixmap( embed::getIconPixmap(
|
||||
"toolbar_bg" ) );
|
||||
#endif
|
||||
|
||||
QHBoxLayout * tb_layout = new QHBoxLayout( m_toolBar );
|
||||
tb_layout->setMargin( 0 );
|
||||
@@ -251,29 +224,17 @@ pianoRoll::pianoRoll( void ) :
|
||||
tr( "Stop playing of current pattern (Space)" ),
|
||||
this, SLOT( stop() ), m_toolBar );
|
||||
|
||||
#ifdef QT4
|
||||
m_playButton->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_playButton,
|
||||
#endif
|
||||
tr( "Click here, if you want to play the current pattern. "
|
||||
"This is useful while editing it. The pattern is "
|
||||
"automatically looped when its end is reached." ) );
|
||||
#ifdef QT4
|
||||
m_recordButton->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_recordButton,
|
||||
#endif
|
||||
tr( "Click here, if you want to record notes from a MIDI-"
|
||||
"device or the virtual test-piano of the according "
|
||||
"channel-window to the current pattern. When recording "
|
||||
"all notes you play will be written to this pattern "
|
||||
"and you can play and edit them afterwards." ) );
|
||||
#ifdef QT4
|
||||
m_stopButton->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_stopButton,
|
||||
#endif
|
||||
tr( "Click here, if you want to stop playing of current "
|
||||
"pattern." ) );
|
||||
|
||||
@@ -322,43 +283,24 @@ pianoRoll::pianoRoll( void ) :
|
||||
tool_button_group->addButton( m_selectButton );
|
||||
tool_button_group->addButton( m_moveButton );
|
||||
tool_button_group->setExclusive( TRUE );
|
||||
#ifndef QT4
|
||||
tool_button_group->hide();
|
||||
#endif
|
||||
|
||||
#ifdef QT4
|
||||
m_drawButton->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_drawButton,
|
||||
#endif
|
||||
tr( "If you click here, draw-mode will be activated. In this "
|
||||
"mode you can add, resize and move single notes. This "
|
||||
"is the default-mode which is used most of the time. "
|
||||
"You can also press 'Shift+D' on your keyboard to "
|
||||
"activate this mode." ) );
|
||||
#ifdef QT4
|
||||
m_eraseButton->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_eraseButton,
|
||||
#endif
|
||||
tr( "If you click here, erase-mode will be activated. In this "
|
||||
"mode you can erase single notes. You can also press "
|
||||
"'Shift+E' on your keyboard to activate this mode." ) );
|
||||
#ifdef QT4
|
||||
m_selectButton->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_selectButton,
|
||||
#endif
|
||||
tr( "If you click here, select-mode will be activated. "
|
||||
"In this mode you can select notes. This is neccessary "
|
||||
"if you want to cut, copy, paste, delete or move "
|
||||
"notes. You can also press 'Shift+S' on your keyboard "
|
||||
"to activate this mode." ) );
|
||||
#ifdef QT4
|
||||
m_moveButton->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_moveButton,
|
||||
#endif
|
||||
tr( "If you click here, move-mode will be activated. In this "
|
||||
"mode you can move the notes you selected in select-"
|
||||
"mode. You can also press 'Shift+M' on your keyboard "
|
||||
@@ -380,27 +322,15 @@ pianoRoll::pianoRoll( void ) :
|
||||
this, SLOT( pasteNotes() ),
|
||||
m_toolBar );
|
||||
|
||||
#ifdef QT4
|
||||
m_cutButton->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_cutButton,
|
||||
#endif
|
||||
tr( "If you click here, selected notes will be cut into the "
|
||||
"clipboard. You can paste them anywhere in any pattern "
|
||||
"by clicking on the paste-button." ) );
|
||||
#ifdef QT4
|
||||
m_copyButton->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_copyButton,
|
||||
#endif
|
||||
tr( "If you click here, selected notes will be copied into the "
|
||||
"clipboard. You can paste them anywhere in any pattern "
|
||||
"by clicking on the paste-button." ) );
|
||||
#ifdef QT4
|
||||
m_pasteButton->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_pasteButton,
|
||||
#endif
|
||||
tr( "If you click here, the notes from the clipboard will be "
|
||||
"pasted at the first visible tact." ) );
|
||||
|
||||
@@ -450,12 +380,7 @@ pianoRoll::pianoRoll( void ) :
|
||||
m_noteLenComboBox->addItem( "1/" + QString::number( 1 << i ),
|
||||
embed::getIconPixmap(
|
||||
QString( "note_" + pixmaps[i] ).
|
||||
#ifndef QT3
|
||||
toAscii().constData()
|
||||
#else
|
||||
ascii()
|
||||
#endif
|
||||
) );
|
||||
toAscii().constData() ) );
|
||||
}
|
||||
m_noteLenComboBox->setValue( 0 );
|
||||
|
||||
@@ -494,9 +419,6 @@ pianoRoll::pianoRoll( void ) :
|
||||
resize( INITIAL_PIANOROLL_WIDTH, INITIAL_PIANOROLL_HEIGHT );
|
||||
setCurrentPattern( NULL );
|
||||
|
||||
#ifndef QT4
|
||||
setBackgroundMode( Qt::NoBackground );
|
||||
#endif
|
||||
setMouseTracking( TRUE );
|
||||
|
||||
hide();
|
||||
@@ -657,11 +579,8 @@ inline void pianoRoll::drawDetuningInfo( QPainter & _p, note * _n, Uint16 _x,
|
||||
}
|
||||
Uint16 pos_x = _x + pos_tact_64th * m_ppt / 64;
|
||||
|
||||
#ifdef QT3
|
||||
const int level = it.data();
|
||||
#else
|
||||
const int level = it.value();
|
||||
#endif
|
||||
|
||||
Uint16 pos_y = middle_y - level * KEY_LINE_HEIGHT / 10;
|
||||
|
||||
_p.drawLine( pos_x - 1, pos_y, pos_x + 1, pos_y );
|
||||
@@ -1024,12 +943,8 @@ void pianoRoll::updatePaintPixmap( QPixmap & _p )
|
||||
|
||||
// reset scroll-range
|
||||
m_leftRightScroll->setRange( 0, l );
|
||||
#ifdef QT4
|
||||
m_leftRightScroll->setSingleStep( 1 );
|
||||
m_leftRightScroll->setPageStep( l );
|
||||
#else
|
||||
m_leftRightScroll->setSteps( 1, l );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -1207,13 +1122,8 @@ void pianoRoll::keyPressEvent( QKeyEvent * _ke )
|
||||
if( mouseOverNote() )
|
||||
{
|
||||
m_editMode = OPEN;
|
||||
#ifndef QT3
|
||||
QApplication::changeOverrideCursor(
|
||||
QCursor( Qt::ArrowCursor ) );
|
||||
#else
|
||||
QApplication::setOverrideCursor(
|
||||
QCursor( Qt::ArrowCursor ), TRUE );
|
||||
#endif
|
||||
update();
|
||||
}
|
||||
|
||||
@@ -1558,23 +1468,12 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me )
|
||||
m_action != CHANGE_NOTE_VOLUME &&
|
||||
m_action != MOVE_SELECTION &&
|
||||
edit_note == FALSE &&
|
||||
#ifdef QT4
|
||||
_me->buttons() &
|
||||
#else
|
||||
_me->state() ==
|
||||
#endif
|
||||
Qt::LeftButton )
|
||||
_me->buttons() & Qt::LeftButton )
|
||||
{
|
||||
m_pattern->getInstrumentTrack()->processInEvent(
|
||||
midiEvent( NOTE_OFF, 0, m_lastKey, 0 ),
|
||||
midiTime() );
|
||||
if(
|
||||
#ifdef QT4
|
||||
_me->buttons() &
|
||||
#else
|
||||
_me->modifiers() ==
|
||||
#endif
|
||||
Qt::LeftButton &&
|
||||
if( _me->buttons() & Qt::LeftButton &&
|
||||
m_action != RESIZE_NOTE &&
|
||||
m_action != SELECT_NOTES &&
|
||||
m_action != MOVE_SELECTION &&
|
||||
@@ -1614,12 +1513,7 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me )
|
||||
}
|
||||
}
|
||||
else if( m_currentNote != NULL &&
|
||||
#ifdef QT4
|
||||
_me->buttons() &
|
||||
#else
|
||||
_me->state() ==
|
||||
#endif
|
||||
Qt::LeftButton && m_editMode == DRAW )
|
||||
_me->buttons() & Qt::LeftButton && m_editMode == DRAW )
|
||||
{
|
||||
int key_num = getKey( _me->y() );
|
||||
|
||||
@@ -1665,14 +1559,7 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me )
|
||||
engine::getSongEditor()->setModified();
|
||||
|
||||
}
|
||||
else if(
|
||||
#ifdef QT4
|
||||
_me->buttons() == Qt::NoButton
|
||||
#else
|
||||
( _me->state() == NoButton
|
||||
|| _me->state() == ControlButton )
|
||||
#endif
|
||||
&& m_editMode == DRAW )
|
||||
else if( _me->buttons() == Qt::NoButton && m_editMode == DRAW )
|
||||
{
|
||||
// set move- or resize-cursor
|
||||
|
||||
@@ -1709,14 +1596,8 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me )
|
||||
if( _me->modifiers() & Qt::ControlModifier )
|
||||
{
|
||||
m_editMode = OPEN;
|
||||
#ifndef QT3
|
||||
QApplication::changeOverrideCursor(
|
||||
QCursor( Qt::ArrowCursor ) );
|
||||
#else
|
||||
QApplication::setOverrideCursor(
|
||||
QCursor( Qt::ArrowCursor ),
|
||||
TRUE );
|
||||
#endif
|
||||
}
|
||||
// cursor at the "tail" of the note?
|
||||
else if( ( *it )->length() > 0 &&
|
||||
@@ -1778,13 +1659,7 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me )
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(
|
||||
#ifdef QT4
|
||||
_me->buttons() &
|
||||
#else
|
||||
_me->modifiers() ==
|
||||
#endif
|
||||
Qt::LeftButton &&
|
||||
else if( _me->buttons() & Qt::LeftButton &&
|
||||
m_editMode == SELECT &&
|
||||
m_action == SELECT_NOTES )
|
||||
{
|
||||
@@ -1834,13 +1709,7 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me )
|
||||
--m_selectedKeys;
|
||||
}
|
||||
}
|
||||
else if(
|
||||
#ifdef QT4
|
||||
_me->buttons() &
|
||||
#else
|
||||
_me->modifiers() ==
|
||||
#endif
|
||||
Qt::LeftButton &&
|
||||
else if( _me->buttons() & Qt::LeftButton &&
|
||||
m_editMode == MOVE &&
|
||||
m_action == MOVE_SELECTION )
|
||||
{
|
||||
@@ -1945,13 +1814,7 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me )
|
||||
}
|
||||
else
|
||||
{
|
||||
if(
|
||||
#ifdef QT4
|
||||
_me->buttons() &
|
||||
#else
|
||||
_me->modifiers() ==
|
||||
#endif
|
||||
Qt::LeftButton &&
|
||||
if( _me->buttons() & Qt::LeftButton &&
|
||||
m_editMode == SELECT &&
|
||||
m_action == SELECT_NOTES )
|
||||
{
|
||||
@@ -2041,14 +1904,8 @@ void pianoRoll::paintEvent( QPaintEvent * )
|
||||
{
|
||||
QPixmap paintPixmap( size() );
|
||||
updatePaintPixmap( paintPixmap );
|
||||
#ifdef QT4
|
||||
QPainter p( this );
|
||||
#else
|
||||
QPixmap draw_pm( size() );
|
||||
draw_pm.fill( QColor( 0, 0, 0 ) );
|
||||
|
||||
QPainter p( &draw_pm, this );
|
||||
#endif
|
||||
p.drawPixmap( 0, 0, paintPixmap );
|
||||
|
||||
p.setClipRect( WHITE_KEY_WIDTH, PR_TOP_MARGIN, width() -
|
||||
@@ -2077,10 +1934,6 @@ void pianoRoll::paintEvent( QPaintEvent * )
|
||||
p.drawPixmap( mapFromGlobal( QCursor::pos() ) + QPoint( 8, 8 ),
|
||||
*cursor );
|
||||
|
||||
#ifndef QT4
|
||||
// and blit all the drawn stuff on the screen...
|
||||
bitBlt( this, rect().topLeft(), &draw_pm );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -2104,12 +1957,8 @@ void pianoRoll::resizeEvent( QResizeEvent * )
|
||||
m_totalKeysToScroll = total_pixels * NOTES_PER_OCTAVE / OCTAVE_HEIGHT;
|
||||
|
||||
m_topBottomScroll->setRange( 0, m_totalKeysToScroll );
|
||||
#ifdef QT4
|
||||
m_topBottomScroll->setSingleStep( 1 );
|
||||
m_topBottomScroll->setPageStep( 20 );
|
||||
#else
|
||||
m_topBottomScroll->setSteps( 1, 20 );
|
||||
#endif
|
||||
|
||||
if( m_startKey > m_totalKeysToScroll )
|
||||
{
|
||||
@@ -2457,17 +2306,10 @@ void pianoRoll::copy_to_clipboard( const noteVector & _notes ) const
|
||||
clip_note.saveState( mmp, note_list );
|
||||
}
|
||||
|
||||
#ifdef QT4
|
||||
QMimeData * clip_content = new QMimeData;
|
||||
clip_content->setData( clipboard::mimeType(), mmp.toString().toUtf8() );
|
||||
QApplication::clipboard()->setMimeData( clip_content,
|
||||
QClipboard::Clipboard );
|
||||
#else
|
||||
QStoredDrag * clip_content = new QStoredDrag( clipboard::mimeType() );
|
||||
clip_content->setEncodedData( mmp.toString().utf8() );
|
||||
QApplication::clipboard()->setData( clip_content,
|
||||
QClipboard::Clipboard );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -2531,14 +2373,9 @@ void pianoRoll::pasteNotes( void )
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef QT4
|
||||
QString value = QApplication::clipboard()
|
||||
->mimeData( QClipboard::Clipboard )
|
||||
->data( clipboard::mimeType() );
|
||||
#else
|
||||
QString value = QApplication::clipboard()->data( QClipboard::Clipboard )
|
||||
->encodedData( clipboard::mimeType() );
|
||||
#endif
|
||||
|
||||
if( !value.isEmpty() )
|
||||
{
|
||||
@@ -2730,10 +2567,4 @@ bool pianoRoll::x11Event( XEvent * _xe )
|
||||
#include "piano_roll.moc"
|
||||
|
||||
|
||||
#ifdef QT3
|
||||
#undef addButton
|
||||
#undef setCheckable
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -26,10 +26,6 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtGui/QCursor>
|
||||
#include <QtGui/QKeyEvent>
|
||||
#include <QtGui/QLabel>
|
||||
@@ -37,15 +33,6 @@
|
||||
#include <QtGui/QMouseEvent>
|
||||
#include <QtGui/QPainter>
|
||||
|
||||
#else
|
||||
|
||||
#include <qcursor.h>
|
||||
#include <qlabel.h>
|
||||
#include <qpainter.h>
|
||||
#include <qpopupmenu.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "piano_widget.h"
|
||||
#include "automatable_object_templates.h"
|
||||
@@ -100,11 +87,7 @@ pianoWidget::pianoWidget( instrumentTrack * _parent ) :
|
||||
m_startOctave( OCTAVE_3 ),
|
||||
m_lastKey( -1 )
|
||||
{
|
||||
#ifdef QT4
|
||||
setFocusPolicy( Qt::StrongFocus );
|
||||
#else
|
||||
setFocusPolicy( StrongFocus );
|
||||
#endif
|
||||
|
||||
if( s_whiteKeyPm == NULL )
|
||||
{
|
||||
@@ -132,30 +115,18 @@ pianoWidget::pianoWidget( instrumentTrack * _parent ) :
|
||||
m_pressedKeys[i] = FALSE;
|
||||
}
|
||||
|
||||
#ifdef QT4
|
||||
m_pianoScroll = new QScrollBar( Qt::Horizontal, this );
|
||||
m_pianoScroll->setRange( 0, WHITE_KEYS_PER_OCTAVE * ( OCTAVES - 3 ) -
|
||||
4 );
|
||||
m_pianoScroll->setSingleStep( 1 );
|
||||
m_pianoScroll->setPageStep( 20 );
|
||||
m_pianoScroll->setValue( OCTAVE_3 * WHITE_KEYS_PER_OCTAVE );
|
||||
#else
|
||||
// create scrollbar below piano-widget...
|
||||
m_pianoScroll = new QScrollBar( 0, WHITE_KEYS_PER_OCTAVE *
|
||||
( OCTAVES - 3 ) - 4, 1, 20,
|
||||
OCTAVE_3 * WHITE_KEYS_PER_OCTAVE,
|
||||
Qt::Horizontal, this );
|
||||
#endif
|
||||
m_pianoScroll->setGeometry( 0, PIANO_BASE + PW_WHITE_KEY_HEIGHT, 250,
|
||||
16 );
|
||||
// ...and connect it to this widget...
|
||||
connect( m_pianoScroll, SIGNAL( valueChanged( int ) ), this,
|
||||
SLOT( pianoScrolled( int ) ) );
|
||||
|
||||
#ifndef QT4
|
||||
// set background-mode for flicker-free redraw
|
||||
setBackgroundMode( Qt::NoBackground );
|
||||
#endif
|
||||
|
||||
m_noteKnob = new knob( knobDark_28, NULL, tr( "Base note" ), _parent );
|
||||
m_noteKnob->setRange( 0, NOTES_PER_OCTAVE * OCTAVES - 1, 1.0f );
|
||||
@@ -247,9 +218,9 @@ void pianoWidget::contextMenuEvent( QContextMenuEvent * _me )
|
||||
}
|
||||
|
||||
QMenu contextMenu( this );
|
||||
#ifdef QT4
|
||||
#warning TODO: use CSS-formatting
|
||||
contextMenu.setTitle( m_noteKnob->accessibleName() );
|
||||
#else
|
||||
#if 0
|
||||
QLabel * caption = new QLabel( "<font color=white><b>" +
|
||||
QString( m_noteKnob->accessibleName() ) + "</b></font>",
|
||||
this );
|
||||
@@ -369,11 +340,7 @@ void pianoWidget::mouseMoveEvent( QMouseEvent * _me )
|
||||
m_pressedKeys[m_lastKey] = FALSE;
|
||||
m_lastKey = -1;
|
||||
}
|
||||
#ifdef QT4
|
||||
if( _me->buttons() & Qt::LeftButton )
|
||||
#else
|
||||
if( _me->state() == Qt::LeftButton )
|
||||
#endif
|
||||
{
|
||||
if( _me->pos().y() > PIANO_BASE )
|
||||
{
|
||||
@@ -498,11 +465,7 @@ void pianoWidget::setKeyState( int _key, bool _on )
|
||||
|
||||
|
||||
|
||||
#ifndef QT3
|
||||
void pianoWidget::customEvent( QEvent * )
|
||||
#else
|
||||
void pianoWidget::customEvent( QCustomEvent * )
|
||||
#endif
|
||||
{
|
||||
update();
|
||||
}
|
||||
@@ -575,14 +538,7 @@ int pianoWidget::getKeyX( int _key_num ) const
|
||||
|
||||
void pianoWidget::paintEvent( QPaintEvent * )
|
||||
{
|
||||
#ifdef QT4
|
||||
QPainter p( this );
|
||||
#else
|
||||
// create pixmap for whole widget
|
||||
QPixmap pm( rect().size() );//width(), PIANO_BASE+PW_WHITE_KEY_HEIGHT);
|
||||
// and a painter for it
|
||||
QPainter p( &pm, this );
|
||||
#endif
|
||||
|
||||
// set smaller font for printing number of every octave
|
||||
p.setFont( pointSize<LABEL_TEXT_SIZE>( p.font() ) );
|
||||
@@ -704,10 +660,6 @@ void pianoWidget::paintEvent( QPaintEvent * )
|
||||
}
|
||||
++cur_key;
|
||||
}
|
||||
#ifndef QT4
|
||||
// blit drawn pixmap to actual widget
|
||||
bitBlt( this, rect().topLeft(), &pm );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -25,24 +25,11 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QLibrary>
|
||||
#include <QtGui/QMessageBox>
|
||||
#include <QtGui/QPixmap>
|
||||
|
||||
#else
|
||||
|
||||
#include <qmessagebox.h>
|
||||
#include <qdir.h>
|
||||
#include <qlibrary.h>
|
||||
#include <qpixmap.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "plugin.h"
|
||||
#include "mixer.h"
|
||||
@@ -131,9 +118,6 @@ plugin * plugin::instantiate( const QString & _plugin_name, void * _data )
|
||||
QMessageBox::Default );
|
||||
return( new dummyPlugin() );
|
||||
}
|
||||
#ifndef QT4
|
||||
plugin_lib.setAutoUnload( FALSE );
|
||||
#endif
|
||||
plugin * inst = inst_hook( _data );
|
||||
return( inst );
|
||||
}
|
||||
@@ -156,53 +140,30 @@ void plugin::waitForWorkerThread( void )
|
||||
|
||||
|
||||
|
||||
void plugin::getDescriptorsOfAvailPlugins( vvector<descriptor> & _plugin_descs )
|
||||
void plugin::getDescriptorsOfAvailPlugins( QVector<descriptor> & _plugin_descs )
|
||||
{
|
||||
QDir directory( configManager::inst()->pluginDir() );
|
||||
#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;
|
||||
}
|
||||
QFileInfoList list = *lp;
|
||||
#endif
|
||||
for( QFileInfoList::iterator file = list.begin();
|
||||
file != list.end(); ++file )
|
||||
{
|
||||
#ifdef QT4
|
||||
const QFileInfo & f = *file;
|
||||
#else
|
||||
const QFileInfo & f = **file;
|
||||
#endif
|
||||
QLibrary plugin_lib( f.absoluteFilePath() );
|
||||
if( plugin_lib.load() == FALSE ||
|
||||
plugin_lib.resolve( "lmms_plugin_main" ) == NULL )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
#ifndef QT4
|
||||
plugin_lib.setAutoUnload( FALSE );
|
||||
#endif
|
||||
QString desc_name = f.fileName().section( '.', 0, 0 ) +
|
||||
"_plugin_descriptor";
|
||||
if( desc_name.left( 3 ) == "lib" )
|
||||
{
|
||||
desc_name = desc_name.mid( 3 );
|
||||
}
|
||||
descriptor * plugin_desc = (descriptor *) plugin_lib.resolve(
|
||||
desc_name.
|
||||
#ifdef QT4
|
||||
toAscii().constData()
|
||||
#else
|
||||
ascii()
|
||||
#endif
|
||||
);
|
||||
descriptor * plugin_desc =
|
||||
(descriptor *) plugin_lib.resolve(
|
||||
desc_name.toAscii().constData() );
|
||||
if( plugin_desc == NULL )
|
||||
{
|
||||
continue;
|
||||
|
||||
@@ -25,23 +25,11 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtGui/QCursor>
|
||||
#include <QtGui/QMouseEvent>
|
||||
|
||||
#else
|
||||
|
||||
#include <qlabel.h>
|
||||
#include <qpainter.h>
|
||||
#include <qcursor.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "plugin_browser.h"
|
||||
#include "embed.h"
|
||||
@@ -74,16 +62,12 @@ pluginBrowser::pluginBrowser( QWidget * _parent ) :
|
||||
"corresponding channel-button." ),
|
||||
m_view );
|
||||
hint->setFont( pointSize<8>( hint->font() ) );
|
||||
#ifdef QT4
|
||||
hint->setWordWrap( TRUE );
|
||||
#else
|
||||
hint->setAlignment( hint->alignment() | Qt::WordBreak );
|
||||
#endif
|
||||
view_layout->addWidget( hint );
|
||||
|
||||
plugin::getDescriptorsOfAvailPlugins( m_pluginDescriptors );
|
||||
|
||||
for( vvector<plugin::descriptor>::iterator it =
|
||||
for( QVector<plugin::descriptor>::iterator it =
|
||||
m_pluginDescriptors.begin();
|
||||
it != m_pluginDescriptors.end(); ++it )
|
||||
{
|
||||
@@ -124,9 +108,6 @@ pluginDescWidget::pluginDescWidget( const plugin::descriptor & _pd,
|
||||
connect( &m_updateTimer, SIGNAL( timeout() ), SLOT( updateHeight() ) );
|
||||
setFixedHeight( m_targetHeight );
|
||||
setMouseTracking( TRUE );
|
||||
#ifdef QT3
|
||||
setBackgroundMode( Qt::NoBackground );
|
||||
#endif
|
||||
setCursor( Qt::PointingHandCursor );
|
||||
}
|
||||
|
||||
@@ -145,35 +126,16 @@ void pluginDescWidget::paintEvent( QPaintEvent * )
|
||||
const QColor fill_color = m_mouseOver ? QColor( 224, 224, 224 ) :
|
||||
QColor( 192, 192, 192 );
|
||||
|
||||
#ifdef QT4
|
||||
QPainter p( this );
|
||||
p.fillRect( rect(), fill_color );
|
||||
#else
|
||||
// create pixmap for whole widget
|
||||
QPixmap pm( rect().size() );
|
||||
pm.fill( fill_color );
|
||||
|
||||
// and a painter for it
|
||||
QPainter p( &pm );
|
||||
#endif
|
||||
|
||||
const int s = 16 + ( 32 * ( tLimit( height(), 24, 60 ) - 24 ) ) /
|
||||
( 60 - 24 );
|
||||
const QSize logo_size( s, s );
|
||||
#ifndef QT3
|
||||
QPixmap logo = m_logo.scaled( logo_size, Qt::KeepAspectRatio,
|
||||
Qt::SmoothTransformation );
|
||||
#else
|
||||
QPixmap logo;
|
||||
logo.convertFromImage( m_logo.convertToImage().smoothScale( logo_size,
|
||||
QImage::ScaleMin ) );
|
||||
#endif
|
||||
p.setPen( QColor( 64, 64, 64 ) );
|
||||
#ifndef QT3
|
||||
p.drawRect( 0, 0, rect().right(), rect().bottom() );
|
||||
#else
|
||||
p.drawRect( rect() );
|
||||
#endif
|
||||
p.drawPixmap( 4, 4, logo );
|
||||
|
||||
QFont f = pointSize<8>( p.font() );
|
||||
@@ -188,15 +150,8 @@ void pluginDescWidget::paintEvent( QPaintEvent * )
|
||||
p.setFont( pointSize<7>( f ) );
|
||||
QRect br;
|
||||
p.drawText( 10 + logo_size.width(), 20, width() - 58 - 5, 999,
|
||||
#ifndef QT3
|
||||
Qt::TextWordWrap,
|
||||
#else
|
||||
Qt::WordBreak,
|
||||
#endif
|
||||
pluginBrowser::tr( m_pluginDescriptor.description ),
|
||||
#ifdef QT3
|
||||
-1,
|
||||
#endif
|
||||
&br );
|
||||
if( m_mouseOver )
|
||||
{
|
||||
@@ -204,10 +159,6 @@ void pluginDescWidget::paintEvent( QPaintEvent * )
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef QT4
|
||||
// blit drawn pixmap to actual widget
|
||||
bitBlt( this, rect().topLeft(), &pm );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -25,21 +25,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtCore/QMutex>
|
||||
#include <QtCore/QMutexLocker>
|
||||
|
||||
#else
|
||||
|
||||
#include <qmutex.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#include "preset_preview_play_handle.h"
|
||||
#include "debug.h"
|
||||
#include "engine.h"
|
||||
|
||||
@@ -25,10 +25,6 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtGui/QComboBox>
|
||||
#include <QtGui/QFileDialog>
|
||||
#include <QtGui/QLabel>
|
||||
@@ -38,19 +34,6 @@
|
||||
#include <QtGui/QSlider>
|
||||
#include <QtGui/QWhatsThis>
|
||||
|
||||
#else
|
||||
|
||||
#include <qlayout.h>
|
||||
#include <qlabel.h>
|
||||
#include <qslider.h>
|
||||
#include <qwhatsthis.h>
|
||||
#include <qcombobox.h>
|
||||
#include <qmessagebox.h>
|
||||
#include <qlineedit.h>
|
||||
#include <qfiledialog.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "setup_dialog.h"
|
||||
#include "tab_bar.h"
|
||||
@@ -167,15 +150,8 @@ setupDialog::setupDialog( configTabs _tab_to_open ) :
|
||||
bufsize_tw->setFixedHeight( 80 );
|
||||
|
||||
m_bufSizeSlider = new QSlider( Qt::Horizontal, bufsize_tw );
|
||||
#ifdef QT4
|
||||
m_bufSizeSlider->setRange( 1, 256 );
|
||||
m_bufSizeSlider->setTickPosition( QSlider::TicksBelow );
|
||||
#else
|
||||
m_bufSizeSlider->setMinimum( 1 );
|
||||
m_bufSizeSlider->setMaximum( 256 );
|
||||
m_bufSizeSlider->setLineStep( 8 );
|
||||
m_bufSizeSlider->setTickmarks( QSlider::Below );
|
||||
#endif
|
||||
m_bufSizeSlider->setPageStep( 8 );
|
||||
m_bufSizeSlider->setTickInterval( 8 );
|
||||
m_bufSizeSlider->setGeometry( 10, 16, 340, 18 );
|
||||
@@ -483,11 +459,7 @@ setupDialog::setupDialog( configTabs _tab_to_open ) :
|
||||
"problems (i.e. lot of xruns), try to increase buffer-"
|
||||
"size." ), smp_supp_tw );
|
||||
smp_help->setFixedSize( performance->width() - 20, 140 );
|
||||
#ifndef QT3
|
||||
smp_help->setWordWrap( TRUE );
|
||||
#else
|
||||
smp_help->setAlignment( Qt::WordBreak );
|
||||
#endif
|
||||
smp_help->move( 10, 55 );
|
||||
|
||||
|
||||
@@ -523,9 +495,6 @@ setupDialog::setupDialog( configTabs _tab_to_open ) :
|
||||
// create ifaces-settings-widget
|
||||
QWidget * asw = new QWidget( audio );
|
||||
asw->setFixedHeight( 60 );
|
||||
#ifndef QT4
|
||||
asw->setBackgroundMode( NoBackground );
|
||||
#endif
|
||||
|
||||
QHBoxLayout * asw_layout = new QHBoxLayout( asw );
|
||||
asw_layout->setSpacing( 0 );
|
||||
@@ -558,31 +527,18 @@ setupDialog::setupDialog( configTabs _tab_to_open ) :
|
||||
for( aswMap::iterator it = m_audioIfaceSetupWidgets.begin();
|
||||
it != m_audioIfaceSetupWidgets.end(); ++it )
|
||||
{
|
||||
m_audioIfaceNames[tr( it.key()
|
||||
#ifndef QT3
|
||||
.toAscii()
|
||||
#endif
|
||||
)] = it.key();
|
||||
m_audioIfaceNames[tr( it.key().toAscii())] = it.key();
|
||||
}
|
||||
for( trMap::iterator it = m_audioIfaceNames.begin();
|
||||
it != m_audioIfaceNames.end(); ++it )
|
||||
{
|
||||
#ifdef QT4
|
||||
QWidget * audioWidget = m_audioIfaceSetupWidgets[it.value()];
|
||||
#else
|
||||
QWidget * audioWidget = m_audioIfaceSetupWidgets[it.data()];
|
||||
#endif
|
||||
audioWidget->hide();
|
||||
asw_layout->addWidget( audioWidget );
|
||||
m_audioInterfaces->addItem( it.key() );
|
||||
}
|
||||
#ifdef QT4
|
||||
m_audioInterfaces->setCurrentIndex( m_audioInterfaces->findText(
|
||||
tr( engine::getMixer()->audioDevName().toAscii() ) ) );
|
||||
#else
|
||||
m_audioInterfaces->setCurrentText(
|
||||
tr( engine::getMixer()->audioDevName() ) );
|
||||
#endif
|
||||
m_audioIfaceSetupWidgets[engine::getMixer()->audioDevName()]->show();
|
||||
|
||||
connect( m_audioInterfaces, SIGNAL( activated( const QString & ) ),
|
||||
@@ -621,9 +577,6 @@ setupDialog::setupDialog( configTabs _tab_to_open ) :
|
||||
// create ifaces-settings-widget
|
||||
QWidget * msw = new QWidget( midi );
|
||||
msw->setFixedHeight( 60 );
|
||||
#ifndef QT4
|
||||
msw->setBackgroundMode( NoBackground );
|
||||
#endif
|
||||
|
||||
QHBoxLayout * msw_layout = new QHBoxLayout( msw );
|
||||
msw_layout->setSpacing( 0 );
|
||||
@@ -648,32 +601,19 @@ setupDialog::setupDialog( configTabs _tab_to_open ) :
|
||||
for( mswMap::iterator it = m_midiIfaceSetupWidgets.begin();
|
||||
it != m_midiIfaceSetupWidgets.end(); ++it )
|
||||
{
|
||||
m_midiIfaceNames[tr( it.key()
|
||||
#ifndef QT3
|
||||
.toAscii()
|
||||
#endif
|
||||
)] = it.key();
|
||||
m_midiIfaceNames[tr( it.key().toAscii())] = it.key();
|
||||
}
|
||||
for( trMap::iterator it = m_midiIfaceNames.begin();
|
||||
it != m_midiIfaceNames.end(); ++it )
|
||||
{
|
||||
#ifdef QT4
|
||||
QWidget * midiWidget = m_midiIfaceSetupWidgets[it.value()];
|
||||
#else
|
||||
QWidget * midiWidget = m_midiIfaceSetupWidgets[it.data()];
|
||||
#endif
|
||||
midiWidget->hide();
|
||||
msw_layout->addWidget( midiWidget );
|
||||
m_midiInterfaces->addItem( it.key() );
|
||||
}
|
||||
|
||||
#ifdef QT4
|
||||
m_midiInterfaces->setCurrentIndex( m_midiInterfaces->findText(
|
||||
tr( engine::getMixer()->midiClientName().toAscii() ) ) );
|
||||
#else
|
||||
m_midiInterfaces->setCurrentText(
|
||||
tr( engine::getMixer()->midiClientName() ) );
|
||||
#endif
|
||||
m_midiIfaceSetupWidgets[engine::getMixer()->midiClientName()]->show();
|
||||
|
||||
connect( m_midiInterfaces, SIGNAL( activated( const QString & ) ),
|
||||
@@ -686,10 +626,6 @@ setupDialog::setupDialog( configTabs _tab_to_open ) :
|
||||
midi_layout->addStretch();
|
||||
|
||||
|
||||
#ifndef QT4
|
||||
#define setIcon setPixmap
|
||||
#endif
|
||||
|
||||
m_tabBar->addTab( general, tr( "General settings" ), 0, FALSE, TRUE
|
||||
)->setIcon( embed::getIconPixmap( "setup_general" ) );
|
||||
m_tabBar->addTab( directories, tr( "Directories" ), 1, FALSE, TRUE
|
||||
@@ -799,21 +735,13 @@ void setupDialog::accept( void )
|
||||
for( aswMap::iterator it = m_audioIfaceSetupWidgets.begin();
|
||||
it != m_audioIfaceSetupWidgets.end(); ++it )
|
||||
{
|
||||
#ifdef QT4
|
||||
it.value()->saveSettings();
|
||||
#else
|
||||
it.data()->saveSettings();
|
||||
#endif
|
||||
}
|
||||
// tell all MIDI-settings-widget to save their settings
|
||||
for( mswMap::iterator it = m_midiIfaceSetupWidgets.begin();
|
||||
it != m_midiIfaceSetupWidgets.end(); ++it )
|
||||
{
|
||||
#ifdef QT4
|
||||
it.value()->saveSettings();
|
||||
#else
|
||||
it.data()->saveSettings();
|
||||
#endif
|
||||
}
|
||||
|
||||
configManager::inst()->saveConfigFile();
|
||||
@@ -875,11 +803,7 @@ void setupDialog::resetBufSize( void )
|
||||
|
||||
void setupDialog::displayBufSizeHelp( void )
|
||||
{
|
||||
#ifdef QT4
|
||||
QWhatsThis::showText( QCursor::pos(),
|
||||
#else
|
||||
QWhatsThis::display(
|
||||
#endif
|
||||
tr( "Here you can setup the internal buffer-size "
|
||||
"used by LMMS. Smaller values result "
|
||||
"in a lower latency but also may cause "
|
||||
@@ -973,16 +897,9 @@ void setupDialog::setParallelizingLevel( int _level )
|
||||
|
||||
void setupDialog::openWorkingDir( void )
|
||||
{
|
||||
#ifdef QT4
|
||||
QString new_dir = QFileDialog::getExistingDirectory( this,
|
||||
tr( "Choose LMMS working directory" ),
|
||||
m_workingDir );
|
||||
#else
|
||||
QString new_dir = QFileDialog::getExistingDirectory( m_workingDir,
|
||||
0, 0,
|
||||
tr( "Choose LMMS working directory" ),
|
||||
TRUE );
|
||||
#endif
|
||||
if( new_dir != QString::null )
|
||||
{
|
||||
m_wdLineEdit->setText( new_dir );
|
||||
@@ -1002,15 +919,9 @@ void setupDialog::setWorkingDir( const QString & _wd )
|
||||
|
||||
void setupDialog::openVSTDir( void )
|
||||
{
|
||||
#ifdef QT4
|
||||
QString new_dir = QFileDialog::getExistingDirectory( this,
|
||||
tr( "Choose your VST-plugin directory" ),
|
||||
m_vstDir );
|
||||
#else
|
||||
QString new_dir = QFileDialog::getExistingDirectory( m_vstDir, 0, 0,
|
||||
tr( "Choose your VST-plugin directory" ),
|
||||
TRUE );
|
||||
#endif
|
||||
if( new_dir != QString::null )
|
||||
{
|
||||
m_vdLineEdit->setText( new_dir );
|
||||
@@ -1030,15 +941,9 @@ void setupDialog::setVSTDir( const QString & _vd )
|
||||
|
||||
void setupDialog::openArtworkDir( void )
|
||||
{
|
||||
#ifdef QT4
|
||||
QString new_dir = QFileDialog::getExistingDirectory( this,
|
||||
tr( "Choose artwork-theme directory" ),
|
||||
m_artworkDir );
|
||||
#else
|
||||
QString new_dir = QFileDialog::getExistingDirectory( m_artworkDir,
|
||||
0, 0,
|
||||
tr( "Choose artwork-theme directory" ), TRUE );
|
||||
#endif
|
||||
if( new_dir != QString::null )
|
||||
{
|
||||
m_adLineEdit->setText( new_dir );
|
||||
@@ -1058,14 +963,9 @@ void setupDialog::setArtworkDir( const QString & _ad )
|
||||
|
||||
void setupDialog::openFLDir( void )
|
||||
{
|
||||
#ifdef QT4
|
||||
QString new_dir = QFileDialog::getExistingDirectory( this,
|
||||
tr( "Choose FL Studio installation directory" ),
|
||||
m_flDir );
|
||||
#else
|
||||
QString new_dir = QFileDialog::getExistingDirectory( m_flDir, 0, 0,
|
||||
tr( "Choose FL Studio installation directory" ), TRUE );
|
||||
#endif
|
||||
if( new_dir != QString::null )
|
||||
{
|
||||
m_fdLineEdit->setText( new_dir );
|
||||
@@ -1077,14 +977,9 @@ void setupDialog::openFLDir( void )
|
||||
|
||||
void setupDialog::openLADSPADir( void )
|
||||
{
|
||||
#ifdef QT4
|
||||
QString new_dir = QFileDialog::getExistingDirectory( this,
|
||||
tr( "Choose LADSPA plugin directory" ),
|
||||
m_ladDir );
|
||||
#else
|
||||
QString new_dir = QFileDialog::getExistingDirectory( m_ladDir, 0, 0,
|
||||
tr( "Choose LADSPA plugin directory" ), TRUE );
|
||||
#endif
|
||||
if( new_dir != QString::null )
|
||||
{
|
||||
if( m_ladLineEdit->text() == "" )
|
||||
@@ -1105,14 +1000,9 @@ void setupDialog::openLADSPADir( void )
|
||||
void setupDialog::openSTKDir( void )
|
||||
{
|
||||
#ifdef HAVE_STK_H
|
||||
#ifdef QT4
|
||||
QString new_dir = QFileDialog::getExistingDirectory( this,
|
||||
tr( "Choose STK rawwave directory" ),
|
||||
m_ladDir );
|
||||
#else
|
||||
QString new_dir = QFileDialog::getExistingDirectory( m_ladDir, 0, 0,
|
||||
tr( "Choose STK rawwave directory" ), TRUE );
|
||||
#endif
|
||||
if( new_dir != QString::null )
|
||||
{
|
||||
m_stkLineEdit->setText( new_dir );
|
||||
@@ -1154,11 +1044,7 @@ void setupDialog::audioInterfaceChanged( const QString & _iface )
|
||||
for( aswMap::iterator it = m_audioIfaceSetupWidgets.begin();
|
||||
it != m_audioIfaceSetupWidgets.end(); ++it )
|
||||
{
|
||||
#ifdef QT4
|
||||
it.value()->hide();
|
||||
#else
|
||||
it.data()->hide();
|
||||
#endif
|
||||
}
|
||||
|
||||
m_audioIfaceSetupWidgets[m_audioIfaceNames[_iface]]->show();
|
||||
@@ -1169,11 +1055,7 @@ void setupDialog::audioInterfaceChanged( const QString & _iface )
|
||||
|
||||
void setupDialog::displayAudioHelp( void )
|
||||
{
|
||||
#ifdef QT4
|
||||
QWhatsThis::showText( QCursor::pos(),
|
||||
#else
|
||||
QWhatsThis::display(
|
||||
#endif
|
||||
tr( "Here you can select your preferred "
|
||||
"audio-interface. Depending on the "
|
||||
"configuration of your system during "
|
||||
@@ -1192,11 +1074,7 @@ void setupDialog::midiInterfaceChanged( const QString & _iface )
|
||||
for( mswMap::iterator it = m_midiIfaceSetupWidgets.begin();
|
||||
it != m_midiIfaceSetupWidgets.end(); ++it )
|
||||
{
|
||||
#ifdef QT4
|
||||
it.value()->hide();
|
||||
#else
|
||||
it.data()->hide();
|
||||
#endif
|
||||
}
|
||||
|
||||
m_midiIfaceSetupWidgets[m_midiIfaceNames[_iface]]->show();
|
||||
@@ -1207,11 +1085,7 @@ void setupDialog::midiInterfaceChanged( const QString & _iface )
|
||||
|
||||
void setupDialog::displayMIDIHelp( void )
|
||||
{
|
||||
#ifdef QT4
|
||||
QWhatsThis::showText( QCursor::pos(),
|
||||
#else
|
||||
QWhatsThis::display(
|
||||
#endif
|
||||
tr( "Here you can select your preferred "
|
||||
"MIDI-interface. Depending on the "
|
||||
"configuration of your system during "
|
||||
|
||||
@@ -32,10 +32,6 @@
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <Qt/QtXml>
|
||||
#include <QtCore/QFile>
|
||||
#include <QtCore/QFileInfo>
|
||||
@@ -46,25 +42,9 @@
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QLayout>
|
||||
#include <QtGui/QMessageBox>
|
||||
#include <QtGui/QScrollBar>
|
||||
#include <QtGui/QStatusBar>
|
||||
|
||||
#else
|
||||
|
||||
#include <qfile.h>
|
||||
#include <qmessagebox.h>
|
||||
#include <qfiledialog.h>
|
||||
#include <qfileinfo.h>
|
||||
#include <qdom.h>
|
||||
#include <qlabel.h>
|
||||
#include <qstatusbar.h>
|
||||
#include <qlayout.h>
|
||||
#include <qbuttongroup.h>
|
||||
|
||||
#define addButton insert
|
||||
#define setCheckable setToggleButton
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "song_editor.h"
|
||||
#include "automatable_object_templates.h"
|
||||
@@ -129,11 +109,7 @@ songEditor::songEditor( void ) :
|
||||
w->move( 210, 10 );
|
||||
}
|
||||
|
||||
#ifdef QT4
|
||||
setFocusPolicy( Qt::StrongFocus );
|
||||
#else
|
||||
setFocusPolicy( StrongFocus );
|
||||
#endif
|
||||
setFocus();
|
||||
|
||||
QWidget * cw = new QWidget( this );
|
||||
@@ -167,11 +143,7 @@ songEditor::songEditor( void ) :
|
||||
SLOT( setModified() ) );
|
||||
toolTip::add( m_bpmSpinBox, tr( "tempo of song" ) );
|
||||
|
||||
#ifdef QT4
|
||||
m_bpmSpinBox->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_bpmSpinBox,
|
||||
#endif
|
||||
tr( "The tempo of a song is specified in beats per minute "
|
||||
"(BPM). If you want to change the tempo of your "
|
||||
"song, change this value. Every tact has four beats, "
|
||||
@@ -219,11 +191,7 @@ songEditor::songEditor( void ) :
|
||||
m_masterVolumeSlider->setRange( 0, 200 );
|
||||
m_masterVolumeSlider->setPageStep( 1 );
|
||||
m_masterVolumeSlider->setInitValue( 100 );
|
||||
#ifdef QT4
|
||||
m_masterVolumeSlider->setTickPosition( QSlider::TicksLeft );
|
||||
#else
|
||||
m_masterVolumeSlider->setTickPosition( QSlider::Left );
|
||||
#endif
|
||||
m_masterVolumeSlider->setFixedSize( 26, 60 );
|
||||
m_masterVolumeSlider->setTickInterval( 50 );
|
||||
toolTip::add( m_masterVolumeSlider, tr( "master volume" ) );
|
||||
@@ -257,11 +225,7 @@ songEditor::songEditor( void ) :
|
||||
m_masterPitchSlider->setRange( -12, 12 );
|
||||
m_masterPitchSlider->setPageStep( 1 );
|
||||
m_masterPitchSlider->setInitValue( 0 );
|
||||
#ifdef QT4
|
||||
m_masterPitchSlider->setTickPosition( QSlider::TicksLeft );
|
||||
#else
|
||||
m_masterPitchSlider->setTickPosition( QSlider::Left );
|
||||
#endif
|
||||
m_masterPitchSlider->setFixedSize( 26, 60 );
|
||||
m_masterPitchSlider->setTickInterval( 12 );
|
||||
toolTip::add( m_masterPitchSlider, tr( "master pitch" ) );
|
||||
@@ -303,26 +267,17 @@ songEditor::songEditor( void ) :
|
||||
m_toolBar = new QWidget( cw );
|
||||
m_toolBar->setFixedHeight( 32 );
|
||||
m_toolBar->move( 0, 0 );
|
||||
#ifdef QT4
|
||||
m_toolBar->setAutoFillBackground( TRUE );
|
||||
QPalette pal;
|
||||
pal.setBrush( m_toolBar->backgroundRole(),
|
||||
embed::getIconPixmap( "toolbar_bg" ) );
|
||||
m_toolBar->setPalette( pal );
|
||||
#else
|
||||
m_toolBar->setPaletteBackgroundPixmap( embed::getIconPixmap(
|
||||
"toolbar_bg" ) );
|
||||
#endif
|
||||
|
||||
QHBoxLayout * tb_layout = new QHBoxLayout( m_toolBar );
|
||||
tb_layout->setMargin( 0 );
|
||||
tb_layout->setSpacing( 0 );
|
||||
|
||||
#ifdef QT4
|
||||
containerWidget()->setParent( cw );
|
||||
#else
|
||||
containerWidget()->reparent( cw, 0, QPoint( 0, 0 ) );
|
||||
#endif
|
||||
containerWidget()->move( 0, m_toolBar->height() + tl->height() );
|
||||
|
||||
|
||||
@@ -365,13 +320,9 @@ songEditor::songEditor( void ) :
|
||||
tool_button_group->addButton( m_drawModeButton );
|
||||
tool_button_group->addButton( m_editModeButton );
|
||||
tool_button_group->setExclusive( TRUE );
|
||||
#ifndef QT4
|
||||
tool_button_group->hide();
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef QT4
|
||||
#else
|
||||
#if 0
|
||||
#warning TODO
|
||||
QWhatsThis::add( m_playButton, tr( "Click here, if you want to play "
|
||||
"your whole song. Playing will "
|
||||
"be started at the "
|
||||
@@ -431,12 +382,8 @@ songEditor::songEditor( void ) :
|
||||
m_leftRightScroll = new QScrollBar( Qt::Horizontal, cw );
|
||||
m_leftRightScroll->setMinimum( 0 );
|
||||
m_leftRightScroll->setMaximum( 0 );
|
||||
#ifndef QT3
|
||||
m_leftRightScroll->setSingleStep( 1 );
|
||||
m_leftRightScroll->setPageStep( 20 );
|
||||
#else
|
||||
m_leftRightScroll->setSteps( 1, 20 );
|
||||
#endif
|
||||
connect( m_leftRightScroll, SIGNAL( valueChanged( int ) ),
|
||||
this, SLOT( scrolled( int ) ) );
|
||||
|
||||
@@ -1136,11 +1083,7 @@ void songEditor::play( void )
|
||||
return;
|
||||
}
|
||||
}
|
||||
#ifdef QT4
|
||||
m_playButton->setIcon( embed::getIconPixmap( "pause" ) );
|
||||
#else
|
||||
m_playButton->setPixmap( embed::getIconPixmap( "pause" ) );
|
||||
#endif
|
||||
m_actions.push_back( ACT_PLAY_SONG );
|
||||
}
|
||||
|
||||
@@ -1237,11 +1180,7 @@ void songEditor::updateTimeLinePosition( void )
|
||||
void songEditor::stop( void )
|
||||
{
|
||||
m_actions.push_back( ACT_STOP_PLAY );
|
||||
#ifdef QT4
|
||||
m_playButton->setIcon( embed::getIconPixmap( "play" ) );
|
||||
#else
|
||||
m_playButton->setPixmap( embed::getIconPixmap( "play" ) );
|
||||
#endif
|
||||
m_scrollBack = TRUE;
|
||||
}
|
||||
|
||||
@@ -1253,11 +1192,7 @@ void songEditor::stop( void )
|
||||
void songEditor::pause( void )
|
||||
{
|
||||
m_actions.push_back( ACT_PAUSE );
|
||||
#ifdef QT4
|
||||
m_playButton->setIcon( embed::getIconPixmap( "play" ) );
|
||||
#else
|
||||
m_playButton->setPixmap( embed::getIconPixmap( "play" ) );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -1266,11 +1201,7 @@ void songEditor::pause( void )
|
||||
void songEditor::resumeFromPause( void )
|
||||
{
|
||||
m_actions.push_back( ACT_RESUME_FROM_PAUSE );
|
||||
#ifdef QT4
|
||||
m_playButton->setIcon( embed::getIconPixmap( "pause" ) );
|
||||
#else
|
||||
m_playButton->setPixmap( embed::getIconPixmap( "pause" ) );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -1370,30 +1301,11 @@ bool songEditor::mayChangeProject( void )
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
/* int answer = QMessageBox::
|
||||
#if QT_VERSION >= 0x030200
|
||||
question
|
||||
#else
|
||||
information
|
||||
#endif
|
||||
( engine::getMainWindow(),
|
||||
tr( "Project not saved" ),
|
||||
tr( "The current project was "
|
||||
"modified since last "
|
||||
"saving. Do you want "
|
||||
"to save it now?" ),
|
||||
QMessageBox::Yes,
|
||||
QMessageBox::No,
|
||||
QMessageBox::Cancel );*/
|
||||
QMessageBox mb ( tr( "Project not saved" ),
|
||||
tr( "The current project was modified since "
|
||||
"last saving. Do you want to save it "
|
||||
"now?" ),
|
||||
#if QT_VERSION >= 0x030200
|
||||
QMessageBox::Question,
|
||||
#else
|
||||
QMessageBox::Information,
|
||||
#endif
|
||||
QMessageBox::Yes,
|
||||
QMessageBox::No,
|
||||
QMessageBox::Cancel,
|
||||
@@ -1662,14 +1574,8 @@ bool FASTCALL songEditor::saveProjectAs( const QString & _file_name )
|
||||
|
||||
void songEditor::importProject( void )
|
||||
{
|
||||
#ifdef QT4
|
||||
QFileDialog ofd( this, tr( "Import file" ), ""/*,
|
||||
tr( "MIDI-files (*.mid)" )*/ );
|
||||
#else
|
||||
QFileDialog ofd( QString::null,/* tr( "MIDI-files (*.mid)" )*/ QString::null,
|
||||
this, "", TRUE );
|
||||
ofd.setWindowTitle( tr( "Import file" ) );
|
||||
#endif
|
||||
ofd.setDirectory( configManager::inst()->userProjectsDir() );
|
||||
ofd.setFileMode( QFileDialog::ExistingFiles );
|
||||
if( ofd.exec () == QDialog::Accepted && !ofd.selectedFiles().isEmpty() )
|
||||
@@ -1679,6 +1585,12 @@ void songEditor::importProject( void )
|
||||
}
|
||||
|
||||
|
||||
#warning TODO: move somewhere else
|
||||
static inline QString baseName( const QString & _file )
|
||||
{
|
||||
return( QFileInfo( _file ).absolutePath() + "/" +
|
||||
QFileInfo( _file ).completeBaseName() );
|
||||
}
|
||||
|
||||
|
||||
void songEditor::exportProject( void )
|
||||
@@ -1699,7 +1611,6 @@ void songEditor::exportProject( void )
|
||||
efd.setFileMode( QFileDialog::AnyFile );
|
||||
|
||||
int idx = 0;
|
||||
#ifdef QT4
|
||||
QStringList types;
|
||||
while( fileEncodeDevices[idx].m_fileType != NULL_FILE )
|
||||
{
|
||||
@@ -1708,30 +1619,13 @@ void songEditor::exportProject( void )
|
||||
}
|
||||
efd.setFilters( types );
|
||||
efd.selectFile( base_filename );
|
||||
#else
|
||||
while( fileEncodeDevices[idx].m_fileType != NULL_FILE )
|
||||
{
|
||||
efd.addFilter( tr( fileEncodeDevices[idx].m_description ) );
|
||||
++idx;
|
||||
}
|
||||
efd.setSelectedFilter( tr( fileEncodeDevices[0].m_description ) );
|
||||
efd.setSelection( base_filename );
|
||||
#endif
|
||||
efd.setWindowTitle( tr( "Select file for project-export..." ) );
|
||||
|
||||
if( efd.exec() == QDialog::Accepted &&
|
||||
#ifdef QT4
|
||||
!efd.selectedFiles().isEmpty() && efd.selectedFiles()[0] != ""
|
||||
#else
|
||||
efd.selectedFile() != ""
|
||||
#endif
|
||||
)
|
||||
{
|
||||
#ifdef QT4
|
||||
const QString export_file_name = efd.selectedFiles()[0];
|
||||
#else
|
||||
const QString export_file_name = efd.selectedFile();
|
||||
#endif
|
||||
if( QFileInfo( export_file_name ).exists() == TRUE &&
|
||||
QMessageBox::warning( engine::getMainWindow(),
|
||||
tr( "File already exists" ),
|
||||
@@ -1768,10 +1662,4 @@ void songEditor::updateFramesPerTact64th( void )
|
||||
#include "song_editor.moc"
|
||||
|
||||
|
||||
#ifdef QT3
|
||||
#undef addButton
|
||||
#undef setCheckable
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -26,10 +26,6 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QCursor>
|
||||
#include <QtGui/QLabel>
|
||||
@@ -37,17 +33,6 @@
|
||||
#include <QtGui/QMouseEvent>
|
||||
#include <QtGui/QPainter>
|
||||
|
||||
#else
|
||||
|
||||
#include <qapplication.h>
|
||||
#include <qlabel.h>
|
||||
#include <qpainter.h>
|
||||
#include <qpopupmenu.h>
|
||||
#include <qcursor.h>
|
||||
#include <qimage.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include <math.h>
|
||||
|
||||
@@ -68,11 +53,7 @@ QPixmap * surroundArea::s_backgroundArtwork = NULL;
|
||||
|
||||
surroundArea::surroundArea( QWidget * _parent, const QString & _name,
|
||||
track * _track ) :
|
||||
QWidget( _parent
|
||||
#ifndef QT4
|
||||
, _name.ascii()
|
||||
#endif
|
||||
),
|
||||
QWidget( _parent ),
|
||||
m_sndSrcPos( QPoint() )
|
||||
{
|
||||
m_position_x = new knob( knobDark_28, NULL, tr ( "Surround area X" ),
|
||||
@@ -98,11 +79,7 @@ surroundArea::surroundArea( QWidget * _parent, const QString & _name,
|
||||
|
||||
setFixedSize( s_backgroundArtwork->width(),
|
||||
s_backgroundArtwork->height() );
|
||||
#ifdef QT4
|
||||
setAccessibleName( _name );
|
||||
#else
|
||||
setBackgroundMode( Qt::NoBackground );
|
||||
#endif
|
||||
toolTip::add( this,
|
||||
tr( "click to where this channel should be audible" ) );
|
||||
}
|
||||
@@ -188,15 +165,7 @@ void surroundArea::contextMenuEvent( QContextMenuEvent * )
|
||||
mouseReleaseEvent( NULL );
|
||||
|
||||
QMenu contextMenu( this );
|
||||
#ifdef QT4
|
||||
contextMenu.setTitle( accessibleName() );
|
||||
#else
|
||||
QLabel * caption = new QLabel( "<font color=white><b>" +
|
||||
QString( accessibleName() ) + "</b></font>", this );
|
||||
caption->setPaletteBackgroundColor( QColor( 0, 0, 192 ) );
|
||||
caption->setAlignment( Qt::AlignCenter );
|
||||
contextMenu.addAction( caption );
|
||||
#endif
|
||||
contextMenu.addAction( embed::getIconPixmap( "automation" ),
|
||||
tr( "Open &X in automation editor" ),
|
||||
m_position_x->getAutomationPattern(),
|
||||
@@ -213,7 +182,6 @@ void surroundArea::contextMenuEvent( QContextMenuEvent * )
|
||||
|
||||
void surroundArea::paintEvent( QPaintEvent * )
|
||||
{
|
||||
#ifdef QT4
|
||||
QPainter p( this );
|
||||
if( s_backgroundArtwork->size() != size() )
|
||||
{
|
||||
@@ -226,20 +194,6 @@ void surroundArea::paintEvent( QPaintEvent * )
|
||||
Qt::IgnoreAspectRatio,
|
||||
Qt::SmoothTransformation ) );
|
||||
}
|
||||
#else
|
||||
QPixmap pm;
|
||||
if( s_backgroundArtwork->size() != size() )
|
||||
{
|
||||
pm.convertFromImage(
|
||||
s_backgroundArtwork->convertToImage().smoothScale(
|
||||
width(), height() ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
pm = *s_backgroundArtwork;
|
||||
}
|
||||
QPainter p( &pm );
|
||||
#endif
|
||||
const int x = ( width() + m_sndSrcPos.x() * ( width() - 4 ) /
|
||||
SURROUND_AREA_SIZE ) / 2;
|
||||
const int y = ( height() + m_sndSrcPos.y() * ( height() - 4 ) /
|
||||
@@ -250,11 +204,6 @@ void surroundArea::paintEvent( QPaintEvent * )
|
||||
p.drawPoint( x, y );
|
||||
p.drawPoint( x + 1, y );
|
||||
p.drawPoint( x, y + 1 );
|
||||
|
||||
#ifndef QT4
|
||||
// blit drawn pixmap to actual widget
|
||||
bitBlt( this, rect().topLeft(), &pm );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -25,10 +25,6 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <Qt/QtXml>
|
||||
#include <QtCore/QTimer>
|
||||
#include <QtGui/QApplication>
|
||||
@@ -36,16 +32,6 @@
|
||||
#include <QtGui/QMouseEvent>
|
||||
#include <QtGui/QPainter>
|
||||
|
||||
#else
|
||||
|
||||
#include <qpainter.h>
|
||||
#include <qapplication.h>
|
||||
#include <qlayout.h>
|
||||
#include <qtimer.h>
|
||||
#include <qdom.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "timeline.h"
|
||||
#include "embed.h"
|
||||
@@ -111,10 +97,6 @@ timeLine::timeLine( const int _xoff, const int _yoff, const float _ppt,
|
||||
|
||||
m_xOffset -= s_posMarkerPixmap->width() / 2;
|
||||
|
||||
#ifndef QT4
|
||||
setBackgroundMode( Qt::NoBackground );
|
||||
#endif
|
||||
|
||||
m_pos.m_timeLine = this;
|
||||
|
||||
QTimer * update_timer = new QTimer( this );
|
||||
@@ -247,13 +229,7 @@ void timeLine::toggleBehaviourAtStop( int _n )
|
||||
|
||||
void timeLine::paintEvent( QPaintEvent * )
|
||||
{
|
||||
#ifdef QT4
|
||||
QPainter p( this );
|
||||
#else
|
||||
QPixmap draw_pm( rect().size() );
|
||||
|
||||
QPainter p( &draw_pm, this );
|
||||
#endif
|
||||
|
||||
for( int x = 0; x < width(); x += s_timeLinePixmap->width() )
|
||||
{
|
||||
@@ -290,11 +266,6 @@ void timeLine::paintEvent( QPaintEvent * )
|
||||
}
|
||||
|
||||
p.drawPixmap( m_posMarkerX, 4, *s_posMarkerPixmap );
|
||||
|
||||
#ifndef QT4
|
||||
// and blit all the drawn stuff on the screen...
|
||||
bitBlt( this, rect().topLeft(), &draw_pm );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -26,27 +26,12 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <Qt/QtXml>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QLayout>
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QMouseEvent>
|
||||
|
||||
#else
|
||||
|
||||
#include <qapplication.h>
|
||||
#include <qdom.h>
|
||||
#include <qpopupmenu.h>
|
||||
#include <qlayout.h>
|
||||
#include <qcursor.h>
|
||||
#include <qwhatsthis.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "track.h"
|
||||
#include "automation_pattern.h"
|
||||
@@ -87,11 +72,7 @@ textFloat * trackContentObject::s_textFloat = NULL;
|
||||
// trackContentObject
|
||||
// ===========================================================================
|
||||
trackContentObject::trackContentObject( track * _track ) :
|
||||
selectableObject( _track->getTrackContentWidget()
|
||||
#ifdef QT3
|
||||
, Qt::WDestructiveClose
|
||||
#endif
|
||||
),
|
||||
selectableObject( _track->getTrackContentWidget() ),
|
||||
m_track( _track ),
|
||||
m_startPosition(),
|
||||
m_length(),
|
||||
@@ -107,12 +88,8 @@ trackContentObject::trackContentObject( track * _track ) :
|
||||
s_textFloat->setPixmap( embed::getIconPixmap( "clock" ) );
|
||||
}
|
||||
|
||||
#ifdef QT4
|
||||
setAttribute( Qt::WA_DeleteOnClose );
|
||||
setFocusPolicy( Qt::StrongFocus );
|
||||
#else
|
||||
setFocusPolicy( StrongFocus );
|
||||
#endif
|
||||
show();
|
||||
|
||||
setJournalling( FALSE );
|
||||
@@ -259,17 +236,10 @@ void trackContentObject::mousePressEvent( QMouseEvent * _me )
|
||||
// start drag-action
|
||||
multimediaProject mmp( multimediaProject::DRAG_N_DROP_DATA );
|
||||
saveState( mmp, mmp.content() );
|
||||
#ifdef QT4
|
||||
QPixmap thumbnail = QPixmap::grabWidget( this ).scaled(
|
||||
128, 128,
|
||||
Qt::KeepAspectRatio,
|
||||
Qt::SmoothTransformation );
|
||||
#else
|
||||
QSize s( size() );
|
||||
s.scale( 128, 128, QSize::ScaleMin );
|
||||
QPixmap thumbnail = QPixmap::grabWidget( this ).
|
||||
convertToImage().smoothScale( s );
|
||||
#endif
|
||||
new stringPairDrag( QString( "tco_%1" ).arg( m_track->type() ),
|
||||
mmp.toString(), thumbnail, this );
|
||||
}
|
||||
@@ -361,13 +331,13 @@ void trackContentObject::mouseMoveEvent( QMouseEvent * _me )
|
||||
else if( m_action == MOVE_SELECTION )
|
||||
{
|
||||
const int dx = _me->x() - m_initialMouseX;
|
||||
vvector<selectableObject *> so =
|
||||
QVector<selectableObject *> so =
|
||||
m_track->getTrackContainer()->selectedObjects();
|
||||
vvector<trackContentObject *> tcos;
|
||||
QVector<trackContentObject *> tcos;
|
||||
midiTime smallest_pos;
|
||||
// find out smallest position of all selected objects for not
|
||||
// moving an object before zero
|
||||
for( vvector<selectableObject *>::iterator it = so.begin();
|
||||
for( QVector<selectableObject *>::iterator it = so.begin();
|
||||
it != so.end(); ++it )
|
||||
{
|
||||
trackContentObject * tco =
|
||||
@@ -381,7 +351,7 @@ void trackContentObject::mouseMoveEvent( QMouseEvent * _me )
|
||||
(Sint32)tco->startPosition() +
|
||||
static_cast<int>( dx * 64 / ppt ) );
|
||||
}
|
||||
for( vvector<trackContentObject *>::iterator it = tcos.begin();
|
||||
for( QVector<trackContentObject *>::iterator it = tcos.begin();
|
||||
it != tcos.end(); ++it )
|
||||
{
|
||||
( *it )->movePosition( ( *it )->startPosition() +
|
||||
@@ -455,10 +425,6 @@ void trackContentObject::mouseReleaseEvent( QMouseEvent * _me )
|
||||
|
||||
|
||||
|
||||
#ifdef QT3
|
||||
#define addSeparator insertSeparator
|
||||
#endif
|
||||
|
||||
void trackContentObject::contextMenuEvent( QContextMenuEvent * _cme )
|
||||
{
|
||||
QMenu contextMenu( this );
|
||||
@@ -596,14 +562,10 @@ trackContentWidget::trackContentWidget( trackWidget * _parent ) :
|
||||
QWidget( _parent ),
|
||||
m_trackWidget( _parent )
|
||||
{
|
||||
#ifdef QT4
|
||||
setAutoFillBackground( TRUE );
|
||||
QPalette pal;
|
||||
pal.setColor( backgroundRole(), QColor( 96, 96, 96 ) );
|
||||
setPalette( pal );
|
||||
#else
|
||||
setPaletteBackgroundColor( QColor( 96, 96, 96 ) );
|
||||
#endif
|
||||
setAcceptDrops( TRUE );
|
||||
}
|
||||
|
||||
@@ -617,7 +579,7 @@ trackContentWidget::~trackContentWidget()
|
||||
|
||||
|
||||
|
||||
trackContentObject * trackContentWidget::getTCO( csize _tco_num )
|
||||
trackContentObject * trackContentWidget::getTCO( int _tco_num )
|
||||
{
|
||||
if( _tco_num < m_trackContentObjects.size() )
|
||||
{
|
||||
@@ -632,7 +594,7 @@ trackContentObject * trackContentWidget::getTCO( csize _tco_num )
|
||||
|
||||
|
||||
|
||||
csize trackContentWidget::numOfTCOs( void )
|
||||
int trackContentWidget::numOfTCOs( void )
|
||||
{
|
||||
return( m_trackContentObjects.size() );
|
||||
}
|
||||
@@ -660,7 +622,7 @@ trackContentObject * trackContentWidget::addTCO( trackContentObject * _tco )
|
||||
|
||||
|
||||
|
||||
void trackContentWidget::removeTCO( csize _tco_num, bool _also_delete )
|
||||
void trackContentWidget::removeTCO( int _tco_num, bool _also_delete )
|
||||
{
|
||||
removeTCO( getTCO( _tco_num ), _also_delete );
|
||||
}
|
||||
@@ -708,7 +670,7 @@ void trackContentWidget::removeAllTCOs( void )
|
||||
|
||||
|
||||
|
||||
void trackContentWidget::swapPositionOfTCOs( csize _tco_num1, csize _tco_num2 )
|
||||
void trackContentWidget::swapPositionOfTCOs( int _tco_num1, int _tco_num2 )
|
||||
{
|
||||
// TODO: range-checking
|
||||
qSwap( m_trackContentObjects[_tco_num1],
|
||||
@@ -850,17 +812,8 @@ void trackContentWidget::mousePressEvent( QMouseEvent * _me )
|
||||
|
||||
void trackContentWidget::paintEvent( QPaintEvent * _pe )
|
||||
{
|
||||
#ifdef QT4
|
||||
QPainter p( this );
|
||||
p.fillRect( rect(), QColor( 96, 96, 96 ) );
|
||||
#else
|
||||
// create pixmap for whole widget
|
||||
QPixmap pm( rect().size() );
|
||||
pm.fill( QColor( 96, 96, 96 ) );
|
||||
|
||||
// and a painter for it
|
||||
QPainter p( &pm );
|
||||
#endif
|
||||
const trackContainer * tc = getTrack()->getTrackContainer();
|
||||
const int offset = (int)( ( tc->currentPosition() % 4 ) *
|
||||
tc->pixelsPerTact() );
|
||||
@@ -870,11 +823,6 @@ void trackContentWidget::paintEvent( QPaintEvent * _pe )
|
||||
{
|
||||
p.drawLine( x, 0, x, height() );
|
||||
}
|
||||
|
||||
#ifndef QT4
|
||||
// blit drawn pixmap to actual widget
|
||||
bitBlt( this, rect().topLeft(), &pm );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -1008,11 +956,7 @@ trackOperationsWidget::trackOperationsWidget( trackWidget * _parent ) :
|
||||
SLOT( setMuted( bool ) ) );
|
||||
connect( m_muteBtn, SIGNAL( clickedRight() ), this,
|
||||
SLOT( muteBtnRightClicked() ) );
|
||||
#ifdef QT4
|
||||
m_muteBtn->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_muteBtn,
|
||||
#endif
|
||||
tr( "With this switch you can either mute this track or mute "
|
||||
"all other tracks.\nBy clicking left, this track is "
|
||||
"muted. This is useful, if you only want to listen to "
|
||||
@@ -1077,17 +1021,8 @@ void trackOperationsWidget::mousePressEvent( QMouseEvent * _me )
|
||||
|
||||
void trackOperationsWidget::paintEvent( QPaintEvent * _pe )
|
||||
{
|
||||
#ifdef QT4
|
||||
QPainter p( this );
|
||||
p.fillRect( rect(), QColor( 128, 128, 128 ) );
|
||||
#else
|
||||
// create pixmap for whole widget
|
||||
QPixmap pm( rect().size() );
|
||||
pm.fill( QColor( 128, 128, 128 ) );
|
||||
|
||||
// and a painter for it
|
||||
QPainter p( &pm );
|
||||
#endif
|
||||
if( m_trackWidget->isMovingTrack() == FALSE )
|
||||
{
|
||||
p.drawPixmap( 2, 2, *s_grip );
|
||||
@@ -1110,13 +1045,8 @@ void trackOperationsWidget::paintEvent( QPaintEvent * _pe )
|
||||
mute_active_icon = "mute_on";
|
||||
mute_inactive_icon = "mute_off";
|
||||
}
|
||||
#ifndef QT3
|
||||
m_trackOps->setIcon( embed::getIconPixmap(
|
||||
trackOps_icon ) );
|
||||
#else
|
||||
m_trackOps->setIconSet( embed::getIconPixmap(
|
||||
trackOps_icon ) );
|
||||
#endif
|
||||
m_muteBtn->setActiveGraphic( embed::getIconPixmap(
|
||||
mute_active_icon ) );
|
||||
m_muteBtn->setInactiveGraphic( embed::getIconPixmap(
|
||||
@@ -1130,11 +1060,6 @@ void trackOperationsWidget::paintEvent( QPaintEvent * _pe )
|
||||
m_trackOps->hide();
|
||||
m_muteBtn->hide();
|
||||
}
|
||||
|
||||
#ifndef QT4
|
||||
// blit drawn pixmap to actual widget
|
||||
bitBlt( this, rect().topLeft(), &pm );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -1184,12 +1109,7 @@ void trackOperationsWidget::muteBtnRightClicked( void )
|
||||
|
||||
void trackOperationsWidget::updateMenu( void )
|
||||
{
|
||||
QMenu * to_menu = m_trackOps->
|
||||
#ifndef QT3
|
||||
menu();
|
||||
#else
|
||||
popup();
|
||||
#endif
|
||||
QMenu * to_menu = m_trackOps->menu();
|
||||
to_menu->clear();
|
||||
if( inBBEditor() )
|
||||
{
|
||||
@@ -1271,31 +1191,18 @@ trackWidget::trackWidget( track * _track, QWidget * _parent ) :
|
||||
m_trackContentWidget( this ),
|
||||
m_action( NONE )
|
||||
{
|
||||
#ifdef QT4
|
||||
m_trackOperationsWidget.setAutoFillBackground( TRUE );
|
||||
QPalette pal;
|
||||
pal.setColor( m_trackOperationsWidget.backgroundRole(),
|
||||
QColor( 128, 128, 128 ) );
|
||||
m_trackOperationsWidget.setPalette( pal );
|
||||
#else
|
||||
m_trackOperationsWidget.setPaletteBackgroundColor(
|
||||
QColor( 128, 128, 128 ) );
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifdef QT4
|
||||
m_trackSettingsWidget.setAutoFillBackground( TRUE );
|
||||
pal.setColor( m_trackSettingsWidget.backgroundRole(),
|
||||
QColor( 64, 64, 64 ) );
|
||||
m_trackSettingsWidget.setPalette( pal );
|
||||
#else
|
||||
m_trackSettingsWidget.setPaletteBackgroundColor( QColor( 64, 64, 64 ) );
|
||||
|
||||
|
||||
// set background-mode for flicker-free redraw
|
||||
setBackgroundMode( Qt::NoBackground );
|
||||
#endif
|
||||
setAcceptDrops( TRUE );
|
||||
}
|
||||
|
||||
@@ -1340,9 +1247,9 @@ void trackWidget::changePosition( const midiTime & _new_pos )
|
||||
const Sint32 begin = pos;
|
||||
const Sint32 end = endPosition( pos );
|
||||
const float ppt = m_track->getTrackContainer()->pixelsPerTact();
|
||||
const csize tcos = m_trackContentWidget.numOfTCOs();
|
||||
const int tcos = m_trackContentWidget.numOfTCOs();
|
||||
|
||||
for( csize i = 0; i < tcos; ++i )
|
||||
for( int i = 0; i < tcos; ++i )
|
||||
{
|
||||
trackContentObject * tco = m_trackContentWidget.getTCO( i );
|
||||
tco->changeLength( tco->length() );
|
||||
@@ -1526,23 +1433,9 @@ void trackWidget::mouseReleaseEvent( QMouseEvent * _me )
|
||||
|
||||
void trackWidget::paintEvent( QPaintEvent * _pe )
|
||||
{
|
||||
#ifdef QT4
|
||||
QPainter p( this );
|
||||
#else
|
||||
// create pixmap for whole widget
|
||||
QPixmap pm( rect().size() );
|
||||
pm.fill( QColor( 224, 224, 224 ) );
|
||||
|
||||
// and a painter for it
|
||||
QPainter p( &pm );
|
||||
#endif
|
||||
p.setPen( QColor( 0, 0, 0 ) );
|
||||
p.drawLine( 0, height() - 1, width() - 1, height() - 1 );
|
||||
|
||||
#ifndef QT4
|
||||
// blit drawn pixmap to actual widget
|
||||
bitBlt( this, rect().topLeft(), &pm );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -1627,7 +1520,7 @@ track::~track()
|
||||
m_trackWidget = NULL;
|
||||
}
|
||||
|
||||
for( vlist<automationPattern *>::iterator it =
|
||||
for( QList<automationPattern *>::iterator it =
|
||||
m_automation_patterns.begin();
|
||||
it != m_automation_patterns.end();
|
||||
++it )
|
||||
@@ -1694,7 +1587,7 @@ tact track::length( void ) const
|
||||
|
||||
void track::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
{
|
||||
csize num_of_tcos = getTrackContentWidget()->numOfTCOs();
|
||||
int num_of_tcos = getTrackContentWidget()->numOfTCOs();
|
||||
|
||||
_this.setTagName( "track" );
|
||||
_this.setAttribute( "type", type() );
|
||||
@@ -1708,7 +1601,7 @@ void track::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
saveTrackSpecificSettings( _doc, ts_de );
|
||||
|
||||
// now save settings of all TCO's
|
||||
for( csize i = 0; i < num_of_tcos; ++i )
|
||||
for( int i = 0; i < num_of_tcos; ++i )
|
||||
{
|
||||
trackContentObject * tco = getTCO( i );
|
||||
tco->saveState( _doc, _this );
|
||||
@@ -1774,7 +1667,7 @@ trackContentObject * track::addTCO( trackContentObject * _tco )
|
||||
|
||||
|
||||
|
||||
void track::removeTCO( csize _tco_num )
|
||||
void track::removeTCO( int _tco_num )
|
||||
{
|
||||
getTrackContentWidget()->removeTCO( _tco_num );
|
||||
}
|
||||
@@ -1782,7 +1675,7 @@ void track::removeTCO( csize _tco_num )
|
||||
|
||||
|
||||
|
||||
csize track::numOfTCOs( void )
|
||||
int track::numOfTCOs( void )
|
||||
{
|
||||
return( getTrackContentWidget()->numOfTCOs() );
|
||||
}
|
||||
@@ -1790,7 +1683,7 @@ csize track::numOfTCOs( void )
|
||||
|
||||
|
||||
|
||||
trackContentObject * track::getTCO( csize _tco_num )
|
||||
trackContentObject * track::getTCO( int _tco_num )
|
||||
{
|
||||
return( getTrackContentWidget()->getTCO( _tco_num ) );
|
||||
|
||||
@@ -1799,9 +1692,9 @@ trackContentObject * track::getTCO( csize _tco_num )
|
||||
|
||||
|
||||
|
||||
csize track::getTCONum( trackContentObject * _tco )
|
||||
int track::getTCONum( trackContentObject * _tco )
|
||||
{
|
||||
for( csize i = 0; i < getTrackContentWidget()->numOfTCOs(); ++i )
|
||||
for( int i = 0; i < getTrackContentWidget()->numOfTCOs(); ++i )
|
||||
{
|
||||
if( getTCO( i ) == _tco )
|
||||
{
|
||||
@@ -1815,11 +1708,11 @@ csize track::getTCONum( trackContentObject * _tco )
|
||||
|
||||
|
||||
|
||||
void track::getTCOsInRange( vlist<trackContentObject *> & _tco_v,
|
||||
void track::getTCOsInRange( QList<trackContentObject *> & _tco_v,
|
||||
const midiTime & _start,
|
||||
const midiTime & _end )
|
||||
{
|
||||
for( csize i = 0; i < getTrackContentWidget()->numOfTCOs(); ++i )
|
||||
for( int i = 0; i < getTrackContentWidget()->numOfTCOs(); ++i )
|
||||
{
|
||||
trackContentObject * tco = getTCO( i );
|
||||
Sint32 s = tco->startPosition();
|
||||
@@ -1830,7 +1723,7 @@ void track::getTCOsInRange( vlist<trackContentObject *> & _tco_v,
|
||||
// now let's search according position for TCO in list
|
||||
// -> list is ordered by TCO's position afterwards
|
||||
bool inserted = FALSE;
|
||||
for( vlist<trackContentObject *>::iterator it =
|
||||
for( QList<trackContentObject *>::iterator it =
|
||||
_tco_v.begin();
|
||||
it != _tco_v.end(); ++it )
|
||||
{
|
||||
@@ -1853,7 +1746,7 @@ void track::getTCOsInRange( vlist<trackContentObject *> & _tco_v,
|
||||
|
||||
|
||||
|
||||
void track::swapPositionOfTCOs( csize _tco_num1, csize _tco_num2 )
|
||||
void track::swapPositionOfTCOs( int _tco_num1, int _tco_num2 )
|
||||
{
|
||||
getTrackContentWidget()->swapPositionOfTCOs( _tco_num1, _tco_num2 );
|
||||
}
|
||||
@@ -1879,7 +1772,7 @@ void track::removeAutomationPattern( automationPattern * _pattern )
|
||||
|
||||
void track::sendMidiTime( const midiTime & _time )
|
||||
{
|
||||
for( vlist<automationPattern *>::iterator it =
|
||||
for( QList<automationPattern *>::iterator it =
|
||||
m_automation_patterns.begin();
|
||||
it != m_automation_patterns.end();
|
||||
++it )
|
||||
|
||||
@@ -26,26 +26,11 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <Qt/QtXml>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QProgressDialog>
|
||||
#include <QtGui/QWheelEvent>
|
||||
|
||||
#else
|
||||
|
||||
#include <qdom.h>
|
||||
#include <qapplication.h>
|
||||
#include <qprogressdialog.h>
|
||||
|
||||
#define setValue setProgress
|
||||
#define maximum totalSteps
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "track_container.h"
|
||||
#include "bb_track.h"
|
||||
@@ -68,23 +53,17 @@
|
||||
|
||||
|
||||
trackContainer::trackContainer( void ) :
|
||||
QMainWindow( engine::getMainWindow()->workspace()
|
||||
#ifdef QT3
|
||||
, 0, Qt::WStyle_Title
|
||||
#endif
|
||||
),
|
||||
QMainWindow( engine::getMainWindow()->workspace() ),
|
||||
m_currentPosition( 0, 0 ),
|
||||
m_scrollArea( new scrollArea( this ) ),
|
||||
m_ppt( DEFAULT_PIXELS_PER_TACT ),
|
||||
m_rubberBand( new rubberBand( m_scrollArea ) ),
|
||||
m_origin()
|
||||
{
|
||||
#ifdef QT4
|
||||
if( engine::getMainWindow()->workspace() != NULL )
|
||||
{
|
||||
engine::getMainWindow()->workspace()->addWindow( this );
|
||||
}
|
||||
#endif
|
||||
|
||||
m_scrollArea->show();
|
||||
m_rubberBand->hide();
|
||||
@@ -134,40 +113,23 @@ void trackContainer::loadSettings( const QDomElement & _this )
|
||||
int start_val = 0;
|
||||
if( pd == NULL )
|
||||
{
|
||||
#ifdef QT4
|
||||
pd = new QProgressDialog( tr( "Loading project..." ),
|
||||
tr( "Cancel" ), 0,
|
||||
_this.childNodes().count() );
|
||||
#else
|
||||
pd = new QProgressDialog( tr( "Loading project..." ),
|
||||
tr( "Cancel" ),
|
||||
_this.childNodes().count(),
|
||||
0, 0, TRUE );
|
||||
#endif
|
||||
pd->setWindowTitle( tr( "Please wait..." ) );
|
||||
pd->show();
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef QT4
|
||||
start_val = pd->value();
|
||||
pd->setMaximum( pd->maximum() + _this.childNodes().count() );
|
||||
#else
|
||||
start_val = pd->progress();
|
||||
pd->setTotalSteps( pd->maximum() + _this.childNodes().count() );
|
||||
#endif
|
||||
}
|
||||
|
||||
QDomNode node = _this.firstChild();
|
||||
while( !node.isNull() )
|
||||
{
|
||||
#ifdef QT4
|
||||
pd->setValue( pd->value() + 1 );
|
||||
qApp->processEvents( QEventLoop::AllEvents, 100 );
|
||||
#else
|
||||
pd->setValue( pd->progress() + 1 );
|
||||
qApp->processEvents( 100 );
|
||||
#endif
|
||||
|
||||
if( pd->wasCanceled() )
|
||||
{
|
||||
@@ -203,9 +165,6 @@ void trackContainer::addTrack( track * _track )
|
||||
addJournalEntry( journalEntry( ADD_TRACK, map ) );
|
||||
|
||||
m_trackWidgets.push_back( _track->getTrackWidget() );
|
||||
#ifndef QT4
|
||||
m_scrollArea->addChild( _track->getTrackWidget() );
|
||||
#endif
|
||||
connect( this, SIGNAL( positionChanged( const midiTime & ) ),
|
||||
_track->getTrackWidget(),
|
||||
SLOT( changePosition( const midiTime & ) ) );
|
||||
@@ -228,9 +187,6 @@ void trackContainer::removeTrack( track * _track )
|
||||
map["state"] = mmp.toString();
|
||||
addJournalEntry( journalEntry( REMOVE_TRACK, map ) );
|
||||
|
||||
#ifndef QT4
|
||||
m_scrollArea->removeChild( _track->getTrackWidget() );
|
||||
#endif
|
||||
m_trackWidgets.erase( it );
|
||||
|
||||
delete _track;
|
||||
@@ -301,19 +257,12 @@ void trackContainer::realignTracks( bool _complete_update )
|
||||
{
|
||||
( *it )->show();
|
||||
( *it )->update();
|
||||
#ifdef QT4
|
||||
( *it )->move( 0, y );
|
||||
#else
|
||||
m_scrollArea->moveChild( *it, 0, y );
|
||||
#endif
|
||||
( *it )->resize( width() - DEFAULT_SCROLLBAR_SIZE,
|
||||
( *it )->height() );
|
||||
( *it )->changePosition( m_currentPosition );
|
||||
y += ( *it )->height();
|
||||
}
|
||||
#ifdef QT3
|
||||
m_scrollArea->resizeContents( width() - DEFAULT_SCROLLBAR_SIZE, y );
|
||||
#endif
|
||||
updateScrollArea();
|
||||
}
|
||||
|
||||
@@ -333,12 +282,7 @@ void trackContainer::clearAllTracks( void )
|
||||
|
||||
const trackWidget * trackContainer::trackWidgetAt( const int _y ) const
|
||||
{
|
||||
const int abs_y = _y +
|
||||
#ifndef QT3
|
||||
m_scrollArea->viewport()->y();
|
||||
#else
|
||||
m_scrollArea->contentsY();
|
||||
#endif
|
||||
const int abs_y = _y + m_scrollArea->viewport()->y();
|
||||
int y_cnt = 0;
|
||||
for( trackWidgetVector::const_iterator it = m_trackWidgets.begin();
|
||||
it != m_trackWidgets.end(); ++it )
|
||||
@@ -615,20 +559,8 @@ trackContainer::scrollArea::scrollArea( trackContainer * _parent ) :
|
||||
m_trackContainer( _parent )
|
||||
{
|
||||
setFrameStyle( QFrame::NoFrame );
|
||||
setHorizontalScrollBarPolicy(
|
||||
#ifdef QT4
|
||||
Qt::ScrollBarAlwaysOff
|
||||
#else
|
||||
QScrollArea::AlwaysOff
|
||||
#endif
|
||||
);
|
||||
setVerticalScrollBarPolicy(
|
||||
#ifdef QT4
|
||||
Qt::ScrollBarAlwaysOn
|
||||
#else
|
||||
QScrollArea::AlwaysOn
|
||||
#endif
|
||||
);
|
||||
setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
|
||||
setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOn );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* base64.cpp - namespace base64 with methods for encoding/decoding binary data
|
||||
* to/from base64
|
||||
*
|
||||
* Copyright (c) 2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2006-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -30,152 +30,9 @@
|
||||
#include "base64.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifndef QT3
|
||||
|
||||
#include <QtCore/QBuffer>
|
||||
#include <QtCore/QVariant>
|
||||
|
||||
#else
|
||||
|
||||
#include <qvariant.h>
|
||||
#include <qbuffer.h>
|
||||
|
||||
|
||||
namespace base64
|
||||
{
|
||||
|
||||
|
||||
void encode( const char * _data, const int _size, QString & _dst )
|
||||
{
|
||||
// code mostly taken from
|
||||
// qt-x11-opensource-src-4.0.1/src/corelib/tools/qbytearray.cpp
|
||||
|
||||
const char alphabet[] = "ABCDEFGH" "IJKLMNOP" "QRSTUVWX" "YZabcdef"
|
||||
"ghijklmn" "opqrstuv" "wxyz0123" "456789+/";
|
||||
const char padchar = '=';
|
||||
int padlen = 0;
|
||||
|
||||
const int dsize = ( ( _size * 4 ) / 3 ) + 3;
|
||||
char * ptr = new char[dsize + 1];
|
||||
char * out = ptr;
|
||||
|
||||
int i = 0;
|
||||
while( i < _size )
|
||||
{
|
||||
Uint32 chunk = 0;
|
||||
chunk |= Uint32( Uint8( _data[i++] ) ) << 16;
|
||||
if( i == dsize )
|
||||
{
|
||||
padlen = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
chunk |= Uint32( Uint8( _data[i++] ) ) << 8;
|
||||
if( i == _size )
|
||||
{
|
||||
padlen = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
chunk |= Uint32( Uint8( _data[i++] ) );
|
||||
}
|
||||
}
|
||||
|
||||
Uint32 j = ( chunk & 0x00fc0000 ) >> 18;
|
||||
Uint32 k = ( chunk & 0x0003f000 ) >> 12;
|
||||
Uint32 l = ( chunk & 0x00000fc0 ) >> 6;
|
||||
Uint32 m = ( chunk & 0x0000003f );
|
||||
*out++ = alphabet[j];
|
||||
*out++ = alphabet[k];
|
||||
if( padlen > 1 )
|
||||
{
|
||||
*out++ = padchar;
|
||||
}
|
||||
else
|
||||
{
|
||||
*out++ = alphabet[l];
|
||||
}
|
||||
if( padlen > 0 )
|
||||
{
|
||||
*out++ = padchar;
|
||||
}
|
||||
else
|
||||
{
|
||||
*out++ = alphabet[m];
|
||||
}
|
||||
}
|
||||
|
||||
// terminate string
|
||||
ptr[out - ptr] = 0;
|
||||
_dst = ptr;
|
||||
delete[] ptr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void decode( const QString & _b64, char * * _data, int * _size )
|
||||
{
|
||||
const char * src = _b64.ascii();
|
||||
const csize ssize = _b64.length();
|
||||
const csize dsize = *_size = ( ssize * 3 ) / 4;
|
||||
*_data = new char[dsize];
|
||||
|
||||
// code mostly taken from
|
||||
// qt-x11-opensource-src-4.0.1/src/corelib/tools/qbytearray.cpp
|
||||
unsigned int buf = 0;
|
||||
int nbits = 0;
|
||||
int offset = 0;
|
||||
|
||||
for( csize i = 0; i < ssize; ++i )
|
||||
{
|
||||
int ch = src[i];
|
||||
int d;
|
||||
|
||||
if( ch >= 'A' && ch <= 'Z' )
|
||||
{
|
||||
d = ch - 'A';
|
||||
}
|
||||
else if( ch >= 'a' && ch <= 'z' )
|
||||
{
|
||||
d = ch - 'a' + 26;
|
||||
}
|
||||
else if( ch >= '0' && ch <= '9' )
|
||||
{
|
||||
d = ch - '0' + 52;
|
||||
}
|
||||
else if( ch == '+' )
|
||||
{
|
||||
d = 62;
|
||||
}
|
||||
else if( ch == '/' )
|
||||
{
|
||||
d = 63;
|
||||
}
|
||||
else
|
||||
{
|
||||
d = -1;
|
||||
}
|
||||
|
||||
if( d != -1 )
|
||||
{
|
||||
buf = ( buf << 6 ) | (Uint32)d;
|
||||
nbits += 6;
|
||||
if( nbits >= 8 )
|
||||
{
|
||||
nbits -= 8;
|
||||
( *_data )[offset++] = buf >> nbits;
|
||||
buf &= ( 1 << nbits ) - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
namespace base64
|
||||
{
|
||||
|
||||
@@ -183,20 +40,12 @@ namespace base64
|
||||
QString encode( const QVariant & _data )
|
||||
{
|
||||
QBuffer buf;
|
||||
#ifndef QT3
|
||||
buf.open( QBuffer::WriteOnly );
|
||||
#else
|
||||
buf.open( IO_WriteOnly );
|
||||
#endif
|
||||
QDataStream out( &buf );
|
||||
out << _data;
|
||||
QByteArray data = buf.buffer();
|
||||
QString dst;
|
||||
#ifndef QT3
|
||||
encode( data.constData(), data.size(), dst );
|
||||
#else
|
||||
encode( data.data(), data.size(), dst );
|
||||
#endif
|
||||
return( dst );
|
||||
}
|
||||
|
||||
@@ -208,16 +57,9 @@ QVariant decode( const QString & _b64 )
|
||||
char * dst = NULL;
|
||||
int dsize = 0;
|
||||
base64::decode( _b64, &dst, &dsize );
|
||||
#ifndef QT3
|
||||
QByteArray ba( dst, dsize );
|
||||
QBuffer buf( &ba );
|
||||
buf.open( QBuffer::ReadOnly );
|
||||
#else
|
||||
QByteArray ba;
|
||||
ba.setRawData( dst, dsize );
|
||||
QBuffer buf( ba );
|
||||
buf.open( IO_ReadOnly );
|
||||
#endif
|
||||
QDataStream in( &buf );
|
||||
QVariant ret;
|
||||
in >> ret;
|
||||
|
||||
@@ -25,19 +25,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtGui/QImage>
|
||||
|
||||
#else
|
||||
|
||||
#include <qimage.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "embed.h"
|
||||
#include "config_mgr.h"
|
||||
|
||||
@@ -80,13 +69,8 @@ QPixmap getIconPixmap( const char * _name, int _w, int _h )
|
||||
}
|
||||
if( p.isNull() )
|
||||
{
|
||||
#ifdef QT4
|
||||
const embed::descriptor & e = findEmbeddedData(
|
||||
name.toAscii().constData() );
|
||||
#else
|
||||
const embed::descriptor & e = findEmbeddedData(
|
||||
name.ascii() );
|
||||
#endif
|
||||
// found?
|
||||
if( QString( e.name ) == name )
|
||||
{
|
||||
@@ -99,12 +83,8 @@ QPixmap getIconPixmap( const char * _name, int _w, int _h )
|
||||
}
|
||||
return( p );
|
||||
}
|
||||
#ifdef QT4
|
||||
return( getIconPixmap( _name ).scaled( _w, _h, Qt::IgnoreAspectRatio,
|
||||
Qt::SmoothTransformation ) );
|
||||
#else
|
||||
return( getIconPixmap( _name ).convertToImage().smoothScale( _w, _h ) );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -25,23 +25,13 @@
|
||||
*/
|
||||
|
||||
|
||||
#include <Qt/QtXml>
|
||||
|
||||
#include "journalling_object.h"
|
||||
#include "project_journal.h"
|
||||
#include "base64.h"
|
||||
#include "engine.h"
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifndef QT3
|
||||
|
||||
#include <Qt/QtXml>
|
||||
|
||||
#else
|
||||
|
||||
#include <qdom.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
journallingObject::journallingObject( void ) :
|
||||
|
||||
@@ -29,18 +29,9 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtCore/QFile>
|
||||
#include <QtGui/QMessageBox>
|
||||
|
||||
#else
|
||||
|
||||
#include <qfile.h>
|
||||
#include <qmessagebox.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "config_mgr.h"
|
||||
#include "project_version.h"
|
||||
@@ -101,11 +92,7 @@ multimediaProject::multimediaProject( const QString & _in_file_name,
|
||||
QFile in_file( _in_file_name );
|
||||
if( _is_filename == TRUE )
|
||||
{
|
||||
#ifdef QT4
|
||||
if( !in_file.open( QIODevice::ReadOnly ) )
|
||||
#else
|
||||
if( !in_file.open( IO_ReadOnly ) )
|
||||
#endif
|
||||
{
|
||||
QMessageBox::critical( NULL,
|
||||
songEditor::tr( "Could not open file" ),
|
||||
@@ -255,13 +242,7 @@ bool multimediaProject::writeFile( QString & _fn, bool _overwrite_check )
|
||||
QFile outfile( fn );
|
||||
if( _overwrite_check == TRUE &&
|
||||
outfile.exists() == TRUE &&
|
||||
QMessageBox::
|
||||
#if QT_VERSION >= 0x030200
|
||||
question
|
||||
#else
|
||||
information
|
||||
#endif
|
||||
( NULL,
|
||||
QMessageBox::question( NULL,
|
||||
songEditor::tr( "File already exists" ),
|
||||
songEditor::tr( "The file %1 already "
|
||||
"exists.\nDo you want "
|
||||
@@ -274,11 +255,7 @@ bool multimediaProject::writeFile( QString & _fn, bool _overwrite_check )
|
||||
}
|
||||
|
||||
|
||||
#ifdef QT4
|
||||
if( !outfile.open( QIODevice::WriteOnly | QIODevice::Truncate ) )
|
||||
#else
|
||||
if( !outfile.open( IO_WriteOnly | IO_Truncate ) )
|
||||
#endif
|
||||
{
|
||||
QMessageBox::critical( NULL, songEditor::tr( "Could not write "
|
||||
"file" ),
|
||||
@@ -293,28 +270,14 @@ bool multimediaProject::writeFile( QString & _fn, bool _overwrite_check )
|
||||
).arg( fn ) );
|
||||
return( FALSE );
|
||||
}
|
||||
QString xml = "<?xml version=\"1.0\"?>\n" + toString(
|
||||
#if QT_VERSION >= 0x030100
|
||||
1
|
||||
#endif
|
||||
);
|
||||
QString xml = "<?xml version=\"1.0\"?>\n" + toString( 1 );
|
||||
if( compress )
|
||||
{
|
||||
#ifndef QT3
|
||||
outfile.write( qCompress( xml.toAscii() ) );
|
||||
#else
|
||||
outfile.writeBlock( qCompress(
|
||||
(const uchar *) xml.ascii(), xml.length() ) );
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef QT4
|
||||
outfile.write( xml.toUtf8().constData(), xml.length() );
|
||||
#else
|
||||
QCString xml_utf8 = xml.utf8();
|
||||
outfile.writeBlock( xml_utf8.data(), xml_utf8.length() );
|
||||
#endif
|
||||
}
|
||||
outfile.close();
|
||||
|
||||
|
||||
@@ -29,10 +29,6 @@
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtCore/QBuffer>
|
||||
#include <QtCore/QFile>
|
||||
#include <QtCore/QFileInfo>
|
||||
@@ -40,21 +36,6 @@
|
||||
#include <QtGui/QMessageBox>
|
||||
#include <QtGui/QPainter>
|
||||
|
||||
#else
|
||||
|
||||
#include <qpainter.h>
|
||||
#include <qmessagebox.h>
|
||||
#include <qfiledialog.h>
|
||||
#include <qfileinfo.h>
|
||||
#include <qfile.h>
|
||||
#include <qbuffer.h>
|
||||
|
||||
#if QT_VERSION < 0x030100
|
||||
#include <qregexp.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include <cstring>
|
||||
|
||||
@@ -89,15 +70,6 @@
|
||||
#include "debug.h"
|
||||
|
||||
|
||||
#ifndef QT4
|
||||
|
||||
#define write writeBlock
|
||||
#define read readBlock
|
||||
#define pos at
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
sampleBuffer::sampleBuffer( const QString & _audio_file,
|
||||
bool _is_base64_data ) :
|
||||
@@ -225,12 +197,7 @@ void sampleBuffer::update( bool _keep_settings )
|
||||
else if( m_audioFile != "" )
|
||||
{
|
||||
QString file = tryToMakeAbsolute( m_audioFile );
|
||||
const char * f =
|
||||
#ifdef QT4
|
||||
file.toAscii().constData();
|
||||
#else
|
||||
file.ascii();
|
||||
#endif
|
||||
const char * f = file.toAscii().constData();
|
||||
int_sample_t * buf = NULL;
|
||||
ch_cnt_t channels = DEFAULT_CHANNELS;
|
||||
sample_rate_t samplerate = SAMPLE_RATES[DEFAULT_QUALITY_LEVEL];
|
||||
@@ -509,11 +476,7 @@ f_cnt_t sampleBuffer::decodeSampleOGGVorbis( const char * _f,
|
||||
f_cnt_t frames = 0;
|
||||
|
||||
QFile * f = new QFile( _f );
|
||||
#ifdef QT4
|
||||
if( f->open( QFile::ReadOnly | QFile::Truncate ) == FALSE )
|
||||
#else
|
||||
if( f->open( IO_ReadOnly | IO_Truncate ) == FALSE )
|
||||
#endif
|
||||
{
|
||||
delete f;
|
||||
return( 0 );
|
||||
@@ -775,10 +738,8 @@ void sampleBuffer::visualize( QPainter & _p, const QRect & _dr,
|
||||
// _p.setClipRect( _clip );
|
||||
// _p.setPen( QColor( 0x22, 0xFF, 0x44 ) );
|
||||
//_p.setPen( QColor( 64, 224, 160 ) );
|
||||
#ifdef QT4
|
||||
// TODO: save and restore aa-settings
|
||||
#warning TODO: save and restore aa-settings
|
||||
_p.setRenderHint( QPainter::Antialiasing );
|
||||
#endif
|
||||
const int w = _dr.width();
|
||||
const int h = _dr.height();
|
||||
|
||||
@@ -789,7 +750,6 @@ void sampleBuffer::visualize( QPainter & _p, const QRect & _dr,
|
||||
|
||||
if( _dm == LINE_CONNECT )
|
||||
{
|
||||
#ifdef QT4
|
||||
float old_x = _dr.x();
|
||||
float old_y[DEFAULT_CHANNELS] = { y_base, y_base };
|
||||
|
||||
@@ -810,32 +770,6 @@ void sampleBuffer::visualize( QPainter & _p, const QRect & _dr,
|
||||
}
|
||||
old_x = x;
|
||||
}
|
||||
#else
|
||||
int old_y[DEFAULT_CHANNELS] = { y_base, y_base };
|
||||
|
||||
const f_cnt_t fpp = tMax<f_cnt_t>( tMin<f_cnt_t>( m_frames / w,
|
||||
20 ), 1 );
|
||||
const f_cnt_t fbase = m_frames * _clip.x() / _clip.width();
|
||||
const f_cnt_t fmax = tMin<f_cnt_t>( m_frames,
|
||||
_clip.width() * fpp );
|
||||
int old_x = _clip.x();
|
||||
//printf("%d\n", fmax );
|
||||
for( f_cnt_t frame = 0; frame < m_frames; frame += fpp )
|
||||
{
|
||||
const int x = _dr.x() + static_cast<int>( frame /
|
||||
(float) m_frames * _dr.width() );
|
||||
for( ch_cnt_t chnl = 0; chnl < DEFAULT_CHANNELS;
|
||||
++chnl )
|
||||
{
|
||||
const Uint16 y = y_base +
|
||||
static_cast<Uint16>( m_data[frame][chnl] *
|
||||
y_space );
|
||||
_p.drawLine( old_x, old_y[chnl], x, y );
|
||||
old_y[chnl] = y;
|
||||
}
|
||||
old_x = x;
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
else if( _dm == DOTS )
|
||||
@@ -859,12 +793,7 @@ void sampleBuffer::visualize( QPainter & _p, const QRect & _dr,
|
||||
|
||||
QString sampleBuffer::openAudioFile( void ) const
|
||||
{
|
||||
#ifdef QT4
|
||||
QFileDialog ofd( NULL, tr( "Open audio file" ) );
|
||||
#else
|
||||
QFileDialog ofd( QString::null, QString::null, NULL, "", TRUE );
|
||||
ofd.setWindowTitle( tr( "Open audio file" ) );
|
||||
#endif
|
||||
|
||||
QString dir;
|
||||
if( m_audioFile != "" )
|
||||
@@ -879,11 +808,7 @@ QString sampleBuffer::openAudioFile( void ) const
|
||||
m_audioFile;
|
||||
}
|
||||
}
|
||||
#ifdef QT4
|
||||
dir = QFileInfo( f ).absolutePath();
|
||||
#else
|
||||
dir = QFileInfo( f ).dirPath( TRUE );
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -894,7 +819,6 @@ QString sampleBuffer::openAudioFile( void ) const
|
||||
ofd.setFileMode( QFileDialog::ExistingFiles );
|
||||
|
||||
// set filters
|
||||
#ifdef QT4
|
||||
QStringList types;
|
||||
types << tr( "All Audio-Files (*.wav *.ogg *.flac *.spx *.voc *.aif "
|
||||
"*.aiff *.au *.raw)" )
|
||||
@@ -911,23 +835,6 @@ QString sampleBuffer::openAudioFile( void ) const
|
||||
//<< tr( "MOD-Files (*.mod)" )
|
||||
;
|
||||
ofd.setFilters( types );
|
||||
#else
|
||||
ofd.addFilter( tr( "All Audio-Files (*.wav *.ogg *.flac *.spx *.voc "
|
||||
"*.aif *.aiff *.au *.raw)" ) );
|
||||
ofd.addFilter( tr( "Wave-Files (*.wav)" ) );
|
||||
ofd.addFilter( tr( "OGG-Files (*.ogg)" ) );
|
||||
ofd.addFilter( tr( "FLAC-Files (*.flac)" ) );
|
||||
ofd.addFilter( tr( "SPEEX-Files (*.spx)" ) );
|
||||
//ofd.addFilter (tr("MP3-Files (*.mp3)"));
|
||||
//ofd.addFilter (tr("MIDI-Files (*.mid)"));^
|
||||
ofd.addFilter( tr( "VOC-Files (*.voc)" ) );
|
||||
ofd.addFilter( tr( "AIFF-Files (*.aif *.aiff)" ) );
|
||||
ofd.addFilter( tr( "AU-Files (*.au)" ) );
|
||||
ofd.addFilter( tr( "RAW-Files (*.raw)" ) );
|
||||
//ofd.addFilter (tr("MOD-Files (*.mod)"));
|
||||
ofd.setSelectedFilter( tr( "All Audio-Files (*.wav *.ogg *.flac *.spx "
|
||||
"*.voc *.aif *.aiff *.au *.raw)" ) );
|
||||
#endif
|
||||
if( m_audioFile != "" )
|
||||
{
|
||||
// select previously opened file
|
||||
@@ -998,11 +905,7 @@ QString & sampleBuffer::toBase64( QString & _dst ) const
|
||||
FLAC__stream_encoder_set_sample_rate( flac_enc,
|
||||
engine::getMixer()->sampleRate() );
|
||||
QBuffer ba_writer;
|
||||
#ifdef QT4
|
||||
ba_writer.open( QBuffer::WriteOnly );
|
||||
#else
|
||||
ba_writer.open( IO_WriteOnly );
|
||||
#endif
|
||||
|
||||
FLAC__stream_encoder_set_write_callback( flac_enc,
|
||||
flacStreamEncoderWriteCallback );
|
||||
@@ -1205,23 +1108,12 @@ void sampleBuffer::loadFromBase64( const QString & _data )
|
||||
|
||||
#ifdef HAVE_FLAC_STREAM_DECODER_H
|
||||
|
||||
#ifndef QT3
|
||||
QByteArray orig_data = QByteArray::fromRawData( dst, dsize );
|
||||
QBuffer ba_reader( &orig_data );
|
||||
ba_reader.open( QBuffer::ReadOnly );
|
||||
#else
|
||||
QByteArray orig_data;
|
||||
orig_data.setRawData( dst, dsize );
|
||||
QBuffer ba_reader( orig_data );
|
||||
ba_reader.open( IO_ReadOnly );
|
||||
#endif
|
||||
|
||||
QBuffer ba_writer;
|
||||
#ifdef QT4
|
||||
ba_writer.open( QBuffer::WriteOnly );
|
||||
#else
|
||||
ba_writer.open( IO_WriteOnly );
|
||||
#endif
|
||||
|
||||
flacStreamDecoderClientData cdata = { &ba_reader, &ba_writer } ;
|
||||
|
||||
@@ -1263,9 +1155,7 @@ void sampleBuffer::loadFromBase64( const QString & _data )
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef QT3
|
||||
delete[] dst;
|
||||
#endif
|
||||
|
||||
m_audioFile = "";
|
||||
update();
|
||||
|
||||
@@ -27,38 +27,26 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "string_pair_drag.h"
|
||||
#include "engine.h"
|
||||
#include "main_window.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtCore/QMimeData>
|
||||
#include <QtGui/QDragEnterEvent>
|
||||
#include <QtGui/QDropEvent>
|
||||
|
||||
#endif
|
||||
|
||||
#include "string_pair_drag.h"
|
||||
#include "engine.h"
|
||||
#include "main_window.h"
|
||||
|
||||
|
||||
stringPairDrag::stringPairDrag( const QString & _key, const QString & _value,
|
||||
const QPixmap & _icon, QWidget * _w ) :
|
||||
#ifdef QT4
|
||||
QDrag( _w )
|
||||
#else
|
||||
QStoredDrag( mimeType(), _w )
|
||||
#endif
|
||||
QDrag( _w )
|
||||
{
|
||||
setPixmap( _icon );
|
||||
QString txt = _key + ":" + _value;
|
||||
#ifdef QT4
|
||||
QMimeData * m = new QMimeData();
|
||||
m->setData( mimeType(), txt.toAscii() );
|
||||
setMimeData( m );
|
||||
start( Qt::IgnoreAction );
|
||||
#else
|
||||
setEncodedData( txt.utf8() );
|
||||
drag( QDragObject::DragDefault );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -78,7 +66,6 @@ stringPairDrag::~stringPairDrag()
|
||||
bool stringPairDrag::processDragEnterEvent( QDragEnterEvent * _dee,
|
||||
const QString & _allowed_keys )
|
||||
{
|
||||
#ifdef QT4
|
||||
if( !_dee->mimeData()->hasFormat( mimeType() ) )
|
||||
{
|
||||
return( FALSE );
|
||||
@@ -91,13 +78,6 @@ bool stringPairDrag::processDragEnterEvent( QDragEnterEvent * _dee,
|
||||
}
|
||||
_dee->ignore();
|
||||
return( FALSE );
|
||||
#else
|
||||
QString txt = _dee->encodedData( mimeType() );
|
||||
bool accepted = QStringList::split( ',', _allowed_keys ).contains(
|
||||
txt.section( ':', 0, 0 ) );
|
||||
_dee->accept( accepted );
|
||||
return( accepted );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -105,13 +85,8 @@ bool stringPairDrag::processDragEnterEvent( QDragEnterEvent * _dee,
|
||||
|
||||
QString stringPairDrag::decodeKey( QDropEvent * _de )
|
||||
{
|
||||
#ifdef QT4
|
||||
return( QString( _de->mimeData()->data( mimeType()
|
||||
) ).section( ':', 0, 0 ) );
|
||||
#else
|
||||
return( QString( _de->encodedData( mimeType() ) ).section(
|
||||
':', 0, 0 ) );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -119,13 +94,8 @@ QString stringPairDrag::decodeKey( QDropEvent * _de )
|
||||
|
||||
QString stringPairDrag::decodeValue( QDropEvent * _de )
|
||||
{
|
||||
#ifdef QT4
|
||||
return( QString( _de->mimeData()->data( mimeType()
|
||||
) ).section( ':', 1, -1 ) );
|
||||
#else
|
||||
return( QString( _de->encodedData( mimeType() ) ).section(
|
||||
':', 1, -1 ) );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -25,21 +25,9 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QLineEdit>
|
||||
|
||||
#else
|
||||
|
||||
#include <qpair.h>
|
||||
#include <qlineedit.h>
|
||||
#include <qlabel.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "midi_alsa_raw.h"
|
||||
#include "config_mgr.h"
|
||||
@@ -56,11 +44,7 @@ midiALSARaw::midiALSARaw( void ) :
|
||||
{
|
||||
int err;
|
||||
if( ( err = snd_rawmidi_open( m_inputp, m_outputp,
|
||||
#ifdef QT4
|
||||
probeDevice().toAscii().constData(),
|
||||
#else
|
||||
probeDevice().ascii(),
|
||||
#endif
|
||||
0 ) ) < 0 )
|
||||
{
|
||||
printf( "cannot open MIDI-device: %s\n", snd_strerror( err ) );
|
||||
@@ -74,11 +58,7 @@ midiALSARaw::midiALSARaw( void ) :
|
||||
m_pfds = new pollfd[m_npfds];
|
||||
snd_rawmidi_poll_descriptors( m_input, m_pfds, m_npfds );
|
||||
|
||||
start(
|
||||
#if QT_VERSION >= 0x030505
|
||||
QThread::LowPriority
|
||||
#endif
|
||||
);
|
||||
start( QThread::LowPriority );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -25,21 +25,9 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QLineEdit>
|
||||
|
||||
#else
|
||||
|
||||
#include <qpair.h>
|
||||
#include <qlineedit.h>
|
||||
#include <qlabel.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "midi_alsa_seq.h"
|
||||
#include "config_mgr.h"
|
||||
@@ -61,11 +49,7 @@ midiALSASeq::midiALSASeq( void ) :
|
||||
{
|
||||
int err;
|
||||
if( ( err = snd_seq_open( &m_seqHandle,
|
||||
#ifdef QT4
|
||||
probeDevice().toAscii().constData(),
|
||||
#else
|
||||
probeDevice().ascii(),
|
||||
#endif
|
||||
SND_SEQ_OPEN_DUPLEX, 0 ) ) < 0 )
|
||||
{
|
||||
printf( "cannot open sequencer: %s\n", snd_strerror( err ) );
|
||||
@@ -101,11 +85,7 @@ midiALSASeq::midiALSASeq( void ) :
|
||||
perror( __FILE__ ": pipe" );
|
||||
}
|
||||
|
||||
start(
|
||||
#if QT_VERSION >= 0x030505
|
||||
QThread::IdlePriority
|
||||
#endif
|
||||
);
|
||||
start( QThread::IdlePriority );
|
||||
}
|
||||
|
||||
|
||||
@@ -261,11 +241,7 @@ 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 );
|
||||
@@ -314,13 +290,7 @@ 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().
|
||||
#ifdef QT4
|
||||
toAscii().constData()
|
||||
#else
|
||||
ascii()
|
||||
#endif
|
||||
);
|
||||
_port->name().toAscii().constData() );
|
||||
snd_seq_set_port_info( m_seqHandle, m_portIDs[_port][i],
|
||||
port_info );
|
||||
snd_seq_port_info_free( port_info );
|
||||
@@ -362,13 +332,7 @@ void midiALSASeq::subscribeReadablePort( midiPort * _port,
|
||||
}
|
||||
snd_seq_addr_t sender;
|
||||
if( snd_seq_parse_address( m_seqHandle, &sender,
|
||||
_dest.section( ' ', 0, 0 ).
|
||||
#ifdef QT4
|
||||
toAscii().constData()
|
||||
#else
|
||||
ascii()
|
||||
#endif
|
||||
) )
|
||||
_dest.section( ' ', 0, 0 ).toAscii().constData() ) )
|
||||
{
|
||||
printf( "error parsing sender-address!!\n" );
|
||||
return;
|
||||
@@ -407,13 +371,7 @@ void midiALSASeq::subscribeWriteablePort( midiPort * _port,
|
||||
}
|
||||
snd_seq_addr_t dest;
|
||||
if( snd_seq_parse_address( m_seqHandle, &dest,
|
||||
_dest.section( ' ', 0, 0 ).
|
||||
#ifdef QT4
|
||||
toAscii().constData()
|
||||
#else
|
||||
ascii()
|
||||
#endif
|
||||
) )
|
||||
_dest.section( ' ', 0, 0 ).toAscii().constData() ) )
|
||||
{
|
||||
printf( "error parsing dest-address!!\n" );
|
||||
return;
|
||||
@@ -475,7 +433,7 @@ void midiALSASeq::run( void )
|
||||
snd_seq_event_input( m_seqHandle, &ev );
|
||||
|
||||
midiPort * dest = NULL;
|
||||
for( csize i = 0; i < m_portIDs.values().size(); ++i )
|
||||
for( int i = 0; i < m_portIDs.values().size(); ++i )
|
||||
{
|
||||
if( m_portIDs.values()[i][0] == ev->dest.port ||
|
||||
m_portIDs.values()[i][0] == ev->dest.port )
|
||||
|
||||
@@ -26,11 +26,6 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
#ifndef QT4
|
||||
#include <qmap.h>
|
||||
#endif
|
||||
|
||||
#include "midi_client.h"
|
||||
/*#include "midi_mapper.h"*/
|
||||
#include "templates.h"
|
||||
@@ -82,7 +77,7 @@ midiPort * midiClient::addPort( midiEventProcessor * _mep,
|
||||
|
||||
void midiClient::removePort( midiPort * _port )
|
||||
{
|
||||
vvector<midiPort *>::iterator it = qFind( m_midiPorts.begin(),
|
||||
QVector<midiPort *>::iterator it = qFind( m_midiPorts.begin(),
|
||||
m_midiPorts.end(),
|
||||
_port );
|
||||
if( it != m_midiPorts.end() )
|
||||
@@ -281,7 +276,7 @@ void midiClientRaw::parseData( const Uint8 _c )
|
||||
|
||||
void midiClientRaw::processParsedEvent()
|
||||
{
|
||||
for( csize i = 0; i < m_midiPorts.size(); ++i )
|
||||
for( int i = 0; i < m_midiPorts.size(); ++i )
|
||||
{
|
||||
m_midiPorts[i]->processInEvent( m_midiParseData.m_midiEvent,
|
||||
midiTime() );
|
||||
|
||||
@@ -28,18 +28,8 @@
|
||||
|
||||
#include "midi_mapper.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtCore/QRegExp>
|
||||
|
||||
#else
|
||||
|
||||
#include <qregexp.h>
|
||||
|
||||
#define indexOf find
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
midiMapper::midiMapper( const QString & _map ) :
|
||||
m_drumsetChannel( 0 ),
|
||||
@@ -59,11 +49,7 @@ midiMapper::midiMapper( const QString & _map ) :
|
||||
m_channelMap[i] = i;
|
||||
}
|
||||
QFile map( _map );
|
||||
#ifdef QT4
|
||||
if( !map.open( QIODevice::ReadOnly ) )
|
||||
#else
|
||||
if( !map.open( IO_ReadOnly ) )
|
||||
#endif
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -76,14 +62,7 @@ midiMapper::midiMapper( const QString & _map ) :
|
||||
continue;
|
||||
}
|
||||
QString line( buf );
|
||||
#if QT_VERSION >= 0x030100
|
||||
line.replace( '\n', "" );
|
||||
#else
|
||||
if( line.contains( '\n' ) )
|
||||
{
|
||||
line = line.left( line.length() - 1 );
|
||||
}
|
||||
#endif
|
||||
if( line.left( 6 ) == "DEFINE" )
|
||||
{
|
||||
if( line.section( ' ', 1, 1 ) == "PATCHMAP" )
|
||||
@@ -127,14 +106,7 @@ void midiMapper::readPatchMap( QFile & _f )
|
||||
continue;
|
||||
}
|
||||
QString line( buf );
|
||||
#if QT_VERSION >= 0x030100
|
||||
line.replace( '\n', "" );
|
||||
#else
|
||||
if( line.contains( '\n' ) )
|
||||
{
|
||||
line = line.left( line.length() - 1 );
|
||||
}
|
||||
#endif
|
||||
if( line.left( 3 ) == "END" )
|
||||
{
|
||||
return;
|
||||
@@ -144,11 +116,8 @@ void midiMapper::readPatchMap( QFile & _f )
|
||||
continue;
|
||||
}
|
||||
m_patchMap[prog_idx].first = line.section( '=', 1, 1 ).toInt();
|
||||
m_patchMap[prog_idx].second = line.section( '=', 0, 0 )
|
||||
#if QT_VERSION >= 0x030100
|
||||
.replace( ' ', "" )
|
||||
#endif
|
||||
;
|
||||
m_patchMap[prog_idx].second =
|
||||
line.section( '=', 0, 0 ).replace( ' ', "" );
|
||||
++prog_idx;
|
||||
}
|
||||
}
|
||||
@@ -168,14 +137,7 @@ void midiMapper::readDrumsetKeyMap( QFile & _f )
|
||||
continue;
|
||||
}
|
||||
QString line( buf );
|
||||
#if QT_VERSION >= 0x030100
|
||||
line.replace( '\n', "" );
|
||||
#else
|
||||
if( line.contains( '\n' ) )
|
||||
{
|
||||
line = line.left( line.length() - 1 );
|
||||
}
|
||||
#endif
|
||||
if( line.left( 3 ) == "END" )
|
||||
{
|
||||
return;
|
||||
@@ -189,13 +151,9 @@ void midiMapper::readDrumsetKeyMap( QFile & _f )
|
||||
m_drumsetKeyMap[key].first = line.section( '=', 1, 1 ).
|
||||
toInt();
|
||||
|
||||
m_drumsetKeyMap[key].second = line.mid( 4 ).
|
||||
section( '=', 0, 0 ).
|
||||
section( ' ', 1, 1 )
|
||||
#if QT_VERSION >= 0x030100
|
||||
.replace( ' ', "" )
|
||||
#endif
|
||||
;
|
||||
m_drumsetKeyMap[key].second =
|
||||
line.mid( 4 ).section( '=', 0, 0 )
|
||||
.section( ' ', 1, 1 ).replace( ' ', "" );
|
||||
}
|
||||
++key;
|
||||
}
|
||||
|
||||
@@ -30,20 +30,9 @@
|
||||
#ifdef OSS_SUPPORT
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QLineEdit>
|
||||
|
||||
#else
|
||||
|
||||
#include <qmap.h>
|
||||
#include <qlineedit.h>
|
||||
#include <qlabel.h>
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
@@ -61,18 +50,10 @@ midiOSS::midiOSS( void ) :
|
||||
{
|
||||
// only start thread, if opening of MIDI-device is successful,
|
||||
// otherwise isRunning()==FALSE indicates error
|
||||
#ifdef QT4
|
||||
if( m_midiDev.open( QIODevice::ReadWrite ) ||
|
||||
m_midiDev.open( QIODevice::ReadOnly ) )
|
||||
#else
|
||||
if( m_midiDev.open( IO_ReadWrite ) || m_midiDev.open( IO_ReadOnly ) )
|
||||
#endif
|
||||
{
|
||||
start(
|
||||
#if QT_VERSION >= 0x030505
|
||||
QThread::LowPriority
|
||||
#endif
|
||||
);
|
||||
start( QThread::LowPriority );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,11 +92,7 @@ QString midiOSS::probeDevice( void )
|
||||
|
||||
void midiOSS::sendByte( const Uint8 _c )
|
||||
{
|
||||
#ifdef QT4
|
||||
m_midiDev.putChar( _c );
|
||||
#else
|
||||
m_midiDev.putch( _c );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -125,16 +102,12 @@ void midiOSS::run( void )
|
||||
{
|
||||
while( m_quit == FALSE && m_midiDev.isOpen() )
|
||||
{
|
||||
#ifdef QT4
|
||||
char c;
|
||||
if( !m_midiDev.getChar( &c ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
parseData( c );
|
||||
#else
|
||||
parseData( m_midiDev.getch() );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,24 +25,11 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <Qt/QtXml>
|
||||
#include <QtGui/QColorDialog>
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QPainter>
|
||||
|
||||
#else
|
||||
|
||||
#include <qdom.h>
|
||||
#include <qpainter.h>
|
||||
#include <qcolordialog.h>
|
||||
#include <qpopupmenu.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "bb_track.h"
|
||||
#include "bb_editor.h"
|
||||
@@ -67,9 +54,6 @@ bbTCO::bbTCO( track * _track, const QColor & _c ) :
|
||||
QString( "" ) ),
|
||||
m_color( _c.isValid() ? _c : QColor( 64, 128, 255 ) )
|
||||
{
|
||||
#ifndef QT4
|
||||
setBackgroundMode( Qt::NoBackground );
|
||||
#endif
|
||||
tact t = engine::getBBEditor()->lengthOfBB(
|
||||
bbTrack::numOfBBTrack( getTrack() ) );
|
||||
if( t > 0 )
|
||||
@@ -92,29 +76,14 @@ bbTCO::~bbTCO()
|
||||
|
||||
void bbTCO::constructContextMenu( QMenu * _cm )
|
||||
{
|
||||
#ifdef QT4
|
||||
QAction * a = new QAction( embed::getIconPixmap( "bb_track" ),
|
||||
tr( "Open in Beat+Baseline-Editor" ),
|
||||
_cm );
|
||||
_cm->insertAction( _cm->actions()[0], a );
|
||||
connect( a, SIGNAL( triggered( bool ) ), this,
|
||||
SLOT( openInBBEditor( bool ) ) );
|
||||
#else
|
||||
_cm->insertItem( embed::getIconPixmap( "bb_track" ),
|
||||
tr( "Open in Beat+Baseline-Editor" ),
|
||||
this, SLOT( openInBBEditor() ),
|
||||
0, -1, 0 );
|
||||
#endif
|
||||
#ifdef QT4
|
||||
_cm->insertSeparator( _cm->actions()[1] );
|
||||
#else
|
||||
_cm->insertSeparator( 1 );
|
||||
#endif
|
||||
#ifdef QT4
|
||||
_cm->addSeparator();
|
||||
#else
|
||||
_cm->insertSeparator();
|
||||
#endif
|
||||
_cm->addAction( embed::getIconPixmap( "reload" ), tr( "Reset name" ),
|
||||
this, SLOT( resetName() ) );
|
||||
_cm->addAction( embed::getIconPixmap( "rename" ), tr( "Change name" ),
|
||||
@@ -146,26 +115,12 @@ void bbTCO::paintEvent( QPaintEvent * )
|
||||
col = QColor( tMax( col.red() - 128, 0 ),
|
||||
tMax( col.green() - 128, 0 ), 255 );
|
||||
}
|
||||
#ifdef QT4
|
||||
QPainter p( this );
|
||||
|
||||
QLinearGradient lingrad( 0, 0, 0, height() );
|
||||
lingrad.setColorAt( 0, col.light( 130 ) );
|
||||
lingrad.setColorAt( 1, col.light( 70 ) );
|
||||
p.fillRect( rect(), lingrad );
|
||||
#else
|
||||
// create pixmap for whole widget
|
||||
QPixmap pm( rect().size() );
|
||||
// and a painter for it
|
||||
QPainter p( &pm );
|
||||
|
||||
// COOL gradient ;-)
|
||||
for( int y = 1; y < height() - 1; ++y )
|
||||
{
|
||||
p.setPen( col.light( 130 - y * 60 / height() ) );
|
||||
p.drawLine( 1, y, width() - 1, y );
|
||||
}
|
||||
#endif
|
||||
|
||||
tact t = engine::getBBEditor()->lengthOfBB( bbTrack::numOfBBTrack(
|
||||
getTrack() ) );
|
||||
@@ -183,11 +138,7 @@ void bbTCO::paintEvent( QPaintEvent * )
|
||||
}
|
||||
|
||||
p.setPen( col.dark() );
|
||||
#ifndef QT3
|
||||
p.drawRect( 0, 0, rect().right(), rect().bottom() );
|
||||
#else
|
||||
p.drawRect( rect() );
|
||||
#endif
|
||||
|
||||
p.setFont( pointSize<7>( p.font() ) );
|
||||
p.setPen( QColor( 0, 0, 0 ) );
|
||||
@@ -198,10 +149,6 @@ void bbTCO::paintEvent( QPaintEvent * )
|
||||
p.drawPixmap( 3, p.fontMetrics().height() + 1,
|
||||
embed::getIconPixmap( "muted", 16, 16 ) );
|
||||
}
|
||||
|
||||
#ifndef QT4
|
||||
bitBlt( this, rect().topLeft(), &pm );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -297,9 +244,9 @@ void bbTCO::changeColor( void )
|
||||
}
|
||||
if( isSelected() )
|
||||
{
|
||||
vvector<selectableObject *> selected =
|
||||
QVector<selectableObject *> selected =
|
||||
engine::getSongEditor()->selectedObjects();
|
||||
for( vvector<selectableObject *>::iterator it =
|
||||
for( QVector<selectableObject *>::iterator it =
|
||||
selected.begin();
|
||||
it != selected.end(); ++it )
|
||||
{
|
||||
@@ -341,7 +288,7 @@ bbTrack::bbTrack( trackContainer * _tc ) :
|
||||
// too), so disable it
|
||||
getTrackWidget()->setAcceptDrops( FALSE );
|
||||
|
||||
csize bbNum = s_infoMap.size();
|
||||
int bbNum = s_infoMap.size();
|
||||
s_infoMap[this] = bbNum;
|
||||
|
||||
m_trackLabel = new nameLabel( tr( "Beat/Baseline %1" ).arg( bbNum ),
|
||||
@@ -371,22 +318,15 @@ bbTrack::~bbTrack()
|
||||
{
|
||||
engine::getMixer()->removePlayHandles( this );
|
||||
|
||||
csize bb = s_infoMap[this];
|
||||
int bb = s_infoMap[this];
|
||||
engine::getBBEditor()->removeBB( bb );
|
||||
for( infoMap::iterator it = s_infoMap.begin(); it != s_infoMap.end();
|
||||
++it )
|
||||
{
|
||||
#ifdef QT4
|
||||
if( it.value() > bb )
|
||||
{
|
||||
--it.value();
|
||||
}
|
||||
#else
|
||||
if( it.data() > bb )
|
||||
{
|
||||
--it.data();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
s_infoMap.remove( this );
|
||||
engine::getBBEditor()->updateComboBox();
|
||||
@@ -417,7 +357,7 @@ bool FASTCALL bbTrack::play( const midiTime & _start,
|
||||
s_infoMap[this] ) );
|
||||
}
|
||||
|
||||
vlist<trackContentObject *> tcos;
|
||||
QList<trackContentObject *> tcos;
|
||||
getTCOsInRange( tcos, _start, _start + static_cast<Sint32>( _frames /
|
||||
engine::framesPerTact64th() ) );
|
||||
|
||||
@@ -428,7 +368,7 @@ bool FASTCALL bbTrack::play( const midiTime & _start,
|
||||
|
||||
midiTime lastPosition;
|
||||
midiTime lastLen;
|
||||
for( vlist<trackContentObject *>::iterator it = tcos.begin();
|
||||
for( QList<trackContentObject *>::iterator it = tcos.begin();
|
||||
it != tcos.end(); ++it )
|
||||
{
|
||||
if( !( *it )->muted() &&
|
||||
@@ -456,7 +396,7 @@ trackContentObject * bbTrack::createTCO( const midiTime & _pos )
|
||||
// if we're creating a new bbTCO, we colorize it according to the
|
||||
// previous bbTCO, so we have to get all TCOs from 0 to _pos and
|
||||
// pickup the last and take the color if it
|
||||
vlist<trackContentObject *> tcos;
|
||||
QList<trackContentObject *> tcos;
|
||||
getTCOsInRange( tcos, 0, _pos );
|
||||
if( tcos.size() > 0 && dynamic_cast<bbTCO *>( tcos.back() ) != NULL )
|
||||
{
|
||||
@@ -546,16 +486,12 @@ void bbTrack::loadTrackSpecificSettings( const QDomElement & _this )
|
||||
|
||||
|
||||
// return pointer to bbTrack specified by _bb_num
|
||||
bbTrack * bbTrack::findBBTrack( csize _bb_num )
|
||||
bbTrack * bbTrack::findBBTrack( int _bb_num )
|
||||
{
|
||||
for( infoMap::iterator it = s_infoMap.begin(); it != s_infoMap.end();
|
||||
++it )
|
||||
{
|
||||
#ifdef QT4
|
||||
if( it.value() == _bb_num )
|
||||
#else
|
||||
if( it.data() == _bb_num )
|
||||
#endif
|
||||
{
|
||||
return( it.key() );
|
||||
}
|
||||
@@ -566,7 +502,7 @@ bbTrack * bbTrack::findBBTrack( csize _bb_num )
|
||||
|
||||
|
||||
|
||||
csize bbTrack::numOfBBTrack( track * _track )
|
||||
int bbTrack::numOfBBTrack( track * _track )
|
||||
{
|
||||
if( dynamic_cast<bbTrack *>( _track ) != NULL )
|
||||
{
|
||||
|
||||
@@ -26,10 +26,6 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <Qt/QtXml>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QFile>
|
||||
@@ -42,23 +38,6 @@
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QMessageBox>
|
||||
|
||||
#else
|
||||
|
||||
#include <qfiledialog.h>
|
||||
#include <qdir.h>
|
||||
#include <qfile.h>
|
||||
#include <qapplication.h>
|
||||
#include <qdom.h>
|
||||
#include <qlineedit.h>
|
||||
#include <qbuttongroup.h>
|
||||
#include <qlayout.h>
|
||||
#include <qlabel.h>
|
||||
#include <qpopupmenu.h>
|
||||
#include <qwhatsthis.h>
|
||||
#include <qmessagebox.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "instrument_track.h"
|
||||
#include "arp_and_chords_tab_widget.h"
|
||||
@@ -126,13 +105,8 @@ instrumentTrack::instrumentTrack( trackContainer * _tc ) :
|
||||
m_baseTone( A ),
|
||||
m_baseOctave( OCTAVE_4 ),
|
||||
m_instrument( NULL ),
|
||||
#ifdef QT4
|
||||
m_midiInputAction( NULL ),
|
||||
m_midiOutputAction( NULL )
|
||||
#else
|
||||
m_midiInputID( -1 ),
|
||||
m_midiOutputID( -1 )
|
||||
#endif
|
||||
{
|
||||
for( int i = 0; i < NOTES; ++i )
|
||||
{
|
||||
@@ -140,9 +114,7 @@ instrumentTrack::instrumentTrack( trackContainer * _tc ) :
|
||||
}
|
||||
|
||||
|
||||
#ifdef QT4
|
||||
engine::getMainWindow()->workspace()->addWindow( this );
|
||||
#endif
|
||||
|
||||
setAcceptDrops( TRUE );
|
||||
|
||||
@@ -162,12 +134,7 @@ instrumentTrack::instrumentTrack( trackContainer * _tc ) :
|
||||
m_tswVolumeKnob->show();
|
||||
/* connect( m_tswVolumeKnob, SIGNAL( valueChanged( float ) ), this,
|
||||
SLOT( volValueChanged( float ) ) );*/
|
||||
#ifdef QT4
|
||||
m_tswVolumeKnob->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_tswVolumeKnob,
|
||||
#endif
|
||||
tr( volume_help ) );
|
||||
m_tswVolumeKnob->setWhatsThis( tr( volume_help ) );
|
||||
|
||||
QPushButton * tsw_midi = new QPushButton(
|
||||
embed::getIconPixmap( "piano" ), QString::null,
|
||||
@@ -200,11 +167,7 @@ instrumentTrack::instrumentTrack( trackContainer * _tc ) :
|
||||
|
||||
|
||||
// init own layout + widgets
|
||||
#ifdef QT4
|
||||
setFocusPolicy( Qt::StrongFocus );
|
||||
#else
|
||||
setFocusPolicy( StrongFocus );
|
||||
#endif
|
||||
QVBoxLayout * vlayout = new QVBoxLayout( this );
|
||||
vlayout->setMargin( 0 );
|
||||
vlayout->setSpacing( 0 );
|
||||
@@ -231,12 +194,7 @@ instrumentTrack::instrumentTrack( trackContainer * _tc ) :
|
||||
m_volumeKnob->setHintText( tr( "Channel volume:" ) + " ", "%" );
|
||||
m_volumeKnob->setLabel( tr( "VOLUME" ) );
|
||||
|
||||
#ifdef QT4
|
||||
m_volumeKnob->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_volumeKnob,
|
||||
#endif
|
||||
tr( volume_help ) );
|
||||
m_volumeKnob->setWhatsThis( tr( volume_help ) );
|
||||
/* connect( m_volumeKnob, SIGNAL( valueChanged( float ) ), this,
|
||||
SLOT( volValueChanged( float ) ) );*/
|
||||
volumeKnob::linkObjects( m_tswVolumeKnob, m_volumeKnob );
|
||||
@@ -247,12 +205,7 @@ instrumentTrack::instrumentTrack( trackContainer * _tc ) :
|
||||
tr( "Surround area" ), this );
|
||||
m_surroundArea->move( 20 + m_volumeKnob->width(), 38 );
|
||||
m_surroundArea->show();
|
||||
#ifdef QT4
|
||||
m_surroundArea->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_surroundArea,
|
||||
#endif
|
||||
tr( surroundarea_help ) );
|
||||
m_surroundArea->setWhatsThis( tr( surroundarea_help ) );
|
||||
|
||||
connect( m_surroundArea, SIGNAL( valueChanged( const QPoint & ) ),
|
||||
this,
|
||||
@@ -282,11 +235,7 @@ instrumentTrack::instrumentTrack( trackContainer * _tc ) :
|
||||
SLOT( saveSettingsBtnClicked() ) );
|
||||
toolTip::add( m_saveSettingsBtn,
|
||||
tr( "Save current channel settings in a preset-file" ) );
|
||||
#ifdef QT4
|
||||
m_saveSettingsBtn->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_saveSettingsBtn,
|
||||
#endif
|
||||
tr( "Click here, if you want to save current channel settings "
|
||||
"in a preset-file. Later you can load this preset by "
|
||||
"double-clicking it in the preset-browser." ) );
|
||||
@@ -320,7 +269,6 @@ instrumentTrack::instrumentTrack( trackContainer * _tc ) :
|
||||
vlayout->addWidget( m_tabWidget );
|
||||
vlayout->addWidget( m_pianoWidget );
|
||||
|
||||
#ifdef QT4
|
||||
if( m_midiWidget->m_readablePorts )
|
||||
{
|
||||
m_midiInputAction = m_tswMidiMenu->addMenu(
|
||||
@@ -345,22 +293,6 @@ instrumentTrack::instrumentTrack( trackContainer * _tc ) :
|
||||
}
|
||||
m_midiInputAction->setText( tr( "MIDI input" ) );
|
||||
m_midiOutputAction->setText( tr( "MIDI output" ) );
|
||||
#else
|
||||
m_midiInputID = m_tswMidiMenu->insertItem( tr( "MIDI input" ),
|
||||
m_midiWidget->m_readablePorts );
|
||||
if( m_midiWidget->m_readablePorts == NULL )
|
||||
{
|
||||
m_tswMidiMenu->connectItem( m_midiInputID, this,
|
||||
SLOT( midiInSelected() ) );
|
||||
}
|
||||
m_midiOutputID = m_tswMidiMenu->insertItem( tr( "MIDI output" ),
|
||||
m_midiWidget->m_writeablePorts );
|
||||
if( m_midiWidget->m_writeablePorts == NULL )
|
||||
{
|
||||
m_tswMidiMenu->connectItem( m_midiOutputID, this,
|
||||
SLOT( midiOutSelected() ) );
|
||||
}
|
||||
#endif
|
||||
if( m_midiWidget->m_readablePorts == NULL ||
|
||||
m_midiWidget->m_writeablePorts == NULL )
|
||||
{
|
||||
@@ -378,10 +310,9 @@ instrumentTrack::instrumentTrack( trackContainer * _tc ) :
|
||||
|
||||
|
||||
_tc->updateAfterTrackAdd();
|
||||
#ifndef QT3
|
||||
|
||||
setFixedWidth( INSTRUMENT_WIDTH );
|
||||
resize( sizeHint() );
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
@@ -406,14 +337,8 @@ instrumentTrack::~instrumentTrack()
|
||||
|
||||
void instrumentTrack::saveSettingsBtnClicked( void )
|
||||
{
|
||||
#ifdef QT4
|
||||
QFileDialog sfd( this, tr( "Save channel-settings in file" ), "",
|
||||
tr( "Channel-Settings-File (*.cs.xml)" ) );
|
||||
#else
|
||||
QFileDialog sfd( this, "", TRUE );
|
||||
sfd.setWindowTitle( tr( "Save channel-settings in file" ) );
|
||||
sfd.setFilter( tr( "Channel-Settings-File (*.cs.xml)" ) );
|
||||
#endif
|
||||
|
||||
QString preset_root = configManager::inst()->userPresetsDir();
|
||||
if( !QDir( preset_root ).exists() )
|
||||
@@ -428,11 +353,7 @@ void instrumentTrack::saveSettingsBtnClicked( void )
|
||||
sfd.setDirectory( preset_root + instrumentName() );
|
||||
sfd.setFileMode( QFileDialog::AnyFile );
|
||||
if( sfd.exec () == QDialog::Accepted &&
|
||||
#ifdef QT4
|
||||
!sfd.selectedFiles().isEmpty() && sfd.selectedFiles()[0] != ""
|
||||
#else
|
||||
sfd.selectedFile() != ""
|
||||
#endif
|
||||
)
|
||||
{
|
||||
multimediaProject mmp(
|
||||
@@ -440,11 +361,7 @@ void instrumentTrack::saveSettingsBtnClicked( void )
|
||||
QDomElement _this = mmp.createElement( nodeName() );
|
||||
saveTrackSpecificSettings( mmp, _this );
|
||||
mmp.content().appendChild( _this );
|
||||
#ifdef QT4
|
||||
QString f = sfd.selectedFiles()[0];
|
||||
#else
|
||||
QString f = sfd.selectedFile();
|
||||
#endif
|
||||
mmp.writeFile( f );
|
||||
}
|
||||
}
|
||||
@@ -474,32 +391,18 @@ void instrumentTrack::activityIndicatorReleased( void )
|
||||
|
||||
void instrumentTrack::midiInSelected( void )
|
||||
{
|
||||
#ifdef QT4
|
||||
m_midiInputAction->setChecked( !m_midiInputAction->isChecked() );
|
||||
m_midiWidget->m_receiveCheckBox->setChecked(
|
||||
m_midiInputAction->isChecked() );
|
||||
#else
|
||||
m_tswMidiMenu->setItemChecked( m_midiInputID,
|
||||
!m_tswMidiMenu->isItemChecked( m_midiInputID ) );
|
||||
m_midiWidget->m_receiveCheckBox->setChecked(
|
||||
m_tswMidiMenu->isItemChecked( m_midiInputID ) );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
void instrumentTrack::midiOutSelected( void )
|
||||
{
|
||||
#ifdef QT4
|
||||
m_midiOutputAction->setChecked( !m_midiOutputAction->isChecked() );
|
||||
m_midiWidget->m_sendCheckBox->setChecked(
|
||||
m_midiOutputAction->isChecked() );
|
||||
#else
|
||||
m_tswMidiMenu->setItemChecked( m_midiOutputID,
|
||||
!m_tswMidiMenu->isItemChecked( m_midiOutputID ) );
|
||||
m_midiWidget->m_sendCheckBox->setChecked(
|
||||
m_tswMidiMenu->isItemChecked( m_midiOutputID ) );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -507,17 +410,10 @@ void instrumentTrack::midiOutSelected( void )
|
||||
|
||||
void instrumentTrack::midiConfigChanged( bool )
|
||||
{
|
||||
#ifdef QT4
|
||||
m_midiInputAction->setChecked(
|
||||
m_midiWidget->m_receiveCheckBox->isChecked() );
|
||||
m_midiOutputAction->setChecked(
|
||||
m_midiWidget->m_sendCheckBox->isChecked() );
|
||||
#else
|
||||
m_tswMidiMenu->setItemChecked( m_midiInputID,
|
||||
m_midiWidget->m_receiveCheckBox->isChecked( ) );
|
||||
m_tswMidiMenu->setItemChecked( m_midiOutputID,
|
||||
m_midiWidget->m_sendCheckBox->isChecked( ) );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -864,7 +760,7 @@ void instrumentTrack::setName( const QString & _new_name )
|
||||
{
|
||||
// when changing name of channel, also change name of those patterns,
|
||||
// which have the same name as the channel
|
||||
for( csize i = 0; i < numOfTCOs(); ++i )
|
||||
for( int i = 0; i < numOfTCOs(); ++i )
|
||||
{
|
||||
pattern * p = dynamic_cast<pattern *>( getTCO( i ) );
|
||||
if( p != NULL && p->name() == m_name || p->name() == "" )
|
||||
@@ -932,7 +828,7 @@ void instrumentTrack::setBaseNote( Uint32 _new_note, bool _modified )
|
||||
setBaseTone( (tones)( _new_note % NOTES_PER_OCTAVE ) );
|
||||
setBaseOctave( (octaves)( _new_note / NOTES_PER_OCTAVE ) );
|
||||
|
||||
for( vlist<notePlayHandle *>::iterator it = m_processHandles.begin();
|
||||
for( QList<notePlayHandle *>::iterator it = m_processHandles.begin();
|
||||
it != m_processHandles.end(); ++it )
|
||||
{
|
||||
( *it )->updateFrequency();
|
||||
@@ -988,7 +884,7 @@ bool FASTCALL instrumentTrack::play( const midiTime & _start,
|
||||
{
|
||||
float frames_per_tact64th = engine::framesPerTact64th();
|
||||
|
||||
vlist<trackContentObject *> tcos;
|
||||
QList<trackContentObject *> tcos;
|
||||
bbTrack * bb_track;
|
||||
if( _tco_num >= 0 )
|
||||
{
|
||||
@@ -1010,7 +906,7 @@ bool FASTCALL instrumentTrack::play( const midiTime & _start,
|
||||
}
|
||||
|
||||
// Handle automation: detuning
|
||||
for( vlist<notePlayHandle *>::iterator it = m_processHandles.begin();
|
||||
for( QList<notePlayHandle *>::iterator it = m_processHandles.begin();
|
||||
it != m_processHandles.end(); ++it )
|
||||
{
|
||||
( *it )->processMidiTime( _start );
|
||||
@@ -1023,7 +919,7 @@ bool FASTCALL instrumentTrack::play( const midiTime & _start,
|
||||
|
||||
bool played_a_note = FALSE; // will be return variable
|
||||
|
||||
for( vlist<trackContentObject *>::iterator it = tcos.begin();
|
||||
for( QList<trackContentObject *>::iterator it = tcos.begin();
|
||||
it != tcos.end(); ++it )
|
||||
{
|
||||
pattern * p = dynamic_cast<pattern *>( *it );
|
||||
@@ -1408,12 +1304,7 @@ void instrumentTrackButton::drawButtonLabel( QPainter * _p )
|
||||
QString in = m_instrumentTrack->instrumentName() + ":";
|
||||
int extra = isChecked() ? -1 : -3;
|
||||
_p->setFont( pointSize<7>( _p->font() ) );
|
||||
#ifdef QT4
|
||||
_p->setPen( QApplication::palette().buttonText().color() );
|
||||
#else
|
||||
_p->setPen( QApplication::palette().color( QPalette::Normal,
|
||||
QColorGroup::ButtonText ) );
|
||||
#endif
|
||||
_p->drawText( ( width() - QFontMetrics( _p->font() ).width( in ) ) / 2 +
|
||||
extra, height() / 2 + extra, in );
|
||||
_p->setPen( QColor( 0, 0, 0 ) );
|
||||
|
||||
@@ -26,10 +26,6 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <Qt/QtXml>
|
||||
#include <QtCore/QTimer>
|
||||
#include <QtGui/QMenu>
|
||||
@@ -38,21 +34,6 @@
|
||||
#include <QtGui/QProgressBar>
|
||||
#include <QtGui/QPushButton>
|
||||
|
||||
#else
|
||||
|
||||
#include <qdom.h>
|
||||
#include <qpopupmenu.h>
|
||||
#include <qprogressbar.h>
|
||||
#include <qpushbutton.h>
|
||||
#include <qmessagebox.h>
|
||||
#include <qimage.h>
|
||||
#include <qtimer.h>
|
||||
|
||||
#define addSeparator insertSeparator
|
||||
#define addMenu insertItem
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "pattern.h"
|
||||
#include "instrument_track.h"
|
||||
@@ -191,11 +172,6 @@ void pattern::init( void )
|
||||
changeLength( length() );
|
||||
restoreJournallingState();
|
||||
|
||||
#ifdef QT3
|
||||
// set background-mode for flicker-free redraw
|
||||
setBackgroundMode( Qt::NoBackground );
|
||||
#endif
|
||||
|
||||
setFixedHeight( parentWidget()->height() - 2 );
|
||||
setAutoResizeEnabled( FALSE );
|
||||
|
||||
@@ -563,8 +539,6 @@ void pattern::abortFreeze( void )
|
||||
|
||||
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
void pattern::addSteps( QAction * _item )
|
||||
{
|
||||
addSteps( _item->text().toInt() );
|
||||
@@ -580,13 +554,6 @@ void pattern::removeSteps( QAction * _item )
|
||||
|
||||
|
||||
|
||||
#else
|
||||
|
||||
void pattern::addSteps( QAction * ) { }
|
||||
void pattern::removeSteps( QAction * ) { }
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
void pattern::addSteps( int _n )
|
||||
@@ -626,23 +593,12 @@ void pattern::removeSteps( int _n )
|
||||
|
||||
void pattern::constructContextMenu( QMenu * _cm )
|
||||
{
|
||||
#ifdef QT4
|
||||
QAction * a = new QAction( embed::getIconPixmap( "piano" ),
|
||||
tr( "Open in piano-roll" ), _cm );
|
||||
_cm->insertAction( _cm->actions()[0], a );
|
||||
connect( a, SIGNAL( triggered( bool ) ), this,
|
||||
SLOT( openInPianoRoll( bool ) ) );
|
||||
#else
|
||||
_cm->insertItem( embed::getIconPixmap( "piano" ),
|
||||
tr( "Open in piano-roll" ),
|
||||
this, SLOT( openInPianoRoll() ),
|
||||
0, -1, 0 );
|
||||
#endif
|
||||
#ifdef QT4
|
||||
_cm->insertSeparator( _cm->actions()[1] );
|
||||
#else
|
||||
_cm->insertSeparator( 1 );
|
||||
#endif
|
||||
|
||||
_cm->addSeparator();
|
||||
|
||||
@@ -675,7 +631,6 @@ void pattern::constructContextMenu( QMenu * _cm )
|
||||
_cm->addSeparator();
|
||||
}
|
||||
|
||||
#ifdef QT4
|
||||
QMenu * add_step_menu = _cm->addMenu(
|
||||
embed::getIconPixmap( "step_btn_add" ),
|
||||
tr( "Add steps" ) );
|
||||
@@ -686,33 +641,14 @@ void pattern::constructContextMenu( QMenu * _cm )
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
@@ -861,7 +797,7 @@ void pattern::paintEvent( QPaintEvent * )
|
||||
}
|
||||
|
||||
QPainter p( &m_paintPixmap );
|
||||
#ifdef QT4
|
||||
|
||||
QLinearGradient lingrad( 0, 0, 0, height() );
|
||||
const QColor c = isSelected() ? QColor( 0, 0, 224 ) :
|
||||
QColor( 96, 96, 96 );
|
||||
@@ -869,34 +805,6 @@ void pattern::paintEvent( QPaintEvent * )
|
||||
lingrad.setColorAt( 0.5, Qt::black );
|
||||
lingrad.setColorAt( 1, c );
|
||||
p.fillRect( QRect( 1, 1, width() - 2, height() - 2 ), lingrad );
|
||||
#else
|
||||
for( int y = 1; y < height() / 2; ++y )
|
||||
{
|
||||
const int gray = 96 - y * 192 / height();
|
||||
if( isSelected() == TRUE )
|
||||
{
|
||||
p.setPen( QColor( 0, 0, 128 + gray ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
p.setPen( QColor( gray, gray, gray ) );
|
||||
}
|
||||
p.drawLine( 1, y, width() - 1, y );
|
||||
}
|
||||
for( int y = height() / 2; y < height() - 1; ++y )
|
||||
{
|
||||
const int gray = ( y - height() / 2 ) * 192 / height();
|
||||
if( isSelected() == TRUE )
|
||||
{
|
||||
p.setPen( QColor( 0, 0, 128 + gray ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
p.setPen( QColor( gray, gray, gray ) );
|
||||
}
|
||||
p.drawLine( 1, y, width() - 1, y );
|
||||
}
|
||||
#endif
|
||||
|
||||
p.setPen( QColor( 57, 69, 74 ) );
|
||||
p.drawLine( 0, 0, width(), 0 );
|
||||
@@ -994,7 +902,6 @@ void pattern::paintEvent( QPaintEvent * )
|
||||
QPixmap stepoffl;
|
||||
const int steps = length() / BEATS_PER_TACT;
|
||||
const int w = width() - 2 * TCO_BORDER_WIDTH;
|
||||
#ifdef QT4
|
||||
stepon = s_stepBtnOn->scaled( w / steps,
|
||||
s_stepBtnOn->height(),
|
||||
Qt::IgnoreAspectRatio,
|
||||
@@ -1011,19 +918,6 @@ void pattern::paintEvent( QPaintEvent * )
|
||||
s_stepBtnOffLight->height(),
|
||||
Qt::IgnoreAspectRatio,
|
||||
Qt::SmoothTransformation );
|
||||
#else
|
||||
stepon.convertFromImage(
|
||||
s_stepBtnOn->convertToImage().scale(
|
||||
w / steps, s_stepBtnOn->height() ) );
|
||||
stepoverlay.convertFromImage(
|
||||
s_stepBtnOverlay->convertToImage().scale(
|
||||
w / steps, s_stepBtnOverlay->height() ) );
|
||||
stepoff.convertFromImage( s_stepBtnOff->convertToImage().scale(
|
||||
w / steps, s_stepBtnOff->height() ) );
|
||||
stepoffl.convertFromImage( s_stepBtnOffLight->convertToImage().
|
||||
scale( w / steps,
|
||||
s_stepBtnOffLight->height() ) );
|
||||
#endif
|
||||
for( noteVector::iterator it = m_notes.begin();
|
||||
it != m_notes.end(); ++it )
|
||||
{
|
||||
@@ -1153,17 +1047,11 @@ patternFreezeStatusDialog::patternFreezeStatusDialog( QThread * _thread ) :
|
||||
m_progress( 0 )
|
||||
{
|
||||
setWindowTitle( tr( "Freezing pattern..." ) );
|
||||
#if QT_VERSION >= 0x030200
|
||||
setModal( TRUE );
|
||||
#endif
|
||||
|
||||
m_progressBar = new QProgressBar( this );
|
||||
m_progressBar->setGeometry( 10, 10, 200, 24 );
|
||||
#ifdef QT4
|
||||
m_progressBar->setMaximum( 100 );
|
||||
#else
|
||||
m_progressBar->setTotalSteps( 100 );
|
||||
#endif
|
||||
m_progressBar->setTextVisible( FALSE );
|
||||
m_progressBar->show();
|
||||
m_cancelBtn = new QPushButton( embed::getIconPixmap( "cancel" ),
|
||||
@@ -1179,11 +1067,7 @@ 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() ) );
|
||||
|
||||
}
|
||||
@@ -1235,11 +1119,7 @@ void patternFreezeStatusDialog::updateProgress( void )
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef QT4
|
||||
m_progressBar->setValue( m_progress );
|
||||
#else
|
||||
m_progressBar->setProgress( m_progress );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,26 +26,12 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <Qt/QtXml>
|
||||
#include <QtGui/QDropEvent>
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtGui/QPushButton>
|
||||
|
||||
#else
|
||||
|
||||
#include <qpushbutton.h>
|
||||
#include <qpainter.h>
|
||||
#include <qdom.h>
|
||||
#include <qwhatsthis.h>
|
||||
|
||||
#endif
|
||||
|
||||
#include "effect_label.h"
|
||||
|
||||
#include "sample_track.h"
|
||||
#include "song_editor.h"
|
||||
#include "embed.h"
|
||||
@@ -64,10 +50,6 @@ sampleTCO::sampleTCO( track * _track ) :
|
||||
trackContentObject( _track ),
|
||||
m_sampleBuffer( new sampleBuffer )
|
||||
{
|
||||
#ifndef QT4
|
||||
setBackgroundMode( Qt::NoBackground );
|
||||
#endif
|
||||
|
||||
saveJournallingState( FALSE );
|
||||
setSampleFile( "" );
|
||||
restoreJournallingState();
|
||||
@@ -181,11 +163,10 @@ void sampleTCO::mouseDoubleClickEvent( QMouseEvent * )
|
||||
|
||||
void sampleTCO::paintEvent( QPaintEvent * _pe )
|
||||
{
|
||||
#ifdef QT4
|
||||
QPainter p( this );
|
||||
#warning TODO: set according brush for gradient!
|
||||
p.fillRect( _pe->rect(), QColor( 64, 64, 64 ) );
|
||||
#else
|
||||
#if 0
|
||||
// create pixmap for our widget
|
||||
QPixmap pm( _pe->rect().size() );
|
||||
// and a painter for it
|
||||
@@ -233,10 +214,6 @@ void sampleTCO::paintEvent( QPaintEvent * _pe )
|
||||
{
|
||||
p.drawPixmap( 3, 8, embed::getIconPixmap( "muted", 16, 16 ) );
|
||||
}
|
||||
|
||||
#ifndef QT4
|
||||
bitBlt( this, _pe->rect().topLeft(), &pm );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -385,11 +362,7 @@ sampleTrack::sampleTrack( trackContainer * _tc ) :
|
||||
m_volumeKnob->move( 4, 4 );
|
||||
m_volumeKnob->setLabel( tr( "VOL" ) );
|
||||
m_volumeKnob->show();
|
||||
#ifdef QT4
|
||||
m_volumeKnob->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_volumeKnob,
|
||||
#endif
|
||||
tr( "With this knob you can set "
|
||||
"the volume of the opened "
|
||||
"channel." ) );
|
||||
@@ -427,7 +400,7 @@ bool FASTCALL sampleTrack::play( const midiTime & _start,
|
||||
m_audioPort->getEffects()->startRunning();
|
||||
bool played_a_note = FALSE; // will be return variable
|
||||
|
||||
for( csize i = 0; i < numOfTCOs(); ++i )
|
||||
for( int i = 0; i < numOfTCOs(); ++i )
|
||||
{
|
||||
trackContentObject * tco = getTCO( i );
|
||||
if( tco->startPosition() != _start )
|
||||
|
||||
@@ -26,25 +26,12 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "automatable_button.h"
|
||||
|
||||
#ifndef QT3
|
||||
|
||||
#include <QtGui/QCursor>
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QMouseEvent>
|
||||
|
||||
#else
|
||||
|
||||
#include <qcursor.h>
|
||||
#include <qlabel.h>
|
||||
#include <qpopupmenu.h>
|
||||
|
||||
#define indexOf findIndex
|
||||
|
||||
#endif
|
||||
|
||||
#include "automatable_button.h"
|
||||
#include "automatable_object_templates.h"
|
||||
#include "embed.h"
|
||||
|
||||
@@ -52,11 +39,7 @@
|
||||
|
||||
automatableButton::automatableButton( QWidget * _parent, const QString & _name,
|
||||
track * _track ) :
|
||||
QWidget( _parent
|
||||
#ifndef QT4
|
||||
, _name.ascii()
|
||||
#endif
|
||||
),
|
||||
QWidget( _parent ),
|
||||
autoObj( _track, FALSE, FALSE, TRUE ),
|
||||
m_group( NULL ),
|
||||
m_checkable( FALSE )
|
||||
@@ -66,9 +49,7 @@ automatableButton::automatableButton( QWidget * _parent, const QString & _name,
|
||||
getAutomationPattern();
|
||||
}
|
||||
setInitValue( FALSE );
|
||||
#ifdef QT4
|
||||
setAccessibleName( _name );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -113,9 +94,9 @@ void automatableButton::contextMenuEvent( QContextMenuEvent * _me )
|
||||
}
|
||||
|
||||
QMenu contextMenu( target );
|
||||
#ifdef QT4
|
||||
#warning TODO: set according CSS-formatting
|
||||
contextMenu.setTitle( target->accessibleName() );
|
||||
#else
|
||||
#if 0
|
||||
QLabel * caption = new QLabel( "<font color=white><b>" +
|
||||
QString( target->accessibleName() ) + "</b></font>",
|
||||
this );
|
||||
@@ -208,11 +189,7 @@ void automatableButton::setValue( const bool _on )
|
||||
automatableButtonGroup::automatableButtonGroup( QWidget * _parent,
|
||||
const QString & _name,
|
||||
track * _track ) :
|
||||
QWidget( _parent
|
||||
#ifndef QT4
|
||||
, _name.ascii()
|
||||
#endif
|
||||
),
|
||||
QWidget( _parent ),
|
||||
automatableObject<int>( _track )
|
||||
{
|
||||
hide();
|
||||
@@ -221,9 +198,7 @@ automatableButtonGroup::automatableButtonGroup( QWidget * _parent,
|
||||
getAutomationPattern();
|
||||
}
|
||||
setInitValue( 0 );
|
||||
#ifdef QT4
|
||||
setAccessibleName( _name );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -296,11 +271,6 @@ void automatableButtonGroup::setValue( const int _value )
|
||||
}
|
||||
|
||||
|
||||
#ifdef QT3
|
||||
#undef indexOf
|
||||
#endif
|
||||
|
||||
|
||||
#include "automatable_button.moc"
|
||||
|
||||
#endif
|
||||
|
||||
@@ -25,23 +25,13 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "automatable_slider.h"
|
||||
|
||||
#ifndef QT3
|
||||
|
||||
#include <QtGui/QCursor>
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QMouseEvent>
|
||||
|
||||
#else
|
||||
|
||||
#include <qcursor.h>
|
||||
#include <qlabel.h>
|
||||
#include <qpopupmenu.h>
|
||||
|
||||
#endif
|
||||
|
||||
#include "automatable_slider.h"
|
||||
#include "automatable_object_templates.h"
|
||||
#include "embed.h"
|
||||
#include "knob.h"
|
||||
@@ -51,18 +41,12 @@
|
||||
|
||||
automatableSlider::automatableSlider( QWidget * _parent, const QString & _name,
|
||||
class track * _track ) :
|
||||
QSlider( _parent
|
||||
#ifndef QT4
|
||||
, _name.ascii()
|
||||
#endif
|
||||
),
|
||||
QSlider( _parent ),
|
||||
m_show_status( FALSE )
|
||||
{
|
||||
m_knob = new knob( knobDark_28, NULL, _name, _track );
|
||||
|
||||
#ifdef QT4
|
||||
setAccessibleName( _name );
|
||||
#endif
|
||||
|
||||
connect( m_knob, SIGNAL( valueChanged( float ) ), this,
|
||||
SLOT( updateSlider( void ) ) );
|
||||
@@ -119,9 +103,9 @@ void automatableSlider::contextMenuEvent( QContextMenuEvent * _me )
|
||||
mouseReleaseEvent( NULL );
|
||||
|
||||
QMenu contextMenu( this );
|
||||
#ifdef QT4
|
||||
#warning TODO: use according CSS formatting
|
||||
contextMenu.setTitle( accessibleName() );
|
||||
#else
|
||||
#if 0
|
||||
QLabel * caption = new QLabel( "<font color=white><b>" +
|
||||
QString( accessibleName() ) + "</b></font>", this );
|
||||
caption->setPaletteBackgroundColor( QColor( 0, 0, 192 ) );
|
||||
|
||||
@@ -25,14 +25,6 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "combobox.h"
|
||||
#include "automatable_object_templates.h"
|
||||
#include "templates.h"
|
||||
#include "embed.h"
|
||||
#include "gui_templates.h"
|
||||
|
||||
#ifndef QT3
|
||||
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QCursor>
|
||||
#include <QtGui/QDesktopWidget>
|
||||
@@ -41,16 +33,11 @@
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtGui/QPixmap>
|
||||
|
||||
#else
|
||||
|
||||
#include <qcursor.h>
|
||||
#include <qlabel.h>
|
||||
#include <qpainter.h>
|
||||
#include <qpixmap.h>
|
||||
#include <qimage.h>
|
||||
#include <qapplication.h>
|
||||
|
||||
#endif
|
||||
#include "combobox.h"
|
||||
#include "automatable_object_templates.h"
|
||||
#include "templates.h"
|
||||
#include "embed.h"
|
||||
#include "gui_templates.h"
|
||||
|
||||
|
||||
QPixmap * comboBox::s_background = NULL;
|
||||
@@ -60,11 +47,7 @@ const int CB_ARROW_BTN_WIDTH = 20;
|
||||
|
||||
|
||||
comboBox::comboBox( QWidget * _parent, const QString & _name, track * _track ) :
|
||||
QWidget( _parent
|
||||
#ifndef QT4
|
||||
, _name.ascii()
|
||||
#endif
|
||||
),
|
||||
QWidget( _parent ),
|
||||
automatableObject<int>( _track ),
|
||||
m_menu( this ),
|
||||
m_pressed( FALSE )
|
||||
@@ -84,26 +67,15 @@ comboBox::comboBox( QWidget * _parent, const QString & _name, track * _track ) :
|
||||
setFont( pointSize<8>( font() ) );
|
||||
m_menu.setFont( pointSize<8>( m_menu.font() ) );
|
||||
|
||||
#ifndef QT3
|
||||
connect( &m_menu, SIGNAL( triggered( QAction * ) ),
|
||||
this, SLOT( setItem( QAction * ) ) );
|
||||
#else
|
||||
connect( &m_menu, SIGNAL( activated( int ) ),
|
||||
this, SLOT( setItem( int ) ) );
|
||||
#endif
|
||||
|
||||
#ifdef QT3
|
||||
setBackgroundMode( NoBackground );
|
||||
#endif
|
||||
|
||||
if( _track != NULL )
|
||||
{
|
||||
getAutomationPattern();
|
||||
}
|
||||
setInitValue( 0 );
|
||||
#ifdef QT4
|
||||
setAccessibleName( _name );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -121,26 +93,14 @@ void comboBox::addItem( const QString & _item, const QPixmap & _pixmap )
|
||||
QPixmap pm = _pixmap;
|
||||
if( pm.height() > 16 )
|
||||
{
|
||||
#ifndef QT3
|
||||
pm = pm.scaledToHeight( 16, Qt::SmoothTransformation );
|
||||
#else
|
||||
pm.convertFromImage( pm.convertToImage().smoothScale(
|
||||
pm.width(), 16,
|
||||
QImage::ScaleMin ) );
|
||||
#endif
|
||||
}
|
||||
m_items.push_back( qMakePair( _item, pm ) );
|
||||
m_menu.clear();
|
||||
for( vvector<item>::iterator it = m_items.begin();
|
||||
for( QVector<item>::iterator it = m_items.begin();
|
||||
it != m_items.end(); ++it )
|
||||
{
|
||||
m_menu.addAction( ( *it ).second, ( *it ).first
|
||||
// when using Qt3, we pass item-index as id for using
|
||||
// it in setItem( int ) as index
|
||||
#ifdef QT3
|
||||
, it - m_items.begin()
|
||||
#endif
|
||||
);
|
||||
m_menu.addAction( ( *it ).second, ( *it ).first );
|
||||
}
|
||||
setRange( 0, m_items.size() - 1 );
|
||||
}
|
||||
@@ -150,7 +110,7 @@ void comboBox::addItem( const QString & _item, const QPixmap & _pixmap )
|
||||
|
||||
int comboBox::findText( const QString & _txt ) const
|
||||
{
|
||||
for( vvector<item>::const_iterator it = m_items.begin();
|
||||
for( QVector<item>::const_iterator it = m_items.begin();
|
||||
it != m_items.end(); ++it )
|
||||
{
|
||||
if( ( *it ).first == _txt )
|
||||
@@ -187,9 +147,9 @@ void comboBox::contextMenuEvent( QContextMenuEvent * _me )
|
||||
}
|
||||
|
||||
QMenu contextMenu( this );
|
||||
#ifdef QT4
|
||||
contextMenu.setTitle( accessibleName() );
|
||||
#else
|
||||
#warning TODO: add css-formatting
|
||||
#if 0
|
||||
QLabel * caption = new QLabel( "<font color=white><b>" +
|
||||
QString( accessibleName() ) + "</b></font>",
|
||||
this );
|
||||
@@ -247,12 +207,8 @@ void comboBox::mousePressEvent( QMouseEvent * _me )
|
||||
|
||||
void comboBox::paintEvent( QPaintEvent * _pe )
|
||||
{
|
||||
#ifndef QT3
|
||||
QPainter p( this );
|
||||
#else
|
||||
QPixmap draw_pm( rect().size() );
|
||||
QPainter p( &draw_pm, this );
|
||||
#endif
|
||||
|
||||
p.fillRect( rect(), QColor( 0, 0, 0 ) );
|
||||
|
||||
for( int x = 2; x < width() - 2; x += s_background->width() )
|
||||
@@ -303,11 +259,6 @@ void comboBox::paintEvent( QPaintEvent * _pe )
|
||||
p.drawText( tx, p.fontMetrics().height(),
|
||||
m_items[value()].first );
|
||||
}
|
||||
|
||||
#ifdef QT3
|
||||
// and blit all the drawn stuff on the screen...
|
||||
bitBlt( this, rect().topLeft(), &draw_pm );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -321,33 +272,12 @@ void comboBox::wheelEvent( QWheelEvent * _we )
|
||||
|
||||
|
||||
|
||||
#ifndef QT3
|
||||
|
||||
void comboBox::setItem( QAction * _item )
|
||||
{
|
||||
setInitValue( findText( _item->text() ) );
|
||||
}
|
||||
|
||||
|
||||
void comboBox::setItem( int )
|
||||
{
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void comboBox::setItem( QAction * )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void comboBox::setItem( int _item )
|
||||
{
|
||||
setInitValue( _item );
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#include "combobox.moc"
|
||||
|
||||
@@ -26,19 +26,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtGui/QPainter>
|
||||
|
||||
#else
|
||||
|
||||
#include <qpainter.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "cpuload_widget.h"
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
@@ -61,10 +50,6 @@ cpuloadWidget::cpuloadWidget( QWidget * _parent ) :
|
||||
connect( &m_updateTimer, SIGNAL( timeout() ),
|
||||
this, SLOT( updateCpuLoad() ) );
|
||||
m_updateTimer.start( 100 ); // update cpu-load at 10 fps
|
||||
|
||||
#ifndef QT4
|
||||
setBackgroundMode( NoBackground );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -25,24 +25,12 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "fade_button.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtCore/QTimer>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtGui/QPixmap>
|
||||
|
||||
#else
|
||||
|
||||
#include <qapplication.h>
|
||||
#include <qtimer.h>
|
||||
#include <qpainter.h>
|
||||
#include <qpixmap.h>
|
||||
|
||||
#endif
|
||||
|
||||
#include "fade_button.h"
|
||||
#include "update_event.h"
|
||||
|
||||
|
||||
@@ -53,9 +41,6 @@ fadeButton::fadeButton( const QColor & _normal_color,
|
||||
m_normalColor( _normal_color ),
|
||||
m_activatedColor( _activated_color )
|
||||
{
|
||||
#ifndef QT4
|
||||
setBackgroundMode( NoBackground );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -86,11 +71,7 @@ void fadeButton::reset( void )
|
||||
|
||||
|
||||
|
||||
#ifndef QT3
|
||||
void fadeButton::customEvent( QEvent * )
|
||||
#else
|
||||
void fadeButton::customEvent( QCustomEvent * )
|
||||
#endif
|
||||
{
|
||||
update();
|
||||
}
|
||||
@@ -117,25 +98,10 @@ void fadeButton::paintEvent( QPaintEvent * _pe )
|
||||
m_state -= 0.1f;
|
||||
QTimer::singleShot( 20, this, SLOT( update() ) );
|
||||
}
|
||||
#ifdef QT4
|
||||
QPainter p( this );
|
||||
p.fillRect( rect(), col );
|
||||
#else
|
||||
QPixmap draw_pm( rect().size() );
|
||||
draw_pm.fill( col );
|
||||
|
||||
QPainter p( &draw_pm, this );
|
||||
#endif
|
||||
p.setPen( QColor( 0, 0, 0 ) );
|
||||
#ifndef QT3
|
||||
p.drawRect( 0, 0, rect().right(), rect().bottom() );
|
||||
#else
|
||||
p.drawRect( rect() );
|
||||
#endif
|
||||
#ifndef QT4
|
||||
// and blit all the drawn stuff on the screen...
|
||||
bitBlt( this, rect().topLeft(), &draw_pm );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -25,21 +25,10 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtCore/QTimer>
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtGui/QMouseEvent>
|
||||
|
||||
#else
|
||||
|
||||
#include <qpainter.h>
|
||||
#include <qtimer.h>
|
||||
#include <qobjectlist.h>
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef __USE_XOPEN
|
||||
#define __USE_XOPEN
|
||||
@@ -64,9 +53,7 @@ groupBox::groupBox( const QString & _caption, QWidget * _parent,
|
||||
m_origHeight( height() ),
|
||||
m_animating( FALSE )
|
||||
{
|
||||
#ifndef QT3
|
||||
setAutoFillBackground( TRUE );
|
||||
#endif
|
||||
|
||||
if( s_ledBg == NULL )
|
||||
{
|
||||
@@ -153,12 +140,8 @@ void groupBox::animate( void )
|
||||
}
|
||||
resize( width(), height() + dy );
|
||||
QTimer::singleShot( 10, this, SLOT( animate() ) );
|
||||
#ifdef QT4
|
||||
QObjectList ch = parent()->children();
|
||||
#else
|
||||
QObjectList ch = *( parent()->children() );
|
||||
#endif
|
||||
for( csize i = 0; i < ch.count(); ++i )
|
||||
for( int i = 0; i < ch.count(); ++i )
|
||||
{
|
||||
QWidget * w = dynamic_cast<QWidget *>( ch.at( i ) );
|
||||
if( w == NULL || w->y() < y() + height() )
|
||||
@@ -167,12 +150,8 @@ void groupBox::animate( void )
|
||||
}
|
||||
w->move( w->x(), w->y() + dy );
|
||||
}
|
||||
#ifdef QT4
|
||||
ch = children();
|
||||
#else
|
||||
ch = *children();
|
||||
#endif
|
||||
for( csize i = 0; i < ch.count(); ++i )
|
||||
for( int i = 0; i < ch.count(); ++i )
|
||||
{
|
||||
QWidget * w = dynamic_cast<QWidget *>( ch.at( i ) );
|
||||
if( w == NULL || w == m_led )
|
||||
@@ -196,14 +175,9 @@ void groupBox::animate( void )
|
||||
|
||||
void groupBox::updatePixmap( void )
|
||||
{
|
||||
#ifndef QT3
|
||||
const int c = 0;
|
||||
QColor bg_color = QApplication::palette().color( QPalette::Active,
|
||||
QPalette::Background );
|
||||
#else
|
||||
const int c = 1;
|
||||
QColor bg_color = QApplication::palette().active().background();
|
||||
#endif
|
||||
QPixmap pm( size() );
|
||||
pm.fill( bg_color.dark( 132 ) );
|
||||
|
||||
@@ -233,22 +207,13 @@ void groupBox::updatePixmap( void )
|
||||
|
||||
|
||||
//p.setPen( QColor( 255, 255, 255 ) );
|
||||
#ifndef QT3
|
||||
p.setPen( palette().color( QPalette::Active, QPalette::ButtonText ) );
|
||||
#else
|
||||
p.setPen( colorGroup().buttonText() );
|
||||
#endif
|
||||
p.setFont( pointSize<7>( font() ) );
|
||||
p.drawText( 22, 10, m_caption );
|
||||
|
||||
#ifdef QT4
|
||||
QPalette pal = palette();
|
||||
pal.setBrush( backgroundRole(), QBrush( pm ) );
|
||||
setPalette( pal );
|
||||
#else
|
||||
setPaletteBackgroundColor( bg_color.dark( 132 ) );
|
||||
setErasePixmap( pm );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
#include "templates.h"
|
||||
#include "tooltip.h"
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifndef QT3
|
||||
|
||||
#include "kmultitabbar.h"
|
||||
|
||||
#include <QtCore/QEvent>
|
||||
@@ -893,803 +889,5 @@ QList<KMultiTabBarButton *>* KMultiTabBar::buttons() {return &m_buttons;}
|
||||
#include "kmultitabbar.moc"
|
||||
|
||||
|
||||
#else
|
||||
|
||||
|
||||
#include "kmultitabbar-qt3.h"
|
||||
|
||||
#include <qbutton.h>
|
||||
#include <qpopupmenu.h>
|
||||
#include <qabstractlayout.h>
|
||||
#include <qpainter.h>
|
||||
#include <qfontmetrics.h>
|
||||
#include <qstyle.h>
|
||||
#include <qapplication.h>
|
||||
|
||||
|
||||
class KMultiTabBarTabPrivate {
|
||||
public:
|
||||
QPixmap pix;
|
||||
};
|
||||
|
||||
|
||||
KMultiTabBarInternal::KMultiTabBarInternal(QWidget *parent, KMultiTabBar::KMultiTabBarMode m):Q3ScrollView(parent)
|
||||
{
|
||||
m_expandedTabSize=-1;
|
||||
m_showActiveTabTexts=false;
|
||||
m_tabs.setAutoDelete(true);
|
||||
setHScrollBarMode(AlwaysOff);
|
||||
setVScrollBarMode(AlwaysOff);
|
||||
if (m==KMultiTabBar::Vertical)
|
||||
{
|
||||
box=new QWidget(viewport());
|
||||
mainLayout=new QVBoxLayout(box);
|
||||
mainLayout->setAutoAdd(true);
|
||||
box->setFixedWidth(24);
|
||||
setFixedWidth(24);
|
||||
}
|
||||
else
|
||||
{
|
||||
box=new QWidget(viewport());
|
||||
mainLayout=new QHBoxLayout(box);
|
||||
mainLayout->setAutoAdd(true);
|
||||
box->setFixedHeight(24);
|
||||
setFixedHeight(24);
|
||||
}
|
||||
mainLayout->setMargin( 0 );
|
||||
mainLayout->setSpacing( 0 );
|
||||
addChild(box);
|
||||
setFrameStyle(NoFrame);
|
||||
viewport()->setBackgroundMode(Qt::PaletteBackground);
|
||||
}
|
||||
|
||||
void KMultiTabBarInternal::setStyle(enum KMultiTabBar::KMultiTabBarStyle style)
|
||||
{
|
||||
m_style=style;
|
||||
for (csize i=0;i<m_tabs.count();i++)
|
||||
m_tabs.at(i)->setStyle(m_style);
|
||||
|
||||
if ( (m_style==KMultiTabBar::KDEV3) ||
|
||||
(m_style==KMultiTabBar::KDEV3ICON ) ) {
|
||||
resizeEvent(0);
|
||||
}
|
||||
viewport()->update();
|
||||
}
|
||||
|
||||
|
||||
void KMultiTabBarInternal::contentsMousePressEvent(QMouseEvent *ev)
|
||||
{
|
||||
ev->ignore();
|
||||
}
|
||||
|
||||
void KMultiTabBarInternal::mousePressEvent(QMouseEvent *ev)
|
||||
{
|
||||
ev->ignore();
|
||||
}
|
||||
|
||||
void KMultiTabBarInternal::resizeEvent(QResizeEvent *ev) {
|
||||
//kdDebug()<<"KMultiTabBarInternal::resizeEvent"<<endl;
|
||||
if ( (m_style==KMultiTabBar::KDEV3) ||
|
||||
(m_style==KMultiTabBar::KDEV3ICON) ){
|
||||
box->setGeometry(0,0,width(),height());
|
||||
int lines=1;
|
||||
int space;
|
||||
int tmp=0;
|
||||
if ((m_position==KMultiTabBar::Bottom) || (m_position==KMultiTabBar::Top))
|
||||
space=width();
|
||||
else
|
||||
space=height();
|
||||
|
||||
int cnt=0;
|
||||
//CALCULATE LINES
|
||||
for (csize i=0;i<m_tabs.count();i++) {
|
||||
cnt++;
|
||||
tmp+=m_tabs.at(i)->neededSize();
|
||||
if (tmp>space) {
|
||||
if (cnt>1)i--;
|
||||
cnt=0;
|
||||
tmp=0;
|
||||
lines++;
|
||||
}
|
||||
}
|
||||
//SET SIZE & PLACE
|
||||
if ((m_position==KMultiTabBar::Bottom) || (m_position==KMultiTabBar::Top)) {
|
||||
setFixedHeight(lines*24);
|
||||
box->setFixedHeight(lines*24);
|
||||
tmp=0;
|
||||
cnt=0;
|
||||
m_lines=lines;
|
||||
lines=0;
|
||||
for (csize i=0;i<m_tabs.count();i++) {
|
||||
cnt++;
|
||||
tmp+=m_tabs.at(i)->neededSize();
|
||||
if (tmp>space) {
|
||||
if (cnt>1) i--;
|
||||
else
|
||||
m_tabs.at(i)->move(tmp-m_tabs.at(i)->neededSize(),lines*24);
|
||||
cnt=0;
|
||||
tmp=0;
|
||||
lines++;
|
||||
} else m_tabs.at(i)->move(tmp-m_tabs.at(i)->neededSize(),lines*24);
|
||||
}
|
||||
}
|
||||
else {
|
||||
setFixedWidth(lines*24);
|
||||
box->setFixedWidth(lines*24);
|
||||
tmp=0;
|
||||
cnt=0;
|
||||
m_lines=lines;
|
||||
lines=0;
|
||||
for (csize i=0;i<m_tabs.count();i++) {
|
||||
cnt++;
|
||||
tmp+=m_tabs.at(i)->neededSize();
|
||||
if (tmp>space) {
|
||||
if (cnt>1) i--;
|
||||
else
|
||||
m_tabs.at(i)->move(lines*24,tmp-m_tabs.at(i)->neededSize());
|
||||
cnt=0;
|
||||
tmp=0;
|
||||
lines++;
|
||||
} else m_tabs.at(i)->move(lines*24,tmp-m_tabs.at(i)->neededSize());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//kdDebug()<<"needed lines:"<<m_lines<<endl;
|
||||
}
|
||||
if (ev) Q3ScrollView::resizeEvent(ev);
|
||||
}
|
||||
|
||||
|
||||
void KMultiTabBarInternal::showActiveTabTexts(bool show)
|
||||
{
|
||||
m_showActiveTabTexts=show;
|
||||
}
|
||||
|
||||
|
||||
KMultiTabBarTab* KMultiTabBarInternal::tab(int id) const
|
||||
{
|
||||
for (QPtrListIterator<KMultiTabBarTab> it(m_tabs);it.current();++it){
|
||||
if (it.current()->id()==id) return it.current();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int KMultiTabBarInternal::appendTab(const QPixmap &pic ,int id,const QString& text)
|
||||
{
|
||||
KMultiTabBarTab *tab;
|
||||
m_tabs.append(tab= new KMultiTabBarTab(pic,text,id,box,m_position,m_style));
|
||||
tab->showActiveTabText(m_showActiveTabTexts);
|
||||
if (m_style==KMultiTabBar::KONQSBC)
|
||||
{
|
||||
if (m_expandedTabSize<tab->neededSize()) {
|
||||
m_expandedTabSize=tab->neededSize();
|
||||
for (csize i=0;i<m_tabs.count();i++)
|
||||
m_tabs.at(i)->setSize(m_expandedTabSize);
|
||||
|
||||
} else tab->setSize(m_expandedTabSize);
|
||||
} else tab->updateState();
|
||||
tab->show();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void KMultiTabBarInternal::removeTab(int id)
|
||||
{
|
||||
for (csize pos=0;pos<m_tabs.count();pos++)
|
||||
{
|
||||
if (m_tabs.at(pos)->id()==id)
|
||||
{
|
||||
delete m_tabs.at(pos);
|
||||
m_tabs.remove(pos);
|
||||
resizeEvent(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void KMultiTabBarInternal::setPosition(enum KMultiTabBar::KMultiTabBarPosition pos)
|
||||
{
|
||||
m_position=pos;
|
||||
for (csize i=0;i<m_tabs.count();i++)
|
||||
m_tabs.at(i)->setTabsPosition(m_position);
|
||||
viewport()->update();
|
||||
}
|
||||
|
||||
|
||||
KMultiTabBarButton::KMultiTabBarButton(const QPixmap& pic,const QString& text, QMenu *popup,
|
||||
int id,QWidget *parent,KMultiTabBar::KMultiTabBarPosition pos,KMultiTabBar::KMultiTabBarStyle style)
|
||||
:QPushButton(QIcon(),text,parent),m_style(style)
|
||||
{
|
||||
setIcon(pic);
|
||||
setText(text);
|
||||
m_position=pos;
|
||||
if (popup) setMenu(popup);
|
||||
setFlat(true);
|
||||
setFixedHeight(24);
|
||||
setFixedWidth(24);
|
||||
m_id=id;
|
||||
toolTip::add( this, text );
|
||||
connect(this,SIGNAL(clicked()),this,SLOT(slotClicked()));
|
||||
}
|
||||
|
||||
KMultiTabBarButton::KMultiTabBarButton(const QString& text, QMenu *popup,
|
||||
int id,QWidget *parent,KMultiTabBar::KMultiTabBarPosition pos,KMultiTabBar::KMultiTabBarStyle style)
|
||||
:QPushButton(QIcon(),text,parent),m_style(style)
|
||||
{
|
||||
setText(text);
|
||||
m_position=pos;
|
||||
if (popup) setMenu(popup);
|
||||
setFlat(true);
|
||||
setFixedHeight(24);
|
||||
setFixedWidth(24);
|
||||
m_id=id;
|
||||
toolTip::add(this,text);
|
||||
connect(this,SIGNAL(clicked()),this,SLOT(slotClicked()));
|
||||
}
|
||||
|
||||
KMultiTabBarButton::~KMultiTabBarButton() {
|
||||
}
|
||||
|
||||
int KMultiTabBarButton::id() const{
|
||||
return m_id;
|
||||
}
|
||||
|
||||
void KMultiTabBarButton::setText(const QString& text)
|
||||
{
|
||||
QPushButton::setText(text);
|
||||
m_text=text;
|
||||
toolTip::add(this,text);
|
||||
}
|
||||
|
||||
void KMultiTabBarButton::slotClicked()
|
||||
{
|
||||
emit clicked(m_id);
|
||||
}
|
||||
|
||||
void KMultiTabBarButton::setPosition(KMultiTabBar::KMultiTabBarPosition pos)
|
||||
{
|
||||
m_position=pos;
|
||||
update();
|
||||
}
|
||||
|
||||
void KMultiTabBarButton::setStyle(KMultiTabBar::KMultiTabBarStyle style)
|
||||
{
|
||||
m_style=style;
|
||||
update();
|
||||
}
|
||||
|
||||
void KMultiTabBarButton::hideEvent( QHideEvent* he) {
|
||||
QPushButton::hideEvent(he);
|
||||
KMultiTabBar *tb=dynamic_cast<KMultiTabBar*>(parentWidget());
|
||||
if (tb) tb->updateSeparator();
|
||||
}
|
||||
|
||||
void KMultiTabBarButton::showEvent( QShowEvent* he) {
|
||||
QPushButton::showEvent(he);
|
||||
KMultiTabBar *tb=dynamic_cast<KMultiTabBar*>(parentWidget());
|
||||
if (tb) tb->updateSeparator();
|
||||
}
|
||||
|
||||
|
||||
QSize KMultiTabBarButton::sizeHint() const
|
||||
{
|
||||
ensurePolished();
|
||||
|
||||
int w = 0, h = 0;
|
||||
|
||||
// calculate contents size...
|
||||
#ifndef QT_NO_ICONSET
|
||||
if ( iconSet() && !iconSet()->isNull() ) {
|
||||
int iw = iconSet()->pixmap( QIcon::Small, QIcon::Normal ).width() + 4;
|
||||
int ih = iconSet()->pixmap( QIcon::Small, QIcon::Normal ).height();
|
||||
w += iw;
|
||||
h = tMax( h, ih );
|
||||
}
|
||||
#endif
|
||||
if( isMenuButton() )
|
||||
w += style().pixelMetric(QStyle::PM_MenuButtonIndicator, this);
|
||||
|
||||
if ( pixmap() ) {
|
||||
QPixmap *pm = (QPixmap *)pixmap();
|
||||
w += pm->width();
|
||||
h += pm->height();
|
||||
} else {
|
||||
QString s( text() );
|
||||
bool empty = s.isEmpty();
|
||||
if ( empty )
|
||||
s = QString::fromLatin1("XXXX");
|
||||
QFontMetrics fm = fontMetrics();
|
||||
QSize sz = fm.size( Qt::ShowPrefix, s );
|
||||
if(!empty || !w)
|
||||
w += sz.width();
|
||||
if(!empty || !h)
|
||||
h = tMax(h, sz.height());
|
||||
}
|
||||
return (style().sizeFromContents(QStyle::CT_ToolButton, this, QSize(w, h)).
|
||||
expandedTo(QApplication::globalStrut()));
|
||||
}
|
||||
|
||||
|
||||
KMultiTabBarTab::KMultiTabBarTab(const QPixmap& pic, const QString& text,
|
||||
int id,QWidget *parent,KMultiTabBar::KMultiTabBarPosition pos,
|
||||
KMultiTabBar::KMultiTabBarStyle style)
|
||||
:KMultiTabBarButton(text,0,id,parent,pos,style),
|
||||
m_showActiveTabText(false)
|
||||
{
|
||||
d=new KMultiTabBarTabPrivate();
|
||||
setIcon(pic);
|
||||
m_expandedSize=24;
|
||||
setToggleButton(true);
|
||||
}
|
||||
|
||||
KMultiTabBarTab::~KMultiTabBarTab() {
|
||||
delete d;
|
||||
}
|
||||
|
||||
|
||||
void KMultiTabBarTab::setTabsPosition(KMultiTabBar::KMultiTabBarPosition pos)
|
||||
{
|
||||
if ((pos!=m_position) && ((pos==KMultiTabBar::Left) || (pos==KMultiTabBar::Right))) {
|
||||
if (!d->pix.isNull()) {
|
||||
QMatrix temp;// (1.0F, 0.0F, 0.0F, -1.0F, 0.0F, 0.0F);
|
||||
temp.rotate(180);
|
||||
d->pix=d->pix.transformed(temp);
|
||||
setIcon(d->pix);
|
||||
}
|
||||
}
|
||||
|
||||
setPosition(pos);
|
||||
// update();
|
||||
}
|
||||
|
||||
void KMultiTabBarTab::setIcon(const QString& icon)
|
||||
{
|
||||
//QPixmap pic=SmallIcon(icon);
|
||||
QPixmap pic (icon);
|
||||
setIcon(pic);
|
||||
}
|
||||
|
||||
void KMultiTabBarTab::setIcon(const QPixmap& icon)
|
||||
{
|
||||
|
||||
if (m_style!=KMultiTabBar::KDEV3) {
|
||||
if ((m_position==KMultiTabBar::Left) || (m_position==KMultiTabBar::Right)) {
|
||||
QMatrix rotateMatrix;
|
||||
if (m_position==KMultiTabBar::Left)
|
||||
rotateMatrix.rotate(90);
|
||||
else
|
||||
rotateMatrix.rotate(-90);
|
||||
QPixmap pic=icon.transformed(rotateMatrix);
|
||||
d->pix=pic;
|
||||
setIconSet(pic);
|
||||
} else
|
||||
setIconSet(icon);
|
||||
}
|
||||
}
|
||||
|
||||
void KMultiTabBarTab::slotClicked()
|
||||
{
|
||||
updateState();
|
||||
KMultiTabBarButton::slotClicked();
|
||||
}
|
||||
|
||||
void KMultiTabBarTab::setState(bool b)
|
||||
{
|
||||
setOn(b);
|
||||
updateState();
|
||||
}
|
||||
|
||||
void KMultiTabBarTab::updateState()
|
||||
{
|
||||
|
||||
if (m_style!=KMultiTabBar::KONQSBC) {
|
||||
if ((m_style==KMultiTabBar::KDEV3) || (m_style==KMultiTabBar::KDEV3ICON) || (isOn())) {
|
||||
QPushButton::setText(m_text);
|
||||
} else {
|
||||
QPushButton::setText(QString::null);
|
||||
}
|
||||
|
||||
if ((m_position==KMultiTabBar::Right || m_position==KMultiTabBar::Left)) {
|
||||
setFixedWidth(24);
|
||||
if ((m_style==KMultiTabBar::KDEV3) || (m_style==KMultiTabBar::KDEV3ICON) || (isOn())) {
|
||||
setFixedHeight(KMultiTabBarButton::sizeHint().width());
|
||||
} else setFixedHeight(36);
|
||||
} else {
|
||||
setFixedHeight(24);
|
||||
if ((m_style==KMultiTabBar::KDEV3) || (m_style==KMultiTabBar::KDEV3ICON) || (isOn())) {
|
||||
setFixedWidth(KMultiTabBarButton::sizeHint().width());
|
||||
} else setFixedWidth(36);
|
||||
}
|
||||
} else {
|
||||
if ((!isOn()) || (!m_showActiveTabText))
|
||||
{
|
||||
setFixedWidth(24);
|
||||
setFixedHeight(24);
|
||||
return;
|
||||
}
|
||||
if ((m_position==KMultiTabBar::Right || m_position==KMultiTabBar::Left))
|
||||
setFixedHeight(m_expandedSize);
|
||||
else
|
||||
setFixedWidth(m_expandedSize);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int KMultiTabBarTab::neededSize()
|
||||
{
|
||||
return (((m_style!=KMultiTabBar::KDEV3)?24:0)+QFontMetrics(QFont()).width(m_text)+6);
|
||||
}
|
||||
|
||||
void KMultiTabBarTab::setSize(int size)
|
||||
{
|
||||
m_expandedSize=size;
|
||||
updateState();
|
||||
}
|
||||
|
||||
void KMultiTabBarTab::showActiveTabText(bool show)
|
||||
{
|
||||
m_showActiveTabText=show;
|
||||
}
|
||||
|
||||
void KMultiTabBarTab::drawButtonLabel(QPainter *p) {
|
||||
drawButton(p);
|
||||
}
|
||||
void KMultiTabBarTab::drawButton(QPainter *paint)
|
||||
{
|
||||
if (m_style!=KMultiTabBar::KONQSBC) drawButtonStyled(paint);
|
||||
else drawButtonClassic(paint);
|
||||
}
|
||||
|
||||
void KMultiTabBarTab::drawButtonStyled(QPainter *paint) {
|
||||
|
||||
QSize sh;
|
||||
const int width = 36; // rotated
|
||||
const int height = 24;
|
||||
if ((m_style==KMultiTabBar::KDEV3) || (m_style==KMultiTabBar::KDEV3ICON) || (isOn()))
|
||||
sh=KMultiTabBarButton::sizeHint();
|
||||
else
|
||||
sh=QSize(width,height);
|
||||
|
||||
QPixmap pixmap( sh.width(),height); ///,sh.height());
|
||||
pixmap.fill(eraseColor());
|
||||
QPainter painter(&pixmap);
|
||||
|
||||
|
||||
QStyle::SFlags st=QStyle::Style_Default;
|
||||
|
||||
st|=QStyle::Style_Enabled;
|
||||
|
||||
if (isOn()) st|=QStyle::Style_On;
|
||||
|
||||
style().drawControl(QStyle::CE_PushButton,&painter,this, QRect(0,0,pixmap.width(),pixmap.height()), colorGroup(),st);
|
||||
style().drawControl(QStyle::CE_PushButtonLabel,&painter,this, QRect(0,0,pixmap.width(),pixmap.height()), colorGroup(),st);
|
||||
|
||||
switch (m_position) {
|
||||
case KMultiTabBar::Left:
|
||||
paint->rotate(-90);
|
||||
paint->drawPixmap(1-pixmap.width(),0,pixmap);
|
||||
break;
|
||||
case KMultiTabBar::Right:
|
||||
paint->rotate(90);
|
||||
paint->drawPixmap(0,1-pixmap.height(),pixmap);
|
||||
break;
|
||||
|
||||
default:
|
||||
paint->drawPixmap(0,0,pixmap);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void KMultiTabBarTab::drawButtonClassic(QPainter *paint)
|
||||
{
|
||||
QPixmap pixmap;
|
||||
if( iconSet() )
|
||||
pixmap = iconSet()->pixmap( QIconSet::Small, QIconSet::Normal );
|
||||
|
||||
paint->fillRect(0, 0, 24, 24, palette().background());
|
||||
|
||||
if (!isOn())
|
||||
{
|
||||
|
||||
if (m_position==KMultiTabBar::Right)
|
||||
{
|
||||
paint->fillRect(0,0,21,21,QBrush(palette().background()));
|
||||
|
||||
paint->setPen(palette().background().dark(150));
|
||||
paint->drawLine(0,22,23,22);
|
||||
|
||||
paint->drawPixmap(12-pixmap.width()/2,12-pixmap.height()/2,pixmap);
|
||||
|
||||
paint->setPen(palette().shadow());
|
||||
paint->drawLine(0,0,0,23);
|
||||
paint->setPen(palette().background().dark(120));
|
||||
paint->drawLine(1,0,1,23);
|
||||
|
||||
}
|
||||
else
|
||||
if ((m_position==KMultiTabBar::Bottom) || (m_position==KMultiTabBar::Top))
|
||||
{
|
||||
paint->fillRect(0,1,23,22,QBrush(palette().background()));
|
||||
|
||||
paint->drawPixmap(12-pixmap.width()/2,12-pixmap.height()/2,pixmap);
|
||||
|
||||
paint->setPen(palette().background().dark(120));
|
||||
paint->drawLine(23,0,23,23);
|
||||
|
||||
|
||||
paint->setPen(palette().light());
|
||||
paint->drawLine(0,22,23,22);
|
||||
paint->drawLine(0,23,23,23);
|
||||
paint->setPen(palette().shadow());
|
||||
paint->drawLine(0,0,23,0);
|
||||
paint->setPen(palette().background().dark(120));
|
||||
paint->drawLine(0,1,23,1);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
paint->setPen(palette().background().dark(120));
|
||||
paint->drawLine(0,23,23,23);
|
||||
paint->fillRect(0,0,23,21,QBrush(palette().background()));
|
||||
paint->drawPixmap(12-pixmap.width()/2,12-pixmap.height()/2,pixmap);
|
||||
|
||||
paint->setPen(palette().light());
|
||||
paint->drawLine(23,0,23,23);
|
||||
paint->drawLine(22,0,22,23);
|
||||
|
||||
paint->setPen(palette().shadow());
|
||||
paint->drawLine(0,0,0,23);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_position==KMultiTabBar::Right)
|
||||
{
|
||||
paint->setPen(palette().shadow());
|
||||
paint->drawLine(0,height()-1,23,height()-1);
|
||||
paint->drawLine(0,height()-2,23,height()-2);
|
||||
paint->drawLine(23,0,23,height()-1);
|
||||
paint->drawLine(22,0,22,height()-1);
|
||||
paint->fillRect(0,0,21,height()-3,QBrush(palette().light()));
|
||||
paint->drawPixmap(10-pixmap.width()/2,10-pixmap.height()/2,pixmap);
|
||||
|
||||
if (m_showActiveTabText)
|
||||
{
|
||||
if (height()<25+4) return;
|
||||
|
||||
QPixmap tpixmap(height()-25-3, width()-2);
|
||||
QPainter painter(&tpixmap);
|
||||
|
||||
painter.fillRect(0,0,tpixmap.width(),tpixmap.height(),QBrush(palette().light()));
|
||||
|
||||
painter.setPen(palette().text());
|
||||
painter.drawText(0,+width()/2+QFontMetrics(QFont()).height()/2,m_text);
|
||||
|
||||
paint->rotate(90);
|
||||
paint->drawPixmap(25,-tpixmap.height()+1,tpixmap);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
if (m_position==KMultiTabBar::Top)
|
||||
{
|
||||
paint->fillRect(0,0,width()-1,23,QBrush(palette().light()));
|
||||
paint->drawPixmap(10-pixmap.width()/2,10-pixmap.height()/2,pixmap);
|
||||
if (m_showActiveTabText)
|
||||
{
|
||||
paint->setPen(palette().text());
|
||||
paint->drawText(25,height()/2+QFontMetrics(QFont()).height()/2,m_text);
|
||||
}
|
||||
}
|
||||
else
|
||||
if (m_position==KMultiTabBar::Bottom)
|
||||
{
|
||||
paint->setPen(palette().shadow());
|
||||
paint->drawLine(0,23,width()-1,23);
|
||||
paint->drawLine(0,22,width()-1,22);
|
||||
paint->fillRect(0,0,width()-1,21,QBrush(palette().light()));
|
||||
paint->drawPixmap(10-pixmap.width()/2,10-pixmap.height()/2,pixmap);
|
||||
if (m_showActiveTabText)
|
||||
{
|
||||
paint->setPen(palette().text());
|
||||
paint->drawText(25,height()/2+QFontMetrics(QFont()).height()/2,m_text);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
paint->setPen(palette().shadow());
|
||||
paint->drawLine(0,height()-1,23,height()-1);
|
||||
paint->drawLine(0,height()-2,23,height()-2);
|
||||
paint->fillRect(0,0,23,height()-3,QBrush(palette().light()));
|
||||
paint->drawPixmap(10-pixmap.width()/2,10-pixmap.height()/2,pixmap);
|
||||
if (m_showActiveTabText)
|
||||
{
|
||||
|
||||
if (height()<25+4) return;
|
||||
|
||||
QPixmap tpixmap(height()-25-3, width()-2);
|
||||
QPainter painter(&tpixmap);
|
||||
|
||||
painter.fillRect(0,0,tpixmap.width(),tpixmap.height(),QBrush(palette().light()));
|
||||
|
||||
painter.setPen(palette().text());
|
||||
painter.drawText(tpixmap.width()-QFontMetrics(QFont()).width(m_text),+width()/2+QFontMetrics(QFont()).height()/2,m_text);
|
||||
|
||||
paint->rotate(-90);
|
||||
|
||||
paint->drawPixmap(-24-tpixmap.width(),2,tpixmap);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
KMultiTabBar::KMultiTabBar( KMultiTabBarMode m, QWidget *parent):QWidget(parent)
|
||||
{
|
||||
m_buttons.setAutoDelete(false);
|
||||
if (m==Vertical)
|
||||
{
|
||||
m_l=new QVBoxLayout(this);
|
||||
setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding , true));
|
||||
}
|
||||
else
|
||||
{
|
||||
m_l=new QHBoxLayout(this);
|
||||
setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed , true));
|
||||
}
|
||||
m_l->setMargin(0);
|
||||
m_l->setAutoAdd(false);
|
||||
m_internal=new KMultiTabBarInternal(this,m);
|
||||
setPosition((m==Vertical)?KMultiTabBar::Right:KMultiTabBar::Bottom);
|
||||
setStyle(VSNET);
|
||||
m_l->insertWidget(0,m_internal);
|
||||
m_l->insertWidget(0,m_btnTabSep=new QFrame(this));
|
||||
m_btnTabSep->setFixedHeight(4);
|
||||
m_btnTabSep->setFrameStyle(QFrame::Panel | QFrame::Sunken);
|
||||
m_btnTabSep->setLineWidth(2);
|
||||
m_btnTabSep->hide();
|
||||
|
||||
updateGeometry();
|
||||
}
|
||||
|
||||
KMultiTabBar::~KMultiTabBar() {
|
||||
}
|
||||
|
||||
|
||||
int KMultiTabBar::appendButton(const QPixmap &pic ,int id,QMenu *popup,const QString&)
|
||||
{
|
||||
KMultiTabBarButton *btn;
|
||||
m_buttons.append(btn= new KMultiTabBarButton(pic,QString::null,
|
||||
popup,id,this,m_position,m_internal->m_style));
|
||||
m_l->insertWidget(0,btn);
|
||||
btn->show();
|
||||
m_btnTabSep->show();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void KMultiTabBar::updateSeparator() {
|
||||
bool hideSep=true;
|
||||
for (QPtrListIterator<KMultiTabBarButton> it(m_buttons);it.current();++it){
|
||||
if (it.current()->isVisibleTo(this)) {
|
||||
hideSep=false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (hideSep) m_btnTabSep->hide();
|
||||
else m_btnTabSep->show();
|
||||
|
||||
}
|
||||
|
||||
int KMultiTabBar::appendTab(const QPixmap &pic ,int id ,const QString& text)
|
||||
{
|
||||
m_internal->appendTab(pic,id,text);
|
||||
return 0;
|
||||
}
|
||||
|
||||
KMultiTabBarButton* KMultiTabBar::button(int id) const
|
||||
{
|
||||
for (QPtrListIterator<KMultiTabBarButton> it(m_buttons);it.current();++it){
|
||||
if (it.current()->id()==id) return it.current();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
KMultiTabBarTab* KMultiTabBar::tab(int id) const
|
||||
{
|
||||
return m_internal->tab(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void KMultiTabBar::removeButton(int id)
|
||||
{
|
||||
for (csize pos=0;pos<m_buttons.count();pos++)
|
||||
{
|
||||
if (m_buttons.at(pos)->id()==id)
|
||||
{
|
||||
m_buttons.at(pos)->deleteLater();
|
||||
m_buttons.remove(pos);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (m_buttons.count()==0) m_btnTabSep->hide();
|
||||
}
|
||||
|
||||
void KMultiTabBar::removeTab(int id)
|
||||
{
|
||||
m_internal->removeTab(id);
|
||||
}
|
||||
|
||||
void KMultiTabBar::setTab(int id,bool state)
|
||||
{
|
||||
KMultiTabBarTab *ttab=tab(id);
|
||||
if (ttab)
|
||||
{
|
||||
ttab->setState(state);
|
||||
}
|
||||
}
|
||||
|
||||
bool KMultiTabBar::isTabRaised(int id) const
|
||||
{
|
||||
KMultiTabBarTab *ttab=tab(id);
|
||||
if (ttab)
|
||||
{
|
||||
return ttab->isOn();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void KMultiTabBar::showActiveTabTexts(bool show)
|
||||
{
|
||||
m_internal->showActiveTabTexts(show);
|
||||
}
|
||||
|
||||
void KMultiTabBar::setStyle(KMultiTabBarStyle style)
|
||||
{
|
||||
m_internal->setStyle(style);
|
||||
}
|
||||
|
||||
void KMultiTabBar::setPosition(KMultiTabBarPosition pos)
|
||||
{
|
||||
m_position=pos;
|
||||
m_internal->setPosition(pos);
|
||||
for (csize i=0;i<m_buttons.count();i++)
|
||||
m_buttons.at(i)->setPosition(pos);
|
||||
}
|
||||
void KMultiTabBar::fontChange(const QFont& /* oldFont */)
|
||||
{
|
||||
for (csize i=0;i<tabs()->count();i++)
|
||||
tabs()->at(i)->resize();
|
||||
update();
|
||||
}
|
||||
|
||||
tabList * KMultiTabBar::tabs() {return m_internal->tabs();}
|
||||
buttonList * KMultiTabBar::buttons() {return &m_buttons;}
|
||||
|
||||
|
||||
#include "kmultitabbar-qt3.moc"
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -28,10 +28,6 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QBitmap>
|
||||
#include <QtGui/QFontMetrics>
|
||||
@@ -42,23 +38,6 @@
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtGui/QPalette>
|
||||
|
||||
#else
|
||||
|
||||
#include <qpainter.h>
|
||||
#include <qpalette.h>
|
||||
#include <qbitmap.h>
|
||||
#include <qlabel.h>
|
||||
#include <qpopupmenu.h>
|
||||
#include <qstatusbar.h>
|
||||
#include <qfontmetrics.h>
|
||||
#include <qapplication.h>
|
||||
#include <qinputdialog.h>
|
||||
#include <qcursor.h>
|
||||
#include <qwhatsthis.h>
|
||||
|
||||
#define addSeparator insertSeparator
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef __USE_XOPEN
|
||||
#define __USE_XOPEN
|
||||
@@ -67,7 +46,6 @@
|
||||
|
||||
#include "knob.h"
|
||||
#include "automatable_object_templates.h"
|
||||
/*#include "midi_client.h"*/
|
||||
#include "embed.h"
|
||||
#include "spc_bg_hndl_widget.h"
|
||||
#include "config_mgr.h"
|
||||
@@ -88,11 +66,7 @@ textFloat * knob::s_textFloat = NULL;
|
||||
|
||||
knob::knob( int _knob_num, QWidget * _parent, const QString & _name,
|
||||
track * _track ) :
|
||||
QWidget( _parent
|
||||
#ifndef QT4
|
||||
, _name.ascii()
|
||||
#endif
|
||||
),
|
||||
QWidget( _parent ),
|
||||
autoObj( _track ),
|
||||
m_mouseOffset( 0.0f ),
|
||||
m_buttonPressed( FALSE ),
|
||||
@@ -110,15 +84,10 @@ knob::knob( int _knob_num, QWidget * _parent, const QString & _name,
|
||||
|
||||
setAcceptDrops( TRUE );
|
||||
|
||||
#ifdef QT4
|
||||
setAccessibleName( _name );
|
||||
m_knobPixmap = new QPixmap( embed::getIconPixmap( QString( "knob0" +
|
||||
QString::number( m_knobNum + 1 ) ).toAscii().constData() ) );
|
||||
#else
|
||||
setBackgroundMode( Qt::NoBackground );
|
||||
m_knobPixmap = new QPixmap( embed::getIconPixmap( "knob0" +
|
||||
QString::number( m_knobNum + 1 ) ) );
|
||||
#endif
|
||||
|
||||
if( _track != NULL )
|
||||
{
|
||||
getAutomationPattern();
|
||||
@@ -353,9 +322,9 @@ void knob::contextMenuEvent( QContextMenuEvent * )
|
||||
mouseReleaseEvent( NULL );
|
||||
|
||||
QMenu contextMenu( this );
|
||||
#ifdef QT4
|
||||
contextMenu.setTitle( accessibleName() );
|
||||
#else
|
||||
#warning TODO: css-formatting
|
||||
#if 0
|
||||
QLabel * caption = new QLabel( "<font color=white><b>" +
|
||||
QString( accessibleName() ) + "</b></font>", this );
|
||||
caption->setPaletteBackgroundColor( QColor( 0, 0, 192 ) );
|
||||
@@ -546,37 +515,23 @@ void knob::mouseDoubleClickEvent( QMouseEvent * )
|
||||
void knob::paintEvent( QPaintEvent * _me )
|
||||
{
|
||||
QRect ur = _me->rect();
|
||||
#ifndef QT4
|
||||
if( ur.isValid() )
|
||||
{
|
||||
#endif
|
||||
#ifdef QT4
|
||||
QPainter p( this );
|
||||
#else
|
||||
QPixmap pix( ur.size() );
|
||||
pix.fill( this, ur.topLeft() );
|
||||
QPainter p( &pix, this );
|
||||
#endif
|
||||
p.translate( -ur.x(), -ur.y() );
|
||||
drawKnob( &p );
|
||||
if( m_label != "" )
|
||||
{
|
||||
p.setFont( pointSize<6>( p.font() ) );
|
||||
p.setPen( QColor( 64, 64, 64 ) );
|
||||
p.drawText( width() / 2 -
|
||||
p.fontMetrics().width( m_label ) / 2 + 1,
|
||||
height() - 1, m_label );
|
||||
p.setPen( QColor( 255, 255, 255 ) );
|
||||
p.drawText( width() / 2 -
|
||||
p.fontMetrics().width( m_label ) / 2,
|
||||
height() - 2, m_label );
|
||||
}
|
||||
#ifndef QT4
|
||||
p.end();
|
||||
bitBlt( this, ur.topLeft(), &pix );
|
||||
}
|
||||
#endif
|
||||
|
||||
QPainter p( this );
|
||||
|
||||
p.translate( -ur.x(), -ur.y() );
|
||||
drawKnob( &p );
|
||||
if( m_label != "" )
|
||||
{
|
||||
p.setFont( pointSize<6>( p.font() ) );
|
||||
p.setPen( QColor( 64, 64, 64 ) );
|
||||
p.drawText( width() / 2 -
|
||||
p.fontMetrics().width( m_label ) / 2 + 1,
|
||||
height() - 1, m_label );
|
||||
p.setPen( QColor( 255, 255, 255 ) );
|
||||
p.drawText( width() / 2 -
|
||||
p.fontMetrics().width( m_label ) / 2,
|
||||
height() - 2, m_label );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -712,19 +667,13 @@ void knob::enterValue( void )
|
||||
{
|
||||
bool ok;
|
||||
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
|
||||
#ifndef QT4
|
||||
, this
|
||||
#endif
|
||||
);
|
||||
4, &ok );
|
||||
if( ok )
|
||||
{
|
||||
setValue( new_val );
|
||||
@@ -744,13 +693,8 @@ void knob::connectToMidiDevice( void )
|
||||
|
||||
void knob::displayHelp( void )
|
||||
{
|
||||
#ifdef QT4
|
||||
QWhatsThis::showText( mapToGlobal( rect().bottomRight() ),
|
||||
whatsThis() );
|
||||
#else
|
||||
QWhatsThis::display( QWhatsThis::textFor( this ), mapToGlobal(
|
||||
rect().bottomRight() ) );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -759,8 +703,4 @@ void knob::displayHelp( void )
|
||||
#include "knob.moc"
|
||||
|
||||
|
||||
#ifndef QT4
|
||||
#undef addSeparator
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -25,26 +25,12 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QCursor>
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QMouseEvent>
|
||||
|
||||
#else
|
||||
|
||||
#include <qapplication.h>
|
||||
#include <qcursor.h>
|
||||
#include <qlabel.h>
|
||||
#include <qpopupmenu.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "lcd_spinbox.h"
|
||||
#include "automatable_object_templates.h"
|
||||
#include "embed.h"
|
||||
@@ -55,11 +41,7 @@
|
||||
lcdSpinBox::lcdSpinBox( int _min, int _max, int _num_digits, QWidget * _parent,
|
||||
const QString & _name,
|
||||
track * _track ) :
|
||||
QWidget( _parent
|
||||
#ifndef QT4
|
||||
, _name.ascii()
|
||||
#endif
|
||||
),
|
||||
QWidget( _parent ),
|
||||
autoObj( _track, 0, _min, _max ),
|
||||
m_label( NULL ),
|
||||
m_origMousePos()
|
||||
@@ -68,7 +50,7 @@ lcdSpinBox::lcdSpinBox( int _min, int _max, int _num_digits, QWidget * _parent,
|
||||
m_number->setFrameShape( QFrame::Panel );
|
||||
m_number->setFrameShadow( QFrame::Sunken );
|
||||
m_number->setSegmentStyle( QLCDNumber::Flat );
|
||||
#ifndef QT3
|
||||
|
||||
QPalette pal;
|
||||
pal.setColor( QPalette::Light, Qt::gray );
|
||||
pal.setColor( QPalette::Mid, Qt::darkGray );
|
||||
@@ -76,7 +58,7 @@ lcdSpinBox::lcdSpinBox( int _min, int _max, int _num_digits, QWidget * _parent,
|
||||
pal.setColor( m_number->backgroundRole(), Qt::black );
|
||||
m_number->setPalette( pal );
|
||||
m_number->setAutoFillBackground( TRUE );
|
||||
#endif
|
||||
|
||||
setEnabled( TRUE );
|
||||
|
||||
if( _track != NULL )
|
||||
@@ -86,9 +68,8 @@ lcdSpinBox::lcdSpinBox( int _min, int _max, int _num_digits, QWidget * _parent,
|
||||
|
||||
// value is automatically limited to given range
|
||||
setInitValue( 0 );
|
||||
#ifdef QT4
|
||||
|
||||
setAccessibleName( _name );
|
||||
#endif
|
||||
|
||||
m_number->setFixedSize( m_number->sizeHint() * 0.9 );
|
||||
setFixedSize( m_number->size() );
|
||||
@@ -163,15 +144,11 @@ void lcdSpinBox::setEnabled( bool _on )
|
||||
{
|
||||
fg = QColor( 160, 160, 160 );
|
||||
}
|
||||
#ifdef QT4
|
||||
QPalette pal = m_number->palette();
|
||||
pal.setColor( QPalette::Background, QColor( 32, 32, 32 ) );
|
||||
pal.setColor( QPalette::Foreground, fg );
|
||||
m_number->setPalette( pal );
|
||||
#else
|
||||
m_number->setPaletteBackgroundColor( QColor( 32, 32, 32 ) );
|
||||
m_number->setPaletteForegroundColor( fg );
|
||||
#endif
|
||||
|
||||
QWidget::setEnabled( _on );
|
||||
}
|
||||
|
||||
@@ -195,9 +172,9 @@ void lcdSpinBox::contextMenuEvent( QContextMenuEvent * _me )
|
||||
mouseReleaseEvent( NULL );
|
||||
|
||||
QMenu contextMenu( this );
|
||||
#ifdef QT4
|
||||
contextMenu.setTitle( accessibleName() );
|
||||
#else
|
||||
#warning TODO: CSS-formatting
|
||||
#if 0
|
||||
QLabel * caption = new QLabel( "<font color=white><b>" +
|
||||
QString( accessibleName() ) + "</b></font>", this );
|
||||
caption->setPaletteBackgroundColor( QColor( 0, 0, 192 ) );
|
||||
@@ -229,11 +206,7 @@ void lcdSpinBox::mousePressEvent( QMouseEvent * _me )
|
||||
|
||||
void lcdSpinBox::mouseMoveEvent( QMouseEvent * _me )
|
||||
{
|
||||
#ifdef QT4
|
||||
if( _me->buttons() & Qt::LeftButton )
|
||||
#else
|
||||
if( _me->modifiers() == Qt::LeftButton )
|
||||
#endif
|
||||
{
|
||||
int dy = _me->globalY() - m_origMousePos.y();
|
||||
if( dy > 1 || dy < -1 )
|
||||
|
||||
@@ -25,22 +25,10 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtGui/QFontMetrics>
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtGui/QPaintEvent>
|
||||
|
||||
#else
|
||||
|
||||
#include <qfontmetrics.h>
|
||||
#include <qpainter.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "led_checkbox.h"
|
||||
#include "automatable_object_templates.h"
|
||||
#include "embed.h"
|
||||
@@ -67,17 +55,10 @@ ledCheckBox::ledCheckBox( const QString & _text, QWidget * _parent,
|
||||
{
|
||||
_color = YELLOW;
|
||||
}
|
||||
m_ledOnPixmap = new QPixmap( embed::getIconPixmap( names[_color]
|
||||
#ifdef QT4
|
||||
.toAscii().constData()
|
||||
#endif
|
||||
) );
|
||||
m_ledOnPixmap = new QPixmap( embed::getIconPixmap(
|
||||
names[_color].toAscii().constData() ) );
|
||||
m_ledOffPixmap = new QPixmap( embed::getIconPixmap( "led_off" ) );
|
||||
|
||||
#ifndef QT4
|
||||
setBackgroundMode( Qt::PaletteBackground );
|
||||
#endif
|
||||
|
||||
setFont( pointSizeF( font(), 7.5f ) );
|
||||
setFixedSize( m_ledOffPixmap->width() + 4 +
|
||||
QFontMetrics( font() ).width( text() ),
|
||||
@@ -98,14 +79,8 @@ ledCheckBox::~ledCheckBox()
|
||||
|
||||
void ledCheckBox::paintEvent( QPaintEvent * )
|
||||
{
|
||||
#ifdef QT4
|
||||
QPainter p( this );
|
||||
#else
|
||||
QPixmap draw_pm( rect().size() );
|
||||
//draw_pm.fill( this, rect().topLeft() );
|
||||
|
||||
QPainter p( &draw_pm, this );
|
||||
#endif
|
||||
p.drawPixmap( 0, 0, specialBgHandlingWidget::getBackground( this ) );
|
||||
|
||||
if( isChecked() == TRUE )
|
||||
@@ -121,11 +96,6 @@ void ledCheckBox::paintEvent( QPaintEvent * )
|
||||
p.drawText( m_ledOffPixmap->width() + 3, 9, text() );
|
||||
p.setPen( QColor( 255, 255, 255 ) );
|
||||
p.drawText( m_ledOffPixmap->width() + 2, 8, text() );
|
||||
|
||||
#ifndef QT4
|
||||
// and blit all the drawn stuff on the screen...
|
||||
bitBlt( this, rect().topLeft(), &draw_pm );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -25,15 +25,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtGui/QMouseEvent>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "nstate_button.h"
|
||||
#include "embed.h"
|
||||
#include "tooltip.h"
|
||||
|
||||
@@ -26,20 +26,9 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtGui/QMouseEvent>
|
||||
#include <QtGui/QPainter>
|
||||
|
||||
#else
|
||||
|
||||
#include <qpainter.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "pixmap_button.h"
|
||||
#include "automatable_object_templates.h"
|
||||
#include "embed.h"
|
||||
@@ -56,10 +45,6 @@ pixmapButton::pixmapButton( QWidget * _parent, const QString & _name,
|
||||
setActiveGraphic( embed::getIconPixmap( "led_yellow" ) );
|
||||
setInactiveGraphic( embed::getIconPixmap( "led_off" ), FALSE );
|
||||
|
||||
#ifndef QT4
|
||||
setBackgroundMode( Qt::NoBackground );
|
||||
#endif
|
||||
|
||||
//setCheckable( TRUE );
|
||||
}
|
||||
|
||||
@@ -75,14 +60,7 @@ pixmapButton::~pixmapButton()
|
||||
|
||||
void pixmapButton::paintEvent( QPaintEvent * )
|
||||
{
|
||||
#ifdef QT4
|
||||
QPainter p( this );
|
||||
#else
|
||||
QPixmap draw_pm( rect().size() );
|
||||
draw_pm.fill( this, rect().topLeft() );
|
||||
|
||||
QPainter p( &draw_pm, this );
|
||||
#endif
|
||||
|
||||
if( !m_bgPixmap.isNull() )
|
||||
{
|
||||
@@ -100,11 +78,6 @@ void pixmapButton::paintEvent( QPaintEvent * )
|
||||
{
|
||||
p.drawPixmap( 0, 0, m_inactivePixmap );
|
||||
}
|
||||
|
||||
#ifndef QT4
|
||||
// and blit all the drawn stuff on the screen...
|
||||
bitBlt( this, rect().topLeft(), &draw_pm );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -25,10 +25,6 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <Qt/QtXml>
|
||||
#include <QtGui/QAction>
|
||||
#include <QtGui/QApplication>
|
||||
@@ -40,32 +36,6 @@
|
||||
#include <QtGui/QTextEdit>
|
||||
#include <QtGui/QToolBar>
|
||||
|
||||
#else
|
||||
|
||||
#include <qdom.h>
|
||||
#include <qapplication.h>
|
||||
#include <qtextedit.h>
|
||||
#include <qaction.h>
|
||||
#include <qlineedit.h>
|
||||
#include <qtoolbar.h>
|
||||
#include <qfontdatabase.h>
|
||||
#include <qcombobox.h>
|
||||
#include <qcolordialog.h>
|
||||
|
||||
#define isChecked isOn
|
||||
#define setChecked setOn
|
||||
#define setFontWeight setBold
|
||||
#define setFontUnderline setUnderline
|
||||
#define setFontItalic setItalic
|
||||
#define setFontFamily setFamily
|
||||
#define setFontPointSize setPointSize
|
||||
#define setTextColor setColor
|
||||
#define setHtml setText
|
||||
#define toHtml text
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "project_notes.h"
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
@@ -75,26 +45,16 @@
|
||||
|
||||
|
||||
projectNotes::projectNotes( void ) :
|
||||
QMainWindow( engine::getMainWindow()->workspace()
|
||||
#ifndef QT4
|
||||
, 0, Qt::WStyle_Title
|
||||
#endif
|
||||
)
|
||||
QMainWindow( engine::getMainWindow()->workspace() )
|
||||
{
|
||||
#ifdef QT4
|
||||
engine::getMainWindow()->workspace()->addWindow( this );
|
||||
#endif
|
||||
|
||||
m_edit = new QTextEdit( this );
|
||||
#ifdef QT4
|
||||
m_edit->setAutoFillBackground( TRUE );
|
||||
QPalette pal;
|
||||
pal.setColor( m_edit->backgroundRole(), QColor( 64, 64, 64 ) );
|
||||
m_edit->setPalette( pal );
|
||||
#else
|
||||
m_edit->setTextFormat( RichText );
|
||||
m_edit->setPaletteBackgroundColor( QColor( 64, 64, 64 ) );
|
||||
#endif
|
||||
|
||||
clear();
|
||||
|
||||
connect( m_edit, SIGNAL( currentFontChanged( const QFont & ) ),
|
||||
@@ -141,15 +101,9 @@ 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
|
||||
}
|
||||
|
||||
|
||||
@@ -168,9 +122,6 @@ void projectNotes::setupActions()
|
||||
QToolBar * tb = new QToolBar( tr( "Edit Actions" ), this );
|
||||
QAction * a;
|
||||
|
||||
// changes between qt3's toolbar-system and this of qt4 are too
|
||||
// big, so we completely implement two versions
|
||||
#ifdef QT4
|
||||
a = new QAction( embed::getIconPixmap( "edit_undo" ), tr( "&Undo" ),
|
||||
tb );
|
||||
a->setShortcut( tr( "Ctrl+Z" ) );
|
||||
@@ -209,8 +160,8 @@ void projectNotes::setupActions()
|
||||
|
||||
m_comboSize = new QComboBox( tb );
|
||||
m_comboSize->setEditable( TRUE );
|
||||
vlist<int> sizes = db.standardSizes();
|
||||
vlist<int>::Iterator it = sizes.begin();
|
||||
QList<int> sizes = db.standardSizes();
|
||||
QList<int>::Iterator it = sizes.begin();
|
||||
for ( ; it != sizes.end(); ++it )
|
||||
{
|
||||
m_comboSize->addItem( QString::number( *it ) );
|
||||
@@ -269,167 +220,6 @@ void projectNotes::setupActions()
|
||||
connect( m_actionTextColor, SIGNAL( activated() ), this,
|
||||
SLOT( textColor() ) );
|
||||
|
||||
#else
|
||||
#if QT_VERSION >= 0x030100
|
||||
a = new QAction(
|
||||
#if QT_VERSION < 0x030200
|
||||
"",
|
||||
#endif
|
||||
embed::getIconPixmap( "edit_undo" ), tr( "&Undo" ),
|
||||
CTRL + Key_Z, this );
|
||||
connect( a, SIGNAL( activated() ), m_edit, SLOT( undo() ) );
|
||||
a->addTo( tb );
|
||||
|
||||
a = new QAction(
|
||||
#if QT_VERSION < 0x030200
|
||||
"",
|
||||
#endif
|
||||
embed::getIconPixmap( "edit_redo" ), tr( "&Redo" ),
|
||||
CTRL + Key_Y, this );
|
||||
connect( a, SIGNAL( activated() ), m_edit, SLOT( redo() ) );
|
||||
a->addTo( tb );
|
||||
|
||||
a = new QAction(
|
||||
#if QT_VERSION < 0x030200
|
||||
"",
|
||||
#endif
|
||||
embed::getIconPixmap( "edit_copy" ), tr( "&Copy" ),
|
||||
CTRL + Key_C, this );
|
||||
connect( a, SIGNAL( activated() ), m_edit, SLOT( copy() ) );
|
||||
a->addTo( tb );
|
||||
|
||||
a = new QAction(
|
||||
#if QT_VERSION < 0x030200
|
||||
"",
|
||||
#endif
|
||||
embed::getIconPixmap( "edit_cut" ), tr( "Cu&t" ),
|
||||
CTRL + Key_X, this );
|
||||
connect( a, SIGNAL( activated() ), m_edit, SLOT( cut() ) );
|
||||
a->addTo( tb );
|
||||
|
||||
a = new QAction(
|
||||
#if QT_VERSION < 0x030200
|
||||
"",
|
||||
#endif
|
||||
embed::getIconPixmap( "edit_paste" ), tr( "&Paste" ),
|
||||
CTRL + Key_V, this );
|
||||
connect( a, SIGNAL( activated() ), m_edit, SLOT( paste() ) );
|
||||
a->addTo( tb );
|
||||
|
||||
|
||||
tb = new QToolBar( this );
|
||||
tb->setLabel( tr( "Format Actions" ) );
|
||||
|
||||
m_comboFont = new QComboBox( TRUE, tb );
|
||||
QFontDatabase db;
|
||||
m_comboFont->insertStringList( db.families() );
|
||||
connect( m_comboFont, SIGNAL( activated( const QString & ) ),
|
||||
m_edit, SLOT( setFamily( const QString & ) ) );
|
||||
m_comboFont->lineEdit()->setText( QApplication::font().family() );
|
||||
|
||||
m_comboSize = new QComboBox( TRUE, tb );
|
||||
vlist<int> sizes = db.standardSizes();
|
||||
vlist<int>::Iterator it = sizes.begin();
|
||||
for ( ; it != sizes.end(); ++it )
|
||||
{
|
||||
m_comboSize->insertItem( QString::number( *it ) );
|
||||
}
|
||||
connect( m_comboSize, SIGNAL( activated( const QString & ) ),
|
||||
this, SLOT( textSize( const QString & ) ) );
|
||||
m_comboSize->lineEdit()->setText( QString::number(
|
||||
QApplication::font().pointSize() ) );
|
||||
|
||||
m_actionTextBold = new QAction(
|
||||
#if QT_VERSION < 0x030200
|
||||
"",
|
||||
#endif
|
||||
embed::getIconPixmap( "text_bold" ),
|
||||
tr( "&Bold" ), CTRL + Key_B, this );
|
||||
connect( m_actionTextBold, SIGNAL( activated() ), this,
|
||||
SLOT( textBold() ) );
|
||||
m_actionTextBold->addTo( tb );
|
||||
m_actionTextBold->setToggleAction( TRUE );
|
||||
|
||||
m_actionTextItalic = new QAction(
|
||||
#if QT_VERSION < 0x030200
|
||||
"",
|
||||
#endif
|
||||
embed::getIconPixmap( "text_italic" ),
|
||||
tr( "&Italic" ), CTRL + Key_I, this );
|
||||
connect( m_actionTextItalic, SIGNAL( activated() ), this,
|
||||
SLOT( textItalic() ) );
|
||||
m_actionTextItalic->addTo( tb );
|
||||
m_actionTextItalic->setToggleAction( TRUE );
|
||||
|
||||
m_actionTextUnderline = new QAction(
|
||||
#if QT_VERSION < 0x030200
|
||||
"",
|
||||
#endif
|
||||
embed::getIconPixmap(
|
||||
"text_under" ),
|
||||
tr( "&Underline" ),
|
||||
CTRL + Key_U, this );
|
||||
connect( m_actionTextUnderline, SIGNAL( activated() ), this,
|
||||
SLOT( textUnderline() ) );
|
||||
m_actionTextUnderline->addTo( tb );
|
||||
m_actionTextUnderline->setToggleAction( TRUE );
|
||||
|
||||
QActionGroup * grp = new QActionGroup( this );
|
||||
connect( grp, SIGNAL( selected( QAction* ) ), this,
|
||||
SLOT( textAlign( QAction* ) ) );
|
||||
|
||||
m_actionAlignLeft = new QAction(
|
||||
#if QT_VERSION < 0x030200
|
||||
"",
|
||||
#endif
|
||||
embed::getIconPixmap( "text_left" ),
|
||||
tr( "&Left" ), CTRL + Key_L,
|
||||
grp );
|
||||
m_actionAlignLeft->setToggleAction( TRUE );
|
||||
m_actionAlignCenter = new QAction(
|
||||
#if QT_VERSION < 0x030200
|
||||
"",
|
||||
#endif
|
||||
embed::getIconPixmap(
|
||||
"text_center" ),
|
||||
tr( "C&enter" ), CTRL + Key_E,
|
||||
grp );
|
||||
m_actionAlignCenter->setToggleAction( TRUE );
|
||||
|
||||
m_actionAlignRight = new QAction(
|
||||
#if QT_VERSION < 0x030200
|
||||
"",
|
||||
#endif
|
||||
embed::getIconPixmap( "text_right" ),
|
||||
tr( "&Right" ), CTRL + Key_R,
|
||||
grp );
|
||||
m_actionAlignRight->setToggleAction( TRUE );
|
||||
|
||||
m_actionAlignJustify = new QAction(
|
||||
#if QT_VERSION < 0x030200
|
||||
"",
|
||||
#endif
|
||||
embed::getIconPixmap(
|
||||
"text_block" ),
|
||||
tr( "&Justify" ), CTRL + Key_J,
|
||||
grp );
|
||||
m_actionAlignJustify->setToggleAction( TRUE );
|
||||
|
||||
grp->addTo( tb );
|
||||
|
||||
|
||||
QPixmap pix( 16, 16 );
|
||||
pix.fill( Qt::black );
|
||||
m_actionTextColor = new QAction(
|
||||
#if QT_VERSION < 0x030200
|
||||
"",
|
||||
#endif
|
||||
pix, tr( "&Color..." ), 0, this );
|
||||
connect( m_actionTextColor, SIGNAL( activated() ), this,
|
||||
SLOT( textColor() ) );
|
||||
m_actionTextColor->addTo( tb );
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -492,11 +282,7 @@ void projectNotes::textColor()
|
||||
m_edit->setTextColor( col );
|
||||
QPixmap pix( 16, 16 );
|
||||
pix.fill( Qt::black );
|
||||
#ifdef QT4
|
||||
m_actionTextColor->setIcon( pix );
|
||||
#else
|
||||
m_actionTextColor->setIconSet( pix );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -542,11 +328,7 @@ void projectNotes::colorChanged( const QColor & _c )
|
||||
{
|
||||
QPixmap pix( 16, 16 );
|
||||
pix.fill( _c );
|
||||
#ifdef QT4
|
||||
m_actionTextColor->setIcon( pix );
|
||||
#else
|
||||
m_actionTextColor->setIconSet( pix );
|
||||
#endif
|
||||
engine::getSongEditor()->setModified();
|
||||
}
|
||||
|
||||
@@ -555,11 +337,7 @@ void projectNotes::colorChanged( const QColor & _c )
|
||||
|
||||
void projectNotes::alignmentChanged( int _a )
|
||||
{
|
||||
if (
|
||||
#ifndef QT4
|
||||
( _a == Qt::AlignAuto ) ||
|
||||
#endif
|
||||
( _a & Qt::AlignLeft ) )
|
||||
if ( _a & Qt::AlignLeft )
|
||||
{
|
||||
m_actionAlignLeft->setChecked( TRUE );
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -26,10 +26,6 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <Qt/QtXml>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtGui/QLabel>
|
||||
@@ -37,22 +33,6 @@
|
||||
#include <QtGui/QWhatsThis>
|
||||
#include <QtGui/QColor>
|
||||
|
||||
#else
|
||||
|
||||
#include <qdom.h>
|
||||
#include <qmap.h>
|
||||
#include <qwhatsthis.h>
|
||||
#include <qlabel.h>
|
||||
#include <qpopupmenu.h>
|
||||
#include <qcursor.h>
|
||||
#include <qcolor.h>
|
||||
#include <qimage.h>
|
||||
|
||||
#define addSeparator insertSeparator
|
||||
#define addMenu insertItem
|
||||
|
||||
#endif
|
||||
|
||||
#include "rack_plugin.h"
|
||||
#include "audio_port.h"
|
||||
#include "knob.h"
|
||||
@@ -79,14 +59,11 @@ rackPlugin::rackPlugin( QWidget * _parent,
|
||||
setFixedSize( 210, 60 );
|
||||
|
||||
QPixmap bg = embed::getIconPixmap( "effect_plugin" );
|
||||
#ifdef QT4
|
||||
|
||||
setAutoFillBackground( TRUE );
|
||||
QPalette pal;
|
||||
pal.setBrush( backgroundRole(), bg );
|
||||
setPalette( pal );
|
||||
#else
|
||||
setErasePixmap( bg );
|
||||
#endif
|
||||
|
||||
m_bypass = new ledCheckBox( "", this, tr( "Turn the effect off" ),
|
||||
m_track );
|
||||
@@ -95,14 +72,8 @@ rackPlugin::rackPlugin( QWidget * _parent,
|
||||
toolTip::add( m_bypass, tr( "On/Off" ) );
|
||||
m_bypass->setChecked( TRUE );
|
||||
m_bypass->move( 3, 3 );
|
||||
#ifdef QT4
|
||||
m_bypass->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_bypass,
|
||||
#endif
|
||||
tr(
|
||||
"Toggles the effect on or off." ) );
|
||||
|
||||
m_bypass->setWhatsThis( tr( "Toggles the effect on or off." ) );
|
||||
|
||||
m_wetDry = new knob( knobBright_26, this, tr( "Wet/Dry mix" ),
|
||||
m_track );
|
||||
connect( m_wetDry, SIGNAL( valueChanged( float ) ),
|
||||
@@ -112,14 +83,9 @@ rackPlugin::rackPlugin( QWidget * _parent,
|
||||
m_wetDry->setInitValue( 1.0f );
|
||||
m_wetDry->move( 27, 5 );
|
||||
m_wetDry->setHintText( tr( "Wet Level:" ) + " ", "" );
|
||||
#ifdef QT4
|
||||
m_wetDry->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_wetDry,
|
||||
#endif
|
||||
tr(
|
||||
"The Wet/Dry knob sets the ratio between the input signal and the effect that "
|
||||
"shows up in the output." ) );
|
||||
m_wetDry->setWhatsThis( tr( "The Wet/Dry knob sets the ratio between "
|
||||
"the input signal and the effect that "
|
||||
"shows up in the output." ) );
|
||||
|
||||
m_autoQuit = new tempoSyncKnob( knobBright_26, this, tr( "Decay" ),
|
||||
m_track );
|
||||
@@ -130,12 +96,7 @@ rackPlugin::rackPlugin( QWidget * _parent,
|
||||
m_autoQuit->setInitValue( 1 );
|
||||
m_autoQuit->move( 60, 5 );
|
||||
m_autoQuit->setHintText( tr( "Time:" ) + " ", "ms" );
|
||||
#ifdef QT4
|
||||
m_autoQuit->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_autoQuit,
|
||||
#endif
|
||||
tr(
|
||||
m_autoQuit->setWhatsThis( tr(
|
||||
"The Decay knob controls how many buffers of silence must pass before the "
|
||||
"plugin stops processing. Smaller values will reduce the CPU overhead but "
|
||||
"run the risk of clipping the tail on delay effects." ) );
|
||||
@@ -148,12 +109,7 @@ rackPlugin::rackPlugin( QWidget * _parent,
|
||||
m_gate->setInitValue( 0.0f );
|
||||
m_gate->move( 93, 5 );
|
||||
m_gate->setHintText( tr( "Gate:" ) + " ", "" );
|
||||
#ifdef QT4
|
||||
m_gate->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( m_gate,
|
||||
#endif
|
||||
tr(
|
||||
m_gate->setWhatsThis( tr(
|
||||
"The Gate knob controls the signal level that is considered to be 'silence' "
|
||||
"while deciding when to stop processing signals." ) );
|
||||
|
||||
@@ -171,20 +127,13 @@ rackPlugin::rackPlugin( QWidget * _parent,
|
||||
m_label->setFont( pointSize<7>( f ) );
|
||||
m_label->setGeometry( 5, 44, 195, 10 );
|
||||
|
||||
#ifdef QT4
|
||||
m_label->setAutoFillBackground( TRUE );
|
||||
pal.setBrush( backgroundRole(), QPixmap::fromImage(
|
||||
bg.toImage().copy( 5, 44, 195, 10 ) ) );
|
||||
m_label->setPalette( pal );
|
||||
#else
|
||||
m_label->setErasePixmap( QPixmap( bg.convertToImage().copy( 5, 44,
|
||||
195, 10 ) ) );
|
||||
#endif
|
||||
|
||||
|
||||
m_controlView = m_effect->createControlDialog( m_track );
|
||||
#ifndef QT3
|
||||
engine::getMainWindow()->workspace()->addWindow( m_controlView );
|
||||
#endif
|
||||
connect( m_controlView, SIGNAL( closed() ),
|
||||
this, SLOT( closeEffects() ) );
|
||||
m_controlView->hide();
|
||||
@@ -194,12 +143,7 @@ rackPlugin::rackPlugin( QWidget * _parent,
|
||||
m_editButton->hide();
|
||||
}
|
||||
|
||||
#ifdef QT4
|
||||
this->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( this,
|
||||
#endif
|
||||
tr(
|
||||
setWhatsThis( tr(
|
||||
"Effect plugins function as a chained series of effects where the signal will "
|
||||
"be processed from top to bottom.\n\n"
|
||||
|
||||
@@ -296,9 +240,9 @@ void rackPlugin::setGate( float _value )
|
||||
void rackPlugin::contextMenuEvent( QContextMenuEvent * )
|
||||
{
|
||||
QPointer<QMenu> contextMenu = new QMenu( this );
|
||||
#ifdef QT4
|
||||
contextMenu->setTitle( m_effect->publicName() );
|
||||
#else
|
||||
#warning TODO: CSS-formatting
|
||||
#if 0
|
||||
QLabel * caption = new QLabel( "<font color=white><b>" +
|
||||
QString( m_effect->publicName() ) +
|
||||
"</b></font>",
|
||||
@@ -353,13 +297,8 @@ void rackPlugin::deletePlugin()
|
||||
|
||||
void rackPlugin::displayHelp( void )
|
||||
{
|
||||
#ifdef QT4
|
||||
QWhatsThis::showText( mapToGlobal( rect().bottomRight() ),
|
||||
whatsThis() );
|
||||
#else
|
||||
QWhatsThis::display( QWhatsThis::textFor( this ),
|
||||
mapToGlobal( rect().bottomRight() ) );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -25,19 +25,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtGui/QApplication>
|
||||
|
||||
#else
|
||||
|
||||
#include <qmessagebox.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "rack_view.h"
|
||||
#include "audio_port.h"
|
||||
#include "rack_plugin.h"
|
||||
@@ -55,12 +44,9 @@ rackView::rackView( QWidget * _parent, track * _track, audioPort * _port ) :
|
||||
m_mainLayout->setSpacing( 0 );
|
||||
m_scrollArea = new QScrollArea( this );
|
||||
m_scrollArea->setFixedSize( 230, 184 );
|
||||
#ifdef QT4
|
||||
m_scrollArea->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOn );
|
||||
m_scrollArea->setPalette( QApplication::palette( m_scrollArea ) );
|
||||
#else
|
||||
m_scrollArea->setVScrollBarMode( QScrollArea::AlwaysOn );
|
||||
#endif
|
||||
|
||||
m_mainLayout->addWidget( m_scrollArea );
|
||||
|
||||
m_lastY = 0;
|
||||
@@ -78,7 +64,6 @@ rackView::~rackView()
|
||||
|
||||
void rackView::addEffect( effect * _e )
|
||||
{
|
||||
#ifdef QT4
|
||||
if( !m_scrollArea->widget() )
|
||||
{
|
||||
QWidget * w = new QWidget;
|
||||
@@ -86,9 +71,6 @@ void rackView::addEffect( effect * _e )
|
||||
w->show();
|
||||
}
|
||||
QWidget * w = m_scrollArea->widget();
|
||||
#else
|
||||
QWidget * w = m_scrollArea->viewport();
|
||||
#endif
|
||||
rackPlugin * plugin = new rackPlugin( w, _e, m_track, m_port );
|
||||
connect( plugin, SIGNAL( moveUp( rackPlugin * ) ),
|
||||
this, SLOT( moveUp( rackPlugin * ) ) );
|
||||
@@ -96,19 +78,10 @@ void rackView::addEffect( effect * _e )
|
||||
this, SLOT( moveDown( rackPlugin * ) ) );
|
||||
connect( plugin, SIGNAL( deletePlugin( rackPlugin * ) ),
|
||||
this, SLOT( deletePlugin( rackPlugin * ) ) );
|
||||
#ifndef QT3
|
||||
plugin->move( 0, m_lastY );
|
||||
#else
|
||||
m_scrollArea->addChild( plugin );
|
||||
m_scrollArea->moveChild( plugin, 0, m_lastY );
|
||||
#endif
|
||||
plugin->show();
|
||||
m_lastY += plugin->height();
|
||||
#ifdef QT4
|
||||
m_scrollArea->widget()->setFixedSize( 210, m_lastY );
|
||||
#else
|
||||
m_scrollArea->resizeContents( 210, m_lastY );
|
||||
#endif
|
||||
m_rackInserts.append( plugin );
|
||||
}
|
||||
|
||||
@@ -119,7 +92,7 @@ void FASTCALL rackView::saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _this )
|
||||
{
|
||||
_this.setAttribute( "numofeffects", m_rackInserts.count() );
|
||||
for( vvector<rackPlugin *>::iterator it = m_rackInserts.begin();
|
||||
for( QVector<rackPlugin *>::iterator it = m_rackInserts.begin();
|
||||
it != m_rackInserts.end(); it++ )
|
||||
{
|
||||
QDomElement ef = ( *it )->saveState( _doc, _this );
|
||||
@@ -173,7 +146,7 @@ void FASTCALL rackView::loadSettings( const QDomElement & _this )
|
||||
|
||||
void rackView::deleteAllPlugins( void )
|
||||
{
|
||||
for( vvector<rackPlugin *>::iterator it = m_rackInserts.begin();
|
||||
for( QVector<rackPlugin *>::iterator it = m_rackInserts.begin();
|
||||
it != m_rackInserts.end(); ++it )
|
||||
{
|
||||
delete *it;
|
||||
@@ -189,7 +162,7 @@ void rackView::moveUp( rackPlugin * _plugin )
|
||||
if( _plugin != m_rackInserts.first() )
|
||||
{
|
||||
int i = 0;
|
||||
for( vvector<rackPlugin *>::iterator it =
|
||||
for( QVector<rackPlugin *>::iterator it =
|
||||
m_rackInserts.begin();
|
||||
it != m_rackInserts.end(); it++, i++ )
|
||||
{
|
||||
@@ -217,7 +190,7 @@ void rackView::moveDown( rackPlugin * _plugin )
|
||||
if( _plugin != m_rackInserts.last() )
|
||||
{
|
||||
int i = 0;
|
||||
for( vvector<rackPlugin *>::iterator it =
|
||||
for( QVector<rackPlugin *>::iterator it =
|
||||
m_rackInserts.begin();
|
||||
it != m_rackInserts.end(); it++, i++ )
|
||||
{
|
||||
@@ -241,10 +214,6 @@ void rackView::moveDown( rackPlugin * _plugin )
|
||||
|
||||
void rackView::deletePlugin( rackPlugin * _plugin )
|
||||
{
|
||||
#ifdef QT3
|
||||
m_scrollArea->removeChild( _plugin );
|
||||
#endif
|
||||
|
||||
m_rackInserts.erase( qFind( m_rackInserts.begin(), m_rackInserts.end(),
|
||||
_plugin ) );
|
||||
delete _plugin;
|
||||
@@ -257,21 +226,13 @@ void rackView::deletePlugin( rackPlugin * _plugin )
|
||||
void rackView::redraw()
|
||||
{
|
||||
m_lastY = 0;
|
||||
for( vvector<rackPlugin *>::iterator it = m_rackInserts.begin();
|
||||
for( QVector<rackPlugin *>::iterator it = m_rackInserts.begin();
|
||||
it != m_rackInserts.end(); it++ )
|
||||
{
|
||||
#ifdef QT4
|
||||
( *it )->move( 0, m_lastY );
|
||||
#else
|
||||
m_scrollArea->moveChild( *it, 0, m_lastY );
|
||||
#endif
|
||||
m_lastY += ( *it )->height();
|
||||
}
|
||||
#ifdef QT4
|
||||
m_scrollArea->widget()->setFixedSize( 210, m_lastY );
|
||||
#else
|
||||
m_scrollArea->resizeContents( 210, m_lastY );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -25,20 +25,9 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtGui/QKeyEvent>
|
||||
#include <QtGui/QLineEdit>
|
||||
|
||||
#else
|
||||
|
||||
#include <qlineedit.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "rename_dialog.h"
|
||||
|
||||
|
||||
|
||||
@@ -28,27 +28,11 @@
|
||||
|
||||
#include "rubberband.h"
|
||||
|
||||
#ifdef QT3
|
||||
|
||||
#include <qbitmap.h>
|
||||
#include <qevent.h>
|
||||
#include <qobjectlist.h>
|
||||
#include <qpainter.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
rubberBand::rubberBand( QWidget * _parent ) :
|
||||
#ifndef QT3
|
||||
QRubberBand( Rectangle, _parent )
|
||||
#else
|
||||
QWidget( _parent )
|
||||
#endif
|
||||
{
|
||||
#ifdef QT3
|
||||
setBackgroundColor( QColor( 0, 64, 255 ) );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -61,10 +45,10 @@ rubberBand::~rubberBand()
|
||||
|
||||
|
||||
|
||||
vvector<selectableObject *> rubberBand::selectedObjects( void ) const
|
||||
QVector<selectableObject *> rubberBand::selectedObjects( void ) const
|
||||
{
|
||||
vvector<selectableObject *> so = selectableObjects();
|
||||
for( vvector<selectableObject *>::iterator it = so.begin();
|
||||
QVector<selectableObject *> so = selectableObjects();
|
||||
for( QVector<selectableObject *>::iterator it = so.begin();
|
||||
it != so.end(); )
|
||||
{
|
||||
if( ( *it )->isSelected() == FALSE )
|
||||
@@ -84,12 +68,9 @@ vvector<selectableObject *> rubberBand::selectedObjects( void ) const
|
||||
|
||||
void rubberBand::resizeEvent( QResizeEvent * _re )
|
||||
{
|
||||
rubberBandBase::resizeEvent( _re );
|
||||
#ifdef QT3
|
||||
updateMask();
|
||||
#endif
|
||||
vvector<selectableObject *> so = selectableObjects();
|
||||
for( vvector<selectableObject *>::iterator it = so.begin();
|
||||
QRubberBand::resizeEvent( _re );
|
||||
QVector<selectableObject *> so = selectableObjects();
|
||||
for( QVector<selectableObject *>::iterator it = so.begin();
|
||||
it != so.end(); ++it )
|
||||
{
|
||||
( *it )->setSelected( QRect( pos(), size() ).intersects(
|
||||
@@ -102,44 +83,14 @@ void rubberBand::resizeEvent( QResizeEvent * _re )
|
||||
|
||||
|
||||
|
||||
#ifdef QT3
|
||||
|
||||
bool rubberBand::event( QEvent * _e )
|
||||
QVector<selectableObject *> rubberBand::selectableObjects( void ) const
|
||||
{
|
||||
bool ret = QWidget::event( _e );
|
||||
if( isVisible() == TRUE )
|
||||
{
|
||||
raise();
|
||||
}
|
||||
return( ret );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void rubberBand::updateMask( void )
|
||||
{
|
||||
QBitmap rb_mask( size(), TRUE );
|
||||
QPainter p( &rb_mask );
|
||||
p.setPen( Qt::color1 );
|
||||
p.drawRect( 0, 0, width() - 1, height() - 1 );
|
||||
p.end();
|
||||
setMask( rb_mask );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
vvector<selectableObject *> rubberBand::selectableObjects( void ) const
|
||||
{
|
||||
vvector<selectableObject *> so;
|
||||
QVector<selectableObject *> so;
|
||||
if( parentWidget() == NULL )
|
||||
{
|
||||
return( so );
|
||||
}
|
||||
#ifndef QT3
|
||||
|
||||
QList<selectableObject *> l =
|
||||
parentWidget()->findChildren<selectableObject *>();
|
||||
for( QList<selectableObject *>::iterator it = l.begin(); it != l.end();
|
||||
@@ -147,14 +98,6 @@ vvector<selectableObject *> rubberBand::selectableObjects( void ) const
|
||||
{
|
||||
so.push_back( *it );
|
||||
}
|
||||
#else
|
||||
QObjectList * l = parentWidget()->queryList( "selectableObject" );
|
||||
for( QObjectListIt it = *l; it.current() != NULL; ++it )
|
||||
{
|
||||
so.push_back( static_cast<selectableObject *>( *it ) );
|
||||
}
|
||||
delete l;
|
||||
#endif
|
||||
return( so );
|
||||
}
|
||||
|
||||
|
||||
@@ -25,23 +25,10 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QFontMetrics>
|
||||
#include <QtGui/QPainter>
|
||||
|
||||
#else
|
||||
|
||||
#include <qapplication.h>
|
||||
#include <qpainter.h>
|
||||
#include <qfontmetrics.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "side_bar_widget.h"
|
||||
#include "types.h"
|
||||
#include "gui_templates.h"
|
||||
@@ -74,41 +61,21 @@ void sideBarWidget::paintEvent( QPaintEvent * )
|
||||
{
|
||||
const Uint16 TITLE_FONT_HEIGHT = 13;
|
||||
|
||||
#ifdef QT4
|
||||
QPainter p( this );
|
||||
p.fillRect( 0, 0, width(), 27, palette().highlight().color() );
|
||||
#else
|
||||
QPixmap draw_pm( rect().size() );
|
||||
draw_pm.fill( QApplication::palette().color( QPalette::Normal,
|
||||
QColorGroup::Background ) );
|
||||
|
||||
QPainter p( &draw_pm, this );
|
||||
p.fillRect( 0, 0, width(), 27, QApplication::palette().color(
|
||||
QPalette::Normal,
|
||||
QColorGroup::Highlight ) );
|
||||
#endif
|
||||
|
||||
QFont f = p.font();
|
||||
f.setBold( TRUE );
|
||||
p.setFont( pointSize<TITLE_FONT_HEIGHT>( f ) );
|
||||
|
||||
#ifdef QT4
|
||||
p.setPen( palette().highlightedText().color() );
|
||||
#else
|
||||
p.setPen( QApplication::palette().color( QPalette::Normal,
|
||||
QColorGroup::HighlightedText ) );
|
||||
#endif
|
||||
|
||||
const Uint16 tx = m_icon.width()+4;
|
||||
const Uint16 ty = 2+TITLE_FONT_HEIGHT;
|
||||
p.drawText( tx, ty, m_title );
|
||||
p.drawLine( tx, ty+4, width()-4, ty+4 );
|
||||
|
||||
p.drawPixmap( 2, 2, m_icon );
|
||||
|
||||
#ifndef QT4
|
||||
// and blit all drawn stuff on the screen...
|
||||
bitBlt( this, rect().topLeft(), &draw_pm );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -117,7 +84,7 @@ void sideBarWidget::resizeEvent( QResizeEvent * )
|
||||
{
|
||||
const Uint16 MARGIN = 6;
|
||||
m_contents->setGeometry( MARGIN, 40 + MARGIN, width() - MARGIN * 2,
|
||||
height() - MARGIN * 2 - 40 );
|
||||
height() - MARGIN * 2 - 40 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -30,29 +30,17 @@
|
||||
#include "gui_templates.h"
|
||||
#include "tooltip.h"
|
||||
|
||||
#ifndef QT4
|
||||
|
||||
#define value data
|
||||
#define removeWidget remove
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
tabBar::tabBar( QWidget * _parent, QBoxLayout::Direction _dir ) :
|
||||
QWidget( _parent ),
|
||||
#ifdef QT4
|
||||
m_layout( new QBoxLayout( _dir, this ) ),
|
||||
#else
|
||||
m_layout( new QBoxLayout( this, _dir ) ),
|
||||
#endif
|
||||
m_exclusive( FALSE )
|
||||
{
|
||||
m_layout->setMargin( 0 );
|
||||
m_layout->setSpacing( 0 );
|
||||
#ifdef QT4
|
||||
|
||||
setLayout( m_layout );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -90,9 +78,7 @@ tabButton * tabBar::addTab( QWidget * _w, const QString & _text, int _id,
|
||||
QMap<int, QPair<tabButton *, QWidget *> >::iterator it;
|
||||
for( it = m_tabs.begin(); it != m_tabs.end(); ++it )
|
||||
{
|
||||
#if QT_VERSION >= 0x030100
|
||||
m_layout->removeWidget( it.value().first );
|
||||
#endif
|
||||
}
|
||||
m_tabs.insert( _id, qMakePair( b, _w ) );
|
||||
for( it = m_tabs.begin(); it != m_tabs.end(); ++it )
|
||||
|
||||
@@ -25,23 +25,11 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtGui/QMouseEvent>
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtGui/QPixmap>
|
||||
#include <QtGui/QWheelEvent>
|
||||
|
||||
#else
|
||||
|
||||
#include <qpainter.h>
|
||||
#include <qpixmap.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "tab_widget.h"
|
||||
#include "gui_templates.h"
|
||||
|
||||
@@ -54,15 +42,7 @@ tabWidget::tabWidget( const QString & _caption, QWidget * _parent ) :
|
||||
m_caption( _caption )
|
||||
{
|
||||
setFont( pointSize<7>( font() ) );
|
||||
/*#ifdef QT4
|
||||
QPalette pal = palette();
|
||||
pal.setColor( QPalette::Background, QColor( 96, 96, 96 ) );
|
||||
setPalette( pal );
|
||||
#else
|
||||
setPaletteBackgroundColor( QColor( 96, 96, 96 ) );
|
||||
setBackgroundMode( Qt::NoBackground );
|
||||
#endif*/
|
||||
#ifndef QT3
|
||||
|
||||
setAutoFillBackground( TRUE );
|
||||
QColor bg_color = QApplication::palette().color( QPalette::Active,
|
||||
QPalette::Background ).
|
||||
@@ -70,11 +50,6 @@ tabWidget::tabWidget( const QString & _caption, QWidget * _parent ) :
|
||||
QPalette pal = palette();
|
||||
pal.setColor( QPalette::Background, bg_color );
|
||||
setPalette( pal );
|
||||
#else
|
||||
QColor bg_color = QApplication::palette().active().background().dark(
|
||||
132 );
|
||||
setPaletteBackgroundColor( bg_color );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -170,17 +145,11 @@ void tabWidget::resizeEvent( QResizeEvent * )
|
||||
|
||||
void tabWidget::paintEvent( QPaintEvent * _pe )
|
||||
{
|
||||
#ifdef QT4
|
||||
QPainter p( this );
|
||||
p.fillRect( 0, 0, width() - 1, height() - 1, QColor( 96, 96, 96 ) );
|
||||
const int c = 0;
|
||||
#else
|
||||
QPixmap pm( size() );
|
||||
pm.fill( QColor( 96, 96, 96 ) );
|
||||
|
||||
QPainter p( &pm );
|
||||
const int c = 1;
|
||||
#endif
|
||||
p.fillRect( 0, 0, width() - 1, height() - 1, QColor( 96, 96, 96 ) );
|
||||
|
||||
const int c = 0;
|
||||
bool big_tab_captions = ( m_caption == "" );
|
||||
int add = big_tab_captions ? 1 : 0;
|
||||
|
||||
@@ -232,10 +201,6 @@ void tabWidget::paintEvent( QPaintEvent * _pe )
|
||||
p.setPen( cap_col );
|
||||
cx += ( *it ).nwidth;
|
||||
}
|
||||
|
||||
#ifndef QT4
|
||||
bitBlt( this, rect().topLeft(), &pm );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -246,7 +211,7 @@ void tabWidget::wheelEvent( QWheelEvent * _we )
|
||||
_we->accept();
|
||||
int dir = ( _we->delta() < 0 ) ? 1 : -1;
|
||||
int tab = m_activeTab;
|
||||
while( tab > -1 && static_cast<csize>( tab ) < m_widgets.count() )
|
||||
while( tab > -1 && static_cast<int>( tab ) < m_widgets.count() )
|
||||
{
|
||||
tab += dir;
|
||||
if( m_widgets.contains( tab ) )
|
||||
|
||||
@@ -26,26 +26,10 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QMouseEvent>
|
||||
|
||||
#else
|
||||
|
||||
#include <qlabel.h>
|
||||
#include <qpopupmenu.h>
|
||||
#include <qcursor.h>
|
||||
|
||||
#define addSeparator insertSeparator
|
||||
#define addMenu insertItem
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "tempo_sync_knob.h"
|
||||
#include "automatable_object_templates.h"
|
||||
#include "embed.h"
|
||||
@@ -90,9 +74,9 @@ tempoSyncKnob::~tempoSyncKnob()
|
||||
void tempoSyncKnob::contextMenuEvent( QContextMenuEvent * )
|
||||
{
|
||||
QMenu contextMenu( this );
|
||||
#ifdef QT4
|
||||
contextMenu.setTitle( accessibleName() );
|
||||
#else
|
||||
#warning TODO: CSS-formatting
|
||||
#if 0
|
||||
QLabel * caption = new QLabel( "<font color=white><b>" +
|
||||
QString( accessibleName() ) + "</b></font>", this );
|
||||
caption->setPaletteBackgroundColor( QColor( 0, 0, 192 ) );
|
||||
@@ -118,15 +102,10 @@ void tempoSyncKnob::contextMenuEvent( QContextMenuEvent * )
|
||||
float limit = 60000.0f / ( engine::getSongEditor()->getTempo() *
|
||||
m_scale );
|
||||
|
||||
#ifdef QT4
|
||||
QMenu * syncMenu = contextMenu.addMenu( m_tempoSyncIcon,
|
||||
m_tempoSyncDescription );
|
||||
#else
|
||||
QMenu * syncMenu = new QMenu( this );
|
||||
#endif
|
||||
if( limit / 8.0f <= maxValue() )
|
||||
{
|
||||
#ifdef QT4
|
||||
connect( syncMenu, SIGNAL( triggered( QAction * ) ),
|
||||
this, SLOT( setTempoSync( QAction * ) ) );
|
||||
syncMenu->addAction( embed::getIconPixmap( "note_none" ),
|
||||
@@ -174,74 +153,6 @@ void tempoSyncKnob::contextMenuEvent( QContextMenuEvent * )
|
||||
tr( "Custom..." ),
|
||||
this, SLOT( showCustom( void ) )
|
||||
)->setData( (int) CUSTOM );
|
||||
#else
|
||||
int menuId;
|
||||
menuId = syncMenu->addAction( embed::getIconPixmap( "note_none" ),
|
||||
tr( "No Sync" ),
|
||||
this, SLOT( setTempoSync( int ) ) );
|
||||
syncMenu->setItemParameter( menuId, ( int ) NO_SYNC );
|
||||
if( limit / 0.125f <= maxValue() )
|
||||
{
|
||||
menuId = syncMenu->addAction(
|
||||
embed::getIconPixmap( "note_double_whole" ),
|
||||
tr( "Eight beats" ),
|
||||
this, SLOT( setTempoSync( int ) ) );
|
||||
syncMenu->setItemParameter( menuId, ( int ) DOUBLE_WHOLE_NOTE );
|
||||
}
|
||||
if( limit / 0.25f <= maxValue() )
|
||||
{
|
||||
menuId = syncMenu->addAction(
|
||||
embed::getIconPixmap( "note_whole" ),
|
||||
tr( "Whole note" ),
|
||||
this, SLOT( setTempoSync( int ) ) );
|
||||
syncMenu->setItemParameter( menuId, ( int ) WHOLE_NOTE );
|
||||
}
|
||||
if( limit / 0.5f <= maxValue() )
|
||||
{
|
||||
menuId = syncMenu->addAction(
|
||||
embed::getIconPixmap( "note_half" ),
|
||||
tr( "Half note" ),
|
||||
this, SLOT( setTempoSync( int ) ) );
|
||||
syncMenu->setItemParameter( menuId, ( int ) HALF_NOTE );
|
||||
}
|
||||
if( limit <= maxValue() )
|
||||
{
|
||||
menuId = syncMenu->addAction(
|
||||
embed::getIconPixmap( "note_quarter" ),
|
||||
tr( "Quarter note" ),
|
||||
this, SLOT( setTempoSync( int ) ) );
|
||||
syncMenu->setItemParameter( menuId, ( int ) QUARTER_NOTE );
|
||||
}
|
||||
if( limit / 2.0f <= maxValue() )
|
||||
{
|
||||
menuId = syncMenu->addAction(
|
||||
embed::getIconPixmap( "note_eighth" ),
|
||||
tr( "8th note" ),
|
||||
this, SLOT( setTempoSync( int ) ) );
|
||||
syncMenu->setItemParameter( menuId, ( int ) EIGHTH_NOTE );
|
||||
}
|
||||
if( limit / 4.0f <= maxValue() )
|
||||
{
|
||||
menuId = syncMenu->addAction(
|
||||
embed::getIconPixmap( "note_sixteenth" ),
|
||||
tr( "16th note" ),
|
||||
this, SLOT( setTempoSync( int ) ) );
|
||||
syncMenu->setItemParameter( menuId, ( int ) SIXTEENTH_NOTE );
|
||||
}
|
||||
menuId = syncMenu->addAction( embed::getIconPixmap(
|
||||
"note_thirtysecond" ),
|
||||
tr( "32nd note" ),
|
||||
this, SLOT( setTempoSync( int ) ) );
|
||||
syncMenu->setItemParameter( menuId, ( int ) THIRTYSECOND_NOTE );
|
||||
menuId = syncMenu->addAction( embed::getIconPixmap( "dont_know" ),
|
||||
tr( "Custom..." ),
|
||||
this, SLOT( showCustom( void ) ) );
|
||||
syncMenu->setItemParameter( menuId, ( int ) CUSTOM );
|
||||
|
||||
contextMenu.addMenu( m_tempoSyncIcon, m_tempoSyncDescription,
|
||||
syncMenu );
|
||||
#endif
|
||||
|
||||
contextMenu.addSeparator();
|
||||
}
|
||||
|
||||
@@ -282,19 +193,12 @@ 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 )
|
||||
@@ -552,11 +456,6 @@ void tempoSyncKnob::showCustom( void )
|
||||
|
||||
|
||||
|
||||
#ifndef QT4
|
||||
#undef addSeparator
|
||||
#endif
|
||||
|
||||
|
||||
#include "tempo_sync_knob.moc"
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
* text_float.cpp - class textFloat, a floating text-label
|
||||
*
|
||||
* 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
|
||||
*
|
||||
@@ -25,24 +25,9 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtCore/QTimer>
|
||||
#include <QtGui/QPainter>
|
||||
|
||||
#else
|
||||
|
||||
#include <qpainter.h>
|
||||
#include <qpixmap.h>
|
||||
#include <qtimer.h>
|
||||
|
||||
#define setParent reparent
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "text_float.h"
|
||||
#include "gui_templates.h"
|
||||
#include "main_window.h"
|
||||
@@ -51,7 +36,7 @@
|
||||
|
||||
textFloat::textFloat( QWidget * _parent ) :
|
||||
QWidget( _parent
|
||||
#ifndef QT4
|
||||
#if 0
|
||||
, "textFloat", WStyle_Customize | WStyle_NoBorder | WStyle_StaysOnTop
|
||||
#endif
|
||||
),
|
||||
@@ -59,10 +44,6 @@ textFloat::textFloat( QWidget * _parent ) :
|
||||
m_text( "" ),
|
||||
m_pixmap()
|
||||
{
|
||||
#ifndef QT4
|
||||
setBackgroundMode( Qt::NoBackground );
|
||||
#endif
|
||||
|
||||
reparent( parentWidget() );
|
||||
resize( 20, 20 );
|
||||
hide();
|
||||
@@ -111,12 +92,7 @@ void textFloat::reparent( QWidget * _new_parent )
|
||||
// Get position and reparent to either top level or dialog
|
||||
//
|
||||
while( _new_parent->parentWidget() && !_new_parent->isTopLevel() &&
|
||||
#ifdef QT4
|
||||
!_new_parent->windowType() == Qt::Dialog
|
||||
#else
|
||||
!_new_parent->isDialog()
|
||||
#endif
|
||||
)
|
||||
!_new_parent->windowType() == Qt::Dialog )
|
||||
{
|
||||
_new_parent = _new_parent->parentWidget();
|
||||
position += _new_parent->pos();
|
||||
@@ -126,15 +102,8 @@ void textFloat::reparent( QWidget * _new_parent )
|
||||
//
|
||||
//move(pos + QPoint(parent->width() + 5, 5));
|
||||
|
||||
QWidget::setParent( _new_parent,
|
||||
#ifdef QT4
|
||||
Qt::FramelessWindowHint |
|
||||
QWidget::setParent( _new_parent, Qt::FramelessWindowHint |
|
||||
Qt::WindowStaysOnTopHint );
|
||||
#else
|
||||
WStyle_Customize | WStyle_NoBorder |
|
||||
WStyle_StaysOnTop,
|
||||
position + QPoint( 20, 5 ) );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -152,7 +121,6 @@ void textFloat::setVisibilityTimeOut( int _msecs )
|
||||
textFloat * textFloat::displayMessage( const QString & _msg, int _timeout,
|
||||
QWidget * _parent, int _add_y_margin )
|
||||
{
|
||||
#ifdef QT4
|
||||
QWidget * mw = QApplication::activeWindow();
|
||||
if( mw == NULL )
|
||||
{
|
||||
@@ -164,13 +132,7 @@ textFloat * textFloat::displayMessage( const QString & _msg, int _timeout,
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
QWidget * mw = qApp->mainWidget();
|
||||
if( mw == NULL )
|
||||
{
|
||||
mw = qApp->desktop();
|
||||
}
|
||||
#endif
|
||||
|
||||
textFloat * tf = new textFloat( ( _parent == NULL ) ? mw : _parent );
|
||||
if( _parent != NULL )
|
||||
{
|
||||
@@ -186,11 +148,7 @@ textFloat * textFloat::displayMessage( const QString & _msg, int _timeout,
|
||||
tf->show();
|
||||
if( _timeout > 0 )
|
||||
{
|
||||
#ifdef QT4
|
||||
tf->setAttribute( Qt::WA_DeleteOnClose, TRUE );
|
||||
#else
|
||||
tf->setWFlags( tf->getWFlags() | Qt::WDestructiveClose );
|
||||
#endif
|
||||
QTimer::singleShot( _timeout, tf, SLOT( close() ) );
|
||||
}
|
||||
return( tf );
|
||||
@@ -215,22 +173,15 @@ textFloat * textFloat::displayMessage( const QString & _title,
|
||||
|
||||
void textFloat::paintEvent( QPaintEvent * _pe )
|
||||
{
|
||||
#ifdef QT4
|
||||
QPainter p( this );
|
||||
#else
|
||||
QPixmap draw_pm( size() );
|
||||
QPainter p( &draw_pm );
|
||||
#endif
|
||||
|
||||
p.setPen( QColor( 0, 0, 0 ) );
|
||||
|
||||
p.setBrush( QColor( 224, 224, 224 ) );
|
||||
|
||||
p.setFont( pointSize<8>( p.font() ) );
|
||||
|
||||
#ifndef QT3
|
||||
p.drawRect( 0, 0, rect().right(), rect().bottom() );
|
||||
#else
|
||||
p.drawRect( rect() );
|
||||
#endif
|
||||
|
||||
// p.setPen( Qt::black );
|
||||
// small message?
|
||||
@@ -252,10 +203,6 @@ void textFloat::paintEvent( QPaintEvent * _pe )
|
||||
p.setFont( f );
|
||||
p.drawText( text_x, 12, m_title );
|
||||
}
|
||||
|
||||
#ifndef QT4
|
||||
bitBlt( this, rect().topLeft(), &draw_pm );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -41,14 +41,13 @@ toolButton::toolButton( const QPixmap & _pixmap, const QString & _tooltip,
|
||||
m_colorStandard( s_stdColor ),
|
||||
m_colorHighlighted( s_hlColor )
|
||||
{
|
||||
#ifndef QT3
|
||||
setAutoFillBackground( TRUE );
|
||||
QPalette pal = palette();
|
||||
pal.setColor( backgroundRole(), m_colorStandard );
|
||||
pal.setColor( QPalette::Window, m_colorStandard );
|
||||
pal.setColor( QPalette::Button, m_colorStandard );
|
||||
setPalette( pal );
|
||||
#endif
|
||||
|
||||
if( _receiver != NULL && _slot != NULL )
|
||||
{
|
||||
connect( this, SIGNAL( clicked() ), _receiver, _slot );
|
||||
@@ -73,15 +72,11 @@ toolButton::~toolButton()
|
||||
|
||||
void toolButton::enterEvent( QEvent * )
|
||||
{
|
||||
#ifdef QT4
|
||||
QPalette pal = palette();
|
||||
pal.setColor( backgroundRole(), m_colorHighlighted );
|
||||
pal.setColor( QPalette::Window, m_colorHighlighted );
|
||||
pal.setColor( QPalette::Button, m_colorHighlighted );
|
||||
setPalette( pal );
|
||||
#else
|
||||
setPaletteBackgroundColor( m_colorHighlighted );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -89,15 +84,11 @@ void toolButton::enterEvent( QEvent * )
|
||||
|
||||
void toolButton::leaveEvent( QEvent * )
|
||||
{
|
||||
#ifdef QT4
|
||||
QPalette pal = palette();
|
||||
pal.setColor( backgroundRole(), m_colorStandard );
|
||||
pal.setColor( QPalette::Window, m_colorStandard );
|
||||
pal.setColor( QPalette::Button, m_colorStandard );
|
||||
setPalette( pal );
|
||||
#else
|
||||
setPaletteBackgroundColor( m_colorStandard );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -25,18 +25,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtGui/QToolTip>
|
||||
|
||||
#else
|
||||
|
||||
#include <qtooltip.h>
|
||||
|
||||
#endif
|
||||
|
||||
#include "tooltip.h"
|
||||
#include "config_mgr.h"
|
||||
|
||||
@@ -45,11 +35,7 @@ void toolTip::add( QWidget * _w, const QString & _txt )
|
||||
{
|
||||
if( !configManager::inst()->value( "tooltips", "disabled" ).toInt() )
|
||||
{
|
||||
#ifdef QT4
|
||||
//_w->setToolTip( _txt );
|
||||
#else
|
||||
QToolTip::add( _w, _txt );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,24 +25,11 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtCore/QTimer>
|
||||
#include <QtGui/QMouseEvent>
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtGui/QPixmap>
|
||||
|
||||
#else
|
||||
|
||||
#include <qpainter.h>
|
||||
#include <qpixmap.h>
|
||||
#include <qtimer.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "visualization_widget.h"
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
@@ -60,9 +47,6 @@ visualizationWidget::visualizationWidget( const QPixmap & _bg, QWidget * _p,
|
||||
s_background( _bg ),
|
||||
m_enabled( TRUE )
|
||||
{
|
||||
#ifndef QT4
|
||||
setBackgroundMode( Qt::NoBackground );
|
||||
#endif
|
||||
setFixedSize( s_background.width(), s_background.height() );
|
||||
|
||||
|
||||
@@ -113,13 +97,8 @@ void visualizationWidget::setAudioBuffer( const surroundSampleFrame * _ab,
|
||||
|
||||
void visualizationWidget::paintEvent( QPaintEvent * )
|
||||
{
|
||||
#ifdef QT4
|
||||
QPainter p( this );
|
||||
#else
|
||||
QPixmap draw_pm( rect().size() );
|
||||
|
||||
QPainter p( &draw_pm, this );
|
||||
#endif
|
||||
p.drawPixmap( 0, 0, s_background );
|
||||
|
||||
if( m_enabled == TRUE )
|
||||
@@ -186,11 +165,6 @@ void visualizationWidget::paintEvent( QPaintEvent * )
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#ifndef QT4
|
||||
// and blit all drawn stuff on the screen...
|
||||
bitBlt( this, rect().topLeft(), &draw_pm );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -25,6 +25,11 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QInputDialog>
|
||||
#include <QtGui/QMouseEvent>
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include "volume_knob.h"
|
||||
@@ -35,19 +40,6 @@
|
||||
#include "text_float.h"
|
||||
#include "string_pair_drag.h"
|
||||
|
||||
#ifndef QT3
|
||||
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QInputDialog>
|
||||
#include <QtGui/QMouseEvent>
|
||||
|
||||
#else
|
||||
|
||||
#include <qapplication.h>
|
||||
#include <qinputdialog.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
volumeKnob::volumeKnob( int _knob_num, QWidget * _parent, const QString & _name,
|
||||
@@ -196,19 +188,11 @@ void volumeKnob::enterValue( void )
|
||||
if( configManager::inst()->value( "app", "displaydbv" ).toInt() )
|
||||
{
|
||||
new_val = QInputDialog::getDouble(
|
||||
#ifdef QT4
|
||||
this,
|
||||
#endif
|
||||
accessibleName(),
|
||||
this, accessibleName(),
|
||||
tr( "Please enter a new value between "
|
||||
"-96.0 dbV and 6.0 dbV:" ),
|
||||
20.0 * log10( value() / 100.0 ),
|
||||
-96.0, 6.0,
|
||||
4, &ok
|
||||
#ifndef QT4
|
||||
, this
|
||||
#endif
|
||||
);
|
||||
-96.0, 6.0, 4, &ok );
|
||||
if( new_val <= -96.0 )
|
||||
{
|
||||
new_val = 0.0f;
|
||||
@@ -221,19 +205,12 @@ void volumeKnob::enterValue( void )
|
||||
else
|
||||
{
|
||||
new_val = QInputDialog::getDouble(
|
||||
#ifdef QT4
|
||||
this,
|
||||
#endif
|
||||
accessibleName(),
|
||||
tr( "Please enter a new value between "
|
||||
"%1 and %2:" ).arg(
|
||||
this, accessibleName(),
|
||||
tr( "Please enter a new value between "
|
||||
"%1 and %2:" ).arg(
|
||||
minValue() ).arg( maxValue() ),
|
||||
value(), minValue(), maxValue(),
|
||||
4, &ok
|
||||
#ifndef QT4
|
||||
, this
|
||||
#endif
|
||||
);
|
||||
4, &ok );
|
||||
}
|
||||
|
||||
if( ok )
|
||||
|
||||
Reference in New Issue
Block a user