diff --git a/ChangeLog b/ChangeLog index 4f736211c..248cfa030 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,44 @@ * data/themes/blue_scene/: updated some pixmaps + * data/themes/blue_scene/plugins/: + added pixmaps for plugins + +2006-03-08 Tobias Doerffel + + * src/core/timeline.cpp: + more logical loop-point-handling: + middle mouse button -> left loop-point + right mouse button -> right loop-point + + * plugins/audio_file_processor/audio_file_processor.cpp: + * plugins/bit_invader/bit_invader.cpp: + * plugins/organic/organic.cpp: + * plugins/plucked_string_synth/plucked_string_synth.cpp: + * plugins/triple_oscillator/triple_oscillator.cpp: + * plugins/vestige/vestige.cpp: + * include/plugin.h: + * src/core/instrument.cpp: + * src/core/plugin.cpp: + * src/lib/embed.cpp: + added support for plugin-theming + + * src/lib/embed.cpp: + - first search in artwork-directories before searching for embedded data + as most artwork is not linked into binary (except plugins) + - if pixmap not found, try to load according pixmap from + default-artwork-dir + + * include/embed.h: + * src/core/main.cpp: + * src/lib/embed.cpp: + as localizations are no longer embedded into binary, loadTranslation() + was moved to main.cpp and contains only some basic code for loading + appropriate translation from file + + * src/core/config_mgr.cpp: + several fixes concerning artwork-path + 2006-03-07 Tobias Doerffel * src/core/arp_and_chords_tab_widget.cpp: diff --git a/TODO b/TODO index 084d4d889..b925f0e2d 100644 --- a/TODO +++ b/TODO @@ -2,6 +2,7 @@ - message when importing unsupported MIDI-file (track-count = 0) - volume-knobs for each sample-track - AMS-bindings +- remove binary-embed-system - recording-functionality - show loading-vst-hint when cloning vestige-track - do not hang when saving while loading VST-plugin diff --git a/configure.in b/configure.in index 093bf7ca8..b0c44fcb8 100644 --- a/configure.in +++ b/configure.in @@ -2,8 +2,8 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.50) -AC_INIT(lmms, 0.1.4-cvs20060307, tobydox/at/users/dot/sourceforge/dot/net) -AM_INIT_AUTOMAKE(lmms, 0.1.4-cvs20060307) +AC_INIT(lmms, 0.1.4-cvs20060308, tobydox/at/users/dot/sourceforge/dot/net) +AM_INIT_AUTOMAKE(lmms, 0.1.4-cvs20060308) AM_CONFIG_HEADER(config.h) diff --git a/data/themes/Makefile.am b/data/themes/Makefile.am index 659a64e6a..ccae107b4 100755 --- a/data/themes/Makefile.am +++ b/data/themes/Makefile.am @@ -4,5 +4,9 @@ theme_default_DATA = $(wildcard default/*.png) theme_blue_scenedir = $(lmmsdatadir)/themes/blue_scene theme_blue_scene_DATA = $(wildcard blue_scene/*.png) -EXTRA_DIST = $(theme_default_DATA) $(theme_blue_scene_DATA) +plugin_theme_blue_scenedir = $(lmmsdatadir)/themes/blue_scene/plugins +plugin_theme_blue_scene_DATA = $(wildcard blue_scene/plugins/*.png) + + +EXTRA_DIST = $(theme_default_DATA) $(theme_blue_scene_DATA) $(plugin_theme_blue_scene_DATA) diff --git a/data/themes/blue_scene/clock.png b/data/themes/blue_scene/clock.png index f53249452..f0c544ec8 100644 Binary files a/data/themes/blue_scene/clock.png and b/data/themes/blue_scene/clock.png differ diff --git a/data/themes/blue_scene/knob03.png b/data/themes/blue_scene/knob03.png index c41d0b0e9..ee4fec0cb 100644 Binary files a/data/themes/blue_scene/knob03.png and b/data/themes/blue_scene/knob03.png differ diff --git a/data/themes/blue_scene/plugins/audiofileprocessor_artwork.png b/data/themes/blue_scene/plugins/audiofileprocessor_artwork.png new file mode 100644 index 000000000..c00d4100e Binary files /dev/null and b/data/themes/blue_scene/plugins/audiofileprocessor_artwork.png differ diff --git a/data/themes/blue_scene/plugins/audiofileprocessor_logo.png b/data/themes/blue_scene/plugins/audiofileprocessor_logo.png new file mode 100644 index 000000000..794e723c7 Binary files /dev/null and b/data/themes/blue_scene/plugins/audiofileprocessor_logo.png differ diff --git a/data/themes/blue_scene/plugins/audiofileprocessor_loop_off.png b/data/themes/blue_scene/plugins/audiofileprocessor_loop_off.png new file mode 100644 index 000000000..c0cb23d1e Binary files /dev/null and b/data/themes/blue_scene/plugins/audiofileprocessor_loop_off.png differ diff --git a/data/themes/blue_scene/plugins/audiofileprocessor_loop_on.png b/data/themes/blue_scene/plugins/audiofileprocessor_loop_on.png new file mode 100644 index 000000000..40336eb2e Binary files /dev/null and b/data/themes/blue_scene/plugins/audiofileprocessor_loop_on.png differ diff --git a/data/themes/blue_scene/plugins/audiofileprocessor_reverse_off.png b/data/themes/blue_scene/plugins/audiofileprocessor_reverse_off.png new file mode 100644 index 000000000..64d1d535c Binary files /dev/null and b/data/themes/blue_scene/plugins/audiofileprocessor_reverse_off.png differ diff --git a/data/themes/blue_scene/plugins/audiofileprocessor_reverse_on.png b/data/themes/blue_scene/plugins/audiofileprocessor_reverse_on.png new file mode 100644 index 000000000..8e78dcf3d Binary files /dev/null and b/data/themes/blue_scene/plugins/audiofileprocessor_reverse_on.png differ diff --git a/data/themes/blue_scene/plugins/bitinvader_artwork.png b/data/themes/blue_scene/plugins/bitinvader_artwork.png new file mode 100644 index 000000000..8b0fb9a76 Binary files /dev/null and b/data/themes/blue_scene/plugins/bitinvader_artwork.png differ diff --git a/data/themes/blue_scene/plugins/bitinvader_logo.png b/data/themes/blue_scene/plugins/bitinvader_logo.png new file mode 100644 index 000000000..d7f887c80 Binary files /dev/null and b/data/themes/blue_scene/plugins/bitinvader_logo.png differ diff --git a/data/themes/blue_scene/plugins/bitinvader_smooth.png b/data/themes/blue_scene/plugins/bitinvader_smooth.png new file mode 100644 index 000000000..74b80853b Binary files /dev/null and b/data/themes/blue_scene/plugins/bitinvader_smooth.png differ diff --git a/data/themes/blue_scene/plugins/bitinvader_wavegraph.png b/data/themes/blue_scene/plugins/bitinvader_wavegraph.png new file mode 100644 index 000000000..ed5b6978d Binary files /dev/null and b/data/themes/blue_scene/plugins/bitinvader_wavegraph.png differ diff --git a/data/themes/blue_scene/plugins/bitinvader_wavegraph3.png b/data/themes/blue_scene/plugins/bitinvader_wavegraph3.png new file mode 100644 index 000000000..aa7b1110d Binary files /dev/null and b/data/themes/blue_scene/plugins/bitinvader_wavegraph3.png differ diff --git a/data/themes/blue_scene/plugins/pluckedstringsynth_logo.png b/data/themes/blue_scene/plugins/pluckedstringsynth_logo.png new file mode 100644 index 000000000..5df92c4cf Binary files /dev/null and b/data/themes/blue_scene/plugins/pluckedstringsynth_logo.png differ diff --git a/data/themes/blue_scene/plugins/tripleoscillator_am_active.png b/data/themes/blue_scene/plugins/tripleoscillator_am_active.png new file mode 100644 index 000000000..81c9cb8da Binary files /dev/null and b/data/themes/blue_scene/plugins/tripleoscillator_am_active.png differ diff --git a/data/themes/blue_scene/plugins/tripleoscillator_am_inactive.png b/data/themes/blue_scene/plugins/tripleoscillator_am_inactive.png new file mode 100644 index 000000000..efc9c0f6a Binary files /dev/null and b/data/themes/blue_scene/plugins/tripleoscillator_am_inactive.png differ diff --git a/data/themes/blue_scene/plugins/tripleoscillator_artwork.png b/data/themes/blue_scene/plugins/tripleoscillator_artwork.png new file mode 100644 index 000000000..6616e48cd Binary files /dev/null and b/data/themes/blue_scene/plugins/tripleoscillator_artwork.png differ diff --git a/data/themes/blue_scene/plugins/tripleoscillator_btn_mask.png b/data/themes/blue_scene/plugins/tripleoscillator_btn_mask.png new file mode 100644 index 000000000..bd257ea55 Binary files /dev/null and b/data/themes/blue_scene/plugins/tripleoscillator_btn_mask.png differ diff --git a/data/themes/blue_scene/plugins/tripleoscillator_fm_active.png b/data/themes/blue_scene/plugins/tripleoscillator_fm_active.png new file mode 100644 index 000000000..c4d463bf7 Binary files /dev/null and b/data/themes/blue_scene/plugins/tripleoscillator_fm_active.png differ diff --git a/data/themes/blue_scene/plugins/tripleoscillator_fm_inactive.png b/data/themes/blue_scene/plugins/tripleoscillator_fm_inactive.png new file mode 100644 index 000000000..50ad1d4a6 Binary files /dev/null and b/data/themes/blue_scene/plugins/tripleoscillator_fm_inactive.png differ diff --git a/data/themes/blue_scene/plugins/tripleoscillator_mix_active.png b/data/themes/blue_scene/plugins/tripleoscillator_mix_active.png new file mode 100644 index 000000000..e2262c6d7 Binary files /dev/null and b/data/themes/blue_scene/plugins/tripleoscillator_mix_active.png differ diff --git a/data/themes/blue_scene/plugins/tripleoscillator_mix_inactive.png b/data/themes/blue_scene/plugins/tripleoscillator_mix_inactive.png new file mode 100644 index 000000000..0d8941114 Binary files /dev/null and b/data/themes/blue_scene/plugins/tripleoscillator_mix_inactive.png differ diff --git a/data/themes/blue_scene/plugins/tripleoscillator_sync_active.png b/data/themes/blue_scene/plugins/tripleoscillator_sync_active.png new file mode 100644 index 000000000..3d80c8363 Binary files /dev/null and b/data/themes/blue_scene/plugins/tripleoscillator_sync_active.png differ diff --git a/data/themes/blue_scene/plugins/tripleoscillator_sync_inactive.png b/data/themes/blue_scene/plugins/tripleoscillator_sync_inactive.png new file mode 100644 index 000000000..ae9226ced Binary files /dev/null and b/data/themes/blue_scene/plugins/tripleoscillator_sync_inactive.png differ diff --git a/data/themes/blue_scene/plugins/vestige_artwork.png b/data/themes/blue_scene/plugins/vestige_artwork.png new file mode 100644 index 000000000..c5b423475 Binary files /dev/null and b/data/themes/blue_scene/plugins/vestige_artwork.png differ diff --git a/data/themes/blue_scene/plugins/vestige_logo.png b/data/themes/blue_scene/plugins/vestige_logo.png new file mode 100644 index 000000000..be248938c Binary files /dev/null and b/data/themes/blue_scene/plugins/vestige_logo.png differ diff --git a/data/themes/blue_scene/tempo_sync.png b/data/themes/blue_scene/tempo_sync.png new file mode 100644 index 000000000..ae57ba90a Binary files /dev/null and b/data/themes/blue_scene/tempo_sync.png differ diff --git a/data/themes/default/clock.png b/data/themes/default/clock.png index 9060065ca..f0c544ec8 100755 Binary files a/data/themes/default/clock.png and b/data/themes/default/clock.png differ diff --git a/data/themes/default/tempo_sync.png b/data/themes/default/tempo_sync.png new file mode 100755 index 000000000..f0c544ec8 Binary files /dev/null and b/data/themes/default/tempo_sync.png differ diff --git a/include/config_mgr.h b/include/config_mgr.h index 65ec835a2..bea65d9b7 100644 --- a/include/config_mgr.h +++ b/include/config_mgr.h @@ -102,6 +102,11 @@ public: return( m_workingDir + SAMPLES_PATH ); } + QString defaultArtworkDir( void ) const + { + return( m_dataDir + DEFAULT_THEME_PATH ); + } + QString artworkDir( void ) const { return( m_artworkDir ); diff --git a/include/embed.h b/include/embed.h index 9a2f209b7..c3a71582a 100644 --- a/include/embed.h +++ b/include/embed.h @@ -53,7 +53,6 @@ struct descriptor QPixmap getIconPixmap( const char * _name, int _w = -1, int _h = -1 ); QString getText( const char * _name ); -void loadTranslation( const QString & _tname ); } @@ -63,8 +62,7 @@ namespace PLUGIN_NAME { QPixmap getIconPixmap( const char * _name, int _w = -1, int _h = -1 ); -QString getText( const char * _name ); -void loadTranslation( const QString & _tname ); +//QString getText( const char * _name ); } #endif diff --git a/include/plugin.h b/include/plugin.h index 58fba3ade..915d50c50 100644 --- a/include/plugin.h +++ b/include/plugin.h @@ -82,7 +82,7 @@ public: const char * author; int version; pluginTypes type; - embed::descriptor logo; + const QPixmap * logo; } ; // contructor of a plugin diff --git a/plugins/audio_file_processor/audio_file_processor.cpp b/plugins/audio_file_processor/audio_file_processor.cpp index db91980a8..34ef6e786 100644 --- a/plugins/audio_file_processor/audio_file_processor.cpp +++ b/plugins/audio_file_processor/audio_file_processor.cpp @@ -78,7 +78,7 @@ plugin::descriptor audiofileprocessor_plugin_descriptor = "Tobias Doerffel ", 0x0100, plugin::INSTRUMENT, - PLUGIN_NAME::findEmbeddedData( "logo.png" ) + new QPixmap( PLUGIN_NAME::getIconPixmap( "logo" ) ) } ; } diff --git a/plugins/bit_invader/bit_invader.cpp b/plugins/bit_invader/bit_invader.cpp index dded118eb..148d2b0c9 100644 --- a/plugins/bit_invader/bit_invader.cpp +++ b/plugins/bit_invader/bit_invader.cpp @@ -84,7 +84,7 @@ plugin::descriptor bitinvader_plugin_descriptor = "Andreas Brandmaier ", 0x0100, plugin::INSTRUMENT, - PLUGIN_NAME::findEmbeddedData( "logo.png" ) + new QPixmap( PLUGIN_NAME::getIconPixmap( "logo" ) ) } ; } diff --git a/plugins/organic/organic.cpp b/plugins/organic/organic.cpp index 3c01b96ec..c901f8c53 100644 --- a/plugins/organic/organic.cpp +++ b/plugins/organic/organic.cpp @@ -85,7 +85,7 @@ plugin::descriptor organic_plugin_descriptor = "Andreas Brandmaier ", 0x0100, plugin::INSTRUMENT, - PLUGIN_NAME::findEmbeddedData( "logo.png" ) + new QPixmap( PLUGIN_NAME::getIconPixmap( "logo" ) ) } ; } diff --git a/plugins/plucked_string_synth/plucked_string_synth.cpp b/plugins/plucked_string_synth/plucked_string_synth.cpp index 8258d63b8..68d26950d 100644 --- a/plugins/plucked_string_synth/plucked_string_synth.cpp +++ b/plugins/plucked_string_synth/plucked_string_synth.cpp @@ -61,7 +61,7 @@ plugin::descriptor pluckedstringsynth_plugin_descriptor = "Tobias Doerffel ", 0x0100, plugin::INSTRUMENT, - PLUGIN_NAME::findEmbeddedData( "logo.png" ) + new QPixmap( PLUGIN_NAME::getIconPixmap( "logo" ) ) } ; } diff --git a/plugins/triple_oscillator/triple_oscillator.cpp b/plugins/triple_oscillator/triple_oscillator.cpp index 0555ee93a..18070183a 100644 --- a/plugins/triple_oscillator/triple_oscillator.cpp +++ b/plugins/triple_oscillator/triple_oscillator.cpp @@ -73,7 +73,7 @@ plugin::descriptor tripleoscillator_plugin_descriptor = "Tobias Doerffel ", 0x0100, plugin::INSTRUMENT, - PLUGIN_NAME::findEmbeddedData( "logo.png" ) + new QPixmap( PLUGIN_NAME::getIconPixmap( "logo" ) ) } ; } diff --git a/plugins/vestige/vestige.cpp b/plugins/vestige/vestige.cpp index 0b722313d..e852f4611 100644 --- a/plugins/vestige/vestige.cpp +++ b/plugins/vestige/vestige.cpp @@ -78,7 +78,7 @@ plugin::descriptor vestige_plugin_descriptor = "Tobias Doerffel ", 0x0100, plugin::INSTRUMENT, - PLUGIN_NAME::findEmbeddedData( "logo.png" ) + new QPixmap( PLUGIN_NAME::getIconPixmap( "logo" ) ) } ; } diff --git a/src/core/arp_and_chords_tab_widget.cpp b/src/core/arp_and_chords_tab_widget.cpp index 39802def2..5200ae463 100644 --- a/src/core/arp_and_chords_tab_widget.cpp +++ b/src/core/arp_and_chords_tab_widget.cpp @@ -68,9 +68,6 @@ arpAndChordsTabWidget::chord arpAndChordsTabWidget::s_chords[] = { - // thanks to the FL-team for this chords *lol* ;-) took me at least 3 - // hours to get them all out of FL-arpeggiator... - { arpAndChordsTabWidget::tr( "octave" ), { 0, -1 } }, { arpAndChordsTabWidget::tr( "Major" ), { 0, 4, 7, -1 } }, { arpAndChordsTabWidget::tr( "Majb5" ), { 0, 4, 6, -1 } }, diff --git a/src/core/config_mgr.cpp b/src/core/config_mgr.cpp index e3084fa8f..79a440684 100644 --- a/src/core/config_mgr.cpp +++ b/src/core/config_mgr.cpp @@ -168,7 +168,7 @@ configManager::configManager( void ) : // since real support for qt < 3.2 is senseless too ;-) m_dataDir( "/usr/share/lmms/" ), #endif - m_artworkDir( m_dataDir + DEFAULT_THEME_PATH ), + m_artworkDir( defaultArtworkDir() ), #if QT_VERSION >= 0x030200 m_pluginDir( qApp->applicationDirPath().section( '/', 0, -2 ) + "/lib/lmms/" ), @@ -811,7 +811,7 @@ bool configManager::loadConfigFile( void ) m_artworkDir = value( "paths", "artwork" ); if( QDir( m_artworkDir ).exists() == FALSE ) { - m_artworkDir = m_dataDir + DEFAULT_THEME_PATH; + m_artworkDir = defaultArtworkDir(); } if( m_artworkDir.right( 1 ) != "/" ) { diff --git a/src/core/instrument.cpp b/src/core/instrument.cpp index ba384cc69..5ededdf0a 100644 --- a/src/core/instrument.cpp +++ b/src/core/instrument.cpp @@ -38,10 +38,7 @@ instrument::instrument( channelTrack * _channel_track, m_valid( TRUE ) { setFixedSize( 250, 250 ); - QPixmap logo; - logo.loadFromData( getDescriptor()->logo.data, - getDescriptor()->logo.size ); - m_channelTrack->setWindowIcon( logo ); + m_channelTrack->setWindowIcon( *getDescriptor()->logo ); } diff --git a/src/core/main.cpp b/src/core/main.cpp index 945f04fc2..97b557863 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #else @@ -40,6 +41,7 @@ #if QT_VERSION >= 0x030200 #include #endif +#include #endif @@ -63,6 +65,17 @@ QString file_to_render; int splash_alignment_flags = Qt::AlignTop | Qt::AlignLeft; #endif +inline void loadTranslation( const QString & _tname ) +{ + QTranslator * t = new QTranslator( 0 ); + QString name = _tname + ".qm"; + + t->load( name, configManager::inst()->localeDir() ); + + qApp->installTranslator( t ); +} + + int main( int argc, char * * argv ) { @@ -160,9 +173,9 @@ int main( int argc, char * * argv ) QString( QTextCodec::locale() ).section( '_', 0, 0 ); #endif // load translation for Qt-widgets/-dialogs - embed::loadTranslation( QString( "qt_" ) + pos ); + loadTranslation( QString( "qt_" ) + pos ); // load actual translation for LMMS - embed::loadTranslation( pos ); + loadTranslation( pos ); #ifdef QT4 app.setFont( pointSize<10>( app.font() ) ); diff --git a/src/core/plugin.cpp b/src/core/plugin.cpp index 8a82df13a..69bc03b45 100644 --- a/src/core/plugin.cpp +++ b/src/core/plugin.cpp @@ -48,7 +48,7 @@ #include "dummy_plugin.h" -static embed::descriptor dummy_embed = { 0, NULL, "" } ; +//static embed::descriptor dummy_embed = { 0, NULL, "" } ; static plugin::descriptor dummy_plugin_descriptor = { @@ -58,7 +58,7 @@ static plugin::descriptor dummy_plugin_descriptor = "Tobias Doerffel ", 0x0100, plugin::UNDEFINED, - dummy_embed + NULL } ; @@ -68,6 +68,11 @@ plugin::plugin( const descriptor * _descriptor, engine * _engine ) : engineObject( _engine ), m_descriptor( _descriptor ) { + if( dummy_plugin_descriptor.logo == NULL ) + { + dummy_plugin_descriptor.logo = new QPixmap(); + } + if( m_descriptor == NULL ) { m_descriptor = &dummy_plugin_descriptor; diff --git a/src/core/plugin_browser.cpp b/src/core/plugin_browser.cpp index ad8339147..0afbe5662 100644 --- a/src/core/plugin_browser.cpp +++ b/src/core/plugin_browser.cpp @@ -114,10 +114,9 @@ pluginDescWidget::pluginDescWidget( const plugin::descriptor & _pd, QWidget( _parent ), engineObject( _engine ), m_pluginDescriptor( _pd ), - m_logo(), + m_logo( *_pd.logo ), m_mouseOver( FALSE ) { - m_logo.loadFromData( _pd.logo.data, _pd.logo.size ); setFixedHeight( 60 ); setMouseTracking( TRUE ); #ifndef QT4 diff --git a/src/core/timeline.cpp b/src/core/timeline.cpp index cf1530d7a..2e7e53c5d 100644 --- a/src/core/timeline.cpp +++ b/src/core/timeline.cpp @@ -279,49 +279,7 @@ void timeLine::mousePressEvent( QMouseEvent * _me ) { return; } - if( _me->button() == Qt::RightButton ) - { - if( _me->x() >= markerX( loopBegin() ) && - _me->x() <= markerX( loopBegin() ) + - s_loopPointPixmap->width() ) - { - m_action = MOVE_LOOP_BEGIN; - } - else if( _me->x() >= markerX( loopEnd() ) && - _me->x() <= markerX( loopEnd() ) + - s_loopPointPixmap->width() ) - { - m_action = MOVE_LOOP_END; - } - if( m_action != NONE ) - { - m_moveXOff = s_loopPointPixmap->width() / 2; - } - } - else if( _me->button() == Qt::MidButton ) - { - const midiTime t = m_begin + - static_cast( _me->x() * 64 / m_ppt ); - Uint8 pmin = 0; - Uint8 pmax = 1; - m_action = MOVE_LOOP_BEGIN; - if( m_loopPos[pmin] > m_loopPos[pmax] ) - { - qSwap( pmin, pmax ); - m_action = MOVE_LOOP_END; - } - if( eng()->getMainWindow()->isShiftPressed() == TRUE ) - { - m_loopPos[pmax] = t; - m_action = ( m_action == MOVE_LOOP_BEGIN ) ? - MOVE_LOOP_END : MOVE_LOOP_BEGIN; - } - else - { - m_loopPos[pmin] = t; - } - } - else + if( _me->button() == Qt::LeftButton ) { m_action = MOVE_POS_MARKER; if( _me->x() - m_xOffset < s_posMarkerPixmap->width() ) @@ -333,6 +291,23 @@ void timeLine::mousePressEvent( QMouseEvent * _me ) m_moveXOff = s_posMarkerPixmap->width() / 2; } } + else + { + const midiTime t = m_begin + + static_cast( _me->x() * 64 / m_ppt ); + Uint8 pmin = 0; + Uint8 pmax = 1; + m_action = MOVE_LOOP_BEGIN; + if( m_loopPos[0] > m_loopPos[1] ) + { + qSwap( m_loopPos[0], m_loopPos[1] ); + } + if( _me->button() == Qt::RightButton ) + { + m_action = MOVE_LOOP_END; + } + m_loopPos[( m_action == MOVE_LOOP_BEGIN ) ? 0 : 1] = t; + } if( m_action == MOVE_LOOP_BEGIN || m_action == MOVE_LOOP_END ) { delete m_hint; diff --git a/src/core/track.cpp b/src/core/track.cpp index 662813d93..53b7690bf 100644 --- a/src/core/track.cpp +++ b/src/core/track.cpp @@ -100,8 +100,7 @@ trackContentObject::trackContentObject( track * _track ) : if( s_textFloat == NULL ) { s_textFloat = new textFloat( this ); - s_textFloat->setPixmap( embed::getIconPixmap( - "xclock", 24, 24 ) ); + s_textFloat->setPixmap( embed::getIconPixmap( "clock" ) ); } #ifdef QT4 diff --git a/src/lib/embed.cpp b/src/lib/embed.cpp index cdce07c88..6712dfbee 100644 --- a/src/lib/embed.cpp +++ b/src/lib/embed.cpp @@ -3,7 +3,7 @@ /* * embed.cpp - misc stuff for using embedded resources (linked into binary) * - * Copyright (c) 2004-2005 Tobias Doerffel + * Copyright (c) 2004-2006 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -29,14 +29,10 @@ #ifdef QT4 -#include -#include #include #else -#include -#include #include #endif @@ -63,25 +59,44 @@ QPixmap getIconPixmap( const char * _name, int _w, int _h ) if( _w == -1 || _h == -1 ) { QString name = QString( _name ) + ".png"; + +#ifdef PLUGIN_NAME + QPixmap p( configManager::inst()->artworkDir() + "plugins/" + + STRINGIFY_PLUGIN_NAME( PLUGIN_NAME ) + "_" + name ); + if( p.isNull() ) + { + p = QPixmap( configManager::inst()->artworkDir() + + name ); + } +#else + // look whether icon is in artwork-dir + QPixmap p( configManager::inst()->artworkDir() + name ); +#endif + if( p.isNull() ) + { + // nothing found, so look in default-artwork-dir + p = + QPixmap( configManager::inst()->defaultArtworkDir() + name ); + } + if( p.isNull() ) + { #ifdef QT4 - const embed::descriptor & e = findEmbeddedData( + const embed::descriptor & e = findEmbeddedData( name.toAscii().constData() ); #else - const embed::descriptor & e = findEmbeddedData( name.ascii() ); + const embed::descriptor & e = findEmbeddedData( + name.ascii() ); #endif - // not found? - if( QString( e.name ) != name ) - { - // then look whether icon is in data-dir - QPixmap p( configManager::inst()->artworkDir() + name ); - if( p.isNull() ) + // found? + if( QString( e.name ) == name ) + { + p.loadFromData( e.data, e.size ); + } + else { p = QPixmap( 1, 1 ); } - return( p ); } - QPixmap p; - p.loadFromData( e.data, e.size ); return( p ); } #ifdef QT4 @@ -102,38 +117,6 @@ QString getText( const char * _name ) } - -void loadTranslation( const QString & _tname ) -{ - QTranslator * t = new QTranslator( 0 ); - QString name = _tname + ".qm"; - -#if QT_VERSION >= 0x030100 - -#ifdef QT4 - const embed::descriptor & e = findEmbeddedData( - name.toAscii().constData() ); -#else - const embed::descriptor & e = findEmbeddedData( name.ascii() ); -#endif - // not found? - if( QString( e.name ) != name ) - { -#endif - // then look whether translation is in data-dir - t->load( name, configManager::inst()->localeDir() ); -#if QT_VERSION >= 0x030100 - } - else - { - t->load( e.data, (int) e.size ); - } -#endif - - qApp->installTranslator( t ); -} - - } diff --git a/src/widgets/group_box.cpp b/src/widgets/group_box.cpp index a85149da8..2d5ed2041 100644 --- a/src/widgets/group_box.cpp +++ b/src/widgets/group_box.cpp @@ -221,7 +221,7 @@ void groupBox::updatePixmap( void ) //p.setPen( QColor( 255, 255, 255 ) ); - p.setPen( colorGroup().highlight() ); + p.setPen( colorGroup().buttonText() ); p.setFont( pointSize<7>( font() ) ); p.drawText( 22, 10, m_caption ); diff --git a/src/widgets/tab_widget.cpp b/src/widgets/tab_widget.cpp index ad8f03123..12a5c139f 100644 --- a/src/widgets/tab_widget.cpp +++ b/src/widgets/tab_widget.cpp @@ -54,13 +54,22 @@ tabWidget::tabWidget( const QString & _caption, QWidget * _parent ) : m_caption( _caption ) { setFont( pointSize<7>( font() ) ); -#ifdef QT4 +/*#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*/ + QColor bg_color = QApplication::palette().active().background().dark( + 132 ); +#ifdef QT4 + QPalette pal = palette(); + pal.setColor( QPalette::Background, bg_color ); + setPalette( pal ); +#else + setPaletteBackgroundColor( bg_color ); #endif } diff --git a/src/widgets/tempo_sync_knob.cpp b/src/widgets/tempo_sync_knob.cpp index b286eb9f4..6477ceb6f 100644 --- a/src/widgets/tempo_sync_knob.cpp +++ b/src/widgets/tempo_sync_knob.cpp @@ -60,7 +60,7 @@ tempoSyncKnob::tempoSyncKnob( int _knob_num, QWidget * _parent, knob( _knob_num, _parent, _name, _engine ), m_tempoSyncMode( NO_SYNC ), m_scale( _scale ), - m_tempoSyncIcon( embed::getIconPixmap( "xclock" ) ), + m_tempoSyncIcon( embed::getIconPixmap( "tempo_sync" ) ), m_tempoSyncDescription( tr( "Tempo Sync" ) ), m_tempoLastSyncMode( NO_SYNC ) { @@ -301,7 +301,7 @@ void tempoSyncKnob::calculateTempoSyncTime( bpm_t _bpm ) else { m_tempoSyncDescription = tr( "Tempo Sync" ); - m_tempoSyncIcon = embed::getIconPixmap( "xclock" ); + m_tempoSyncIcon = embed::getIconPixmap( "tempo_sync" ); } if( m_tempoSyncMode != m_tempoLastSyncMode )