diff --git a/ChangeLog b/ChangeLog index 4e9a32d7d..8482e6666 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,18 +1,93 @@ +2006-02-22 Tobias Doerffel + + * configure.in: + * Makefile.am: + * src/lmms_single_source.cpp: + added support for compiling LMMS from one source file which often + results in a better/more optimized executable + + * include/note.h: + * include/piano_roll.h: + * src/core/note.cpp: + * src/core/piano_roll.cpp: + - simple quantization-support + - fixed lengths for drawing notes can be selected in piano-roll + + * resources/black_key.png: + * resources/black_key_pressed.png: + * resources/pr_black_key.png: + * resources/pr_white_key_big.png: + * resources/pr_white_key_small.png: + * resources/white_key.png: + * resources/white_key_pressed.png: + replaced by new graphics + + * src/core/engine.cpp: + delete piano-roll after song-editor and bb-editor as patterns being + destroyed still depend on it + +2006-02-21 Tobias Doerffel + + * src/tracks/channel_track.cpp: + do not lock mutex in processOutEvent() as it causes a deadlock when + having channel-activity-indicators enabled + + * include/midi_mapper.h + * include/project_notes.h: + * src/lib/sample_buffer.cpp: + * src/midi/midi_file.cpp: + * src/midi/midi_mapper.cpp: + * src/widgets/project_notes.cpp: + misc fixes for being able to compile LMMS from one source-file + + * include/automatable_object.h: + * include/knob.h: + * include/lcd_spinbox.h: + * include/led_checkbox.h: + * src/widgets/knob.cpp: + * src/widgets/led_checkbox.cpp: + * src/widgets/lcd_spinbox.cpp: + introduced template-class automatableObject for central value- + manipulation, range-checking etc. and made some classes (e.g. knob, + ledCheckBox, lcdCheckBox) derive from it - preparations for full + automation-support in LMMS + + * Makefile.am: + do not strip executable when installing as it makes even basic debugging + impossible + +2006-02-20 Tobias Doerffel + + * src/widgets/combobox.cpp: + * src/widgets/knob.cpp: + * src/widgets/led_checkbox.cpp: + draw shadowed text + + * include/mixer.h: + * src/core/arp_and_chords_tab_widget.cpp: + * src/core/mixer.cpp: + better xrun-detection and -handling (still not perfect) + + * include/mixer.h: + * src/tracks/channel_track.cpp: + fixed critical bug which made LMMS crash if xruns were detected and + notes were discarded by mixer and therefore deleted twice + 2006-02-19 Andreas Brandmaier - * plugins/organic/organic.cpp - * plugins/organic/organic.h - * presets/Organic - * presets/Bitinvader + * plugins/organic/organic.cpp: + * plugins/organic/organic.h: + * presets/Organic: + * presets/Bitinvader: added waveshape knob changed distortion method from clipping to foldback renamed and added presets for Organic and BitInvader 2006-02-18 Andreas Brandmaier - * plugins/organic/organic.cpp - * plugins/organic/organic.h - * presets/Organic + * plugins/organic/organic.cpp: + * plugins/organic/organic.h: + * presets/Organic: added new plugin synthesizer plugin organic and some presets 2006-02-09 Tobias Doerffel diff --git a/Makefile.am b/Makefile.am index 08e895745..3cce1d2a9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,9 +4,9 @@ dist-hook: rm -rf `find $(distdir) -name \*.moc` -install-exec-hook: - cd $(DESTDIR)$(bindir) ; \ - strip lmms +#install-exec-hook: +# cd $(DESTDIR)$(bindir) ; \ +# strip lmms if HAVE_RPM @@ -188,6 +188,7 @@ lmms_SOURCES = \ $(srcdir)/src/widgets/tool_button.cpp \ $(srcdir)/src/widgets/tooltip.cpp \ $(srcdir)/src/widgets/visualization_widget.cpp \ + $(srcdir)/src/lmms_single_source.cpp \ $(srcdir)/include/pch.h \ $(srcdir)/include/debug.h \ $(srcdir)/include/main_window.h \ @@ -294,6 +295,7 @@ lmms_SOURCES = \ $(srcdir)/include/combobox.h \ $(srcdir)/include/rubberband.h \ $(srcdir)/include/base64.h \ + $(srcdir)/include/automatable_object.h \ $(srcdir)/include/qxembed.h diff --git a/TODO b/TODO index 40e55d733..f6921f581 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,6 @@ to be done as soon as possible: +- KNOB-setValue!!! - separate GUI and data/sound-processing-code - fix qtimer-problem /channel-activity-LEDs - make color-scheme switchable: LMMS / user diff --git a/configure.in b/configure.in index d40035949..fc87a7d82 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-cvs20060209, tobydox/at/users/dot/sourceforge/dot/net) -AM_INIT_AUTOMAKE(lmms, 0.1.4-cvs20060209) +AC_INIT(lmms, 0.1.4-cvs20060222, tobydox/at/users/dot/sourceforge/dot/net) +AM_INIT_AUTOMAKE(lmms, 0.1.4-cvs20060222) AM_CONFIG_HEADER(config.h) @@ -330,6 +330,21 @@ else AC_MSG_RESULT(no) fi +# check whether to disable single-source-compile +AC_MSG_CHECKING([whether to disable single-source-compile]) +# AH_TEMPLATE(SINGLE_SOURCE_COMPILE, [Define if you want to enable single-source-compile.]) +AC_ARG_ENABLE([ssc], + AS_HELP_STRING([--disable-ssc], + [disable single-source-compile]), NO_SSC="true") +if test ! "x$NO_SSC" = "xtrue" ; then + AC_MSG_RESULT(no) + # AC_DEFINE(SINGLE_SOURCE_COMPILE) + CXXFLAGS="$CXXFLAGS -DSINGLE_SOURCE_COMPILE" +else + AC_MSG_RESULT(yes) +fi + + # check whether compiler of current platform supports attribute regparm(x) AC_MSG_CHECKING([whether we can use function-attribute regparm(x) on current platform]) diff --git a/include/automatable_object.h b/include/automatable_object.h new file mode 100755 index 000000000..4f96a9740 --- /dev/null +++ b/include/automatable_object.h @@ -0,0 +1,198 @@ +/* + * automatable_object.h - declaration of class automatableObject + * + * Copyright (c) 2006 Tobias Doerffel + * + * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + */ + + +#ifndef _AUTOMATABLE_OBJECT_H +#define _AUTOMATABLE_OBJECT_H + +#include + +#include "templates.h" + +template +class automatableObject +{ +public: + automatableObject( const T _val = 0, const T _min = 0, + const T _max = 0, const T _step = 1 ) : + m_value( _val ), + m_minValue( _min ), + m_maxValue( _max ), + m_step( _step ) + { + } + + virtual ~automatableObject() + { + } + + static inline T minRelStep( void ) + { + return( 1 ); + } + + static inline T defaultRelStep( void ) + { + return( 1 ); + } + + static inline T minEps( void ) + { + return( 1 ); + } + + + inline virtual T value( void ) const + { + return( m_value ); + } + + inline virtual T minValue( void ) const + { + return( m_minValue ); + } + + inline virtual T maxValue( void ) const + { + return( m_maxValue ); + } + + inline virtual T step( void ) const + { + return( m_step ); + } + + + inline virtual void setValue( const T _value ) + { + m_value = tLimit( _value, minValue(), maxValue() ); + if( m_step != 0 ) + { + m_value = static_cast( floorf( m_value / m_step ) * + m_step ); + } + else + { + m_value = m_minValue; + } + + // correct rounding error at the border + if( tAbs( m_value - m_maxValue ) < minEps() * + tAbs( m_step ) ) + { + m_value = m_maxValue; + } + + // correct rounding error if value = 0 + if( tAbs( m_value ) < minEps() * tAbs( m_step ) ) + { + m_value = 0; + } + } + + inline virtual void incValue( int _steps ) + { + setValue( m_value + _steps * m_step ); + } + + inline virtual void setRange( const T _min, const T _max, + const T _step = 0 ) + { + m_minValue = _min; + m_maxValue = _max; + setStep( _step ); + if( m_minValue > m_maxValue ) + { + qSwap( m_minValue, m_maxValue ); + } + // re-adjust value + setValue( value() ); + } + + inline virtual void setStep( const T _step ) + { + /* + const T intv = maxValue() - minValue(); + + if( _step == 0 ) + { + m_step = intv * defaultRelStep(); + } + else + { + if( ( intv > 0 ) && ( _step < 0 ) || ( intv < 0 ) && + ( _step > 0 ) ) + { + m_step = -_step; + } + else + { + m_step = _step; + } + if( tAbs( m_step ) < + tAbs( minRelStep() * intv ) ) + { + m_step = minRelStep() * intv; + } + }*/ + m_step = _step; + } + + +private: + T m_value; + T m_minValue; + T m_maxValue; + T m_step; + +} ; + + + +template<> +inline float automatableObject::minRelStep( void ) +{ + return( 1.0e-10 ); +} + + + +template<> +inline float automatableObject::defaultRelStep( void ) +{ + return( 1.0e-2 ); +} + + +template<> +inline float automatableObject::minEps( void ) +{ + return( 1.0e-10 ); +} + + + + +#endif + diff --git a/include/group_box.h b/include/group_box.h index e033e8a58..af14dcab1 100644 --- a/include/group_box.h +++ b/include/group_box.h @@ -1,7 +1,7 @@ /* * group_box.h - LMMS-groupbox * - * Copyright (c) 2005 Tobias Doerffel + * Copyright (c) 2005-2006 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -48,7 +48,7 @@ class groupBox : public QWidget Q_OBJECT public: groupBox( const QString & _caption, QWidget * _parent ); - ~groupBox(); + virtual ~groupBox(); bool isActive( void ) const { diff --git a/include/instrument_play_handle.h b/include/instrument_play_handle.h index 834e96483..4e0147e9e 100644 --- a/include/instrument_play_handle.h +++ b/include/instrument_play_handle.h @@ -33,7 +33,7 @@ class instrumentPlayHandle : public playHandle { public: - inline instrumentPlayHandle( instrument * _instrument ) FASTCALL : + inline instrumentPlayHandle( instrument * _instrument ) : playHandle( INSTRUMENT_PLAY_HANDLE, _instrument->eng() ), m_instrument( _instrument ) { diff --git a/include/knob.h b/include/knob.h index 8b186639f..f1596faff 100644 --- a/include/knob.h +++ b/include/knob.h @@ -45,6 +45,7 @@ #include "engine.h" +#include "automatable_object.h" class QPixmap; @@ -58,7 +59,8 @@ enum knobTypes -class knob : public QWidget, public engineObject +class knob : public QWidget, public engineObject, + public automatableObject { Q_OBJECT public: @@ -73,10 +75,18 @@ public: void setTotalAngle( float _angle ); - void setRange( float _vmin, float _vmax, float _vstep = 0.0, - int _pagesize = 1 ); + inline void setInitValue( const float _val ) + { + m_initValue = _val; + setValue( _val ); + } - inline float value( void ) const + virtual void setValue( const float _x ); + + virtual void setRange( const float _min, const float _max, + const float _step = 0.0 ); + +/* inline float value( void ) const { return( m_value ); } @@ -90,19 +100,19 @@ public: inline float minValue( void ) const { return( m_minValue ); - } + }*/ - inline void incPages( int _n_pages ) +/* inline void incPages( int _n_pages ) { - setNewValue( m_value + float( _n_pages ) * m_pageSize, 1 ); - } + setNewValue( value() + float( _n_pages ) * m_pageSize, 1 ); + }*/ public slots: - void setValue( float _val, bool _is_init_value = FALSE ); +/* void setValue( float _val, bool _is_init_value = FALSE ); void fitValue( float _val ); - void incValue( int _steps ); + void incValue( int _steps );*/ void reset( void ); void copyValue( void ); void pasteValue( void ); @@ -148,7 +158,6 @@ protected: void buttonReleased( void ); - void setNewValue( float _x, bool _align = FALSE ); static float s_copiedValue; @@ -160,6 +169,7 @@ protected: bool m_buttonPressed; + float m_pageSize; float m_angle; float m_totalAngle; @@ -170,14 +180,6 @@ protected: QString m_label; - float m_minValue; - float m_maxValue; - float m_step; - float m_pageSize; - float m_value; - float m_exactValue; - float m_exactPrevValue; - float m_prevValue; float m_initValue; } ; diff --git a/include/lcd_spinbox.h b/include/lcd_spinbox.h index 09838803b..97ea2c16f 100644 --- a/include/lcd_spinbox.h +++ b/include/lcd_spinbox.h @@ -41,22 +41,25 @@ #endif +#include "automatable_object.h" + + class QLabel; -class lcdSpinBox : public QWidget +class lcdSpinBox : public QWidget, public automatableObject { Q_OBJECT public: lcdSpinBox( int _min, int _max, int _num_digits, QWidget * _parent ); virtual ~lcdSpinBox(); - void setStep( int _step ); + virtual void setStep( const int _step ); - inline int value( void ) const +/* inline int value( void ) const { return( m_number->intValue() ); - } + }*/ void setLabel( const QString & _txt ); @@ -67,7 +70,7 @@ public: public slots: - void setValue( int _value ); + virtual void setValue( const int _value ); virtual void setEnabled( bool _on ); @@ -81,10 +84,10 @@ protected: private: QMap m_textForValue; - int m_value; +/* int m_value; int m_minValue; int m_maxValue; - int m_step; + int m_step;*/ QLCDNumber * m_number; QLabel * m_label; diff --git a/include/led_checkbox.h b/include/led_checkbox.h index 5e648715b..07d1670b7 100644 --- a/include/led_checkbox.h +++ b/include/led_checkbox.h @@ -1,7 +1,7 @@ /* * led_checkbox.h - class ledCheckBox, an improved QCheckBox * - * Copyright (c) 2005 Tobias Doerffel + * Copyright (c) 2005-2006 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -39,10 +39,13 @@ #endif +#include "automatable_object.h" + + class QPixmap; -class ledCheckBox : public QWidget +class ledCheckBox : public QWidget, public automatableObject { Q_OBJECT public: @@ -58,7 +61,7 @@ public: inline bool isChecked( void ) const { - return( m_checked ); + return( value() ); } inline const QString & text( void ) @@ -81,7 +84,6 @@ private: QPixmap * m_ledOnPixmap; QPixmap * m_ledOffPixmap; - bool m_checked; QString m_text; signals: diff --git a/include/midi_mapper.h b/include/midi_mapper.h index de66fbbd8..a96d3a887 100644 --- a/include/midi_mapper.h +++ b/include/midi_mapper.h @@ -1,7 +1,7 @@ /* * midi_mapper.h - MIDI-mapper for any midiDevice * - * Copyright (c) 2005 Tobias Doerffel + * Copyright (c) 2005-2006 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -43,11 +43,11 @@ #include "types.h" - +#include "midi.h" const Uint8 MIDI_PROGRAMS = 128; const Uint8 MIDI_KEYS = 128; -const Uint8 MIDI_CHANNELS = 16; + class midiMapper { @@ -104,7 +104,7 @@ private: QPair m_patchMap[MIDI_PROGRAMS]; QPair m_drumsetKeyMap[MIDI_KEYS]; - Uint8 m_channelMap[MIDI_CHANNELS]; + Uint8 m_channelMap[MIDI_CHANNEL_COUNT]; Uint8 m_drumsetChannel; Uint8 m_drumsetPatch; diff --git a/include/mixer.h b/include/mixer.h index 624530b4c..b113d2aa8 100644 --- a/include/mixer.h +++ b/include/mixer.h @@ -161,16 +161,18 @@ public: // play-handle stuff - inline void addPlayHandle( playHandle * _ph ) + inline bool addPlayHandle( playHandle * _ph ) { if( criticalXRuns() == FALSE ) { m_playHandles.push_back( _ph ); + return( TRUE ); } else { delete _ph; } + return( FALSE ); } inline void removePlayHandle( playHandle * _ph ) diff --git a/include/note.h b/include/note.h index a236716d7..c710bdd36 100644 --- a/include/note.h +++ b/include/note.h @@ -101,11 +101,13 @@ public: void FASTCALL setLength( const midiTime & _length ); void FASTCALL setPos( const midiTime & _pos ); - void FASTCALL setTone( tones _tone = C ); - void FASTCALL setOctave( octaves _octave = DEFAULT_OCTAVE ); - void FASTCALL setKey( int _key ); - void FASTCALL setVolume( volume _volume = DEFAULT_VOLUME ); - void FASTCALL setPanning( panning _panning = DEFAULT_PANNING ); + void FASTCALL setTone( const tones _tone = C ); + void FASTCALL setOctave( const octaves _octave = DEFAULT_OCTAVE ); + void FASTCALL setKey( const int _key ); + void FASTCALL setVolume( const volume _volume = DEFAULT_VOLUME ); + void FASTCALL setPanning( const panning _panning = DEFAULT_PANNING ); + void FASTCALL quantizeLength( const int _q_grid ); + void FASTCALL quantizePos( const int _q_grid ); inline midiTime endPos( void ) const { @@ -162,6 +164,8 @@ public: private: + midiTime FASTCALL quantized( const midiTime & _m, const int _q_grid ); + tones m_tone; octaves m_octave; volume m_volume; diff --git a/include/note_play_handle.h b/include/note_play_handle.h index b8b5abc5e..d6c8c1f96 100644 --- a/include/note_play_handle.h +++ b/include/note_play_handle.h @@ -47,7 +47,7 @@ public: notePlayHandle( channelTrack * _chnl_trk, const f_cnt_t _frames_ahead, const f_cnt_t _frames, note * _n, - const bool _arp_note = FALSE ) FASTCALL; + const bool _arp_note = FALSE ); virtual ~notePlayHandle(); diff --git a/include/piano_roll.h b/include/piano_roll.h index 139ac2f44..2c23465fa 100644 --- a/include/piano_roll.h +++ b/include/piano_roll.h @@ -80,6 +80,8 @@ public: return( m_pattern != NULL ); } + int quantization( void ) const; + public slots: virtual void update( void ); @@ -165,6 +167,8 @@ private: pianoRoll( const pianoRoll & ); virtual ~pianoRoll(); + midiTime newNoteLen( void ) const; + static QPixmap * s_whiteKeyBigPm; static QPixmap * s_whiteKeySmallPm; @@ -193,6 +197,8 @@ private: toolButton * m_pasteButton; comboBox * m_zoomingComboBox; + comboBox * m_quantizeComboBox; + comboBox * m_noteLenComboBox; QPixmap m_paintPixmap; bool m_cursorInside; diff --git a/include/play_handle.h b/include/play_handle.h index 9e3a5ad28..fb271844c 100644 --- a/include/play_handle.h +++ b/include/play_handle.h @@ -56,7 +56,7 @@ public: PRESET_PREVIEW_PLAY_HANDLE } ; - inline playHandle( const types _type, engine * _engine ) FASTCALL : + playHandle( const types _type, engine * _engine ) : engineObject( _engine ), m_type( _type ) { diff --git a/include/preset_preview_play_handle.h b/include/preset_preview_play_handle.h index 7dfa8f94f..1ea11eeb5 100644 --- a/include/preset_preview_play_handle.h +++ b/include/preset_preview_play_handle.h @@ -53,7 +53,7 @@ class presetPreviewPlayHandle : public playHandle { public: presetPreviewPlayHandle( const QString & _preset_file, - engine * _engine ) FASTCALL; + engine * _engine ); virtual ~presetPreviewPlayHandle(); virtual void play( void ); diff --git a/include/project_notes.h b/include/project_notes.h index 893cfb317..496622aec 100644 --- a/include/project_notes.h +++ b/include/project_notes.h @@ -35,6 +35,7 @@ #else #include +#define textColor color #endif diff --git a/include/sample_play_handle.h b/include/sample_play_handle.h index 049659f0a..2a55fe711 100644 --- a/include/sample_play_handle.h +++ b/include/sample_play_handle.h @@ -37,9 +37,8 @@ class audioPort; class samplePlayHandle : public playHandle { public: - samplePlayHandle( const QString & _sample_file, engine * _engine ) - FASTCALL; - samplePlayHandle( sampleBuffer * _sample_buffer ) FASTCALL; + samplePlayHandle( const QString & _sample_file, engine * _engine ); + samplePlayHandle( sampleBuffer * _sample_buffer ); virtual ~samplePlayHandle(); virtual void play( void ); diff --git a/lmms.1 b/lmms.1 index 398cea0bc..b2940de7a 100644 --- a/lmms.1 +++ b/lmms.1 @@ -2,7 +2,7 @@ .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) -.TH LMMS 1 "February 01, 2006" +.TH LMMS 1 "February 20, 2006" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: @@ -30,9 +30,9 @@ lmms \- software for easy music-production .\" \fI\fP escape sequences to invode bold face and italics, .\" respectively. .B LMMS -aims to be a free alternative to popular (but commercial and closed- source) programs like FruityLoops, Cubase and Logic giving you the ability of producing music with your computer by creating cool loops, synthesizing and mixing sounds, arranging samples, having fun with your MIDI-keyboard and much more... +aims to be a free alternative to popular (but commercial and closed-source) programs such as FL Studio, Cubase and Logic giving you the ability of producing music with your computer by creating cool loops, synthesizing and mixing sounds, arranging samples, having fun with your MIDI-keyboard and much more... -LMMS combines the features of a tracker-/sequencer-program (pattern-/channel-/ sample-/song-/effect-management) and those of powerful instrument-plugins and samplers in a modern, user-friendly and easy to use graphical user-interface. +LMMS combines the features of a tracker-/sequencer-program (pattern-/channel-/sample-/song-/effect-management) and those of powerful instrument-plugins and samplers in a modern, user-friendly and easy to use graphical user-interface. .SH OPTIONS .IP "\fB\-r, --render\fP \fIfile\fP @@ -45,5 +45,4 @@ Specify format of render-output where \fIformat\fP is either 'wav' or 'ogg' lmms was written by Tobias Doerffel and others. See AUTHORS for details. .PP This manual page was written by Florian Ragwitz and -Tobias Doerffel , for the Debian project (but may be -used by others). +Tobias Doerffel , for the Debian project (but may be used by others). diff --git a/plugins/audio_file_processor/audio_file_processor.cpp b/plugins/audio_file_processor/audio_file_processor.cpp index 6ae759318..80db32c99 100644 --- a/plugins/audio_file_processor/audio_file_processor.cpp +++ b/plugins/audio_file_processor/audio_file_processor.cpp @@ -60,6 +60,7 @@ #include "string_pair_drag.h" #include "mmp.h" +#undef SINGLE_SOURCE_COMPILE #include "embed.cpp" @@ -171,7 +172,7 @@ audioFileProcessor::audioFileProcessor( channelTrack * _channel_track ) : m_ampKnob = new knob( knobDark_28, this, tr( "Amplify" ), eng() ); m_ampKnob->setRange( 0, 500, 1.0f ); m_ampKnob->move( 6, 114 ); - m_ampKnob->setValue( 100.0f, TRUE ); + m_ampKnob->setInitValue( 100.0f ); m_ampKnob->setHintText( tr( "Amplify:" )+" ", "%" ); m_ampKnob->setLabel( tr( "AMP" ) ); connect( m_ampKnob, SIGNAL( valueChanged( float ) ), this, @@ -190,7 +191,7 @@ audioFileProcessor::audioFileProcessor( channelTrack * _channel_track ) : eng() ); m_startKnob->setRange( 0.0f, 1.0f, 0.00001f ); m_startKnob->move( 46, 114 ); - m_startKnob->setValue( 0.0f, TRUE ); + m_startKnob->setInitValue( 0.0f ); m_startKnob->setHintText( tr( "Startpoint:" )+" ", "" ); m_startKnob->setLabel( tr( "START" ) ); connect( m_startKnob, SIGNAL( valueChanged( float ) ), this, @@ -209,7 +210,7 @@ audioFileProcessor::audioFileProcessor( channelTrack * _channel_track ) : m_endKnob = new knob( knobDark_28, this, tr( "End of sample" ), eng() ); m_endKnob->setRange( 0.0f, 1.0f, 0.00001f ); m_endKnob->move( 84, 114 ); - m_endKnob->setValue( 1.0f, TRUE ); + m_endKnob->setInitValue( 1.0f ); m_endKnob->setHintText( tr( "Endpoint:" )+" ", "" ); m_endKnob->setLabel( tr( "END" ) ); connect( m_endKnob, SIGNAL( valueChanged( float ) ), this, diff --git a/plugins/bit_invader/bit_invader.cpp b/plugins/bit_invader/bit_invader.cpp index 0576a4657..dded118eb 100644 --- a/plugins/bit_invader/bit_invader.cpp +++ b/plugins/bit_invader/bit_invader.cpp @@ -67,9 +67,10 @@ using namespace std; #include "song_editor.h" #include "oscillator.h" #include "sample_buffer.h" -#include "embed.cpp" #include "base64.h" +#undef SINGLE_SOURCE_COMPILE +#include "embed.cpp" extern "C" { @@ -193,7 +194,7 @@ bitInvader::bitInvader( channelTrack * _channel_track ) : m_sampleLengthKnob = new knob( knobDark_28, this, tr( "Samplelength" ), eng() ); m_sampleLengthKnob->setRange( 8, 128, 1 ); - m_sampleLengthKnob->setValue( 128, TRUE ); + m_sampleLengthKnob->setInitValue( 128 ); m_sampleLengthKnob->move( 10, 120 ); m_sampleLengthKnob->setHintText( tr( "Sample Length" ) + " ", "" ); diff --git a/plugins/organic/organic.cpp b/plugins/organic/organic.cpp index b81304652..336d9f79b 100644 --- a/plugins/organic/organic.cpp +++ b/plugins/organic/organic.cpp @@ -67,9 +67,11 @@ using namespace std; #include "song_editor.h" #include "oscillator.h" #include "sample_buffer.h" -#include "embed.cpp" #include "base64.h" +#undef SINGLE_SOURCE_COMPILE +#include "embed.cpp" + extern "C" { @@ -120,7 +122,7 @@ organicInstrument::organicInstrument( channelTrack * _channel_track ) : "Osc %1 waveform" ).arg( i+1 ), eng() ); m_osc[i].oscKnob->move( 25+i*20, 90 ); m_osc[i].oscKnob->setRange( 0.0f, 5.0f, 0.25f ); - m_osc[i].oscKnob->setValue( 0.0f, TRUE ); + m_osc[i].oscKnob->setInitValue( 0.0f ); m_osc[i].oscKnob->setHintText( tr( "Osc %1 waveform:" ).arg( i+1 ) + " ", "%" ); @@ -133,7 +135,7 @@ organicInstrument::organicInstrument( channelTrack * _channel_track ) : "Osc %1 volume" ).arg( i+1 ), eng() ); m_osc[i].volKnob->move( 25+i*20, 110 ); m_osc[i].volKnob->setRange( 0, 100, 1.0f ); - m_osc[i].volKnob->setValue( 100, TRUE ); + m_osc[i].volKnob->setInitValue( 100 ); m_osc[i].volKnob->setHintText( tr( "Osc %1 volume:" ).arg( i+1 ) + " ", "%" ); @@ -142,7 +144,7 @@ organicInstrument::organicInstrument( channelTrack * _channel_track ) : tr( "Osc %1 panning" ).arg( i + 1 ), eng() ); m_osc[i].panKnob->move( 25+i*20, 130 ); m_osc[i].panKnob->setRange( PANNING_LEFT, PANNING_RIGHT, 1.0f ); - m_osc[i].panKnob->setValue( DEFAULT_PANNING, TRUE ); + m_osc[i].panKnob->setInitValue( DEFAULT_PANNING ); m_osc[i].panKnob->setHintText( tr("Osc %1 panning:").arg( i+1 ) + " ", "" ); @@ -152,7 +154,7 @@ organicInstrument::organicInstrument( channelTrack * _channel_track ) : eng() ); m_osc[i].detuneKnob->move( 25+i*20, 150 ); m_osc[i].detuneKnob->setRange( -100.0f, 100.0f, 1.0f ); - m_osc[i].detuneKnob->setValue( 0.0f, TRUE ); + m_osc[i].detuneKnob->setInitValue( 0.0f ); m_osc[i].detuneKnob->setHintText( tr( "Osc %1 fine detuning " "left:" ).arg( i + 1 ) + " ", " " + @@ -164,18 +166,17 @@ organicInstrument::organicInstrument( channelTrack * _channel_track ) : // setup knob for FX1 fx1Knob = new knob( knobGreen_17, this, - tr( "FX1" ), - eng() ); + tr( "FX1" ), eng() ); fx1Knob->move( 20, 200 ); fx1Knob->setRange( 0.0f, 0.99f, 0.01f ); - fx1Knob->setValue( 0.0f, TRUE ); + fx1Knob->setInitValue( 0.0f); // setup volume-knob volKnob = new knob( knobGreen_17, this, tr( "Osc %1 volume" ).arg( 1 ), eng() ); volKnob->move( 50, 200 ); volKnob->setRange( 0, 200, 1.0f ); - volKnob->setValue( 100, TRUE ); + volKnob->setInitValue( 100 ); volKnob->setHintText( tr( "Osc %1 volume:" ).arg( 1 ) + " ", "%" ); diff --git a/plugins/plucked_string_synth/plucked_string_synth.cpp b/plugins/plucked_string_synth/plucked_string_synth.cpp index 80a7d7358..8258d63b8 100644 --- a/plugins/plucked_string_synth/plucked_string_synth.cpp +++ b/plugins/plucked_string_synth/plucked_string_synth.cpp @@ -45,6 +45,7 @@ #include "buffer_allocator.h" #include "knob.h" +#undef SINGLE_SOURCE_COMPILE #include "embed.cpp" @@ -75,14 +76,14 @@ pluckedStringSynth::pluckedStringSynth( channelTrack * _channel_track ) : m_pickKnob = new knob( knobDark_28, this, tr( "Pick position" ), eng() ); m_pickKnob->setRange( 0.0f, 0.5f, 0.005f ); - m_pickKnob->setValue( 0.0f, TRUE ); + m_pickKnob->setInitValue( 0.0f ); m_pickKnob->move( 86, 134 ); m_pickKnob->setHintText( tr( "Pick position:" ) + " ", "" ); m_pickupKnob = new knob( knobDark_28, this, tr( "Pickup position" ), eng() ); m_pickupKnob->setRange( 0.0f, 0.5f, 0.005f ); - m_pickupKnob->setValue( 0.05f, TRUE ); + m_pickupKnob->setInitValue( 0.05f ); m_pickupKnob->move( 138, 134 ); m_pickupKnob->setHintText( tr( "Pickup position:" ) + " ", "" ); #ifdef QT4 diff --git a/plugins/triple_oscillator/triple_oscillator.cpp b/plugins/triple_oscillator/triple_oscillator.cpp index 3c8ea9cf1..0555ee93a 100644 --- a/plugins/triple_oscillator/triple_oscillator.cpp +++ b/plugins/triple_oscillator/triple_oscillator.cpp @@ -56,6 +56,7 @@ #include "tooltip.h" #include "sample_buffer.h" +#undef SINGLE_SOURCE_COMPILE #include "embed.cpp" @@ -268,7 +269,7 @@ tripleOscillator::tripleOscillator( channelTrack * _channel_track ) : "Osc %1 volume" ).arg( i+1 ), eng() ); m_osc[i].volKnob->move( 6, 104+i*50 ); m_osc[i].volKnob->setRange( MIN_VOLUME, MAX_VOLUME, 1.0f ); - m_osc[i].volKnob->setValue( DEFAULT_VOLUME / 3, TRUE ); + m_osc[i].volKnob->setInitValue( DEFAULT_VOLUME / 3 ); m_osc[i].volKnob->setHintText( tr( "Osc %1 volume:" ).arg( i+1 ) + " ", "%" ); #ifdef QT4 @@ -287,7 +288,7 @@ tripleOscillator::tripleOscillator( channelTrack * _channel_track ) : tr( "Osc %1 panning" ).arg( i + 1 ), eng() ); m_osc[i].panKnob->move( 33, 104+i*50 ); m_osc[i].panKnob->setRange( PANNING_LEFT, PANNING_RIGHT, 1.0f ); - m_osc[i].panKnob->setValue( DEFAULT_PANNING, TRUE ); + m_osc[i].panKnob->setInitValue( DEFAULT_PANNING ); m_osc[i].panKnob->setHintText( tr("Osc %1 panning:").arg( i+1 ) + " ", "" ); #ifdef QT4 @@ -307,7 +308,7 @@ tripleOscillator::tripleOscillator( channelTrack * _channel_track ) : m_osc[i].coarseKnob->move( 66, 104 + i * 50 ); m_osc[i].coarseKnob->setRange( -2 * NOTES_PER_OCTAVE, 2 * NOTES_PER_OCTAVE, 1.0f ); - m_osc[i].coarseKnob->setValue( 0.0f, TRUE ); + m_osc[i].coarseKnob->setInitValue( 0.0f ); m_osc[i].coarseKnob->setHintText( tr( "Osc %1 coarse detuning:" ).arg( i + 1 ) + " ", " " + tr( "semitones" ) ); @@ -328,7 +329,7 @@ tripleOscillator::tripleOscillator( channelTrack * _channel_track ) : eng() ); m_osc[i].fineLKnob->move( 90, 104 + i * 50 ); m_osc[i].fineLKnob->setRange( -100.0f, 100.0f, 1.0f ); - m_osc[i].fineLKnob->setValue( 0.0f, TRUE ); + m_osc[i].fineLKnob->setInitValue( 0.0f ); m_osc[i].fineLKnob->setHintText( tr( "Osc %1 fine detuning " "left:" ).arg( i + 1 ) + " ", " " + @@ -350,7 +351,7 @@ tripleOscillator::tripleOscillator( channelTrack * _channel_track ) : ).arg( i + 1 ), eng() ); m_osc[i].fineRKnob->move( 110, 104 + i * 50 ); m_osc[i].fineRKnob->setRange( -100.0f, 100.0f, 1.0f ); - m_osc[i].fineRKnob->setValue( 0.0f, TRUE ); + m_osc[i].fineRKnob->setInitValue( 0.0f ); m_osc[i].fineRKnob->setHintText( tr( "Osc %1 fine detuning " "right:").arg( i + 1 ) + " ", " " + tr( "cents" ) ); @@ -372,7 +373,7 @@ tripleOscillator::tripleOscillator( channelTrack * _channel_track ) : eng() ); m_osc[i].phaseOffsetKnob->move( 142, 104 + i * 50 ); m_osc[i].phaseOffsetKnob->setRange( 0.0f, 360.0f, 1.0f ); - m_osc[i].phaseOffsetKnob->setValue( 0.0f, TRUE ); + m_osc[i].phaseOffsetKnob->setInitValue( 0.0f ); m_osc[i].phaseOffsetKnob->setHintText( tr( "Osc %1 phase-" "offset:" ). arg( i + 1 ) + @@ -399,7 +400,7 @@ tripleOscillator::tripleOscillator( channelTrack * _channel_track ) : m_osc[i].stereoPhaseDetuningKnob->move( 166, 104 + i * 50 ); m_osc[i].stereoPhaseDetuningKnob->setRange( 0.0f, 360.0f, 1.0f ); - m_osc[i].stereoPhaseDetuningKnob->setValue( 0.0f, TRUE ); + m_osc[i].stereoPhaseDetuningKnob->setInitValue( 0.0f ); m_osc[i].stereoPhaseDetuningKnob->setHintText( tr("Osc %1 " "stereo phase-" "detuning:" ). diff --git a/plugins/vestige/vestige.cpp b/plugins/vestige/vestige.cpp index 775b3907b..0b722313d 100644 --- a/plugins/vestige/vestige.cpp +++ b/plugins/vestige/vestige.cpp @@ -62,6 +62,7 @@ #include "song_editor.h" #include "lvsl_client.h" +#undef SINGLE_SOURCE_COMPILE #include "embed.cpp" diff --git a/resources/black_key.png b/resources/black_key.png index c63509456..8576bf1fc 100644 Binary files a/resources/black_key.png and b/resources/black_key.png differ diff --git a/resources/black_key_pressed.png b/resources/black_key_pressed.png index c58e28ee6..52e3fdf55 100644 Binary files a/resources/black_key_pressed.png and b/resources/black_key_pressed.png differ diff --git a/resources/note.png b/resources/note.png new file mode 100644 index 000000000..c0fc91255 Binary files /dev/null and b/resources/note.png differ diff --git a/resources/pr_black_key.png b/resources/pr_black_key.png index dcfe29589..86930716e 100644 Binary files a/resources/pr_black_key.png and b/resources/pr_black_key.png differ diff --git a/resources/pr_white_key_big.png b/resources/pr_white_key_big.png index 424e8a8c4..5bb282477 100644 Binary files a/resources/pr_white_key_big.png and b/resources/pr_white_key_big.png differ diff --git a/resources/pr_white_key_small.png b/resources/pr_white_key_small.png index 5715d7686..8e9de995c 100644 Binary files a/resources/pr_white_key_small.png and b/resources/pr_white_key_small.png differ diff --git a/resources/quantize.png b/resources/quantize.png new file mode 100644 index 000000000..2ee28ca5d Binary files /dev/null and b/resources/quantize.png differ diff --git a/resources/white_key.png b/resources/white_key.png index b2ae40a01..73b0c9e32 100644 Binary files a/resources/white_key.png and b/resources/white_key.png differ diff --git a/resources/white_key_pressed.png b/resources/white_key_pressed.png index 4832392f4..05b8927b7 100644 Binary files a/resources/white_key_pressed.png and b/resources/white_key_pressed.png differ diff --git a/src/audio/audio_alsa.cpp b/src/audio/audio_alsa.cpp index a8d3c32b1..1459a2df8 100644 --- a/src/audio/audio_alsa.cpp +++ b/src/audio/audio_alsa.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * audio_alsa.cpp - device-class which implements ALSA-PCM-output * @@ -488,3 +490,5 @@ void audioALSA::setupWidget::saveSettings( void ) #endif + +#endif diff --git a/src/audio/audio_device.cpp b/src/audio/audio_device.cpp index 5b3bd4dd4..5a1327e17 100644 --- a/src/audio/audio_device.cpp +++ b/src/audio/audio_device.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * audio_device.cpp - base-class for audio-devices used by LMMS-mixer * @@ -333,3 +335,5 @@ void FASTCALL audioDevice::clearS16Buffer( int_sample_t * _outbuf, memset( _outbuf, 0, _frames * channels() * BYTES_PER_INT_SAMPLE ); } + +#endif diff --git a/src/audio/audio_file_device.cpp b/src/audio/audio_file_device.cpp index 371b50ea2..8d317e2fa 100644 --- a/src/audio/audio_file_device.cpp +++ b/src/audio/audio_file_device.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * audio_file_device.cpp - base-class for audio-device-classes which write * their output into a file @@ -105,3 +107,5 @@ void audioFileDevice::seekToBegin( void ) m_outputFile.seek( 0 ); } + +#endif diff --git a/src/audio/audio_file_ogg.cpp b/src/audio/audio_file_ogg.cpp index ad9d92013..e4f8f0996 100644 --- a/src/audio/audio_file_ogg.cpp +++ b/src/audio/audio_file_ogg.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * audio_file_ogg.cpp - audio-device which encodes wave-stream and writes it * into an OGG-file. This is used for song-export. @@ -257,3 +259,5 @@ void audioFileOgg::finishEncoding( void ) #endif + +#endif diff --git a/src/audio/audio_file_wave.cpp b/src/audio/audio_file_wave.cpp index b3aa08f03..d120e6782 100644 --- a/src/audio/audio_file_wave.cpp +++ b/src/audio/audio_file_wave.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * audio_file_wave.cpp - audio-device which encodes wave-stream and writes it * into a WAVE-file. This is used for song-export. @@ -120,3 +122,5 @@ void audioFileWave::finishEncoding( void ) writeData( &m_waveFileHeader, sizeof( m_waveFileHeader ) ); } + +#endif diff --git a/src/audio/audio_jack.cpp b/src/audio/audio_jack.cpp index 190a18953..143d874ec 100644 --- a/src/audio/audio_jack.cpp +++ b/src/audio/audio_jack.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * audio_jack.cpp - support for JACK-transport * @@ -476,4 +478,6 @@ void audioJACK::setupWidget::saveSettings( void ) } +#endif + #endif diff --git a/src/audio/audio_oss.cpp b/src/audio/audio_oss.cpp index 64a046dbb..a0f6fd81f 100644 --- a/src/audio/audio_oss.cpp +++ b/src/audio/audio_oss.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * audio_oss.cpp - device-class that implements OSS-PCM-output * @@ -383,3 +385,5 @@ void audioOSS::setupWidget::saveSettings( void ) #endif + +#endif diff --git a/src/audio/audio_port.cpp b/src/audio/audio_port.cpp index 879d60f2d..e1e898343 100644 --- a/src/audio/audio_port.cpp +++ b/src/audio/audio_port.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * audio_port.cpp - base-class for objects providing sound at a port * @@ -102,3 +104,5 @@ void audioPort::setName( const QString & _name ) eng()->getMixer()->audioDev()->renamePort( this ); } + +#endif diff --git a/src/audio/audio_sample_recorder.cpp b/src/audio/audio_sample_recorder.cpp index 3111389b1..0725f13d6 100644 --- a/src/audio/audio_sample_recorder.cpp +++ b/src/audio/audio_sample_recorder.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * audio_sample_recorder.cpp - device-class that implements recording * surround-audio-buffers into RAM, maybe later @@ -113,3 +115,5 @@ void audioSampleRecorder::writeBuffer( const surroundSampleFrame * _ab, } + +#endif diff --git a/src/audio/audio_sdl.cpp b/src/audio/audio_sdl.cpp index 87353799e..fe2e42e80 100644 --- a/src/audio/audio_sdl.cpp +++ b/src/audio/audio_sdl.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * audio_sdl.cpp - device-class that performs PCM-output via SDL * @@ -184,4 +186,6 @@ void audioSDL::setupWidget::saveSettings( void ) } +#endif + #endif diff --git a/src/core/about_dialog.cpp b/src/core/about_dialog.cpp index a6ac79500..9ab694675 100644 --- a/src/core/about_dialog.cpp +++ b/src/core/about_dialog.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * about_dialog.cpp - implementation of about-dialog * @@ -149,3 +151,5 @@ void aboutDialog::resizeEvent( QResizeEvent * _re ) #include "about_dialog.moc" + +#endif diff --git a/src/core/arp_and_chords_tab_widget.cpp b/src/core/arp_and_chords_tab_widget.cpp index e8d472c24..4528af7c8 100644 --- a/src/core/arp_and_chords_tab_widget.cpp +++ b/src/core/arp_and_chords_tab_widget.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * arp_and_chords_tab_widget.cpp - widget for use in arp/chord-tab of * channel-window @@ -224,8 +226,8 @@ arpAndChordsTabWidget::arpAndChordsTabWidget( channelTrack * _channel_track ) : m_chordRangeKnob = new knob( knobBright_26, m_chordsGroupBox, tr( "Chord range" ), eng() ); m_chordRangeKnob->setLabel( tr( "RANGE" ) ); - m_chordRangeKnob->setRange( 1.0, 9.0, 1.0 ); - m_chordRangeKnob->setValue( 1.0, TRUE ); + m_chordRangeKnob->setRange( 1.0f, 9.0f, 1.0f ); + m_chordRangeKnob->setInitValue( 1.0f ); m_chordRangeKnob->move( 164, 24 ); m_chordRangeKnob->setHintText( tr( "Chord range:" ) + " ", " " + tr( "octave(s)" ) ); @@ -276,8 +278,8 @@ arpAndChordsTabWidget::arpAndChordsTabWidget( channelTrack * _channel_track ) : m_arpRangeKnob = new knob( knobBright_26, m_arpGroupBox, tr( "Arpeggio range" ), eng() ); m_arpRangeKnob->setLabel( tr( "RANGE" ) ); - m_arpRangeKnob->setRange( 1.0, 9.0, 1.0 ); - m_arpRangeKnob->setValue( 1.0, TRUE ); + m_arpRangeKnob->setRange( 1.0f, 9.0f, 1.0f ); + m_arpRangeKnob->setInitValue( 1.0f ); m_arpRangeKnob->move( 164, 24 ); m_arpRangeKnob->setHintText( tr( "Arpeggio range:" ) + " ", " " + tr( "octave(s)" ) ); @@ -293,8 +295,8 @@ arpAndChordsTabWidget::arpAndChordsTabWidget( channelTrack * _channel_track ) : m_arpTimeKnob = new tempoSyncKnob( knobBright_26, m_arpGroupBox, tr( "Arpeggio time" ), eng() ); m_arpTimeKnob->setLabel( tr( "TIME" ) ); - m_arpTimeKnob->setRange( 10.0, 1000.0, 1.0 ); - m_arpTimeKnob->setValue( 100.0, TRUE ); + m_arpTimeKnob->setRange( 10.0f, 1000.0f, 1.0f ); + m_arpTimeKnob->setInitValue( 100.0f ); m_arpTimeKnob->move( 164, 70 ); m_arpTimeKnob->setHintText( tr( "Arpeggio time:" ) + " ", " " + tr( "ms" ) ); @@ -310,8 +312,8 @@ arpAndChordsTabWidget::arpAndChordsTabWidget( channelTrack * _channel_track ) : m_arpGateKnob = new knob( knobBright_26, m_arpGroupBox, tr( "Arpeggio gate" ), eng() ); m_arpGateKnob->setLabel( tr( "GATE" ) ); - m_arpGateKnob->setRange( 1.0, 200.0, 1.0 ); - m_arpGateKnob->setValue( 100.0, TRUE ); + m_arpGateKnob->setRange( 1.0f, 200.0f, 1.0f ); + m_arpGateKnob->setInitValue( 100.0f ); m_arpGateKnob->move( 204, 70 ); m_arpGateKnob->setHintText( tr( "Arpeggio gate:" ) + " ", tr( "%" ) ); #ifdef QT4 @@ -595,7 +597,7 @@ void arpAndChordsTabWidget::processNote( notePlayHandle * _n ) // range-checking if( sub_note_key >= NOTES_PER_OCTAVE * OCTAVES || - sub_note_key < 0 ) + sub_note_key < 0 || eng()->getMixer()->criticalXRuns() ) { continue; } @@ -766,3 +768,5 @@ void arpAndChordsTabWidget::arpRandomToggled( bool _on ) #include "arp_and_chords_tab_widget.moc" + +#endif diff --git a/src/core/bb_editor.cpp b/src/core/bb_editor.cpp index b4d9b1c6b..b87b70dd5 100644 --- a/src/core/bb_editor.cpp +++ b/src/core/bb_editor.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * bb_editor.cpp - basic main-window for editing of beats and basslines * @@ -82,7 +84,7 @@ bbEditor::bbEditor( engine * _engine ) : setWindowIcon( embed::getIconPixmap( "bb_track" ) ); - setWindowTitle( tr( "Beat+Bassline Editor" ) ); + setWindowTitle( tr( "Beat+Baseline Editor" ) ); setMinimumWidth( TRACK_OP_WIDTH + DEFAULT_SETTINGS_WIDGET_WIDTH + BBE_PPT + 2 * TCO_BORDER_WIDTH + DEFAULT_SCROLLBAR_SIZE ); @@ -477,3 +479,5 @@ void bbEditor::swapBB( csize _bb1, csize _bb2 ) #include "bb_editor.moc" + +#endif diff --git a/src/core/config_mgr.cpp b/src/core/config_mgr.cpp index 7c8c9a06d..d0f8694e9 100644 --- a/src/core/config_mgr.cpp +++ b/src/core/config_mgr.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * config_mgr.cpp - implementation of class configManager * @@ -932,3 +934,5 @@ void configManager::processFilesRecursively( const QString & _src_dir, #include "config_mgr.moc" + +#endif diff --git a/src/core/engine.cpp b/src/core/engine.cpp index 7423a7088..a94e8643d 100644 --- a/src/core/engine.cpp +++ b/src/core/engine.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * engine.cpp - implementation of LMMS' engine-system * @@ -61,9 +63,9 @@ engine::~engine() { m_mixer->stopProcessing(); delete m_projectNotes; - delete m_pianoRoll; delete m_songEditor; delete m_bbEditor; + delete m_pianoRoll; presetPreviewPlayHandle::cleanUp( this ); @@ -92,3 +94,5 @@ engineObject::~engineObject() { } + +#endif diff --git a/src/core/envelope_and_lfo_widget.cpp b/src/core/envelope_and_lfo_widget.cpp index 4a5cd5106..27f0a8a25 100644 --- a/src/core/envelope_and_lfo_widget.cpp +++ b/src/core/envelope_and_lfo_widget.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * envelope_and_lfo_widget.cpp - widget which is m_used by envelope/lfo/filter- * tab of channel-window @@ -145,7 +147,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount, eng() ); m_predelayKnob->setLabel( tr( "DEL" ) ); m_predelayKnob->setRange( 0.0, 1.0, 0.001 ); - m_predelayKnob->setValue( 0.0, TRUE ); + m_predelayKnob->setInitValue( 0.0 ); m_predelayKnob->move( PREDELAY_KNOB_X, ENV_KNOBS_Y ); m_predelayKnob->setHintText( tr( "Predelay:" ) + " ", "" ); #ifdef QT4 @@ -163,7 +165,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount, eng() ); m_attackKnob->setLabel( tr( "ATT" ) ); m_attackKnob->setRange( 0.0, 1.0, 0.001 ); - m_attackKnob->setValue( 0.0, TRUE ); + m_attackKnob->setInitValue( 0.0 ); m_attackKnob->move( ATTACK_KNOB_X, ENV_KNOBS_Y ); m_attackKnob->setHintText( tr( "Attack:" )+" ", "" ); #ifdef QT4 @@ -182,7 +184,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount, m_holdKnob = new knob( knobBright_26, this, tr( "Hold-time" ), eng() ); m_holdKnob->setLabel( tr( "HOLD" ) ); m_holdKnob->setRange( 0.0, 1.0, 0.001 ); - m_holdKnob->setValue( 0.5, TRUE ); + m_holdKnob->setInitValue( 0.5 ); m_holdKnob->move( HOLD_KNOB_X, ENV_KNOBS_Y ); m_holdKnob->setHintText( tr( "Hold:" ) + " ", "" ); #ifdef QT4 @@ -201,7 +203,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount, eng() ); m_decayKnob->setLabel( tr( "DEC" ) ); m_decayKnob->setRange( 0.0, 1.0, 0.001 ); - m_decayKnob->setValue( 0.5, TRUE ); + m_decayKnob->setInitValue( 0.5 ); m_decayKnob->move( DECAY_KNOB_X, ENV_KNOBS_Y ); m_decayKnob->setHintText( tr( "Decay:" ) + " ", "" ); #ifdef QT4 @@ -221,7 +223,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount, eng() ); m_sustainKnob->setLabel( tr( "SUST" ) ); m_sustainKnob->setRange( 0.0, 1.0, 0.001 ); - m_sustainKnob->setValue( 0.5, TRUE ); + m_sustainKnob->setInitValue( 0.5 ); m_sustainKnob->move( SUSTAIN_KNOB_X, ENV_KNOBS_Y ); m_sustainKnob->setHintText( tr( "Sustain:" ) + " ", "" ); #ifdef QT4 @@ -240,7 +242,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount, eng() ); m_releaseKnob->setLabel( tr( "REL" ) ); m_releaseKnob->setRange( 0.0, 1.0, 0.001 ); - m_releaseKnob->setValue( 0.1, TRUE ); + m_releaseKnob->setInitValue( 0.1 ); m_releaseKnob->move( RELEASE_KNOB_X, ENV_KNOBS_Y ); m_releaseKnob->setHintText( tr( "Release:" ) + " ", "" ); #ifdef QT4 @@ -260,7 +262,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount, tr( "Modulation amount" ), eng() ); m_amountKnob->setLabel( tr( "AMT" ) ); m_amountKnob->setRange( -1.0, 1.0, 0.005 ); - m_amountKnob->setValue( 0.0, TRUE ); + m_amountKnob->setInitValue( 0.0 ); m_amountKnob->move( AMOUNT_KNOB_X, ENV_GRAPH_Y ); m_amountKnob->setHintText( tr( "Modulation amount:" ) + " ", "" ); #ifdef QT4 @@ -281,7 +283,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount, tr( "LFO-predelay-time" ), eng() ); m_lfoPredelayKnob->setLabel( tr( "DEL" ) ); m_lfoPredelayKnob->setRange( 0.0, 1.0, 0.001 ); - m_lfoPredelayKnob->setValue( 0.0, TRUE ); + m_lfoPredelayKnob->setInitValue( 0.0 ); m_lfoPredelayKnob->move( LFO_PREDELAY_KNOB_X, LFO_KNOB_Y ); m_lfoPredelayKnob->setHintText( tr( "LFO-predelay:" ) + " ", "" ); #ifdef QT4 @@ -299,7 +301,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount, tr( "LFO-attack-time" ), eng() ); m_lfoAttackKnob->setLabel( tr( "ATT" ) ); m_lfoAttackKnob->setRange( 0.0, 1.0, 0.001 ); - m_lfoAttackKnob->setValue( 0.0, TRUE ); + m_lfoAttackKnob->setInitValue( 0.0 ); m_lfoAttackKnob->move( LFO_ATTACK_KNOB_X, LFO_KNOB_Y ); m_lfoAttackKnob->setHintText( tr( "LFO-attack:" ) + " ", "" ); #ifdef QT4 @@ -317,7 +319,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount, tr( "LFO-speed" ), eng(), 20000.0 ); m_lfoSpeedKnob->setLabel( tr( "SPD" ) ); m_lfoSpeedKnob->setRange( 0.01, 1.0, 0.0001 ); - m_lfoSpeedKnob->setValue( 0.1, TRUE ); + m_lfoSpeedKnob->setInitValue( 0.1 ); m_lfoSpeedKnob->move( LFO_SPEED_KNOB_X, LFO_KNOB_Y ); m_lfoSpeedKnob->setHintText( tr( "LFO-speed:" ) + " ", "" ); #ifdef QT4 @@ -335,7 +337,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount, tr( "LFO-modulation-amount" ), eng() ); m_lfoAmountKnob->setLabel( tr( "AMT" ) ); m_lfoAmountKnob->setRange( -1.0, 1.0, 0.005 ); - m_lfoAmountKnob->setValue( 0.0, TRUE ); + m_lfoAmountKnob->setInitValue( 0.0 ); m_lfoAmountKnob->move( LFO_AMOUNT_KNOB_X, LFO_KNOB_Y ); m_lfoAmountKnob->setHintText( tr( "Modulation amount:" ) + " ", "" ); #ifdef QT4 @@ -1217,3 +1219,5 @@ void envelopeAndLFOWidget::lfoUserWaveCh( bool _on ) #include "envelope_and_lfo_widget.moc" + +#endif diff --git a/src/core/envelope_tab_widget.cpp b/src/core/envelope_tab_widget.cpp index 0a1f93a9f..e532c0107 100644 --- a/src/core/envelope_tab_widget.cpp +++ b/src/core/envelope_tab_widget.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * envelope_tab_widget.cpp - widget for use in envelope/lfo/filter-tab of * channel-window @@ -178,7 +180,7 @@ envelopeTabWidget::envelopeTabWidget( channelTrack * _channel_track ) : m_filterCutKnob->setLabel( tr( "CUTOFF" ) ); m_filterCutKnob->setRange( 0.0, 16000.0, 1.0 ); m_filterCutKnob->move( 140, 18 ); - m_filterCutKnob->setValue( 16000.0, TRUE ); + m_filterCutKnob->setInitValue( 16000.0 ); m_filterCutKnob->setHintText( tr( "cutoff-frequency:" ) + " ", " " + tr( "Hz" ) ); #ifdef QT4 @@ -198,7 +200,7 @@ envelopeTabWidget::envelopeTabWidget( channelTrack * _channel_track ) : m_filterResKnob->setLabel( tr( "Q/RESO" ) ); m_filterResKnob->setRange( 0.01, 10.0, 0.01 ); m_filterResKnob->move( 190, 18 ); - m_filterResKnob->setValue( 0.5, TRUE ); + m_filterResKnob->setInitValue( 0.5 ); m_filterResKnob->setHintText( tr( "Q/Resonance:" ) + " ", "" ); #ifdef QT4 m_filterResKnob->setWhatsThis( @@ -617,3 +619,5 @@ return res; } */ + +#endif diff --git a/src/core/export_project_dialog.cpp b/src/core/export_project_dialog.cpp index 92e98e7bc..18adc227f 100644 --- a/src/core/export_project_dialog.cpp +++ b/src/core/export_project_dialog.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * export_project_dialog.cpp - implementation of dialog for exporting project * @@ -469,3 +471,5 @@ void exportProjectDialog::finishProjectExport( void ) #include "export_project_dialog.moc" + +#endif diff --git a/src/core/file_browser.cpp b/src/core/file_browser.cpp index 3796e9b86..50b284bb1 100644 --- a/src/core/file_browser.cpp +++ b/src/core/file_browser.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * file_browser.cpp - implementation of the project-, preset- and * sample-file-browser @@ -830,3 +832,5 @@ void fileItem::determineFileType( void ) #include "file_browser.moc" + +#endif diff --git a/src/core/instrument.cpp b/src/core/instrument.cpp index 237c77b3d..ba384cc69 100644 --- a/src/core/instrument.cpp +++ b/src/core/instrument.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * instrument.cpp - base-class for all instrument-plugins (synths, samplers etc) * @@ -97,3 +99,5 @@ instrument * instrument::instantiate( const QString & _plugin_name, return( new dummyInstrument( _channel_track ) ); } + +#endif diff --git a/src/core/main.cpp b/src/core/main.cpp index 9b56285f6..f1acc8169 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * main.cpp - just main.cpp which is starting up app... * @@ -256,3 +258,5 @@ int main( int argc, char * * argv ) return( app.exec() ); } + +#endif diff --git a/src/core/main_window.cpp b/src/core/main_window.cpp index e776e4a5a..f92fdda52 100644 --- a/src/core/main_window.cpp +++ b/src/core/main_window.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * main_window.cpp - implementation of LMMS-main-window * @@ -315,7 +317,7 @@ void mainWindow::finalize( void ) // window-toolbar toolButton * bb_editor_window = new toolButton( embed::getIconPixmap( "bb_track" ), - tr( "Show/hide Beat+Bassline Editor" ) + + tr( "Show/hide Beat+Baseline Editor" ) + " (F6)", this, SLOT( toggleBBEditorWin() ), m_toolBar ); @@ -326,10 +328,10 @@ void mainWindow::finalize( void ) QWhatsThis::add( bb_editor_window, #endif tr( "By pressing this button, you can show or hide the " - "Beat+Bassline Editor. The Beat+Bassline Editor is " + "Beat+Baseline Editor. The Beat+Baesline Editor is " "needed for setting beats, opening, adding and " "removing channels, cutting, copying and pasting " - "beat- and bassline-patterns and other things like " + "beat- and baseline-patterns and other things like " "that." ) ); @@ -503,7 +505,8 @@ void mainWindow::finalize( void ) if( !configManager::inst()->value( "app", "configured" ).toInt() ) { // no, so show it that user can setup everything - setupDialog( eng() ).exec(); + setupDialog sd( eng() ); + sd.exec(); configManager::inst()->setValue( "app", "configured", "1" ); } // look whether mixer could use a audio-interface beside audioDummy @@ -704,7 +707,8 @@ bool mainWindow::saveProjectAs( void ) void mainWindow::showSettingsDialog( void ) { - setupDialog( eng() ).exec(); + setupDialog sd( eng() ); + sd.exec(); } @@ -862,3 +866,5 @@ void mainWindow::keyReleaseEvent( QKeyEvent * _ke ) #include "main_window.moc" + +#endif diff --git a/src/core/midi_tab_widget.cpp b/src/core/midi_tab_widget.cpp index 40af4f3f1..4fc010e3c 100644 --- a/src/core/midi_tab_widget.cpp +++ b/src/core/midi_tab_widget.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * midi_tab_widget.cpp - tab-widget in channel-track-window for setting up * MIDI-related stuff @@ -613,3 +615,5 @@ void midiTabWidget::activatedWriteablePort( QAction * ) { } #include "midi_tab_widget.moc" + +#endif diff --git a/src/core/mixer.cpp b/src/core/mixer.cpp index 52a3f5113..921c5e551 100644 --- a/src/core/mixer.cpp +++ b/src/core/mixer.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * mixer.cpp - audio-device-independent mixer for LMMS * @@ -137,7 +139,7 @@ void mixer::stopProcessing( void ) bool mixer::criticalXRuns( void ) const { - return( ( m_cpuLoad >= 98 && + return( ( m_cpuLoad >= 99 && eng()->getSongEditor()->realTimeTask() == TRUE ) ); } @@ -239,7 +241,8 @@ const surroundSampleFrame * mixer::renderNextBuffer( void ) const float new_cpu_load = timer.elapsed() / 10000.0f * sampleRate() / m_framesPerAudioBuffer; - m_cpuLoad = tLimit( (int) ( new_cpu_load + m_cpuLoad ) / 2, 0, 100 ); + m_cpuLoad = tLimit( (int) ( new_cpu_load * 0.1f + m_cpuLoad * 0.9f ), 0, + 100 ); return( m_curBuf ); } @@ -578,3 +581,5 @@ void mixer::processBuffer( const surroundSampleFrame * _buf, #include "mixer.moc" + +#endif diff --git a/src/core/name_label.cpp b/src/core/name_label.cpp index 766a01b1e..39d010996 100644 --- a/src/core/name_label.cpp +++ b/src/core/name_label.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * name_label.cpp - implementation of class nameLabel, a label which * is renamable by double-clicking it @@ -268,6 +270,10 @@ void nameLabel::paintEvent( QPaintEvent * ) x += 4 + pm.width(); } + p.setPen( QColor( 16, 16, 16 ) ); + p.drawText( x+1, height() / 2 + p.fontMetrics().height() / 2 - 3, + text() ); + p.setPen( QColor( 0, 224, 0 ) ); bbTrack * bbt = bbTrack::findBBTrack( eng()->getBBEditor()->currentBB(), eng() ); @@ -290,3 +296,5 @@ void nameLabel::paintEvent( QPaintEvent * ) #include "name_label.moc" + +#endif diff --git a/src/core/note.cpp b/src/core/note.cpp index fdf0d3b97..e79c5c332 100644 --- a/src/core/note.cpp +++ b/src/core/note.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * note.cpp - implementation of class note * @@ -35,6 +37,7 @@ #endif +#include #include "debug.h" #include "note.h" @@ -83,7 +86,7 @@ void note::setPos( const midiTime & _pos ) -void note::setTone( tones _tone ) +void note::setTone( const tones _tone ) { if( _tone >= C && _tone <= H ) { @@ -101,7 +104,7 @@ void note::setTone( tones _tone ) -void note::setOctave( octaves _octave ) +void note::setOctave( const octaves _octave ) { if( _octave >= MIN_OCTAVE && _octave <= MAX_OCTAVE ) { @@ -119,7 +122,7 @@ void note::setOctave( octaves _octave ) -void note::setKey( int _key ) +void note::setKey( const int _key ) { setTone( static_cast( _key % NOTES_PER_OCTAVE ) ); setOctave( static_cast( _key / NOTES_PER_OCTAVE ) ); @@ -128,7 +131,7 @@ void note::setKey( int _key ) -void note::setVolume( volume _volume ) +void note::setVolume( const volume _volume ) { if( _volume <= MAX_VOLUME ) { @@ -146,7 +149,7 @@ void note::setVolume( volume _volume ) -void note::setPanning( panning _panning ) +void note::setPanning( const panning _panning ) { if( _panning >= PANNING_LEFT && _panning <= PANNING_RIGHT ) { @@ -155,7 +158,7 @@ void note::setPanning( panning _panning ) #ifdef LMMS_DEBUG else { - printf ("Paning out of range (note::set_panning)\n"); + printf( "Paning out of range (note::setPanning)\n" ); } #endif } @@ -163,6 +166,39 @@ void note::setPanning( panning _panning ) +inline midiTime note::quantized( const midiTime & _m, const int _q_grid ) +{ + float p = ( (float) _m / _q_grid ); + if( p - floorf( p ) < 0.5f ) + { + return( static_cast( p ) * _q_grid ); + } + return( static_cast( p + 1 ) * _q_grid ); +} + + + + +void note::quantizeLength( const int _q_grid ) +{ + setLength( quantized( length(), _q_grid ) ); + if( length() == 0 ) + { + setLength( _q_grid ); + } +} + + + + +void note::quantizePos( const int _q_grid ) +{ + setPos( quantized( pos(), _q_grid ) ); +} + + + + void note::saveSettings( QDomDocument & _doc, QDomElement & _parent ) { QDomElement note_de = _doc.createElement( "note" ); @@ -188,3 +224,8 @@ void note::loadSettings( const QDomElement & _this ) m_pos = _this.attribute( "pos" ).toInt(); } + + + + +#endif diff --git a/src/core/note_play_handle.cpp b/src/core/note_play_handle.cpp index c7ce4ff62..ff0f0a190 100644 --- a/src/core/note_play_handle.cpp +++ b/src/core/note_play_handle.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * note_play_handle.cpp - implementation of class notePlayHandle, part of * play-engine @@ -381,3 +383,5 @@ bool notePlayHandle::operator==( const notePlayHandle & _nph ) const } + +#endif diff --git a/src/core/piano_roll.cpp b/src/core/piano_roll.cpp index 22b7331d4..5b230ed76 100644 --- a/src/core/piano_roll.cpp +++ b/src/core/piano_roll.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * piano_roll.cpp - implementation of piano-roll which is used for actual * writing of melodies @@ -391,7 +393,6 @@ pianoRoll::pianoRoll( engine * _engine ) : // setup zooming-stuff m_zoomingComboBox = new comboBox( m_toolBar ); m_zoomingComboBox->setFixedSize( 80, 22 ); - m_zoomingComboBox->move( 580, 4 ); for( int i = 0; i < 6; ++i ) { m_zoomingComboBox->addItem( QString::number( 25 * @@ -404,6 +405,38 @@ pianoRoll::pianoRoll( engine * _engine ) : this, SLOT( zoomingChanged( const QString & ) ) ); + // setup quantize-stuff + QLabel * quantize_lbl = new QLabel( m_toolBar ); + quantize_lbl->setPixmap( embed::getIconPixmap( "quantize" ) ); + + m_quantizeComboBox = new comboBox( m_toolBar ); + m_quantizeComboBox->setFixedSize( 60, 22 ); + for( int i = 0; i < 7; ++i ) + { + m_quantizeComboBox->addItem( "1/" + QString::number( + static_cast( powf( 2.0f, i ) ) ) ); + } + m_quantizeComboBox->setCurrentIndex( m_quantizeComboBox->findText( + "1/16" ) ); + + // setup note-len-stuff + QLabel * note_len_lbl = new QLabel( m_toolBar ); + note_len_lbl->setPixmap( embed::getIconPixmap( "note" ) ); + + m_noteLenComboBox = new comboBox( m_toolBar ); + m_noteLenComboBox->setFixedSize( 120, 22 ); + m_noteLenComboBox->addItem( tr( "Last note" ), + embed::getIconPixmap( "edit_draw" ) ); + const QString pixmaps[] = { "whole", "half", "quarter", "eighth", + "sixteenth", "thirtysecond" } ; + for( int i = 0; i < 6; ++i ) + { + m_noteLenComboBox->addItem( "1/" + QString::number( + static_cast( powf( 2.0f, i ) ) ), + embed::getIconPixmap( "note_" + pixmaps[i] ) ); + } + m_noteLenComboBox->setCurrentIndex( 0 ); + tb_layout->addSpacing( 5 ); tb_layout->addWidget( m_playButton ); @@ -422,8 +455,16 @@ pianoRoll::pianoRoll( engine * _engine ) : m_timeLine->addToolButtons( m_toolBar ); tb_layout->addSpacing( 15 ); tb_layout->addWidget( zoom_lbl ); - tb_layout->addSpacing( 5 ); + tb_layout->addSpacing( 4 ); tb_layout->addWidget( m_zoomingComboBox ); + tb_layout->addSpacing( 10 ); + tb_layout->addWidget( quantize_lbl ); + tb_layout->addSpacing( 4 ); + tb_layout->addWidget( m_quantizeComboBox ); + tb_layout->addSpacing( 10 ); + tb_layout->addWidget( note_len_lbl ); + tb_layout->addSpacing( 4 ); + tb_layout->addWidget( m_noteLenComboBox ); tb_layout->addStretch(); // setup our actual window @@ -1178,7 +1219,7 @@ void pianoRoll::mousePressEvent( QMouseEvent * _me ) // then set new note midiTime note_pos( pos_tact_64th ); - midiTime note_len( m_lenOfNewNotes ); + midiTime note_len( newNoteLen() ); note new_note( note_len, note_pos, (tones)( key_num % @@ -1472,8 +1513,10 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me ) { tact_64th_diff = 1; } - m_lenOfNewNotes = midiTime( tact_64th_diff ); - m_currentNote->setLength( m_lenOfNewNotes ); + m_currentNote->setLength( midiTime( + tact_64th_diff ) ); + m_currentNote->quantizeLength( quantization() ); + m_lenOfNewNotes = m_currentNote->length(); m_pattern->update(); } @@ -2075,6 +2118,7 @@ void pianoRoll::recordNote( const note & _n ) note n( _n ); n.setPos( eng()->getSongEditor()->getPlayPos( songEditor::PLAY_PATTERN ) - n.length() ); + n.quantizeLength( quantization() ); #ifndef QT4 qApp->lock(); #endif @@ -2430,5 +2474,30 @@ void pianoRoll::zoomingChanged( const QString & _zfac ) +int pianoRoll::quantization( void ) const +{ + return( 64 / m_quantizeComboBox->currentText().right( + m_quantizeComboBox->currentText().length() - + 2 ).toInt() ); +} + + + + +midiTime pianoRoll::newNoteLen( void ) const +{ + if( m_noteLenComboBox->currentIndex() == 0 ) + { + return( m_lenOfNewNotes ); + } + return( 64 / m_noteLenComboBox->currentText().right( + m_noteLenComboBox->currentText().length() - + 2 ).toInt() ); +} + + + #include "piano_roll.moc" + +#endif diff --git a/src/core/piano_widget.cpp b/src/core/piano_widget.cpp index 599a3048d..5e83d206f 100644 --- a/src/core/piano_widget.cpp +++ b/src/core/piano_widget.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * piano_widget.cpp - implementation of piano-widget used in channel-window * for testing channel @@ -68,10 +70,10 @@ QPixmap * pianoWidget::s_blackKeyPressedPm = NULL; const int PIANO_BASE = 11; -const int WHITE_KEY_WIDTH = 10; -const int BLACK_KEY_WIDTH = 8; -const int WHITE_KEY_HEIGHT = 57; -const int BLACK_KEY_HEIGHT = 38; +const int PW_WHITE_KEY_WIDTH = 10; +const int PW_BLACK_KEY_WIDTH = 8; +const int PW_WHITE_KEY_HEIGHT = 57; +const int PW_BLACK_KEY_HEIGHT = 38; const int LABEL_TEXT_SIZE = 7; @@ -127,7 +129,8 @@ pianoWidget::pianoWidget (channelTrack * _parent ) : OCTAVE_3 * WHITE_KEYS_PER_OCTAVE, Qt::Horizontal, this ); #endif - m_pianoScroll->setGeometry( 0, PIANO_BASE+WHITE_KEY_HEIGHT, 250, 16 ); + 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 ) ) ); @@ -152,7 +155,7 @@ pianoWidget::~pianoWidget() int pianoWidget::getKeyFromMouse( const QPoint & _p ) { - int key_num = (int)( (float) _p.x() / (float) WHITE_KEY_WIDTH ); + int key_num = (int)( (float) _p.x() / (float) PW_WHITE_KEY_WIDTH ); for( int i = 0; i <= key_num; ++i ) { @@ -167,23 +170,25 @@ int pianoWidget::getKeyFromMouse( const QPoint & _p ) key_num += m_startOctave * NOTES_PER_OCTAVE + m_startTone; // is it a black key? - if( _p.y() < PIANO_BASE + BLACK_KEY_HEIGHT ) + if( _p.y() < PIANO_BASE + PW_BLACK_KEY_HEIGHT ) { // then do extra checking whether the mouse-cursor is over // a black key if( key_num > 0 && KEY_ORDER[( key_num - 1 ) % NOTES_PER_OCTAVE] == BLACK_KEY && - _p.x() % WHITE_KEY_WIDTH <= ( WHITE_KEY_WIDTH / 2 ) - - ( BLACK_KEY_WIDTH / 2 ) ) + _p.x() % PW_WHITE_KEY_WIDTH <= + ( PW_WHITE_KEY_WIDTH / 2 ) - + ( PW_BLACK_KEY_WIDTH / 2 ) ) { --key_num; } if( key_num < NOTES_PER_OCTAVE * OCTAVES - 1 && KEY_ORDER[( key_num + 1 ) % NOTES_PER_OCTAVE] == BLACK_KEY && - _p.x() % WHITE_KEY_WIDTH >= - ( WHITE_KEY_WIDTH - BLACK_KEY_WIDTH / 2 ) ) + _p.x() % PW_WHITE_KEY_WIDTH >= + ( PW_WHITE_KEY_WIDTH - + PW_BLACK_KEY_WIDTH / 2 ) ) { ++key_num; } @@ -223,7 +228,7 @@ void pianoWidget::mousePressEvent( QMouseEvent * _me ) volume vol = (volume)( ( float ) y_diff / ( ( KEY_ORDER[key_num % NOTES_PER_OCTAVE] == WHITE_KEY ) ? - WHITE_KEY_HEIGHT : BLACK_KEY_HEIGHT ) * + PW_WHITE_KEY_HEIGHT : PW_BLACK_KEY_HEIGHT ) * (float) DEFAULT_VOLUME); if( y_diff < 0 ) { @@ -232,7 +237,7 @@ void pianoWidget::mousePressEvent( QMouseEvent * _me ) else if( y_diff > ( ( KEY_ORDER[key_num % NOTES_PER_OCTAVE] == WHITE_KEY ) ? - WHITE_KEY_HEIGHT : BLACK_KEY_HEIGHT ) ) + PW_WHITE_KEY_HEIGHT : PW_BLACK_KEY_HEIGHT ) ) { vol = DEFAULT_VOLUME; } @@ -284,7 +289,7 @@ void pianoWidget::mouseMoveEvent( QMouseEvent * _me ) int y_diff = _me->pos().y() - PIANO_BASE; volume vol = (volume)( (float) y_diff / ( ( KEY_ORDER[key_num % NOTES_PER_OCTAVE] == WHITE_KEY ) ? - WHITE_KEY_HEIGHT : BLACK_KEY_HEIGHT ) * + PW_WHITE_KEY_HEIGHT : PW_BLACK_KEY_HEIGHT ) * (float)DEFAULT_VOLUME ); // maybe the user moved the mouse-cursor above or under the // piano-widget while holding left button so check that and @@ -295,7 +300,7 @@ void pianoWidget::mouseMoveEvent( QMouseEvent * _me ) } else if( y_diff > ( ( KEY_ORDER[key_num % NOTES_PER_OCTAVE] == WHITE_KEY ) ? - WHITE_KEY_HEIGHT : BLACK_KEY_HEIGHT ) ) + PW_WHITE_KEY_HEIGHT : PW_BLACK_KEY_HEIGHT ) ) { vol = DEFAULT_VOLUME; } @@ -454,7 +459,7 @@ int pianoWidget::getKeyX( int _key_num ) int k = m_startOctave*NOTES_PER_OCTAVE + m_startTone; if( _key_num < k ) { - return( ( _key_num - k ) * WHITE_KEY_WIDTH / 2 ); + return( ( _key_num - k ) * PW_WHITE_KEY_WIDTH / 2 ); } int x = 0; @@ -467,22 +472,22 @@ int pianoWidget::getKeyX( int _key_num ) ++white_cnt; if( white_cnt > 1 ) { - x += WHITE_KEY_WIDTH; + x += PW_WHITE_KEY_WIDTH; } else { - x += WHITE_KEY_WIDTH/2; + x += PW_WHITE_KEY_WIDTH/2; } } else { white_cnt = 0; - x += WHITE_KEY_WIDTH/2; + x += PW_WHITE_KEY_WIDTH/2; } ++k; } - x -= WHITE_KEY_WIDTH / 2; + x -= PW_WHITE_KEY_WIDTH / 2; return( x ); @@ -497,7 +502,7 @@ void pianoWidget::paintEvent( QPaintEvent * ) QPainter p( this ); #else // create pixmap for whole widget - QPixmap pm( rect().size() );//width(), PIANO_BASE+WHITE_KEY_HEIGHT); + QPixmap pm( rect().size() );//width(), PIANO_BASE+PW_WHITE_KEY_HEIGHT); // and a painter for it QPainter p( &pm, this ); #endif @@ -522,14 +527,14 @@ void pianoWidget::paintEvent( QPaintEvent * ) m_channelTrack->baseOctave() * NOTES_PER_OCTAVE; if( KEY_ORDER[base_key % NOTES_PER_OCTAVE] == WHITE_KEY ) { - p.fillRect( QRect( getKeyX( base_key ), 1, WHITE_KEY_WIDTH-1, + p.fillRect( QRect( getKeyX( base_key ), 1, PW_WHITE_KEY_WIDTH-1, PIANO_BASE-2 ), QColor( 0xFF, 0xBB, 0x00 ) ); } else { p.fillRect( QRect( getKeyX( base_key ) + 1, 1, - BLACK_KEY_WIDTH - 1, PIANO_BASE - 2 ), + PW_BLACK_KEY_WIDTH - 1, PIANO_BASE - 2 ), QColor( 0xFF, 0xBB, 0x00 ) ); } @@ -555,13 +560,13 @@ void pianoWidget::paintEvent( QPaintEvent * ) p.drawPixmap( x, PIANO_BASE, *s_whiteKeyPm ); } - x += WHITE_KEY_WIDTH; + x += PW_WHITE_KEY_WIDTH; if( (tones) (cur_key%NOTES_PER_OCTAVE) == C ) { // label key of note C with "C" and number of current // octave - p.drawText( x - WHITE_KEY_WIDTH, LABEL_TEXT_SIZE + 2, + p.drawText( x - PW_WHITE_KEY_WIDTH, LABEL_TEXT_SIZE + 2, QString( "C" ) + QString::number( cur_key / NOTES_PER_OCTAVE, 10 ) ); } @@ -579,12 +584,12 @@ void pianoWidget::paintEvent( QPaintEvent * ) { if( m_pressedKeys[s_key] == TRUE ) { - p.drawPixmap( 0 - WHITE_KEY_WIDTH / 2, PIANO_BASE, + p.drawPixmap( 0 - PW_WHITE_KEY_WIDTH / 2, PIANO_BASE, *s_blackKeyPressedPm ); } else { - p.drawPixmap( 0 - WHITE_KEY_WIDTH / 2, PIANO_BASE, + p.drawPixmap( 0 - PW_WHITE_KEY_WIDTH / 2, PIANO_BASE, *s_blackKeyPm ); } } @@ -598,16 +603,16 @@ void pianoWidget::paintEvent( QPaintEvent * ) // state of current key if( m_pressedKeys[cur_key] == TRUE ) { - p.drawPixmap( x + WHITE_KEY_WIDTH / 2, + p.drawPixmap( x + PW_WHITE_KEY_WIDTH / 2, PIANO_BASE, *s_blackKeyPressedPm ); } else { - p.drawPixmap( x + WHITE_KEY_WIDTH / 2, + p.drawPixmap( x + PW_WHITE_KEY_WIDTH / 2, PIANO_BASE, *s_blackKeyPm ); } - x += WHITE_KEY_WIDTH; + x += PW_WHITE_KEY_WIDTH; white_cnt = 0; } else @@ -617,7 +622,7 @@ void pianoWidget::paintEvent( QPaintEvent * ) ++white_cnt; if( white_cnt > 1 ) { - x += WHITE_KEY_WIDTH; + x += PW_WHITE_KEY_WIDTH; } } ++cur_key; @@ -632,3 +637,5 @@ void pianoWidget::paintEvent( QPaintEvent * ) #include "piano_widget.moc" + +#endif diff --git a/src/core/plugin.cpp b/src/core/plugin.cpp index 12a08c571..8a82df13a 100644 --- a/src/core/plugin.cpp +++ b/src/core/plugin.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * plugin.cpp - implementation of plugin-class including plugin-loader * @@ -244,3 +246,5 @@ void plugin::getDescriptorsOfAvailPlugins( vvector & _plugin_descs ) + +#endif diff --git a/src/core/plugin_browser.cpp b/src/core/plugin_browser.cpp index ca8dc2f0e..ad8339147 100644 --- a/src/core/plugin_browser.cpp +++ b/src/core/plugin_browser.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * plugin_browser.cpp - implementation of the plugin-browser * @@ -67,7 +69,7 @@ pluginBrowser::pluginBrowser( QWidget * _parent, engine * _engine ) : QLabel * hint = new QLabel( tr( "You can drag an instrument-plugin " "into either the Song-Editor, the " - "Beat+Bassline Editor or just into a " + "Beat+Baseline Editor or just into a " "channel-window or on the " "corresponding channel-button." ), m_view ); @@ -268,3 +270,5 @@ void pluginDescWidget::mouseReleaseEvent( QMouseEvent * _me ) #include "plugin_browser.moc" + +#endif diff --git a/src/core/preset_preview_play_handle.cpp b/src/core/preset_preview_play_handle.cpp index 650dfce69..a68acd9f1 100644 --- a/src/core/preset_preview_play_handle.cpp +++ b/src/core/preset_preview_play_handle.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * preset_preview_play_handle.cpp - implementation of class * presetPreviewPlayHandle @@ -227,3 +229,5 @@ constNotePlayHandleVector presetPreviewPlayHandle::nphsOfChannelTrack( + +#endif diff --git a/src/core/sample_play_handle.cpp b/src/core/sample_play_handle.cpp index 96f64ec0f..dfa76939e 100644 --- a/src/core/sample_play_handle.cpp +++ b/src/core/sample_play_handle.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * sample_play_handle.cpp - implementation of class samplePlayHandle * @@ -107,3 +109,5 @@ f_cnt_t samplePlayHandle::totalFrames( void ) const return( m_sampleBuffer->endFrame() - m_sampleBuffer->startFrame() ); } + +#endif diff --git a/src/core/setup_dialog.cpp b/src/core/setup_dialog.cpp index 81d899955..2ae46a100 100644 --- a/src/core/setup_dialog.cpp +++ b/src/core/setup_dialog.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * setup_dialog.cpp - dialog for setting up LMMS * @@ -869,3 +871,5 @@ void setupDialog::displayMIDIHelp( void ) #include "setup_dialog.moc" + +#endif diff --git a/src/core/song_editor.cpp b/src/core/song_editor.cpp index 9acb66334..dd568abdf 100644 --- a/src/core/song_editor.cpp +++ b/src/core/song_editor.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * song_editor.cpp - basic window for editing song * @@ -240,7 +242,7 @@ songEditor::songEditor( engine * _engine ) : SLOT( masterPitchChanged( int ) ) ); connect( m_masterPitchSlider, SIGNAL( sliderPressed() ), this, SLOT( masterPitchPressed() ) ); - connect( m_masterPitchSlider, SIGNAL (sliderMoved( int) ), this, + connect( m_masterPitchSlider, SIGNAL( sliderMoved( int ) ), this, SLOT( masterPitchMoved( int ) ) ); connect( m_masterPitchSlider, SIGNAL( sliderReleased() ), this, SLOT( masterPitchReleased() ) ); @@ -1665,3 +1667,5 @@ void songEditor::loadSettings( const QDomElement & _this ) #include "song_editor.moc" + +#endif diff --git a/src/core/surround_area.cpp b/src/core/surround_area.cpp index dc42dfd33..2d87d9d46 100644 --- a/src/core/surround_area.cpp +++ b/src/core/surround_area.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * surround_area.cpp - a widget for setting position of a channel + * calculation of volume for each speaker @@ -241,3 +243,5 @@ void surroundArea::mouseReleaseEvent( QMouseEvent * ) #include "surround_area.moc" + +#endif diff --git a/src/core/timeline.cpp b/src/core/timeline.cpp index 3df38bbd9..7773a8bc7 100644 --- a/src/core/timeline.cpp +++ b/src/core/timeline.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * timeline.cpp - class timeLine, representing a time-line with position marker * @@ -401,3 +403,5 @@ void timeLine::mouseReleaseEvent( QMouseEvent * _me ) #include "timeline.moc" + +#endif diff --git a/src/core/track.cpp b/src/core/track.cpp index e58a21e78..8d587fd73 100644 --- a/src/core/track.cpp +++ b/src/core/track.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * track.cpp - implementation of classes concerning tracks -> neccessary for * all track-like objects (beat/bassline, sample-track...) @@ -1284,7 +1286,9 @@ track * FASTCALL track::create( trackTypes _tt, trackContainer * _tc ) default: break; } +#ifdef DEBUG_LMMS assert( t != NULL ); +#endif // allow mixer to continue _tc->eng()->getMixer()->play(); @@ -1494,3 +1498,5 @@ void FASTCALL track::swapPositionOfTCOs( csize _tco_num1, csize _tco_num2 ) #include "track.moc" + +#endif diff --git a/src/core/track_container.cpp b/src/core/track_container.cpp index 4358cdcf8..04ab9cd8a 100644 --- a/src/core/track_container.cpp +++ b/src/core/track_container.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * track_container.cpp - implementation of base-class for all track-containers * like Song-Editor, BB-Editor... @@ -583,3 +585,5 @@ void trackContainer::scrollArea::wheelEvent( QWheelEvent * _we ) #undef setValue #undef maximum + +#endif diff --git a/src/lib/base64.cpp b/src/lib/base64.cpp index dd658c260..85745f15b 100644 --- a/src/lib/base64.cpp +++ b/src/lib/base64.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * base64.cpp - namespace base64 with methods for encoding/decoding binary data * to/from base64 @@ -165,3 +167,5 @@ void decode( const QString & _b64, char * * _data, int * _size ) #endif + +#endif diff --git a/src/lib/buffer_allocator.cpp b/src/lib/buffer_allocator.cpp index 7639a7f83..48b0ba86c 100644 --- a/src/lib/buffer_allocator.cpp +++ b/src/lib/buffer_allocator.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * buffer_allocator.cpp - namespace bufferAllocator providing routines for own * optimized memory-management for audio-buffers @@ -224,3 +226,5 @@ void bufferAllocator::disableAutoCleanup( bool _disabled ) s_autoCleanupDisabled = _disabled; } + +#endif diff --git a/src/lib/clipboard.cpp b/src/lib/clipboard.cpp index 88f998fd3..c8388bd77 100644 --- a/src/lib/clipboard.cpp +++ b/src/lib/clipboard.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * clipboard.cpp - the clipboard for patterns, notes etc. * @@ -57,3 +59,5 @@ namespace clipboard } ; + +#endif diff --git a/src/lib/embed.cpp b/src/lib/embed.cpp index de8da7c4c..cdce07c88 100644 --- a/src/lib/embed.cpp +++ b/src/lib/embed.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * embed.cpp - misc stuff for using embedded resources (linked into binary) * @@ -134,3 +136,5 @@ void loadTranslation( const QString & _tname ) } + +#endif diff --git a/src/lib/ladspa_manager.cpp b/src/lib/ladspa_manager.cpp index 0780ae91b..c60a84713 100644 --- a/src/lib/ladspa_manager.cpp +++ b/src/lib/ladspa_manager.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * ladspa_manager.cpp - a class to manage loading and instantiation * of ladspa plugins @@ -917,3 +919,5 @@ void FASTCALL ladspaManager::cleanup( const ladspaKey & _plugin, #endif + +#endif diff --git a/src/lib/mmp.cpp b/src/lib/mmp.cpp index ac35821e4..e78b7bca0 100644 --- a/src/lib/mmp.cpp +++ b/src/lib/mmp.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * mmp.cpp - implementation of class multimediaProject * @@ -301,3 +303,5 @@ QString multimediaProject::typeName( projectTypes _project_type ) return( s_types[UNKNOWN].m_name ); } + +#endif diff --git a/src/lib/oscillator.cpp b/src/lib/oscillator.cpp index 3886ac5cd..786de0732 100644 --- a/src/lib/oscillator.cpp +++ b/src/lib/oscillator.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * oscillator.cpp - implementation of powerful oscillator-class * @@ -156,10 +158,11 @@ void x::updateSync( sampleFrame * _ab, const fpab_t _frames, \ class x : public oscillator \ { \ public: \ - x( const modulationAlgos modulation_algo, const float _freq, \ + inline x( const modulationAlgos modulation_algo, \ + const float _freq, \ const Sint16 _phase_offset, const float _volume_factor, \ const sample_rate_t _sample_rate, \ - oscillator * _sub_osc ) FASTCALL : \ + oscillator * _sub_osc ) : \ oscillator( modulation_algo, _freq, _phase_offset, \ _volume_factor, _sample_rate, _sub_osc ) \ { \ @@ -269,3 +272,5 @@ void oscillator::recalcOscCoeff( const float additional_phase_offset ) --m_sample; } } + +#endif diff --git a/src/lib/sample_buffer.cpp b/src/lib/sample_buffer.cpp index 22379802c..5d6ad9533 100644 --- a/src/lib/sample_buffer.cpp +++ b/src/lib/sample_buffer.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * sample_buffer.cpp - container-class sampleBuffer * @@ -93,7 +95,6 @@ #define write writeBlock #define read readBlock -#define seek at #define pos at #endif @@ -1463,9 +1464,10 @@ void sampleBuffer::deleteResamplingData( void * * _ptr ) #undef write #undef read -#undef seek #undef pos #include "sample_buffer.moc" + +#endif diff --git a/src/lib/string_pair_drag.cpp b/src/lib/string_pair_drag.cpp index 7aeb17c14..486a7c172 100644 --- a/src/lib/string_pair_drag.cpp +++ b/src/lib/string_pair_drag.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * string_pair_drag.cpp - class stringPairDrag which provides general support * for drag'n'drop of string-pairs and which is the base @@ -127,3 +129,5 @@ QString stringPairDrag::decodeValue( QDropEvent * _de ) #endif } + +#endif diff --git a/src/lmms_single_source.cpp b/src/lmms_single_source.cpp new file mode 100644 index 000000000..22e419664 --- /dev/null +++ b/src/lmms_single_source.cpp @@ -0,0 +1,85 @@ +#ifdef SINGLE_SOURCE_COMPILE +#undef SINGLE_SOURCE_COMPILE +#include "src/lib/string_pair_drag.cpp" +#include "src/lib/buffer_allocator.cpp" +#include "src/lib/embed.cpp" +#include "src/lib/base64.cpp" +#include "src/lib/mmp.cpp" +#include "src/lib/ladspa_manager.cpp" +#include "src/lib/oscillator.cpp" +#include "src/lib/clipboard.cpp" +#include "src/lib/sample_buffer.cpp" +#include "src/core/config_mgr.cpp" +#include "src/core/envelope_and_lfo_widget.cpp" +#include "src/core/song_editor.cpp" +#include "src/core/note.cpp" +#include "src/core/sample_play_handle.cpp" +#include "src/core/piano_roll.cpp" +#include "src/core/arp_and_chords_tab_widget.cpp" +#include "src/core/about_dialog.cpp" +#include "src/core/instrument.cpp" +#include "src/core/main.cpp" +#include "src/core/timeline.cpp" +#include "src/core/note_play_handle.cpp" +#include "src/core/plugin.cpp" +#include "src/core/export_project_dialog.cpp" +#include "src/core/main_window.cpp" +#include "src/core/engine.cpp" +#include "src/core/plugin_browser.cpp" +#include "src/core/setup_dialog.cpp" +#include "src/core/bb_editor.cpp" +#include "src/core/envelope_tab_widget.cpp" +#include "src/core/mixer.cpp" +#include "src/core/piano_widget.cpp" +#include "src/core/name_label.cpp" +#include "src/core/preset_preview_play_handle.cpp" +#include "src/core/track_container.cpp" +#include "src/core/track.cpp" +#include "src/core/file_browser.cpp" +#include "src/core/surround_area.cpp" +#include "src/core/midi_tab_widget.cpp" +#include "src/midi/midi_alsa_seq.cpp" +#include "src/midi/midi_oss.cpp" +#include "src/midi/midi_file.cpp" +#include "src/midi/midi_port.cpp" +#include "src/midi/midi_client.cpp" +#include "src/midi/midi_mapper.cpp" +#include "src/midi/midi_alsa_raw.cpp" +#include "src/audio/audio_oss.cpp" +#include "src/audio/audio_file_device.cpp" +#include "src/audio/audio_alsa.cpp" +#include "src/audio/audio_sdl.cpp" +#include "src/audio/audio_port.cpp" +#include "src/audio/audio_device.cpp" +#include "src/audio/audio_jack.cpp" +#include "src/audio/audio_file_ogg.cpp" +#include "src/audio/audio_sample_recorder.cpp" +#include "src/audio/audio_file_wave.cpp" +#include "src/lmms_single_source.cpp" +#include "src/tracks/pattern.cpp" +#include "src/tracks/bb_track.cpp" +#include "src/tracks/channel_track.cpp" +#include "src/tracks/sample_track.cpp" +#include "src/widgets/project_notes.cpp" +#include "src/widgets/led_checkbox.cpp" +#include "src/widgets/knob.cpp" +#include "src/widgets/pixmap_button.cpp" +#include "src/widgets/qxembed.cpp" +#include "src/widgets/group_box.cpp" +#include "src/widgets/tab_bar.cpp" +#include "src/widgets/kmultitabbar.cpp" +#include "src/widgets/tab_widget.cpp" +#include "src/widgets/combobox.cpp" +#include "src/widgets/rubberband.cpp" +#include "src/widgets/cpuload_widget.cpp" +#include "src/widgets/side_bar_widget.cpp" +#include "src/widgets/visualization_widget.cpp" +#include "src/widgets/text_float.cpp" +#include "src/widgets/tool_button.cpp" +#include "src/widgets/rename_dialog.cpp" +#include "src/widgets/fade_button.cpp" +#include "src/widgets/tempo_sync_knob.cpp" +#include "src/widgets/tooltip.cpp" +#include "src/widgets/nstate_button.cpp" +#include "src/widgets/lcd_spinbox.cpp" +#endif diff --git a/src/midi/midi_alsa_raw.cpp b/src/midi/midi_alsa_raw.cpp index 98647f115..218dc77db 100644 --- a/src/midi/midi_alsa_raw.cpp +++ b/src/midi/midi_alsa_raw.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * midi_alsa_raw.cpp - midi-client for RawMIDI via ALSA * @@ -230,3 +232,5 @@ void midiALSARaw::setupWidget::saveSettings( void ) #endif + +#endif diff --git a/src/midi/midi_alsa_seq.cpp b/src/midi/midi_alsa_seq.cpp index 8a30e2c0d..fa2a3e2e4 100644 --- a/src/midi/midi_alsa_seq.cpp +++ b/src/midi/midi_alsa_seq.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * midi_alsa_seq.cpp - ALSA-sequencer-client * @@ -627,3 +629,5 @@ void midiALSASeq::setupWidget::saveSettings( void ) #endif + +#endif diff --git a/src/midi/midi_client.cpp b/src/midi/midi_client.cpp index ebcf1f894..383f14304 100644 --- a/src/midi/midi_client.cpp +++ b/src/midi/midi_client.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * midi_client.cpp - base-class for MIDI-clients like ALSA-sequencer-client * @@ -375,3 +377,5 @@ Uint8 midiClientRaw::eventLength( const Uint8 _event ) } + +#endif diff --git a/src/midi/midi_mapper.cpp b/src/midi/midi_mapper.cpp index d50109af8..1b5aac455 100644 --- a/src/midi/midi_mapper.cpp +++ b/src/midi/midi_mapper.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * midi_mapper.cpp - MIDI-mapper for any midiDevice * @@ -52,7 +54,7 @@ midiMapper::midiMapper( const QString & _map ) : { m_drumsetKeyMap[i].first = i; } - for( Uint8 i = 0; i < MIDI_CHANNELS; ++i ) + for( Uint8 i = 0; i < MIDI_CHANNEL_COUNT; ++i ) { m_channelMap[i] = i; } @@ -233,7 +235,7 @@ void midiMapper::readChannelMap( QFile & _f ) Uint8 mch = line.section( '=', 1, 1 ).mid( 1 ). section( ' ', 0, 0 ). toInt(); - if( ch < MIDI_CHANNELS && mch < MIDI_CHANNELS ) + if( ch < MIDI_CHANNEL_COUNT && mch < MIDI_CHANNEL_COUNT ) { m_channelMap[ch] = mch; if( line.contains( QRegExp( "Keymap *\"Drumset\"" ) ) ) @@ -255,3 +257,5 @@ void midiMapper::readChannelMap( QFile & _f ) #undef indexOf + +#endif diff --git a/src/midi/midi_oss.cpp b/src/midi/midi_oss.cpp index 1dcea6ab0..b6837f447 100644 --- a/src/midi/midi_oss.cpp +++ b/src/midi/midi_oss.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * midi_oss.cpp - OSS-raw-midi-client * @@ -173,3 +175,5 @@ void midiOSS::setupWidget::saveSettings( void ) #endif + +#endif diff --git a/src/midi/midi_port.cpp b/src/midi/midi_port.cpp index 6039c4c06..092231659 100644 --- a/src/midi/midi_port.cpp +++ b/src/midi/midi_port.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * midi_port.cpp - abstraction of MIDI-ports which are part of LMMS's MIDI- * sequencing system @@ -92,3 +94,5 @@ void midiPort::processOutEvent( const midiEvent & _me, const midiTime & _time ) } + +#endif diff --git a/src/tracks/bb_track.cpp b/src/tracks/bb_track.cpp index 1f265d38e..15433a94c 100644 --- a/src/tracks/bb_track.cpp +++ b/src/tracks/bb_track.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * bb_track.cpp - implementation of class bbTrack and bbTCO * @@ -88,14 +90,14 @@ void bbTCO::constructContextMenu( QMenu * _cm ) { #ifdef QT4 QAction * a = new QAction( embed::getIconPixmap( "bb_track" ), - tr( "Open in Beat+Bassline-Editor" ), + 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+Bassline-Editor" ), + tr( "Open in Beat+Baseline-Editor" ), this, SLOT( openInBBEditor() ), 0, -1, 0 ); #endif @@ -291,7 +293,7 @@ bbTrack::bbTrack( trackContainer * _tc ) : csize bbNum = s_infoMap.size(); s_infoMap[this] = bbNum; - m_trackLabel = new nameLabel( tr( "Beat/Bassline %1" ).arg( bbNum ), + m_trackLabel = new nameLabel( tr( "Beat/Baseline %1" ).arg( bbNum ), getTrackSettingsWidget(), eng() ); m_trackLabel->setPixmap( embed::getIconPixmap( "bb_track" ) ); m_trackLabel->setGeometry( 1, 1, DEFAULT_SETTINGS_WIDGET_WIDTH - 2, @@ -517,3 +519,5 @@ void bbTrack::clickedTrackLabel( void ) #include "bb_track.moc" + +#endif diff --git a/src/tracks/pattern.cpp b/src/tracks/pattern.cpp index 4b130a703..822ba62ba 100644 --- a/src/tracks/pattern.cpp +++ b/src/tracks/pattern.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * pattern.cpp - implementation of class pattern which holds notes * @@ -229,6 +231,7 @@ midiTime pattern::length( void ) const note * pattern::addNote( const note & _new_note ) { note * new_note = new note( _new_note ); + new_note->quantizePos( eng()->getPianoRoll()->quantization() ); if( m_notes.size() == 0 || m_notes.back()->pos() <= new_note->pos() ) { @@ -1342,3 +1345,5 @@ void patternFreezeThread::run( void ) #include "pattern.moc" + +#endif diff --git a/src/tracks/sample_track.cpp b/src/tracks/sample_track.cpp index 761166d21..893a381ba 100644 --- a/src/tracks/sample_track.cpp +++ b/src/tracks/sample_track.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * sample_track.cpp - implementation of class sampleTrack, a track which * provides arrangement of samples @@ -474,3 +476,5 @@ void sampleTrack::loadTrackSpecificSettings( const QDomElement & _this ) #include "sample_track.moc" + +#endif diff --git a/src/widgets/combobox.cpp b/src/widgets/combobox.cpp index 9586d0766..1b15999b6 100644 --- a/src/widgets/combobox.cpp +++ b/src/widgets/combobox.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * combobox.cpp - implementation of LMMS-combobox * @@ -230,7 +232,6 @@ void comboBox::paintEvent( QPaintEvent * _pe ) if( m_items.size() > 0 ) { - p.setPen( QColor( 224, 224, 224 ) ); p.setFont( font() ); p.setClipRect( QRect( 5, 2, width() - CB_ARROW_BTN_WIDTH - 8, height() - 2 ) ); @@ -241,6 +242,10 @@ void comboBox::paintEvent( QPaintEvent * _pe ) p.drawPixmap( tx, 3, item_pm ); tx += item_pm.width() + 2; } + p.setPen( QColor( 64, 64, 64 ) ); + p.drawText( tx+1, p.fontMetrics().height()+1, + m_items[currentIndex()].first ); + p.setPen( QColor( 224, 224, 224 ) ); p.drawText( tx, p.fontMetrics().height(), m_items[currentIndex()].first ); } @@ -293,3 +298,5 @@ void comboBox::setItem( int _item ) #include "combobox.moc" + +#endif diff --git a/src/widgets/cpuload_widget.cpp b/src/widgets/cpuload_widget.cpp index e4660f917..81a07d8bc 100644 --- a/src/widgets/cpuload_widget.cpp +++ b/src/widgets/cpuload_widget.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * cpuload_widget.cpp - widget for displaying CPU-load (partly based on * Hydrogen's CPU-load-widget) @@ -117,3 +119,5 @@ void cpuloadWidget::updateCpuLoad() #include "cpuload_widget.moc" + +#endif diff --git a/src/widgets/fade_button.cpp b/src/widgets/fade_button.cpp index cecf5d855..e1fa131b7 100644 --- a/src/widgets/fade_button.cpp +++ b/src/widgets/fade_button.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * fade_button.cpp - implementation of fade-button * @@ -139,3 +141,5 @@ void fadeButton::nextState( void ) #include "fade_button.moc" + +#endif diff --git a/src/widgets/group_box.cpp b/src/widgets/group_box.cpp index 4f2b146e9..a85149da8 100644 --- a/src/widgets/group_box.cpp +++ b/src/widgets/group_box.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * group_box.cpp - groupbox for LMMS * @@ -68,6 +70,7 @@ groupBox::groupBox( const QString & _caption, QWidget * _parent ) : s_ledBg = new QPixmap( embed::getIconPixmap( "groupbox_led_bg" ) ); } + updatePixmap(); m_led = new pixmapButton( this ); @@ -239,3 +242,5 @@ void groupBox::updatePixmap( void ) #include "group_box.moc" + +#endif diff --git a/src/widgets/kmultitabbar.cpp b/src/widgets/kmultitabbar.cpp index ed06e09e6..1e585844a 100644 --- a/src/widgets/kmultitabbar.cpp +++ b/src/widgets/kmultitabbar.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + #include "templates.h" #include "tooltip.h" @@ -1689,3 +1691,5 @@ buttonList * KMultiTabBar::buttons() {return &m_buttons;} + +#endif diff --git a/src/widgets/knob.cpp b/src/widgets/knob.cpp index a83e7863b..b7452a0dd 100644 --- a/src/widgets/knob.cpp +++ b/src/widgets/knob.cpp @@ -1,8 +1,10 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * knob.cpp - powerful knob-widget * - * This file is based on the knob-widget of the Qwt Widget Library from - * Josef Wilgen + * This file is partly based on the knob-widget of the Qwt Widget Library by + * Josef Wilgen. * * Copyright (c) 2004-2006 Tobias Doerffel * @@ -80,10 +82,6 @@ -static double MinRelStep = 1.0e-10; -static double DefaultRelStep = 1.0e-2; -static double MinEps = 1.0e-10; - float knob::s_copiedValue = 0.0f; textFloat * knob::s_textFloat = NULL; @@ -98,6 +96,7 @@ knob::knob( int _knob_num, QWidget * _parent, const QString & _name, #endif ), engineObject( _engine ), + automatableObject(), m_mouseOffset( 0.0f ), m_buttonPressed( FALSE ), m_angle( 0.0f ), @@ -105,12 +104,6 @@ knob::knob( int _knob_num, QWidget * _parent, const QString & _name, m_hintTextBeforeValue( "" ), m_hintTextAfterValue( "" ), m_label( "" ), - m_minValue( 0.0f ), - m_maxValue( 100.0f ), - m_value( 0.0f ), - m_exactValue( 0.0f ), - m_exactPrevValue( 0.0f ), - m_prevValue( 0.0f ), m_initValue( 0.0f ) { if( s_textFloat == NULL ) @@ -274,11 +267,11 @@ float knob::getValue( const QPoint & _p ) const float arc = atan2( -dx, dy ) * 180.0 / M_PI; - float new_value = 0.5 * ( m_minValue + m_maxValue ) + - arc * ( m_maxValue - m_minValue ) / + float new_value = 0.5 * ( minValue() + maxValue() ) + + arc * ( maxValue() - minValue() ) / m_totalAngle; - const float oneTurn = tAbs( m_maxValue - m_minValue ) * + const float oneTurn = tAbs( maxValue() - minValue() ) * 360.0 / m_totalAngle; const float eqValue = value() + m_mouseOffset; @@ -329,14 +322,14 @@ void knob::recalcAngle( void ) // // calculate the angle corresponding to the value // - if( m_maxValue == m_minValue ) + if( maxValue() == minValue() ) { m_angle = 0; } else { - m_angle = ( value() - 0.5 * ( m_minValue + m_maxValue ) ) / - ( m_maxValue - m_minValue ) * m_totalAngle; + m_angle = ( value() - 0.5 * ( minValue() + maxValue() ) ) / + ( maxValue() - minValue() ) * m_totalAngle; m_angle = static_cast( m_angle ) % 360; } } @@ -529,9 +522,13 @@ void knob::paintEvent( QPaintEvent * _me ) 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 - - QFontMetrics( p.font() ).width( m_label ) / 2, + p.fontMetrics().width( m_label ) / 2, height() - 2, m_label ); } #ifndef QT4 @@ -570,22 +567,15 @@ void knob::wheelEvent( QWheelEvent * _we ) QPoint( m_knobPixmap->width() + 2, 0 ) ); s_textFloat->setVisibilityTimeOut( 1000 ); - if( value() != m_prevValue ) - { - emit sliderMoved( value() ); - } + emit sliderMoved( value() ); } -//! Emits a valueChanged() signal if necessary void knob::buttonReleased( void ) { - if( value() != m_prevValue ) - { - emit valueChanged( value() ); - } + emit valueChanged( value() ); } @@ -600,26 +590,25 @@ void knob::setPosition( const QPoint & _p ) } else { - setValue( m_value - getValue( _p ) ); + setValue( value() - getValue( _p ) ); } } -void knob::setValue( float _val, bool _is_init_value ) +void knob::setValue( const float _x ) { - if( _is_init_value ) + const float prev_value = value(); + automatableObject::setValue( _x ); + if( prev_value != value() ) { - m_initValue = _val; + valueChange(); } - - setNewValue( _val, TRUE ); } - - +/* void knob::fitValue( float _val ) { setValue( _val ); @@ -632,49 +621,26 @@ void knob::incValue( int _steps ) { setValue( m_value + float( _steps ) * m_step ); } +*/ - -void knob::setRange( float _vmin, float _vmax, float _vstep, int _page_size ) +void knob::setRange( const float _min, const float _max, const float _step ) { - int rchg = ( ( m_maxValue != _vmax ) || ( m_minValue != _vmin ) ); + bool rchg = ( ( maxValue() != _max ) || ( minValue() != _min ) ); + automatableObject::setRange( _min, _max, _step ); - if( rchg ) - { - m_minValue = _vmin; - m_maxValue = _vmax; - } + m_pageSize = tMax( ( maxValue() - minValue() ) / 100.0f, + step() ); - // - // look if the step width has an acceptable - // value or otherwise change it. - // - setStep( _vstep ); - - // - // limit page size - // -/* m_pageSize = tLimit( pageSize, 0, int( tAbs( ( m_maxValue - - m_minValue ) / m_step ) ) ); */ - m_pageSize = tMax( ( m_maxValue - m_minValue ) / 100.0f, - m_step ); - - // - // If the value lies out of the range, it - // will be changed. Note that it will not be adjusted to - // the new step width. - setNewValue( m_value, FALSE ); - - // call notifier after the step width has been - // adjusted. + // call notifier after the step width has been adjusted. if( rchg ) { rangeChange(); } } - +/* void knob::setNewValue( float _x, bool _align ) @@ -753,7 +719,7 @@ void knob::setStep( float _vstep ) m_step = newStep; } } - +*/ @@ -851,3 +817,5 @@ void knob::displayHelp( void ) #ifndef QT4 #undef addSeparator #endif + +#endif diff --git a/src/widgets/lcd_spinbox.cpp b/src/widgets/lcd_spinbox.cpp index b2e91a16c..1424edcec 100644 --- a/src/widgets/lcd_spinbox.cpp +++ b/src/widgets/lcd_spinbox.cpp @@ -1,7 +1,9 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * lcd_spinbox.cpp - class lcdSpinBox, an improved QLCDNumber * - * Copyright (c) 2005 Tobias Doerffel + * Copyright (c) 2005-2006 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -49,9 +51,7 @@ lcdSpinBox::lcdSpinBox( int _min, int _max, int _num_digits, QWidget * _parent ) : QWidget( _parent ), - m_minValue( _min ), - m_maxValue( _max ), - m_step( 1 ), + automatableObject( 0, _min, _max ), m_label( NULL ), m_origMousePos() { @@ -77,22 +77,22 @@ lcdSpinBox::~lcdSpinBox() -void lcdSpinBox::setStep( int _step ) + +void lcdSpinBox::setStep( const int _step ) { - m_step = tMax( _step, 1 ); + automatableObject::setStep( tMax( _step, 1 ) ); } -void lcdSpinBox::setValue( int _value ) +void lcdSpinBox::setValue( const int _value ) { - _value = ( ( tLimit( _value, m_minValue, m_maxValue ) - m_minValue ) / - m_step ) * m_step + m_minValue; - QString s = m_textForValue[_value]; + automatableObject::setValue( _value ); + QString s = m_textForValue[value()]; if( s == "" ) { - s = QString::number( _value ); + s = QString::number( value() ); while( (int) s.length() < m_number->numDigits() ) { s = "0" + s; @@ -169,7 +169,7 @@ void lcdSpinBox::mouseMoveEvent( QMouseEvent * _me ) int dy = _me->globalY() - m_origMousePos.y(); if( dy > 1 || dy < -1 ) { - setValue( value() - dy / 2 * m_step ); + setValue( value() - dy / 2 * step() ); emit valueChanged( value() ); QCursor::setPos( m_origMousePos ); } @@ -191,7 +191,7 @@ void lcdSpinBox::mouseReleaseEvent( QMouseEvent * _me ) void lcdSpinBox::wheelEvent( QWheelEvent * _we ) { _we->accept(); - setValue( value() + ( ( _we->delta() > 0 ) ? 1 : -1 ) * m_step ); + setValue( value() + ( ( _we->delta() > 0 ) ? 1 : -1 ) * step() ); emit valueChanged( value() ); } @@ -200,3 +200,5 @@ void lcdSpinBox::wheelEvent( QWheelEvent * _we ) #include "lcd_spinbox.moc" + +#endif diff --git a/src/widgets/led_checkbox.cpp b/src/widgets/led_checkbox.cpp index ed2e876bc..d59c4965f 100644 --- a/src/widgets/led_checkbox.cpp +++ b/src/widgets/led_checkbox.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * led_checkbox.cpp - class ledCheckBox, an improved QCheckBox * @@ -55,7 +57,7 @@ static const QString names[ledCheckBox::TOTAL_COLORS] = ledCheckBox::ledCheckBox( const QString & _text, QWidget * _parent, ledColors _color ) : QWidget( _parent ), - m_checked( FALSE ), + automatableObject( FALSE, TRUE, FALSE ), m_text( _text ) { if( _color >= TOTAL_COLORS || _color < YELLOW ) @@ -104,9 +106,9 @@ void ledCheckBox::mousePressEvent( QMouseEvent * _me ) void ledCheckBox::toggle( void ) { - m_checked = !m_checked; + setValue( !value() ); update(); - emit( toggled( m_checked ) ); + emit( toggled( value() ) ); } @@ -120,7 +122,7 @@ void ledCheckBox::setChecked( bool _on ) } else { - emit( toggled( m_checked ) ); + emit( toggled( value() ) ); } } @@ -148,6 +150,9 @@ void ledCheckBox::paintEvent( QPaintEvent * ) p.drawPixmap( 0, 0, *m_ledOffPixmap ); } + p.setPen( QColor( 64, 64, 64 ) ); + p.drawText( m_ledOffPixmap->width() + 3, 9, text() ); + p.setPen( QColor( 255, 255, 255 ) ); p.drawText( m_ledOffPixmap->width() + 2, 8, text() ); #ifndef QT4 @@ -159,3 +164,5 @@ void ledCheckBox::paintEvent( QPaintEvent * ) #include "led_checkbox.moc" + +#endif diff --git a/src/widgets/nstate_button.cpp b/src/widgets/nstate_button.cpp index 0a25c6c68..e9ee70741 100644 --- a/src/widgets/nstate_button.cpp +++ b/src/widgets/nstate_button.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * nstate_button.cpp - implementation of n-state-button * @@ -109,3 +111,5 @@ void nStateButton::mousePressEvent( QMouseEvent * _me ) #include "nstate_button.moc" + +#endif diff --git a/src/widgets/pixmap_button.cpp b/src/widgets/pixmap_button.cpp index 36d3ca06e..2e7ffbad7 100644 --- a/src/widgets/pixmap_button.cpp +++ b/src/widgets/pixmap_button.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * pixmap_button.cpp - implementation of pixmap-button (often used as "themed" * checkboxes/radiobuttons etc) @@ -171,3 +173,5 @@ void pixmapButton::setBgGraphic( const QPixmap & _pm ) #include "pixmap_button.moc" + +#endif diff --git a/src/widgets/project_notes.cpp b/src/widgets/project_notes.cpp index 6de8105fc..1595755a9 100644 --- a/src/widgets/project_notes.cpp +++ b/src/widgets/project_notes.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * project_notes.cpp - implementation of project-notes-editor * @@ -58,7 +60,6 @@ #define setFontFamily setFamily #define setFontPointSize setPointSize #define setTextColor setColor -#define textColor color #define setHtml setText #define toHtml text @@ -597,8 +598,9 @@ void projectNotes::loadSettings( const QDomElement & _this ) #undef setFontItalic #undef setFontFamily #undef setFontPointSize -#undef textColor #undef setTextColor #undef setHtml #undef toHtml + +#endif diff --git a/src/widgets/qxembed.cpp b/src/widgets/qxembed.cpp index 0fd885aa7..8378abff0 100644 --- a/src/widgets/qxembed.cpp +++ b/src/widgets/qxembed.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /**************************************************************************** Implementation of QXEmbed class @@ -1362,3 +1364,5 @@ void QXEmbed::reparent( QWidget * parent, WFlags f, const QPoint & p, bool showI #include "qxembed.moc" #endif #endif // Q_WS_X11 + +#endif diff --git a/src/widgets/rename_dialog.cpp b/src/widgets/rename_dialog.cpp index 05e66e43f..1e6c2fda6 100644 --- a/src/widgets/rename_dialog.cpp +++ b/src/widgets/rename_dialog.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * rename_dialog.cpp - implementation of dialog for renaming something * @@ -88,3 +90,5 @@ void renameDialog::textChanged( const QString & _new_string ) #include "rename_dialog.moc" + +#endif diff --git a/src/widgets/rubberband.cpp b/src/widgets/rubberband.cpp index 3b4e238d6..e1b147ae2 100644 --- a/src/widgets/rubberband.cpp +++ b/src/widgets/rubberband.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * rubberband.cpp - rubberband - either own implementation for Qt3 or wrapper * for Qt4 @@ -161,3 +163,5 @@ vvector rubberBand::selectableObjects( void ) const #include "rubberband.moc" + +#endif diff --git a/src/widgets/side_bar_widget.cpp b/src/widgets/side_bar_widget.cpp index 33dfc5547..52af32bf7 100644 --- a/src/widgets/side_bar_widget.cpp +++ b/src/widgets/side_bar_widget.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * side_bar_widget.cpp - implementation of base-widget for side-bar * @@ -123,3 +125,5 @@ void sideBarWidget::resizeEvent( QResizeEvent * ) #include "side_bar.moc" #include "side_bar_widget.moc" + +#endif diff --git a/src/widgets/tab_bar.cpp b/src/widgets/tab_bar.cpp index 90ae6c84c..2b864b963 100644 --- a/src/widgets/tab_bar.cpp +++ b/src/widgets/tab_bar.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * tab_bar.cpp - implementation of tab-bar * @@ -260,3 +262,5 @@ bool tabBar::allHidden( void ) #include "tab_bar.moc" #include "tab_button.moc" + +#endif diff --git a/src/widgets/tab_widget.cpp b/src/widgets/tab_widget.cpp index 0d1411d8d..ad8f03123 100644 --- a/src/widgets/tab_widget.cpp +++ b/src/widgets/tab_widget.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * tabwidget.cpp - tabwidget for LMMS * @@ -244,3 +246,5 @@ void tabWidget::wheelEvent( QWheelEvent * _we ) #include "tab_widget.moc" + +#endif diff --git a/src/widgets/tempo_sync_knob.cpp b/src/widgets/tempo_sync_knob.cpp index 68fa72eb2..b286eb9f4 100644 --- a/src/widgets/tempo_sync_knob.cpp +++ b/src/widgets/tempo_sync_knob.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * tempo_sync_knob.cpp - adds bpm to ms conversion for knob class * @@ -294,8 +296,7 @@ void tempoSyncKnob::calculateTempoSyncTime( bpm_t _bpm ) ": invalid tempoSyncMode" ); break; } - setValue( 60000.0 / ( _bpm * conversionFactor * m_scale ), - FALSE ); + setValue( 60000.0 / ( _bpm * conversionFactor * m_scale ) ); } else { @@ -391,3 +392,5 @@ void tempoSyncKnob::setSyncIcon( const QPixmap & _new_icon ) #include "tempo_sync_knob.moc" + +#endif diff --git a/src/widgets/text_float.cpp b/src/widgets/text_float.cpp index 77849797c..eb9b81afe 100644 --- a/src/widgets/text_float.cpp +++ b/src/widgets/text_float.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * text_float.cpp - class textFloat, a floating text-label * @@ -280,3 +282,5 @@ void textFloat::updateSize( void ) #undef setParent + +#endif diff --git a/src/widgets/tool_button.cpp b/src/widgets/tool_button.cpp index 7313ff639..e3247b2f5 100644 --- a/src/widgets/tool_button.cpp +++ b/src/widgets/tool_button.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * tool_button.cpp - implementation of LMMS-tool-button for common (cool) look * @@ -102,3 +104,5 @@ void toolButton::toggledBool( bool _on ) #include "tool_button.moc" + +#endif diff --git a/src/widgets/tooltip.cpp b/src/widgets/tooltip.cpp index b78ebe76c..f3a1ab19c 100644 --- a/src/widgets/tooltip.cpp +++ b/src/widgets/tooltip.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * tooltip.cpp - namespace toolTip, a tooltip-wrapper for LMMS * @@ -51,3 +53,5 @@ void toolTip::add( QWidget * _w, const QString & _txt ) } } + +#endif diff --git a/src/widgets/visualization_widget.cpp b/src/widgets/visualization_widget.cpp index 7109c0e66..e764eb3c6 100644 --- a/src/widgets/visualization_widget.cpp +++ b/src/widgets/visualization_widget.cpp @@ -1,3 +1,5 @@ +#ifndef SINGLE_SOURCE_COMPILE + /* * visualization_widget.cpp - widget for visualization of sound-data * @@ -216,3 +218,5 @@ void visualizationWidget::mousePressEvent( QMouseEvent * _me ) #include "visualization_widget.moc" + +#endif