From b1887d62b8d4c4104396cf85ef669970ccbc9e33 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Mon, 10 Apr 2006 08:22:55 +0000 Subject: [PATCH] lot of fixes git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@124 0778d3d1-df1d-0410-868b-ea421aaaa00d --- ChangeLog | 46 +++++++++++++++ acinclude.m4 | 13 ++--- configure.in | 4 +- include/about_dialog.h | 2 +- include/arp_and_chords_tab_widget.h | 2 +- include/audio_device.h | 6 +- include/audio_file_device.h | 2 +- include/audio_jack.h | 8 +-- include/audio_port.h | 2 +- include/audio_sample_recorder.h | 4 +- include/automatable_button.h | 2 +- include/automatable_object.h | 2 +- include/base64.h | 2 +- include/bb_track.h | 4 +- include/clipboard.h | 2 +- include/combobox.h | 10 ++-- include/config_mgr.h | 8 +-- include/cpuload_widget.h | 4 +- include/embed.h | 4 +- include/envelope_and_lfo_widget.h | 6 +- include/envelope_tab_widget.h | 2 +- include/export_project_dialog.h | 2 +- include/fade_button.h | 2 +- include/group_box.h | 2 +- include/gui_templates.h | 6 +- include/import_filter.h | 6 +- include/instrument.h | 4 +- include/instrument_track.h | 8 +-- include/journalling_object.h | 6 +- include/kmultitabbar.h | 6 +- include/knob.h | 4 +- include/ladspa_manager.h | 6 +- include/lcd_spinbox.h | 4 +- include/main_window.h | 6 +- include/midi_alsa_raw.h | 2 +- include/midi_alsa_seq.h | 2 +- include/midi_client.h | 2 +- include/midi_mapper.h | 4 +- include/midi_port.h | 2 +- include/midi_tab_widget.h | 2 +- include/mixer.h | 9 +-- include/name_label.h | 2 +- include/note.h | 2 +- include/nstate_button.h | 6 +- include/pattern.h | 12 ++-- include/piano_roll.h | 6 +- include/piano_widget.h | 6 +- include/pixmap_button.h | 2 +- include/play_handle.h | 2 +- include/plugin.h | 4 +- include/plugin_browser.h | 4 +- include/preset_preview_play_handle.h | 2 +- include/project_journal.h | 6 +- include/project_notes.h | 2 +- include/qt3support.h | 2 +- include/rename_dialog.h | 2 +- include/rubberband.h | 4 +- include/sample_buffer.h | 4 +- include/sample_track.h | 2 +- include/setup_dialog.h | 4 +- include/side_bar.h | 2 +- include/side_bar_widget.h | 4 +- include/spc_bg_hndl_widget.h | 6 +- include/string_pair_drag.h | 2 +- include/surround_area.h | 2 +- include/tab_bar.h | 4 +- include/tab_button.h | 2 +- include/tab_widget.h | 4 +- include/templates.h | 2 +- include/tempo_sync_knob.h | 2 +- include/text_float.h | 4 +- include/timeline.h | 2 +- include/tool_button.h | 4 +- include/track.h | 6 +- include/track_container.h | 8 +-- include/types.h | 20 ++++++- include/visualization_widget.h | 4 +- .../audio_file_processor.cpp | 12 ++-- .../audio_file_processor.h | 2 +- plugins/bit_invader/bit_invader.cpp | 19 +++--- plugins/bit_invader/bit_invader.h | 14 +---- plugins/bit_invader/graph.cpp | 6 +- plugins/bit_invader/graph.h | 6 +- plugins/flp_import/flp_import.cpp | 20 ++++--- plugins/flp_import/flp_import.h | 6 +- plugins/flp_import/unrtf/parse.c | 4 ++ plugins/midi_import/midi_import.cpp | 4 +- plugins/midi_import/midi_import.h | 6 +- plugins/organic/organic.cpp | 10 +--- plugins/organic/organic.h | 14 +---- .../plucked_string_synth.cpp | 2 - .../triple_oscillator/triple_oscillator.cpp | 4 +- plugins/vestige/lvsl_client.cpp | 9 +-- plugins/vestige/lvsl_client.h | 6 +- plugins/vestige/lvsl_server.c | 2 +- plugins/vestige/vestige.cpp | 12 ++-- plugins/vestige/vestige.h | 2 +- plugins/vibed/graph.cpp | 6 +- plugins/vibed/graph.h | 6 +- plugins/vibed/impulse_editor.cpp | 17 ++++-- plugins/vibed/impulse_editor.h | 6 +- plugins/vibed/nine_button_selector.cpp | 9 ++- plugins/vibed/string_container.h | 9 +++ plugins/vibed/vibed.cpp | 7 ++- plugins/vibed/vibrating_string.h | 4 +- src/audio/audio_jack.cpp | 3 +- src/audio/audio_oss.cpp | 2 +- src/core/arp_and_chords_tab_widget.cpp | 2 +- src/core/bb_editor.cpp | 4 +- src/core/envelope_and_lfo_widget.cpp | 58 ++++++++----------- src/core/file_browser.cpp | 2 +- src/core/mixer.cpp | 2 +- src/core/note_play_handle.cpp | 3 +- src/core/preset_preview_play_handle.cpp | 13 ++++- src/core/song_editor.cpp | 8 +-- src/core/track_container.cpp | 4 +- src/lib/embed.cpp | 2 +- src/tracks/instrument_track.cpp | 2 +- 118 files changed, 377 insertions(+), 324 deletions(-) diff --git a/ChangeLog b/ChangeLog index bcba0fb5c..653272bb6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,49 @@ +2006-04-09 Tobias Doerffel + + * src/core/envelope_and_lfo_widget.cpp: + do not show hint when loading settings in which lfo-shape is set to USER + + * src/core/preset_preview_play_handle.cpp: + disable project-journalling while loading preset + + * src/core/preset_preview_play_handle.cpp: + * src/tracks/instrument_track.cpp: + for generating infinite notes, pass valueRanges::max instead + of ~0 to note-play-handle-constructor as ~0 = 1 for signed ints + + * include/types.h: + - changed types of fpab_t and f_cnt_t to be signed - compiler + generates more optimized code this way + - added template-struct "valueRanges", containing members "min" and + "max" which hold the minimum and maximum value of the type the + template is instantiated with + + * plugins/bit_invader/bit_invader.cpp: + - fixed buffer-overflow when loading sample-data from base64 and more + bytes were decoded than allocated in wave-buffer + - delete decoded base64-data after copying it into wave-buffer + +2006-04-08 Tobias Doerffel + + * src/core/envelope_and_lfo_widget.cpp: + - connect valueChanged()-event of lfo-shape-buttongroup with + lfoWaveCh()-slot - fixes bug that clicks at the lfo-wave-buttons + were not recognized + - completely revised level()-method which doesn't have the bug + anymore, that in release-phase the envelope-level simply went down + from sustain-level to zero, now it goes down from the level at which + the note was released, new method is also much cleaner and more + optimized (and optmizable by compiler) + + * src/core/preset_preview_play_handle.cpp: + hide preview-instrument-track-window after loading settings + +2006-04-07 Tobias Doerffel + + * plugins/vibed/vibrating_string.h: + corrected type-names for resample()-method-parameters (f_cnt_t instead + of samplerate_t) + 2006-04-06 Tobias Doerffel * include/config_mgr.h: diff --git a/acinclude.m4 b/acinclude.m4 index 2efbab063..bfdf98990 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -9,7 +9,7 @@ AC_ARG_WITH([qtdir], [ --with-qtdir=DIR Qt installation directory [defau # Check that QTDIR is defined or that --with-qtdir given if test x"$QTDIR" = x ; then # some usual Qt-locations - QT_SEARCH="/usr /usr/lib/qt /usr/lib/qt3 /usr/lib/qt31 /usr/lib/qt32 /usr/lib/qt33 /usr/lib/qt-3.0 /usr/lib/qt-3.1 /usr/lib/qt-3.2 /usr/lib/qt-3.3 usr/local/qt /usr/local/qt3 /usr/local/qt31/ /usr/local/qt32 /usr/local/qt33 /usr/share/qt3 /usr/X11R6 /usr/share/qt4 /usr/local/Trolltech/Qt-4.0.0 /usr/local/Trolltech/Qt-4.0.1 /usr/local/Trolltech/Qt-4.1.0" + QT_SEARCH="/usr /usr/lib/qt /usr/lib/qt3 /usr/lib/qt31 /usr/lib/qt32 /usr/lib/qt33 /usr/lib/qt-3.0 /usr/lib/qt-3.1 /usr/lib/qt-3.2 /usr/lib/qt-3.3 usr/local/qt /usr/local/qt3 /usr/local/qt31/ /usr/local/qt32 /usr/local/qt33 /usr/share/qt3 /usr/X11R6 /usr/share/qt4 /usr/local/Trolltech/Qt-4.0.0 /usr/local/Trolltech/Qt-4.0.1 /usr/local/Trolltech/Qt-4.1.0 /usr/local/Trolltech/Qt-4.1.0" else QT_SEARCH=$QTDIR QTDIR="" @@ -75,12 +75,6 @@ if test x$UIC = x ; then AC_MSG_WARN([*** not found! It's currently not needed but should be part of a proper Qt-devel-tools-installation!]) fi -# qembed is the Qt data embedding utility. -#AC_CHECK_PROG(QEMBED, qembed, $QTDIR/bin/qembed,,$QTDIR/bin/) -#if test x$QEMBED = x ; then -# AC_MSG_ERROR([*** not found! Make sure you have Qt-devel-tools/Qt-extensions installed! On some distributions (e.g. SuSE) the package, containing qembed is also called qt3-extensions.]) -#fi - # lupdate is the Qt translation-update utility. AC_CHECK_PROG(LUPDATE, lupdate, $QTDIR/bin/lupdate,,$QTDIR/bin/) if test x$LUPDATE = x ; then @@ -134,7 +128,10 @@ case "${host}" in if test x$QT_IS_STATIC = xno ; then QT_IS_DYNAMIC=`ls $QTDIR/lib/*.so 2> /dev/null` if test "x$QT_IS_DYNAMIC" = x; then - AC_MSG_ERROR([*** Couldn't find any Qt libraries]) + QT_IS_DYNAMIC=`ls /usr/lib/libQt*so.4 2> /dev/null` + if test "x$QT_IS_DYNAMIC" = x; then + AC_MSG_ERROR([*** Couldn't find any Qt libraries]) + fi fi fi if test "$QT_MAJOR" = "4" ; then diff --git a/configure.in b/configure.in index 703b3007b..1c58e5bdf 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-cvs20060406, tobydox/at/users/dot/sourceforge/dot/net) -AM_INIT_AUTOMAKE(lmms, 0.1.4-cvs20060406) +AC_INIT(lmms, 0.1.4-cvs20060409, tobydox/at/users/dot/sourceforge/dot/net) +AM_INIT_AUTOMAKE(lmms, 0.1.4-cvs20060409) AM_CONFIG_HEADER(config.h) diff --git a/include/about_dialog.h b/include/about_dialog.h index 90f2de7be..14093f646 100644 --- a/include/about_dialog.h +++ b/include/about_dialog.h @@ -30,7 +30,7 @@ #ifdef QT4 -#include +#include #else diff --git a/include/arp_and_chords_tab_widget.h b/include/arp_and_chords_tab_widget.h index ee910f3e4..bdd65a7e5 100644 --- a/include/arp_and_chords_tab_widget.h +++ b/include/arp_and_chords_tab_widget.h @@ -31,7 +31,7 @@ #ifdef QT4 -#include +#include #else diff --git a/include/audio_device.h b/include/audio_device.h index 8c6c9e4d0..0594661d2 100644 --- a/include/audio_device.h +++ b/include/audio_device.h @@ -30,9 +30,9 @@ #ifdef QT4 -#include -#include -#include +#include +#include +#include #else diff --git a/include/audio_file_device.h b/include/audio_file_device.h index 55a47fe44..06539e8ac 100644 --- a/include/audio_file_device.h +++ b/include/audio_file_device.h @@ -31,7 +31,7 @@ #ifdef QT4 -#include +#include #else diff --git a/include/audio_jack.h b/include/audio_jack.h index e159b0b09..2c57dfe9b 100644 --- a/include/audio_jack.h +++ b/include/audio_jack.h @@ -41,10 +41,10 @@ #ifdef QT4 -#include -#include -#include -#include +#include +#include +#include +#include #else diff --git a/include/audio_port.h b/include/audio_port.h index 24ca45ca1..e9a74435e 100644 --- a/include/audio_port.h +++ b/include/audio_port.h @@ -30,7 +30,7 @@ #ifdef QT4 -#include +#include #else diff --git a/include/audio_sample_recorder.h b/include/audio_sample_recorder.h index b93e298b4..71405de84 100644 --- a/include/audio_sample_recorder.h +++ b/include/audio_sample_recorder.h @@ -33,8 +33,8 @@ #ifdef QT4 -#include -#include +#include +#include #else diff --git a/include/automatable_button.h b/include/automatable_button.h index 8572c3983..4ed2e414b 100755 --- a/include/automatable_button.h +++ b/include/automatable_button.h @@ -30,7 +30,7 @@ #ifdef QT4 -#include +#include #else diff --git a/include/automatable_object.h b/include/automatable_object.h index c55782bf9..c91803eec 100755 --- a/include/automatable_object.h +++ b/include/automatable_object.h @@ -271,7 +271,7 @@ protected: { journalEntry je( _je.actionID(), #ifndef QT3 - -_je.data().value(); + -_je.data().value() #else static_cast( -_je.data().toDouble() ) #endif diff --git a/include/base64.h b/include/base64.h index 952bda1cd..98813e576 100644 --- a/include/base64.h +++ b/include/base64.h @@ -31,7 +31,7 @@ #ifndef QT3 -#include +#include #endif diff --git a/include/bb_track.h b/include/bb_track.h index 8b25f3944..c2b9e4086 100644 --- a/include/bb_track.h +++ b/include/bb_track.h @@ -31,8 +31,8 @@ #ifdef QT4 -#include -#include +#include +#include #else diff --git a/include/clipboard.h b/include/clipboard.h index 95bafc031..9027ecbbb 100644 --- a/include/clipboard.h +++ b/include/clipboard.h @@ -35,7 +35,7 @@ #ifdef QT4 -#include +#include #include #else diff --git a/include/combobox.h b/include/combobox.h index b35173db1..8a6ca2b18 100644 --- a/include/combobox.h +++ b/include/combobox.h @@ -30,11 +30,11 @@ #ifdef QT4 -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #else diff --git a/include/config_mgr.h b/include/config_mgr.h index ff6659973..e039e76c1 100644 --- a/include/config_mgr.h +++ b/include/config_mgr.h @@ -36,10 +36,10 @@ #ifdef QT4 -#include -#include -#include -#include +#include +#include +#include +#include #else diff --git a/include/cpuload_widget.h b/include/cpuload_widget.h index cfe6e364b..a336f6829 100644 --- a/include/cpuload_widget.h +++ b/include/cpuload_widget.h @@ -31,8 +31,8 @@ #ifdef QT4 -#include -#include +#include +#include #include #else diff --git a/include/embed.h b/include/embed.h index c3a71582a..f7f888fc0 100644 --- a/include/embed.h +++ b/include/embed.h @@ -30,8 +30,8 @@ #ifdef QT4 -#include -#include +#include +#include #else diff --git a/include/envelope_and_lfo_widget.h b/include/envelope_and_lfo_widget.h index 28ac3203d..a8bd7d6ea 100644 --- a/include/envelope_and_lfo_widget.h +++ b/include/envelope_and_lfo_widget.h @@ -36,9 +36,9 @@ #ifdef QT4 -#include -#include -#include +#include +#include +#include #else diff --git a/include/envelope_tab_widget.h b/include/envelope_tab_widget.h index c3d77b2e1..9fac96afb 100644 --- a/include/envelope_tab_widget.h +++ b/include/envelope_tab_widget.h @@ -32,7 +32,7 @@ #ifdef QT4 -#include +#include #else diff --git a/include/export_project_dialog.h b/include/export_project_dialog.h index 6800541eb..7bf733184 100644 --- a/include/export_project_dialog.h +++ b/include/export_project_dialog.h @@ -35,7 +35,7 @@ #ifdef QT4 -#include +#include #else diff --git a/include/fade_button.h b/include/fade_button.h index 45d9db3de..aba22c657 100644 --- a/include/fade_button.h +++ b/include/fade_button.h @@ -31,7 +31,7 @@ #ifdef QT4 #include -#include +#include #else diff --git a/include/group_box.h b/include/group_box.h index 14fb71623..9ef575f08 100644 --- a/include/group_box.h +++ b/include/group_box.h @@ -30,7 +30,7 @@ #ifdef QT4 -#include +#include #else diff --git a/include/gui_templates.h b/include/gui_templates.h index 627bc4124..f1fbddde0 100644 --- a/include/gui_templates.h +++ b/include/gui_templates.h @@ -30,9 +30,9 @@ #ifdef QT4 -#include -#include -#include +#include +#include +#include #else diff --git a/include/import_filter.h b/include/import_filter.h index 9b6de0310..6fbfb300d 100755 --- a/include/import_filter.h +++ b/include/import_filter.h @@ -36,7 +36,7 @@ #ifdef QT4 -#include +#include #else @@ -96,7 +96,11 @@ protected: inline int readBlock( char * _data, int _len ) { +#ifndef QT3 + return( m_file.read( _data, _len ) ); +#else return( m_file.readBlock( _data, _len ) ); +#endif } inline void ungetChar( int _ch ) diff --git a/include/instrument.h b/include/instrument.h index 3f8c89006..5473f1ec6 100644 --- a/include/instrument.h +++ b/include/instrument.h @@ -37,8 +37,8 @@ #ifdef QT4 -#include -#include +#include +#include #else diff --git a/include/instrument_track.h b/include/instrument_track.h index 5895e8764..315061d6b 100755 --- a/include/instrument_track.h +++ b/include/instrument_track.h @@ -31,10 +31,10 @@ #ifdef QT4 -#include -#include -#include -#include +#include +#include +#include +#include #else diff --git a/include/journalling_object.h b/include/journalling_object.h index 0725cb0b0..d98f6d9b5 100755 --- a/include/journalling_object.h +++ b/include/journalling_object.h @@ -36,9 +36,9 @@ #ifndef QT3 -#include -#include -#include +#include +#include +#include #else diff --git a/include/kmultitabbar.h b/include/kmultitabbar.h index 15c96c16f..971be7ff4 100644 --- a/include/kmultitabbar.h +++ b/include/kmultitabbar.h @@ -28,9 +28,9 @@ #ifndef QT3 #include -#include -#include -#include +#include +#include +#include class QPixmap; class QPainter; diff --git a/include/knob.h b/include/knob.h index c904d56f1..1ea96f4e9 100644 --- a/include/knob.h +++ b/include/knob.h @@ -33,8 +33,8 @@ #ifdef QT4 -#include -#include +#include +#include #else diff --git a/include/ladspa_manager.h b/include/ladspa_manager.h index 3614b7782..a3733166d 100644 --- a/include/ladspa_manager.h +++ b/include/ladspa_manager.h @@ -42,10 +42,10 @@ #ifdef QT4 -#include +#include #include -#include -#include +#include +#include #else diff --git a/include/lcd_spinbox.h b/include/lcd_spinbox.h index 6b14e9a76..d431f90a0 100644 --- a/include/lcd_spinbox.h +++ b/include/lcd_spinbox.h @@ -30,8 +30,8 @@ #ifdef QT4 -#include -#include +#include +#include #else diff --git a/include/main_window.h b/include/main_window.h index 98aeff1f6..a01125fce 100644 --- a/include/main_window.h +++ b/include/main_window.h @@ -30,9 +30,9 @@ #ifdef QT4 -#include -#include -#include +#include +#include +#include #else diff --git a/include/midi_alsa_raw.h b/include/midi_alsa_raw.h index bd9052dbc..ff74f93f0 100644 --- a/include/midi_alsa_raw.h +++ b/include/midi_alsa_raw.h @@ -42,7 +42,7 @@ #ifdef QT4 -#include +#include #else diff --git a/include/midi_alsa_seq.h b/include/midi_alsa_seq.h index 9dd9fa1da..b2964a338 100644 --- a/include/midi_alsa_seq.h +++ b/include/midi_alsa_seq.h @@ -44,7 +44,7 @@ #ifdef QT4 -#include +#include #include #else diff --git a/include/midi_client.h b/include/midi_client.h index 9724433ab..ec34a3299 100644 --- a/include/midi_client.h +++ b/include/midi_client.h @@ -30,7 +30,7 @@ #ifdef QT4 -#include +#include #include #else diff --git a/include/midi_mapper.h b/include/midi_mapper.h index a96d3a887..edd20c4c0 100644 --- a/include/midi_mapper.h +++ b/include/midi_mapper.h @@ -30,8 +30,8 @@ #ifdef QT4 -#include -#include +#include +#include #else diff --git a/include/midi_port.h b/include/midi_port.h index 20a4ab25a..0e4ea6d3f 100644 --- a/include/midi_port.h +++ b/include/midi_port.h @@ -31,7 +31,7 @@ #ifdef QT4 -#include +#include #else diff --git a/include/midi_tab_widget.h b/include/midi_tab_widget.h index 420c0baf0..55e6a2159 100644 --- a/include/midi_tab_widget.h +++ b/include/midi_tab_widget.h @@ -31,7 +31,7 @@ #ifdef QT4 -#include +#include #else diff --git a/include/mixer.h b/include/mixer.h index b113d2aa8..065ec97d8 100644 --- a/include/mixer.h +++ b/include/mixer.h @@ -34,8 +34,8 @@ #ifdef QT4 -#include -#include +#include +#include #else @@ -168,10 +168,7 @@ public: m_playHandles.push_back( _ph ); return( TRUE ); } - else - { - delete _ph; - } + delete _ph; return( FALSE ); } diff --git a/include/name_label.h b/include/name_label.h index 8a6f65f8f..bd8b7a884 100644 --- a/include/name_label.h +++ b/include/name_label.h @@ -32,7 +32,7 @@ #ifdef QT4 #include -#include +#include #else diff --git a/include/note.h b/include/note.h index 711b39354..7b0b1305e 100644 --- a/include/note.h +++ b/include/note.h @@ -35,7 +35,7 @@ #ifdef QT4 -#include +#include #else diff --git a/include/nstate_button.h b/include/nstate_button.h index cafb249b9..e2d25efcf 100644 --- a/include/nstate_button.h +++ b/include/nstate_button.h @@ -34,9 +34,9 @@ #ifdef QT4 -#include -#include -#include +#include +#include +#include #else diff --git a/include/pattern.h b/include/pattern.h index 64576f0a6..a98b8bfb4 100644 --- a/include/pattern.h +++ b/include/pattern.h @@ -31,12 +31,12 @@ #ifdef QT4 -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #else diff --git a/include/piano_roll.h b/include/piano_roll.h index 57a5907aa..f5ee0e252 100644 --- a/include/piano_roll.h +++ b/include/piano_roll.h @@ -31,9 +31,9 @@ #ifdef QT4 -#include -#include -#include +#include +#include +#include #else diff --git a/include/piano_widget.h b/include/piano_widget.h index ac0029003..8f22c79d6 100644 --- a/include/piano_widget.h +++ b/include/piano_widget.h @@ -31,9 +31,9 @@ #ifdef QT4 -#include -#include -#include +#include +#include +#include #else diff --git a/include/pixmap_button.h b/include/pixmap_button.h index 8580551d9..3208b7cd0 100644 --- a/include/pixmap_button.h +++ b/include/pixmap_button.h @@ -30,7 +30,7 @@ #ifdef QT4 -#include +#include #else diff --git a/include/play_handle.h b/include/play_handle.h index c403828a2..43e25e5cf 100644 --- a/include/play_handle.h +++ b/include/play_handle.h @@ -35,7 +35,7 @@ #ifdef QT4 -#include +#include #else diff --git a/include/plugin.h b/include/plugin.h index a67efb9c3..70428429b 100644 --- a/include/plugin.h +++ b/include/plugin.h @@ -35,8 +35,8 @@ #ifdef QT4 -#include -#include +#include +#include #else diff --git a/include/plugin_browser.h b/include/plugin_browser.h index 55ce7ba2a..1942a3a52 100644 --- a/include/plugin_browser.h +++ b/include/plugin_browser.h @@ -35,8 +35,8 @@ #ifdef QT4 -#include -#include +#include +#include #include #else diff --git a/include/preset_preview_play_handle.h b/include/preset_preview_play_handle.h index c3d84ebba..4baced538 100644 --- a/include/preset_preview_play_handle.h +++ b/include/preset_preview_play_handle.h @@ -31,7 +31,7 @@ #ifdef QT4 -#include +#include #else diff --git a/include/project_journal.h b/include/project_journal.h index 50731fa20..6416d0b0a 100755 --- a/include/project_journal.h +++ b/include/project_journal.h @@ -32,9 +32,9 @@ #ifndef QT3 -#include -#include -#include +#include +#include +#include #else diff --git a/include/project_notes.h b/include/project_notes.h index 1c485c530..09aab757a 100644 --- a/include/project_notes.h +++ b/include/project_notes.h @@ -30,7 +30,7 @@ #ifdef QT4 -#include +#include #else diff --git a/include/qt3support.h b/include/qt3support.h index 27a668979..189a06734 100644 --- a/include/qt3support.h +++ b/include/qt3support.h @@ -62,7 +62,7 @@ typedef int csize; #define vstack QStack #define vvector QVector -#include +#include inline QString baseName( const QString & _file ) { diff --git a/include/rename_dialog.h b/include/rename_dialog.h index 374f163db..929dbc0af 100644 --- a/include/rename_dialog.h +++ b/include/rename_dialog.h @@ -31,7 +31,7 @@ #ifdef QT4 -#include +#include #else diff --git a/include/rubberband.h b/include/rubberband.h index 11fdabf54..d3eb89615 100644 --- a/include/rubberband.h +++ b/include/rubberband.h @@ -31,8 +31,8 @@ #ifndef QT3 -#include -#include +#include +#include #else diff --git a/include/sample_buffer.h b/include/sample_buffer.h index 00d574c81..912e84bae 100644 --- a/include/sample_buffer.h +++ b/include/sample_buffer.h @@ -30,8 +30,8 @@ #ifdef QT4 -#include -#include +#include +#include #else diff --git a/include/sample_track.h b/include/sample_track.h index 048d24d2d..f81cc0228 100644 --- a/include/sample_track.h +++ b/include/sample_track.h @@ -31,7 +31,7 @@ #ifdef QT4 -#include +#include #else diff --git a/include/setup_dialog.h b/include/setup_dialog.h index f2aa06d39..e999f0b5d 100644 --- a/include/setup_dialog.h +++ b/include/setup_dialog.h @@ -30,8 +30,8 @@ #ifdef QT4 -#include -#include +#include +#include #else diff --git a/include/side_bar.h b/include/side_bar.h index b1abfda61..966e69b66 100644 --- a/include/side_bar.h +++ b/include/side_bar.h @@ -30,7 +30,7 @@ #ifdef QT4 -#include +#include #else diff --git a/include/side_bar_widget.h b/include/side_bar_widget.h index d34baa1b3..13600712b 100644 --- a/include/side_bar_widget.h +++ b/include/side_bar_widget.h @@ -30,9 +30,9 @@ #ifdef QT4 -#include +#include #include -#include +#include #else diff --git a/include/spc_bg_hndl_widget.h b/include/spc_bg_hndl_widget.h index e7abc908c..fc7520d3d 100644 --- a/include/spc_bg_hndl_widget.h +++ b/include/spc_bg_hndl_widget.h @@ -30,9 +30,9 @@ #ifdef QT4 -#include -#include -#include +#include +#include +#include #else diff --git a/include/string_pair_drag.h b/include/string_pair_drag.h index 09fd30927..f1ef0d243 100644 --- a/include/string_pair_drag.h +++ b/include/string_pair_drag.h @@ -30,7 +30,7 @@ #ifdef QT4 -#include +#include #else diff --git a/include/surround_area.h b/include/surround_area.h index 974ecf42c..14b3b4b27 100644 --- a/include/surround_area.h +++ b/include/surround_area.h @@ -32,7 +32,7 @@ #ifdef QT4 -#include +#include #else diff --git a/include/tab_bar.h b/include/tab_bar.h index 0d951184a..d054e3dc2 100644 --- a/include/tab_bar.h +++ b/include/tab_bar.h @@ -34,8 +34,8 @@ #ifdef QT4 -#include -#include +#include +#include #include #else diff --git a/include/tab_button.h b/include/tab_button.h index 3ae682f1d..1ec938d2e 100644 --- a/include/tab_button.h +++ b/include/tab_button.h @@ -30,7 +30,7 @@ #ifdef QT4 -#include +#include #else diff --git a/include/tab_widget.h b/include/tab_widget.h index 282bdc1a5..4770f4a70 100644 --- a/include/tab_widget.h +++ b/include/tab_widget.h @@ -35,8 +35,8 @@ #ifdef QT4 -#include -#include +#include +#include #else diff --git a/include/templates.h b/include/templates.h index 9b3bb69b0..f32438adb 100644 --- a/include/templates.h +++ b/include/templates.h @@ -30,7 +30,7 @@ #ifdef QT4 -#include +#include #else diff --git a/include/tempo_sync_knob.h b/include/tempo_sync_knob.h index b5d736a0a..254e4af48 100644 --- a/include/tempo_sync_knob.h +++ b/include/tempo_sync_knob.h @@ -28,7 +28,7 @@ #ifdef QT4 -#include +#include #else diff --git a/include/text_float.h b/include/text_float.h index a9711b760..60c974279 100644 --- a/include/text_float.h +++ b/include/text_float.h @@ -30,8 +30,8 @@ #ifdef QT4 -#include -#include +#include +#include #else diff --git a/include/timeline.h b/include/timeline.h index 607ccf673..afacf5253 100644 --- a/include/timeline.h +++ b/include/timeline.h @@ -30,7 +30,7 @@ #ifdef QT4 -#include +#include #else diff --git a/include/tool_button.h b/include/tool_button.h index 410736d16..b0e92d7ac 100644 --- a/include/tool_button.h +++ b/include/tool_button.h @@ -30,8 +30,8 @@ #ifdef QT4 -#include -#include +#include +#include #else diff --git a/include/track.h b/include/track.h index 5c710f690..ddc9d4a4f 100644 --- a/include/track.h +++ b/include/track.h @@ -35,9 +35,9 @@ #ifdef QT4 -#include -#include -#include +#include +#include +#include #else diff --git a/include/track_container.h b/include/track_container.h index 6a0891c6a..52bc50cc9 100644 --- a/include/track_container.h +++ b/include/track_container.h @@ -31,9 +31,9 @@ #ifdef QT4 -#include -#include -#include +#include +#include +#include #else @@ -89,7 +89,7 @@ public: return( FALSE ); } - unsigned int FASTCALL countTracks( track::trackTypes _tt = + Uint16 FASTCALL countTracks( track::trackTypes _tt = track::TOTAL_TRACK_TYPES ) const; void FASTCALL setMutedOfAllTracks( bool _muted ); diff --git a/include/types.h b/include/types.h index ec70f4a9e..675585fee 100644 --- a/include/types.h +++ b/include/types.h @@ -47,13 +47,27 @@ typedef Sint16 int_sample_t; // 16-bit-int-sample typedef Uint32 sample_rate_t; // sample-rate -typedef Uint16 fpab_t; // frames per audio-buffer (0-16384) -typedef Uint32 f_cnt_t; // standard frame-count +typedef Sint16 fpab_t; // frames per audio-buffer (0-16384) +typedef Sint32 f_cnt_t; // standard frame-count typedef Uint8 ch_cnt_t; // channel-count (0-SURROUND_CHANNELS) typedef Uint16 bpm_t; // tempo (MIN_BPM to MAX_BPM) typedef Uint16 bitrate_t; // bitrate in kbps typedef Sint8 fx_ch_t; // FX-channel (0 to MAX_EFFECT_CHANNEL) -typedef Uint32 jo_id_t; // (unique) ID of an journalling object +typedef Uint32 jo_id_t; // (unique) ID of a journalling object + + +template +struct valueRanges +{ + enum + { + max = static_cast( static_cast( ~0 ) > 0 ? + ~0 : ( ( ( T ) 1 << ( sizeof( T ) * 8 - 1 ) ) - 1 ) ), + min = static_cast( static_cast( ~0 ) > 0 ? + 0 : ( -max - 1 ) ) + } ; +} ; + #endif diff --git a/include/visualization_widget.h b/include/visualization_widget.h index 160b8499e..e23be0d63 100644 --- a/include/visualization_widget.h +++ b/include/visualization_widget.h @@ -30,8 +30,8 @@ #ifdef QT4 -#include -#include +#include +#include #else diff --git a/plugins/audio_file_processor/audio_file_processor.cpp b/plugins/audio_file_processor/audio_file_processor.cpp index ac42ec6e0..8e9cf2824 100644 --- a/plugins/audio_file_processor/audio_file_processor.cpp +++ b/plugins/audio_file_processor/audio_file_processor.cpp @@ -27,11 +27,11 @@ #ifdef QT4 -#include -#include +#include +#include #include -#include -#include +#include +#include #else @@ -507,8 +507,8 @@ void audioFileProcessor::paintEvent( QPaintEvent * ) p.setPen( QColor( 0xFF, 0xAA, 0x00 ) ); const QRect graph_rect( 4, 174, 241, 70 ); - const Uint32 frames = tMax( m_sampleBuffer.frames(), - static_cast( 1 ) ); + const f_cnt_t frames = tMax( m_sampleBuffer.frames(), + static_cast( 1 ) ); const Uint16 start_frame_x = m_sampleBuffer.startFrame() * graph_rect.width() / frames; const Uint16 end_frame_x = m_sampleBuffer.endFrame() * diff --git a/plugins/audio_file_processor/audio_file_processor.h b/plugins/audio_file_processor/audio_file_processor.h index cca63ab29..97dabd969 100644 --- a/plugins/audio_file_processor/audio_file_processor.h +++ b/plugins/audio_file_processor/audio_file_processor.h @@ -31,7 +31,7 @@ #ifdef QT4 -#include +#include #else diff --git a/plugins/bit_invader/bit_invader.cpp b/plugins/bit_invader/bit_invader.cpp index c68b52f1d..e1d2a249b 100644 --- a/plugins/bit_invader/bit_invader.cpp +++ b/plugins/bit_invader/bit_invader.cpp @@ -27,17 +27,13 @@ #ifdef QT4 -#include -#include -#include +#include #include -#include -#include +#include #else #include -#include #include #include #include @@ -595,8 +591,6 @@ void bitInvader::saveSettings( QDomDocument & _doc, QDomElement & _this ) void bitInvader::loadSettings( const QDomElement & _this ) { - - // Load sample length sample_length = _this.attribute( "sampleLength" ).toInt() ; @@ -606,13 +600,14 @@ void bitInvader::loadSettings( const QDomElement & _this ) // Load sample shape delete[] sample_shape; sample_shape = new float[sample_length]; - QString sampleString = _this.attribute( "sampleShape"); int size = 0; char * dst = 0; - base64::decode( sampleString, &dst, &size ); - memcpy( sample_shape, dst, size ); + base64::decode( _this.attribute( "sampleShape"), &dst, &size ); + memcpy( sample_shape, dst, tMin( size, sample_length * + sizeof( float ) ) ); - m_graph->setSamplePointer( sample_shape, sample_length ); + delete[] dst; + m_graph->setSamplePointer( sample_shape, sample_length ); // Load LED normalize m_interpolationToggle->setChecked( _this.attribute( diff --git a/plugins/bit_invader/bit_invader.h b/plugins/bit_invader/bit_invader.h index f0e51828b..90f042030 100644 --- a/plugins/bit_invader/bit_invader.h +++ b/plugins/bit_invader/bit_invader.h @@ -28,24 +28,14 @@ #define _BIT_INVADER_H -#ifdef QT4 - -#include - -#else - -#include -#include - -#endif - - #include "instrument.h" #include "spc_bg_hndl_widget.h" #include "graph.h" #include "led_checkbox.h" #include "oscillator.h" +class QPixmap; + class knob; class notePlayHandle; class pixmapButton; diff --git a/plugins/bit_invader/graph.cpp b/plugins/bit_invader/graph.cpp index 3038b5e75..30c3d951a 100644 --- a/plugins/bit_invader/graph.cpp +++ b/plugins/bit_invader/graph.cpp @@ -27,9 +27,9 @@ #ifdef QT4 -#include -#include -#include +#include +#include +#include #else diff --git a/plugins/bit_invader/graph.h b/plugins/bit_invader/graph.h index c71e2f4de..462106a0f 100644 --- a/plugins/bit_invader/graph.h +++ b/plugins/bit_invader/graph.h @@ -30,9 +30,9 @@ #ifdef QT4 -#include -#include -#include +#include +#include +#include #else diff --git a/plugins/flp_import/flp_import.cpp b/plugins/flp_import/flp_import.cpp index 6516d0dc1..ffc50f3e6 100644 --- a/plugins/flp_import/flp_import.cpp +++ b/plugins/flp_import/flp_import.cpp @@ -49,10 +49,10 @@ #ifdef QT4 #include -#include -#include -#include -#include +#include +#include +#include +#include #else @@ -506,12 +506,14 @@ bool flpImport::tryImport( trackContainer * _tc ) case FLP_Text_CommentRTF: { +#ifndef QT3 + QByteArray ba( text, text_len ); + QBuffer buf( &ba ); + buf.open( QBuffer::ReadOnly ); +#else QByteArray ba; ba.setRawData( text, text_len ); QBuffer buf( ba ); -#ifndef QT3 - buf.open( QBuffer::ReadOnly ); -#else buf.open( IO_ReadOnly ); #endif op = html_init(); @@ -521,7 +523,9 @@ bool flpImport::tryImport( trackContainer * _tc ) word_print( word, out ); word_free( word ); op_free( op ); +#ifdef QT3 ba.resetRawData( text, text_len ); +#endif _tc->eng()->getProjectNotes()->setText( out ); outstring = ""; @@ -856,7 +860,7 @@ QString( "echo \"%1\" > /tmp/flp_rtf_comment.rtf ; unrtf -n --html /tmp/flp_rtf_ for( playListItems::const_iterator it = m_plItems.begin(); it != m_plItems.end(); ++it ) { - unsigned int pat_num = ( ( *it ) >> 16 ) - 1; + csize pat_num = ( ( *it ) >> 16 ) - 1; while( _tc->eng()->getBBEditor()->numOfBBs() <= pat_num ) { track::create( track::BB_TRACK, diff --git a/plugins/flp_import/flp_import.h b/plugins/flp_import/flp_import.h index 65ec48c3c..bed004611 100755 --- a/plugins/flp_import/flp_import.h +++ b/plugins/flp_import/flp_import.h @@ -35,9 +35,9 @@ #ifdef QT4 -#include -#include -#include +#include +#include +#include #else diff --git a/plugins/flp_import/unrtf/parse.c b/plugins/flp_import/unrtf/parse.c index f74036d98..cff6275b4 100644 --- a/plugins/flp_import/unrtf/parse.c +++ b/plugins/flp_import/unrtf/parse.c @@ -156,7 +156,11 @@ static int my_getchar (QBuffer* f) error_handler("Cannot allocate read buffer"); } } +#ifndef QT3 + read_buf_end = f->read(read_buf, buffer_size); +#else read_buf_end = f->readBlock(read_buf, buffer_size); +#endif read_buf_index = 0; if (!read_buf_end) return EOF; diff --git a/plugins/midi_import/midi_import.cpp b/plugins/midi_import/midi_import.cpp index 14549c0fa..073f9e1ba 100644 --- a/plugins/midi_import/midi_import.cpp +++ b/plugins/midi_import/midi_import.cpp @@ -32,8 +32,8 @@ #ifdef QT4 #include -#include -#include +#include +#include #else diff --git a/plugins/midi_import/midi_import.h b/plugins/midi_import/midi_import.h index 9893dfceb..be6975b76 100755 --- a/plugins/midi_import/midi_import.h +++ b/plugins/midi_import/midi_import.h @@ -35,9 +35,9 @@ #ifdef QT4 -#include -#include -#include +#include +#include +#include #else diff --git a/plugins/organic/organic.cpp b/plugins/organic/organic.cpp index d58dabdf1..22bfd97fb 100644 --- a/plugins/organic/organic.cpp +++ b/plugins/organic/organic.cpp @@ -27,20 +27,14 @@ #ifdef QT4 -#include -#include -#include +#include #include -#include -#include +#include #else #include -#include -#include #include -#include #include #include #include diff --git a/plugins/organic/organic.h b/plugins/organic/organic.h index 75a78324d..7e494b473 100644 --- a/plugins/organic/organic.h +++ b/plugins/organic/organic.h @@ -27,23 +27,13 @@ #define _ORGANIC_H -#ifdef QT4 - -#include - -#else - -#include -#include - -#endif - - #include "instrument.h" #include "spc_bg_hndl_widget.h" #include "led_checkbox.h" #include "oscillator.h" +class QPixmap; + class knob; class notePlayHandle; class pixmapButton; diff --git a/plugins/plucked_string_synth/plucked_string_synth.cpp b/plugins/plucked_string_synth/plucked_string_synth.cpp index 65ace69a1..6ecceb70e 100644 --- a/plugins/plucked_string_synth/plucked_string_synth.cpp +++ b/plugins/plucked_string_synth/plucked_string_synth.cpp @@ -28,12 +28,10 @@ #ifdef QT4 #include -#include #else #include -#include #endif diff --git a/plugins/triple_oscillator/triple_oscillator.cpp b/plugins/triple_oscillator/triple_oscillator.cpp index 1131bdf78..8736ae0d4 100644 --- a/plugins/triple_oscillator/triple_oscillator.cpp +++ b/plugins/triple_oscillator/triple_oscillator.cpp @@ -28,8 +28,8 @@ #ifdef QT4 #include -#include -#include +#include +#include #else diff --git a/plugins/vestige/lvsl_client.cpp b/plugins/vestige/lvsl_client.cpp index c1fcbe6bf..646345214 100644 --- a/plugins/vestige/lvsl_client.cpp +++ b/plugins/vestige/lvsl_client.cpp @@ -27,10 +27,11 @@ #ifdef QT4 -#include -#include -#include -#include +#include +#include +#include +#include +#include #else diff --git a/plugins/vestige/lvsl_client.h b/plugins/vestige/lvsl_client.h index 215389c6e..805628727 100644 --- a/plugins/vestige/lvsl_client.h +++ b/plugins/vestige/lvsl_client.h @@ -30,8 +30,8 @@ #ifdef QT4 -#include -#include +#include +#include #else @@ -80,7 +80,7 @@ public: void FASTCALL process( const sampleFrame * _in_buf, sampleFrame * _out_buf ); void FASTCALL enqueueMidiEvent( const midiEvent & _event, - const Uint32 _frames_ahead ); + const f_cnt_t _frames_ahead ); void FASTCALL setTempo( const bpm_t _bpm ); const QMap & parameterDump( void ); diff --git a/plugins/vestige/lvsl_server.c b/plugins/vestige/lvsl_server.c index bac231bda..7d917e4f5 100644 --- a/plugins/vestige/lvsl_server.c +++ b/plugins/vestige/lvsl_server.c @@ -512,7 +512,7 @@ void VSTPlugin::enqueueMidiEvent( const midiEvent & _event, -void VSTPlugin::setBlockSize( const Uint16 _bsize ) +void VSTPlugin::setBlockSize( const fpab_t _bsize ) { if( _bsize == m_blockSize ) { diff --git a/plugins/vestige/vestige.cpp b/plugins/vestige/vestige.cpp index 34c573091..b6c304233 100644 --- a/plugins/vestige/vestige.cpp +++ b/plugins/vestige/vestige.cpp @@ -28,12 +28,12 @@ #ifdef QT4 #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #else diff --git a/plugins/vestige/vestige.h b/plugins/vestige/vestige.h index d45d0be6d..6f27ddf37 100644 --- a/plugins/vestige/vestige.h +++ b/plugins/vestige/vestige.h @@ -31,7 +31,7 @@ #ifdef QT4 -#include +#include #else diff --git a/plugins/vibed/graph.cpp b/plugins/vibed/graph.cpp index f310ae426..0defa9517 100644 --- a/plugins/vibed/graph.cpp +++ b/plugins/vibed/graph.cpp @@ -27,9 +27,9 @@ #ifdef QT4 -#include -#include -#include +#include +#include +#include #else diff --git a/plugins/vibed/graph.h b/plugins/vibed/graph.h index 6976c3452..6cd973678 100644 --- a/plugins/vibed/graph.h +++ b/plugins/vibed/graph.h @@ -30,9 +30,9 @@ #ifdef QT4 -#include -#include -#include +#include +#include +#include #else diff --git a/plugins/vibed/impulse_editor.cpp b/plugins/vibed/impulse_editor.cpp index f341d64f3..e66f869f9 100644 --- a/plugins/vibed/impulse_editor.cpp +++ b/plugins/vibed/impulse_editor.cpp @@ -26,11 +26,12 @@ #ifdef QT4 -#include +#include #include -#include -#include -#include +#include +#include +#include +#include #else @@ -53,7 +54,7 @@ impulseEditor::impulseEditor( QWidget * _parent, int _x, int _y, engine * _engine, Uint32 _len ) : - QWidget( _parent, "impulseEditor" ), + QWidget( _parent/*, "impulseEditor"*/ ), engineObject( _engine ), m_sampleLength( _len ), m_normalizeFactor( 1.0f ), @@ -61,7 +62,13 @@ impulseEditor::impulseEditor( QWidget * _parent, int _x, int _y, { setFixedSize( 153, 124 ); m_base = QPixmap::grabWidget( _parent, _x, _y ); +#ifndef QT3 + QPalette pal = palette(); + pal.setBrush( backgroundRole(), QBrush( m_base ) ); + setPalette( pal ); +#else setPaletteBackgroundPixmap( m_base ); +#endif m_graph = new graph( this, eng() ); m_graph->setForeground( PLUGIN_NAME::getIconPixmap( "wavegraph4" ) ); diff --git a/plugins/vibed/impulse_editor.h b/plugins/vibed/impulse_editor.h index ff9a5820f..93ebe5ade 100644 --- a/plugins/vibed/impulse_editor.h +++ b/plugins/vibed/impulse_editor.h @@ -28,9 +28,9 @@ #ifdef QT4 -#include -#include -#include +#include +#include +#include #else diff --git a/plugins/vibed/nine_button_selector.cpp b/plugins/vibed/nine_button_selector.cpp index 6dcc58bd7..679131604 100644 --- a/plugins/vibed/nine_button_selector.cpp +++ b/plugins/vibed/nine_button_selector.cpp @@ -22,10 +22,13 @@ * */ +#include "qt3support.h" + #ifdef QT4 -#include -#include +#include +#include +#include #else @@ -62,7 +65,7 @@ nineButtonSelector::nineButtonSelector( QPixmap _button0_on, Uint32 _x, Uint32 _y, QWidget * _parent, engine * _engine ): - QWidget( _parent, "nineButtonSelector" ), + QWidget( _parent/*, "nineButtonSelector"*/ ), engineObject( _engine ), m_selected( _default ) { diff --git a/plugins/vibed/string_container.h b/plugins/vibed/string_container.h index 9bdc5dbe5..1406795c7 100644 --- a/plugins/vibed/string_container.h +++ b/plugins/vibed/string_container.h @@ -26,8 +26,17 @@ #include "qt3support.h" +#ifndef QT3 + +#include + +#else + #include +#endif + + #include "config.h" #include "types.h" #include "vibrating_string.h" diff --git a/plugins/vibed/vibed.cpp b/plugins/vibed/vibed.cpp index c44c4111e..c1356ce50 100644 --- a/plugins/vibed/vibed.cpp +++ b/plugins/vibed/vibed.cpp @@ -27,9 +27,10 @@ #ifdef QT4 #include -#include -#include -#include +#include +#include +#include +#include #else diff --git a/plugins/vibed/vibrating_string.h b/plugins/vibed/vibrating_string.h index 624401512..149e091a3 100644 --- a/plugins/vibed/vibrating_string.h +++ b/plugins/vibed/vibrating_string.h @@ -107,8 +107,8 @@ private: delayLine * FASTCALL initDelayLine( int _len, int _pick ); static void FASTCALL freeDelayLine( delayLine * _dl ); void FASTCALL resample( float *_src, - sample_rate_t _src_frames, - sample_rate_t _dst_frames ); + f_cnt_t _src_frames, + f_cnt_t _dst_frames ); /* setDelayLine initializes the string with an impulse at the pick * position unless the impulse is longer than the string, in which diff --git a/src/audio/audio_jack.cpp b/src/audio/audio_jack.cpp index c97d1d5f8..a054c0e36 100644 --- a/src/audio/audio_jack.cpp +++ b/src/audio/audio_jack.cpp @@ -382,7 +382,8 @@ int audioJACK::processCallback( jack_nframes_t _nframes, void * _udata ) { for( Uint8 chnl = 0; chnl < _this->channels(); ++chnl ) { - for( Uint32 frame = 0; frame < todo; ++frame ) + for( jack_nframes_t frame = 0; frame < todo; + ++frame ) { outbufs[chnl][done+frame] = _this->m_outBuf[_this->m_framesDoneInCurBuf+frame][chnl] * diff --git a/src/audio/audio_oss.cpp b/src/audio/audio_oss.cpp index 824fc9c10..bec13aee9 100644 --- a/src/audio/audio_oss.cpp +++ b/src/audio/audio_oss.cpp @@ -328,7 +328,7 @@ void audioOSS::run( void ) while( m_quit == FALSE ) { - const Uint32 frames = getNextBuffer( temp ); + const fpab_t frames = getNextBuffer( temp ); int bytes = convertToS16( temp, frames, getMixer()->masterGain(), outbuf, diff --git a/src/core/arp_and_chords_tab_widget.cpp b/src/core/arp_and_chords_tab_widget.cpp index ec607c25b..2ca510ab3 100644 --- a/src/core/arp_and_chords_tab_widget.cpp +++ b/src/core/arp_and_chords_tab_widget.cpp @@ -539,7 +539,7 @@ void arpAndChordsTabWidget::processNote( notePlayHandle * _n ) // now? if( m_arpModeComboBox->value() == SORT && ( ( cur_frame / arp_frames ) % total_range ) / - range != (Uint32) _n->index() ) + range != (f_cnt_t) _n->index() ) { // update counters frames_processed += arp_frames; diff --git a/src/core/bb_editor.cpp b/src/core/bb_editor.cpp index 33b7280bd..c9c65d36b 100644 --- a/src/core/bb_editor.cpp +++ b/src/core/bb_editor.cpp @@ -214,8 +214,8 @@ tact bbEditor::lengthOfBB( csize _bb ) -bool FASTCALL bbEditor::play( midiTime _start, Uint32 _start_frame, - Uint32 _frames, Uint32 _frame_base, +bool FASTCALL bbEditor::play( midiTime _start, f_cnt_t _start_frame, + f_cnt_t _frames, f_cnt_t _frame_base, Sint16 _tco_num ) { bool played_a_note = FALSE; diff --git a/src/core/envelope_and_lfo_widget.cpp b/src/core/envelope_and_lfo_widget.cpp index 4c16bf239..80e2cffc3 100644 --- a/src/core/envelope_and_lfo_widget.cpp +++ b/src/core/envelope_and_lfo_widget.cpp @@ -432,6 +432,8 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount, m_lfoWaveBtnGrp->addButton( m_userLfoBtn ); m_lfoWaveBtnGrp->setInitValue( SIN ); + connect( m_lfoWaveBtnGrp, SIGNAL( valueChanged( int ) ), + SLOT( lfoWaveCh( int ) ) ); m_x100Cb = new ledCheckBox( tr( "FREQ x 100" ), this, eng() ); m_x100Cb->setFont( pointSize<6>( m_x100Cb->font() ) ); @@ -554,46 +556,33 @@ float FASTCALL envelopeAndLFOWidget::level( f_cnt_t _frame, { return( 0.0f ); } - if( _frame < m_pahdFrames ) + const float lfo_level = lfoLevel( _frame, _frame_offset ); + float env_level; + if( _frame < _release_begin && _frame < m_pahdFrames ) { - if( m_controlEnvAmountCb->isChecked() ) + env_level = m_pahdEnv[_frame]; + } + else if( _frame >= _release_begin ) + { + if( ( _frame -= _release_begin ) < m_rFrames ) { - return( m_pahdEnv[_frame] * ( 0.5f + - lfoLevel( _frame, _frame_offset ) ) ); + env_level = m_rEnv[_frame] * + ( ( _release_begin < m_pahdFrames ) ? + m_pahdEnv[_release_begin] : m_sustainLevel ); } else { - return( m_pahdEnv[_frame] + - lfoLevel( _frame, _frame_offset ) ); + env_level = 0.0f; } } - else if( _frame > _release_begin ) + else { - _frame -= _release_begin; - if( _frame < m_rFrames ) - { - if( m_controlEnvAmountCb->isChecked() ) - { - return( m_rEnv[_frame] * ( 0.5f + - lfoLevel( _frame, _frame_offset ) ) ); - } - else - { - return( m_rEnv[_frame] + - lfoLevel( _frame, _frame_offset ) ); - } - } - else - { - return( 0.0f ); - } + env_level = m_sustainLevel; } - if( m_controlEnvAmountCb->isChecked() ) - { - return( m_sustainLevel * ( 0.5f + - lfoLevel( _frame, _frame_offset ) ) ); - } - return( m_sustainLevel + lfoLevel( _frame, _frame_offset ) ); + return( m_controlEnvAmountCb->isChecked() ? + env_level * ( 0.5f + lfo_level ) + : + env_level + lfo_level ); } @@ -998,8 +987,9 @@ void envelopeAndLFOWidget::updateSampleVars( void ) for( f_cnt_t i = 0; i < m_rFrames; ++i ) { - new_r_env[i] = ( (float)( m_rFrames - i ) / m_rFrames * - m_sustainLevel ) * m_amount; + new_r_env[i] = ( (float)( m_rFrames - i ) / m_rFrames + // * m_sustainLevel + ) * m_amount; } // save this calculation in real-time-part @@ -1117,7 +1107,7 @@ void envelopeAndLFOWidget::lfoWaveCh( int _val ) void envelopeAndLFOWidget::lfoUserWaveCh( bool _on ) { - if( _on ) + if( _on && m_lfoShape != USER ) { if( m_userWave.frames() <= 1 ) { diff --git a/src/core/file_browser.cpp b/src/core/file_browser.cpp index 925d3f3f6..5e37baca1 100644 --- a/src/core/file_browser.cpp +++ b/src/core/file_browser.cpp @@ -581,7 +581,7 @@ void listView::contentsMouseReleaseEvent( QMouseEvent * _me ) if( s != NULL ) { if( s->totalFrames() - s->framesDone() <= - static_cast( + static_cast( eng()->getMixer()->sampleRate() * 3 ) ) { s->setDoneMayReturnTrue( TRUE ); diff --git a/src/core/mixer.cpp b/src/core/mixer.cpp index 921c5e551..3e7b059b5 100644 --- a/src/core/mixer.cpp +++ b/src/core/mixer.cpp @@ -140,7 +140,7 @@ void mixer::stopProcessing( void ) bool mixer::criticalXRuns( void ) const { return( ( m_cpuLoad >= 99 && - eng()->getSongEditor()->realTimeTask() == TRUE ) ); + eng()->getSongEditor()->realTimeTask() == TRUE ) ); } diff --git a/src/core/note_play_handle.cpp b/src/core/note_play_handle.cpp index a13478ce4..2acc87051 100644 --- a/src/core/note_play_handle.cpp +++ b/src/core/note_play_handle.cpp @@ -332,7 +332,8 @@ int notePlayHandle::index( void ) const { const notePlayHandle * nph = dynamic_cast( *it ); - if( nph == NULL || nph->m_instrumentTrack != m_instrumentTrack || + if( nph == NULL || + nph->m_instrumentTrack != m_instrumentTrack || nph->released() == TRUE ) { continue; diff --git a/src/core/preset_preview_play_handle.cpp b/src/core/preset_preview_play_handle.cpp index 178fa725e..1e5bdb955 100644 --- a/src/core/preset_preview_play_handle.cpp +++ b/src/core/preset_preview_play_handle.cpp @@ -47,6 +47,7 @@ #include "mmp.h" #include "debug.h" #include "midi_port.h" +#include "project_journal.h" @@ -143,11 +144,15 @@ presetPreviewPlayHandle::presetPreviewPlayHandle( } + const bool j = eng()->getProjectJournal()->isJournalling(); + eng()->getProjectJournal()->setJournalling( FALSE ); + multimediaProject mmp( _preset_file ); - printf("load track sp\n"); previewTC()->previewInstrumentTrack()->loadTrackSpecificSettings( mmp.content().firstChild().toElement() ); - printf("here\n"); + // preset also contains information about window-states etc. that's why + // here we have to make sure that the instrument-track-window is hidden + previewTC()->previewInstrumentTrack()->hide(); // make sure, our preset-preview-track does not appear in any MIDI- // devices list, so just disable receiving/sending MIDI-events at all @@ -156,7 +161,8 @@ presetPreviewPlayHandle::presetPreviewPlayHandle( // create note-play-handle for it m_previewNote = new notePlayHandle( - previewTC()->previewInstrumentTrack(), 0, ~0, + previewTC()->previewInstrumentTrack(), 0, + valueRanges::max, note( NULL, 0, 0, static_cast( A ), static_cast( DEFAULT_OCTAVE - 1 ), 100 ) ); @@ -164,6 +170,7 @@ presetPreviewPlayHandle::presetPreviewPlayHandle( previewTC()->setPreviewNote( m_previewNote ); previewTC()->unlockData(); + eng()->getProjectJournal()->setJournalling( j ); } diff --git a/src/core/song_editor.cpp b/src/core/song_editor.cpp index 4bd4eb0c7..67bc90ac9 100644 --- a/src/core/song_editor.cpp +++ b/src/core/song_editor.cpp @@ -953,8 +953,8 @@ void songEditor::processNextBuffer( void ) } } - Uint32 total_frames_played = 0; - Uint32 frames_per_tact = static_cast( framesPerTact() ); + f_cnt_t total_frames_played = 0; + f_cnt_t frames_per_tact = static_cast( framesPerTact() ); if( m_playPos[m_playMode].currentFrame() == 0 && m_playPos[m_playMode].getTact64th() > 0 ) { @@ -965,7 +965,7 @@ void songEditor::processNextBuffer( void ) while( total_frames_played < eng()->getMixer()->framesPerAudioBuffer() ) { - Uint32 played_frames = eng()->getMixer()->framesPerAudioBuffer() - + f_cnt_t played_frames = eng()->getMixer()->framesPerAudioBuffer() - total_frames_played; // did we play a whole tact? @@ -1144,7 +1144,7 @@ void songEditor::setPlayPos( tact _tact_num, tact64th _t_64th, playModes { m_playPos[_play_mode].setTact( _tact_num ); m_playPos[_play_mode].setTact64th( _t_64th ); - m_playPos[_play_mode].setCurrentFrame( static_cast( + m_playPos[_play_mode].setCurrentFrame( static_cast( _t_64th * framesPerTact() / 64.0f ) ); if( _play_mode == m_playMode ) { diff --git a/src/core/track_container.cpp b/src/core/track_container.cpp index d93fa712e..acbf7e2f6 100644 --- a/src/core/track_container.cpp +++ b/src/core/track_container.cpp @@ -367,9 +367,9 @@ bool trackContainer::allowRubberband( void ) const -unsigned int trackContainer::countTracks( track::trackTypes _tt ) const +Uint16 trackContainer::countTracks( track::trackTypes _tt ) const { - unsigned int cnt = 0; + Uint16 cnt = 0; for( trackWidgetVector::const_iterator it = m_trackWidgets.begin(); it != m_trackWidgets.end(); ++it ) { diff --git a/src/lib/embed.cpp b/src/lib/embed.cpp index 6712dfbee..93cf8b900 100644 --- a/src/lib/embed.cpp +++ b/src/lib/embed.cpp @@ -29,7 +29,7 @@ #ifdef QT4 -#include +#include #else diff --git a/src/tracks/instrument_track.cpp b/src/tracks/instrument_track.cpp index 3e8343377..3ac5068fb 100644 --- a/src/tracks/instrument_track.cpp +++ b/src/tracks/instrument_track.cpp @@ -621,7 +621,7 @@ void instrumentTrack::processInEvent( const midiEvent & _me, notePlayHandle * nph = new notePlayHandle( this, _time.frames( eng()->getSongEditor()->framesPerTact() ), - ~0, n ); + valueRanges::max, n ); if( eng()->getMixer()->addPlayHandle( nph ) ) {