diff --git a/ChangeLog b/ChangeLog index 653272bb6..9c55060cd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,60 @@ +2006-04-10 Danny McRae + * Makefile.am: + * include/lmms_constants.h: + * include/basic_filters.h: + * include/oscillator.h: + * include/interpolation.h: + * src/widgets/knob.cpp: + converted calculations using PI to single precision + + * src/audio/audio_device.cpp: + * src/audio/audio_alsa.cpp: + * src/audio/audio_file_wave.cpp: + corrected handling of big endian data + + * plugins/vibed/vibed.h: + * plugins/vibed/vibed.cpp: + * plugins/vibed/nine_button_selector.h: + * plugins/vibed/nine_button_selector.cpp: + -added octave to save and restore settings + -removed mysterious m_sampleBuffer that was causing seg faults in the + deconstructor + + * src/core/main_window.cpp: + added checks to handle "gimp like windows" for save and restore widget + states to prevent seg fault + + * data/projects/cool_songs/Djeezus-BeatRolls.mmp: + * data/projects/cool_songs/Djeezus-Oscilisous.mmp: + * data/projects/cool_songs/Marfil-MarfilDrum01.mpp: + * data/projects/cool_songs/Mart-Concave_flow.mpp: + * data/projects/cool_songs/Mart-Dirt_Track.mpp: + * data/projects/cool_songs/MaxFellner-Ease.mpp: + * data/projects/cool_songs/SharkyX-DeadManDancing.mpp: + * data/projects/cool_songs/SharkyX-Experiments.mpp: + * data/projects/cool_songs/Siegel-DreamWave.mpp: + * data/projects/cool_songs/TobyDox-Confused.mpp: + * data/projects/cool_songs/TobyDox-Psycho.mpp: + * data/projects/cool_songs/TobyDox-TheFourthDimension.mpp: + * data/projects/covers/J.S.Bach-Preludium_and_Fuge_A-Minor.mmp: + * data/projects/demos/basses-demo.mpp: + * data/projects/demos/beat-collection.mpp: + * data/projects/demos/demo1.mpp: + * data/projects/demos/demo3.mpp: + * data/projects/demos/demo5.mpp: + * data/projects/demos/demo6.mpp: + * data/projects/demos/loop_collection.mpp: + * data/projects/demos/some_basslines.mpp: + * data/projects/misc/1st.mpp: + * data/projects/misc/time_machine.mpp: + * data/projects/templates/AccousticDrums.mpt: + * data/projects/templates/ClubMix.mpt: + * data/presets/AudioFileProcessor/Bass-Mainia.cs.xml: + * data/presets/AudioFileProcessor/Fat-Reversed-Kick.cs.xml: + * data/presets/AudioFileProcessor/Kick-4-your-Subwoofer.cs.xml: + updated audiofileprocessors to point to factory presets files in /usr/local/share/lmms + + 2006-04-09 Tobias Doerffel * src/core/envelope_and_lfo_widget.cpp: diff --git a/Makefile.am b/Makefile.am index fda00894e..b08db5076 100644 --- a/Makefile.am +++ b/Makefile.am @@ -208,6 +208,7 @@ lmms_SOURCES = \ $(srcdir)/include/audio_sample_recorder.h \ $(srcdir)/include/audio_sdl.h \ $(srcdir)/include/interpolation.h \ + $(srcdir)/include/lmms_constants.h \ $(srcdir)/include/mixer.h \ $(srcdir)/include/pattern.h \ $(srcdir)/include/instrument_track.h \ diff --git a/data/presets/AudioFileProcessor/Bass-Mania.cs.xml b/data/presets/AudioFileProcessor/Bass-Mania.cs.xml index bb5304b32..3204fe8ef 100755 --- a/data/presets/AudioFileProcessor/Bass-Mania.cs.xml +++ b/data/presets/AudioFileProcessor/Bass-Mania.cs.xml @@ -4,7 +4,7 @@ - + diff --git a/data/presets/AudioFileProcessor/Fat-Reversed-Kick.cs.xml b/data/presets/AudioFileProcessor/Fat-Reversed-Kick.cs.xml index 6b6df5e1d..2a2121768 100755 --- a/data/presets/AudioFileProcessor/Fat-Reversed-Kick.cs.xml +++ b/data/presets/AudioFileProcessor/Fat-Reversed-Kick.cs.xml @@ -4,7 +4,7 @@ - + diff --git a/data/presets/AudioFileProcessor/Kick-4-your-Subwoofer.cs.xml b/data/presets/AudioFileProcessor/Kick-4-your-Subwoofer.cs.xml index 7520c16e8..f4f1bf560 100755 --- a/data/presets/AudioFileProcessor/Kick-4-your-Subwoofer.cs.xml +++ b/data/presets/AudioFileProcessor/Kick-4-your-Subwoofer.cs.xml @@ -4,7 +4,7 @@ - + diff --git a/data/projects/cool_songs/Djeezus-BeatRolls.mmp b/data/projects/cool_songs/Djeezus-BeatRolls.mmp index 4b0844db6..daf8699cd 100755 --- a/data/projects/cool_songs/Djeezus-BeatRolls.mmp +++ b/data/projects/cool_songs/Djeezus-BeatRolls.mmp @@ -13,7 +13,7 @@ - + @@ -60,7 +60,7 @@ - + @@ -92,7 +92,7 @@ - + @@ -147,7 +147,7 @@ - + @@ -180,7 +180,7 @@ - + @@ -213,7 +213,7 @@ - + @@ -230,7 +230,7 @@ - + @@ -255,7 +255,7 @@ - + @@ -280,7 +280,7 @@ - + @@ -313,7 +313,7 @@ - + @@ -345,7 +345,7 @@ - + @@ -456,7 +456,7 @@ - + @@ -479,7 +479,7 @@ - + diff --git a/data/projects/cool_songs/Djeezus-Oscilisous.mmp b/data/projects/cool_songs/Djeezus-Oscilisous.mmp index 673e3cddd..02d523342 100755 --- a/data/projects/cool_songs/Djeezus-Oscilisous.mmp +++ b/data/projects/cool_songs/Djeezus-Oscilisous.mmp @@ -13,7 +13,7 @@ - + @@ -42,7 +42,7 @@ - + @@ -69,7 +69,7 @@ - + @@ -98,7 +98,7 @@ - + @@ -127,7 +127,7 @@ - + diff --git a/data/projects/cool_songs/Marfil-MarfilDrum01.mmp b/data/projects/cool_songs/Marfil-MarfilDrum01.mmp index 4612fe414..6ceeaa332 100755 --- a/data/projects/cool_songs/Marfil-MarfilDrum01.mmp +++ b/data/projects/cool_songs/Marfil-MarfilDrum01.mmp @@ -13,7 +13,7 @@ - + @@ -43,7 +43,7 @@ - + @@ -75,7 +75,7 @@ - + @@ -113,7 +113,7 @@ - + @@ -139,7 +139,7 @@ - + @@ -167,7 +167,7 @@ - + @@ -192,7 +192,7 @@ - + @@ -217,7 +217,7 @@ - + @@ -243,7 +243,7 @@ - + @@ -271,7 +271,7 @@ - + @@ -299,7 +299,7 @@ - + @@ -329,7 +329,7 @@ - + @@ -358,7 +358,7 @@ - + @@ -384,7 +384,7 @@ - + @@ -408,7 +408,7 @@ - + @@ -432,7 +432,7 @@ - + diff --git a/data/projects/cool_songs/Mart-Concave_flow.mmp b/data/projects/cool_songs/Mart-Concave_flow.mmp index 59fd08ac8..44bec1906 100755 --- a/data/projects/cool_songs/Mart-Concave_flow.mmp +++ b/data/projects/cool_songs/Mart-Concave_flow.mmp @@ -439,7 +439,7 @@ - + @@ -466,7 +466,7 @@ - + @@ -486,7 +486,7 @@ - + @@ -523,7 +523,7 @@ - + @@ -542,7 +542,7 @@ - + @@ -694,7 +694,7 @@ - + diff --git a/data/projects/cool_songs/Mart-Dirt_Track.mmp b/data/projects/cool_songs/Mart-Dirt_Track.mmp index 859d268b2..e5189d687 100755 --- a/data/projects/cool_songs/Mart-Dirt_Track.mmp +++ b/data/projects/cool_songs/Mart-Dirt_Track.mmp @@ -13,7 +13,7 @@ - + @@ -50,7 +50,7 @@ - + @@ -88,7 +88,7 @@ - + @@ -128,7 +128,7 @@ - + @@ -221,7 +221,7 @@ - + diff --git a/data/projects/cool_songs/MaxFellner-Ease.mmp b/data/projects/cool_songs/MaxFellner-Ease.mmp index c1d90ebd9..ada0bd44e 100755 --- a/data/projects/cool_songs/MaxFellner-Ease.mmp +++ b/data/projects/cool_songs/MaxFellner-Ease.mmp @@ -13,7 +13,7 @@ - + @@ -38,7 +38,7 @@ - + @@ -71,7 +71,7 @@ - + @@ -105,7 +105,7 @@ - + @@ -126,7 +126,7 @@ - + @@ -147,7 +147,7 @@ - + @@ -178,7 +178,7 @@ - + @@ -206,7 +206,7 @@ - + @@ -239,7 +239,7 @@ - + @@ -262,7 +262,7 @@ - + @@ -283,7 +283,7 @@ - + diff --git a/data/projects/cool_songs/SharkyX-DeadManDancing.mmp b/data/projects/cool_songs/SharkyX-DeadManDancing.mmp index 56abc01c9..f606cd738 100755 --- a/data/projects/cool_songs/SharkyX-DeadManDancing.mmp +++ b/data/projects/cool_songs/SharkyX-DeadManDancing.mmp @@ -13,7 +13,7 @@ - + @@ -48,7 +48,7 @@ - + @@ -79,7 +79,7 @@ - + @@ -100,7 +100,7 @@ - + @@ -123,7 +123,7 @@ - + @@ -146,7 +146,7 @@ - + @@ -172,7 +172,7 @@ - + @@ -198,7 +198,7 @@ - + @@ -228,7 +228,7 @@ - + @@ -254,7 +254,7 @@ - + @@ -280,7 +280,7 @@ - + @@ -306,7 +306,7 @@ - + @@ -333,7 +333,7 @@ - + @@ -354,7 +354,7 @@ - + @@ -380,7 +380,7 @@ - + @@ -403,7 +403,7 @@ - + diff --git a/data/projects/cool_songs/SharkyX-Experiments.mmp b/data/projects/cool_songs/SharkyX-Experiments.mmp index 435c14bf8..5cfb6dd96 100755 --- a/data/projects/cool_songs/SharkyX-Experiments.mmp +++ b/data/projects/cool_songs/SharkyX-Experiments.mmp @@ -13,7 +13,7 @@ - + @@ -42,7 +42,7 @@ - + @@ -64,7 +64,7 @@ - + @@ -89,7 +89,7 @@ - + @@ -112,7 +112,7 @@ - + @@ -135,7 +135,7 @@ - + @@ -163,7 +163,7 @@ - + @@ -185,7 +185,7 @@ - + @@ -208,7 +208,7 @@ - + @@ -239,7 +239,7 @@ - + @@ -261,7 +261,7 @@ - + @@ -313,7 +313,7 @@ - + @@ -335,7 +335,7 @@ - + diff --git a/data/projects/cool_songs/Siegel-DreamWave.mmp b/data/projects/cool_songs/Siegel-DreamWave.mmp index 0fa620ccf..dc5392ec6 100755 --- a/data/projects/cool_songs/Siegel-DreamWave.mmp +++ b/data/projects/cool_songs/Siegel-DreamWave.mmp @@ -94,7 +94,7 @@ - + @@ -184,7 +184,7 @@ - + @@ -235,7 +235,7 @@ - + @@ -418,7 +418,7 @@ - + @@ -502,7 +502,7 @@ - + @@ -571,7 +571,7 @@ - + @@ -608,7 +608,7 @@ - + @@ -648,7 +648,7 @@ - + diff --git a/data/projects/cool_songs/TobyDox-Confused.mmp b/data/projects/cool_songs/TobyDox-Confused.mmp index 396468863..d7f2f4a9d 100755 --- a/data/projects/cool_songs/TobyDox-Confused.mmp +++ b/data/projects/cool_songs/TobyDox-Confused.mmp @@ -192,7 +192,7 @@ - + @@ -215,7 +215,7 @@ - + diff --git a/data/projects/cool_songs/TobyDox-Psycho.mmp b/data/projects/cool_songs/TobyDox-Psycho.mmp index a343c5fdb..fb9fb0f97 100755 --- a/data/projects/cool_songs/TobyDox-Psycho.mmp +++ b/data/projects/cool_songs/TobyDox-Psycho.mmp @@ -58,7 +58,7 @@ - + @@ -100,7 +100,7 @@ - + @@ -178,7 +178,7 @@ - + @@ -326,7 +326,7 @@ - + @@ -452,7 +452,7 @@ - + @@ -589,7 +589,7 @@ - + @@ -619,7 +619,7 @@ - + @@ -661,7 +661,7 @@ - + diff --git a/data/projects/cool_songs/TobyDox-TheFourthDimension.mmp b/data/projects/cool_songs/TobyDox-TheFourthDimension.mmp index 55f8259b7..9982aa16c 100755 --- a/data/projects/cool_songs/TobyDox-TheFourthDimension.mmp +++ b/data/projects/cool_songs/TobyDox-TheFourthDimension.mmp @@ -258,7 +258,7 @@ - + @@ -281,7 +281,7 @@ - + @@ -304,7 +304,7 @@ - + @@ -327,7 +327,7 @@ - + @@ -353,7 +353,7 @@ - + diff --git a/data/projects/covers/J.S.Bach-Preludium_and_Fugue_A-Minor.mmp b/data/projects/covers/J.S.Bach-Preludium_and_Fugue_A-Minor.mmp index 6e646720a..f79f5839c 100755 --- a/data/projects/covers/J.S.Bach-Preludium_and_Fugue_A-Minor.mmp +++ b/data/projects/covers/J.S.Bach-Preludium_and_Fugue_A-Minor.mmp @@ -10,7 +10,7 @@ - + @@ -810,7 +810,7 @@ - + @@ -1242,7 +1242,7 @@ - + @@ -4153,7 +4153,7 @@ - + diff --git a/data/projects/demos/basses-demo.mmp b/data/projects/demos/basses-demo.mmp index 35ba50527..08c64dafa 100755 --- a/data/projects/demos/basses-demo.mmp +++ b/data/projects/demos/basses-demo.mmp @@ -441,7 +441,7 @@ - + @@ -461,7 +461,7 @@ - + @@ -476,7 +476,7 @@ - + @@ -496,7 +496,7 @@ - + diff --git a/data/projects/demos/beat_collection.mmp b/data/projects/demos/beat_collection.mmp index fe4aa7975..a25413079 100755 --- a/data/projects/demos/beat_collection.mmp +++ b/data/projects/demos/beat_collection.mmp @@ -13,7 +13,7 @@ - + @@ -32,7 +32,7 @@ - + @@ -68,7 +68,7 @@ - + @@ -105,7 +105,7 @@ - + @@ -133,7 +133,7 @@ - + @@ -153,7 +153,7 @@ - + @@ -173,7 +173,7 @@ - + @@ -192,7 +192,7 @@ - + @@ -233,7 +233,7 @@ - + @@ -253,7 +253,7 @@ - + @@ -274,7 +274,7 @@ - + @@ -296,7 +296,7 @@ - + @@ -322,7 +322,7 @@ - + @@ -347,7 +347,7 @@ - + @@ -374,7 +374,7 @@ - + @@ -393,7 +393,7 @@ - + @@ -414,7 +414,7 @@ - + diff --git a/data/projects/demos/demo1.mmp b/data/projects/demos/demo1.mmp index e1e47bf08..b38775ed9 100755 --- a/data/projects/demos/demo1.mmp +++ b/data/projects/demos/demo1.mmp @@ -13,7 +13,7 @@ - + @@ -37,7 +37,7 @@ - + @@ -63,7 +63,7 @@ - + diff --git a/data/projects/demos/demo3.mmp b/data/projects/demos/demo3.mmp index ede72395f..bed572db8 100755 --- a/data/projects/demos/demo3.mmp +++ b/data/projects/demos/demo3.mmp @@ -42,7 +42,7 @@ - + @@ -65,7 +65,7 @@ - + @@ -99,7 +99,7 @@ - + @@ -120,7 +120,7 @@ - + @@ -380,8 +380,8 @@ - - + + diff --git a/data/projects/demos/demo5.mmp b/data/projects/demos/demo5.mmp index 78e686566..c3224a024 100755 --- a/data/projects/demos/demo5.mmp +++ b/data/projects/demos/demo5.mmp @@ -13,7 +13,7 @@ - + @@ -40,7 +40,7 @@ - + @@ -67,7 +67,7 @@ - + @@ -91,7 +91,7 @@ - + @@ -108,7 +108,7 @@ - + diff --git a/data/projects/demos/demo6.mmp b/data/projects/demos/demo6.mmp index df3d0b09f..6b6409c76 100755 --- a/data/projects/demos/demo6.mmp +++ b/data/projects/demos/demo6.mmp @@ -13,7 +13,7 @@ - + @@ -34,7 +34,7 @@ - + @@ -51,7 +51,7 @@ - + @@ -70,7 +70,7 @@ - + @@ -90,7 +90,7 @@ - + @@ -109,7 +109,7 @@ - + diff --git a/data/projects/demos/loop_collection.mmp b/data/projects/demos/loop_collection.mmp index 031722443..07110ee7d 100755 --- a/data/projects/demos/loop_collection.mmp +++ b/data/projects/demos/loop_collection.mmp @@ -13,7 +13,7 @@ - + @@ -37,7 +37,7 @@ - + @@ -59,7 +59,7 @@ - + diff --git a/data/projects/demos/some_basslines.mmp b/data/projects/demos/some_basslines.mmp index a8a3ed6c5..d508ea7e2 100755 --- a/data/projects/demos/some_basslines.mmp +++ b/data/projects/demos/some_basslines.mmp @@ -13,7 +13,7 @@ - + @@ -48,7 +48,7 @@ - + @@ -79,7 +79,7 @@ - + @@ -108,7 +108,7 @@ - + @@ -138,7 +138,7 @@ - + diff --git a/data/projects/misc/1st.mmp b/data/projects/misc/1st.mmp index 2e36ee5a4..c4dd3bcfa 100755 --- a/data/projects/misc/1st.mmp +++ b/data/projects/misc/1st.mmp @@ -13,7 +13,7 @@ - + @@ -35,7 +35,7 @@ - + @@ -53,7 +53,7 @@ - + @@ -73,7 +73,7 @@ - + @@ -137,7 +137,7 @@ - + diff --git a/data/projects/misc/time_machine.mmp b/data/projects/misc/time_machine.mmp index 8f50c78bd..7980a3a45 100755 --- a/data/projects/misc/time_machine.mmp +++ b/data/projects/misc/time_machine.mmp @@ -38,7 +38,7 @@ - + @@ -72,7 +72,7 @@ - + @@ -103,7 +103,7 @@ - + @@ -385,7 +385,7 @@ - + @@ -410,7 +410,7 @@ - + @@ -435,7 +435,7 @@ - + @@ -460,7 +460,7 @@ - + @@ -485,7 +485,7 @@ - + diff --git a/data/projects/templates/AcousticDrumset.mpt b/data/projects/templates/AcousticDrumset.mpt index d43031c23..4d56b15d9 100755 --- a/data/projects/templates/AcousticDrumset.mpt +++ b/data/projects/templates/AcousticDrumset.mpt @@ -13,7 +13,7 @@ - + @@ -26,7 +26,7 @@ - + @@ -39,7 +39,7 @@ - + @@ -52,7 +52,7 @@ - + @@ -65,7 +65,7 @@ - + diff --git a/data/projects/templates/ClubMix.mpt b/data/projects/templates/ClubMix.mpt index e1d583715..d8706aa18 100755 --- a/data/projects/templates/ClubMix.mpt +++ b/data/projects/templates/ClubMix.mpt @@ -13,7 +13,7 @@ - + @@ -26,7 +26,7 @@ - + @@ -39,7 +39,7 @@ - + @@ -52,7 +52,7 @@ - + @@ -65,7 +65,7 @@ - + @@ -78,7 +78,7 @@ - + diff --git a/include/basic_filters.h b/include/basic_filters.h index 1dff884ca..8eee65eb1 100644 --- a/include/basic_filters.h +++ b/include/basic_filters.h @@ -38,6 +38,7 @@ #include "types.h" #include "mixer.h" #include "templates.h" +#include "lmms_constants.h" //const int MOOG_VOLTAGE = 40000; @@ -273,7 +274,7 @@ public: 0.6490 * kfc + 0.9988; const float kacr = -3.9364 * ( kfc*kfc ) + 1.8409 * kfc + 0.9968; - m_p = MOOG_VOLTAGE * ( 1 - expf( -2.0 * M_PI * + m_p = MOOG_VOLTAGE * ( 1 - expf( F_2PI * kfcr * kf ) ); m_r = 4 * _q * kacr; break; @@ -282,7 +283,7 @@ public: default: { // other filters - const float omega = 2.0f * M_PI * _freq * + const float omega = F_2PI * _freq * m_sampleRate; const float tsin = sinf( omega ); const float tcos = cosf( omega ); diff --git a/include/interpolation.h b/include/interpolation.h index 5e7b5cfed..27c6cdcd8 100644 --- a/include/interpolation.h +++ b/include/interpolation.h @@ -31,7 +31,7 @@ #endif #include - +#include "lmms_constants.h" inline float hermiteInterpolate( float x0, float x1, float x2, float x3, float frac_pos ) @@ -79,7 +79,7 @@ inline float cubicInterpolate( float v0, float v1, float v2, float v3, float x ) inline float cosinusInterpolate( float v0, float v1, float x ) { - float f = cosf( x * ( M_PI*0.5f ) ); + float f = cosf( x * ( F_PI_2 ) ); return( v0*f + v1*( 1.0f-f ) ); } diff --git a/include/lmms_constants.h b/include/lmms_constants.h new file mode 100644 index 000000000..0faf67d40 --- /dev/null +++ b/include/lmms_constants.h @@ -0,0 +1,30 @@ +/* + * lmms_constants.h - defines system constants + * + * Copyright (c) 2006 Danny McRae + * + * 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 _LMMS_CONSTANTS_H +#define _LMMS_CONSTANTS_H + +const float F_PI = 3.141593f; +const float F_2PI = 6.283185f; +const float F_PI_2 = 1.570796f; +#endif diff --git a/include/oscillator.h b/include/oscillator.h index f90a4886d..18227922c 100644 --- a/include/oscillator.h +++ b/include/oscillator.h @@ -36,6 +36,7 @@ #include "mixer.h" #include "interpolation.h" +#include "lmms_constants.h" // fwd-decl because we need it for the typedef below... @@ -138,7 +139,7 @@ public: static inline sample_t sinSample( const float _sample ) { - return( sinf( _sample * 2.0f * M_PI ) ); + return( sinf( _sample * F_2PI ) ); } static inline sample_t triangleSample( const float _sample ) diff --git a/plugins/vibed/nine_button_selector.cpp b/plugins/vibed/nine_button_selector.cpp index 679131604..530ab20a1 100644 --- a/plugins/vibed/nine_button_selector.cpp +++ b/plugins/vibed/nine_button_selector.cpp @@ -173,12 +173,7 @@ nineButtonSelector::~ nineButtonSelector() void nineButtonSelector::button0Clicked( void ) { - m_lastBtn->setChecked( FALSE); - m_lastBtn = m_buttons[0]; - m_lastBtn->setChecked( TRUE ); - - m_selected = 0; - emit nineButtonSelection( m_selected ); + setSelected( 0 ); } @@ -186,12 +181,7 @@ void nineButtonSelector::button0Clicked( void ) void nineButtonSelector::button1Clicked( void ) { - m_lastBtn->setChecked( FALSE); - m_lastBtn = m_buttons[1]; - m_lastBtn->setChecked( TRUE ); - - m_selected = 1; - emit nineButtonSelection( m_selected ); + setSelected( 1 ); } @@ -199,12 +189,7 @@ void nineButtonSelector::button1Clicked( void ) void nineButtonSelector::button2Clicked( void ) { - m_lastBtn->setChecked( FALSE); - m_lastBtn = m_buttons[2]; - m_lastBtn->setChecked( TRUE ); - - m_selected = 2; - emit nineButtonSelection( m_selected ); + setSelected( 2 ); } @@ -212,12 +197,7 @@ void nineButtonSelector::button2Clicked( void ) void nineButtonSelector::button3Clicked( void ) { - m_lastBtn->setChecked( FALSE); - m_lastBtn = m_buttons[3]; - m_lastBtn->setChecked( TRUE ); - - m_selected = 3; - emit nineButtonSelection( m_selected ); + setSelected( 3 ); } @@ -225,12 +205,7 @@ void nineButtonSelector::button3Clicked( void ) void nineButtonSelector::button4Clicked( void ) { - m_lastBtn->setChecked( FALSE); - m_lastBtn = m_buttons[4]; - m_lastBtn->setChecked( TRUE ); - - m_selected = 4; - emit nineButtonSelection( m_selected ); + setSelected( 4 ); } @@ -238,12 +213,7 @@ void nineButtonSelector::button4Clicked( void ) void nineButtonSelector::button5Clicked( void ) { - m_lastBtn->setChecked( FALSE); - m_lastBtn = m_buttons[5]; - m_lastBtn->setChecked( TRUE ); - - m_selected = 5; - emit nineButtonSelection( m_selected ); + setSelected( 5 ); } @@ -251,12 +221,7 @@ void nineButtonSelector::button5Clicked( void ) void nineButtonSelector::button6Clicked( void ) { - m_lastBtn->setChecked( FALSE); - m_lastBtn = m_buttons[6]; - m_lastBtn->setChecked( TRUE ); - - m_selected = 6; - emit nineButtonSelection( m_selected ); + setSelected( 6 ); } @@ -264,12 +229,7 @@ void nineButtonSelector::button6Clicked( void ) void nineButtonSelector::button7Clicked( void ) { - m_lastBtn->setChecked( FALSE); - m_lastBtn = m_buttons[7]; - m_lastBtn->setChecked( TRUE ); - - m_selected = 7; - emit nineButtonSelection( m_selected ); + setSelected( 7 ); } @@ -277,11 +237,20 @@ void nineButtonSelector::button7Clicked( void ) void nineButtonSelector::button8Clicked( void ) { - m_lastBtn->setChecked( FALSE); - m_lastBtn = m_buttons[8]; + setSelected( 8 ); +} + + + + +void FASTCALL nineButtonSelector::setSelected( Uint8 _new_button ) +{ + m_selected = _new_button; + + m_lastBtn->setChecked( FALSE ); + m_lastBtn = m_buttons[m_selected]; m_lastBtn->setChecked( TRUE ); - m_selected = 8; emit nineButtonSelection( m_selected ); } diff --git a/plugins/vibed/nine_button_selector.h b/plugins/vibed/nine_button_selector.h index fd5af32fc..df47763f1 100644 --- a/plugins/vibed/nine_button_selector.h +++ b/plugins/vibed/nine_button_selector.h @@ -60,6 +60,7 @@ public: ~nineButtonSelector(); inline Uint8 getSelected() { return( m_selected ); }; + void FASTCALL setSelected( Uint8 _new_button ); public slots: void button0Clicked( void ); diff --git a/plugins/vibed/vibed.cpp b/plugins/vibed/vibed.cpp index c1356ce50..76bc56a92 100644 --- a/plugins/vibed/vibed.cpp +++ b/plugins/vibed/vibed.cpp @@ -407,7 +407,6 @@ vibed::vibed( instrumentTrack * _channel_track ) : vibed::~vibed() { - delete m_sampleBuffer; for( Uint8 harm = 0; harm < 9; harm++ ) { delete m_pickKnobs[harm]; @@ -458,6 +457,10 @@ void vibed::saveSettings( QDomDocument & _doc, _this.setAttribute( name, QString::number( m_pickupKnobs[i]->value() ) ); + name = "octave" + QString::number( i ); + _this.setAttribute( name, QString::number( + m_harmonics[i]->getSelected() ) ); + name = "length" + QString::number( i ); _this.setAttribute( name, QString::number( m_lengthKnobs[i]->value() ) ); @@ -519,6 +522,10 @@ void vibed::loadSettings( const QDomElement & _this ) m_pickupKnobs[i]->setValue( _this.attribute( name ).toFloat() ); + name = "octave" + QString::number( i ); + m_harmonics[i]->setSelected( + _this.attribute( name ).toInt() ); + name = "length" + QString::number( i ); m_lengthKnobs[i]->setValue( _this.attribute( name ).toFloat() ); diff --git a/plugins/vibed/vibed.h b/plugins/vibed/vibed.h index a01ab6160..56ec08d9d 100644 --- a/plugins/vibed/vibed.h +++ b/plugins/vibed/vibed.h @@ -90,8 +90,6 @@ private: ledCheckBox * m_impulse; - sampleBuffer * m_sampleBuffer; - int m_sampleLength; } ; diff --git a/src/audio/audio_alsa.cpp b/src/audio/audio_alsa.cpp index d7f3b2fcd..053835314 100644 --- a/src/audio/audio_alsa.cpp +++ b/src/audio/audio_alsa.cpp @@ -228,7 +228,7 @@ void audioALSA::run( void ) const f_cnt_t frames = getNextBuffer( temp ); convertToS16( temp, frames, getMixer()->masterGain(), outbuf, - m_littleEndian != isLittleEndian() ); + m_littleEndian ); f_cnt_t frame = 0; int_sample_t * ptr = outbuf; diff --git a/src/audio/audio_device.cpp b/src/audio/audio_device.cpp index 5a1327e17..b9c5b6856 100644 --- a/src/audio/audio_device.cpp +++ b/src/audio/audio_device.cpp @@ -289,37 +289,41 @@ Uint32 FASTCALL audioDevice::convertToS16( const surroundSampleFrame * _ab, const fpab_t _frames, const float _master_gain, int_sample_t * _output_buffer, - const bool _convert_endian ) + const bool _little_endian ) { - for( fpab_t frame = 0; frame < _frames; ++frame ) - { - for( ch_cnt_t chnl = 0; chnl < channels(); ++chnl ) - { - ( _output_buffer + frame * channels() )[chnl] = - static_cast( - mixer::clip( _ab[frame][chnl] * - _master_gain ) * - OUTPUT_SAMPLE_MULTIPLIER ); - } - } - if( _convert_endian ) + if( _little_endian ) { for( fpab_t frame = 0; frame < _frames; ++frame ) { for( ch_cnt_t chnl = 0; chnl < channels(); ++chnl ) { - Sint8 * ptr = reinterpret_cast( - _output_buffer + - frame * channels() + - chnl ); - *(int_sample_t *)ptr = - ( ( int_sample_t )*ptr << 8 - ) | - ( ( int_sample_t ) * - ( ptr+1 ) ); + ( _output_buffer + frame * channels() )[chnl] = + static_cast( + mixer::clip( _ab[frame][chnl] * + _master_gain ) * + OUTPUT_SAMPLE_MULTIPLIER ); } } } + else + { + Uint16 temp; + for( fpab_t frame = 0; frame < _frames; ++frame ) + { + for( ch_cnt_t chnl = 0; chnl < channels(); ++chnl ) + { + temp = static_cast( + mixer::clip( _ab[frame][chnl] * + _master_gain ) * + OUTPUT_SAMPLE_MULTIPLIER ); + + ( _output_buffer + frame * channels() )[chnl] = + ( temp & 0x00ff ) << 8 | + ( temp & 0xff00 ) >> 8; + } + } + } + return( _frames * channels() * BYTES_PER_INT_SAMPLE ); } diff --git a/src/audio/audio_file_wave.cpp b/src/audio/audio_file_wave.cpp index d120e6782..493199639 100644 --- a/src/audio/audio_file_wave.cpp +++ b/src/audio/audio_file_wave.cpp @@ -99,7 +99,7 @@ void FASTCALL audioFileWave::writeBuffer( const surroundSampleFrame * _ab, int_sample_t * outbuf = bufferAllocator::alloc( _frames * channels() ); Uint32 bytes = convertToS16( _ab, _frames, _master_gain, outbuf, - !isLittleEndian() ); + TRUE ); writeData( outbuf, bytes ); bufferAllocator::free( outbuf ); diff --git a/src/core/main_window.cpp b/src/core/main_window.cpp index 550a54f6e..a80b21782 100644 --- a/src/core/main_window.cpp +++ b/src/core/main_window.cpp @@ -611,8 +611,16 @@ void mainWindow::clearKeyModifiers( void ) void mainWindow::saveWidgetState( QWidget * _w, QDomElement & _de ) { - _de.setAttribute( "x", _w->parentWidget()->x() ); - _de.setAttribute( "y", _w->parentWidget()->y() ); + if( _w->parentWidget() != NULL ) + { + _de.setAttribute( "x", _w->parentWidget()->x() ); + _de.setAttribute( "y", _w->parentWidget()->y() ); + } + else + { + _de.setAttribute( "x", 0 ); + _de.setAttribute( "y", 0 ); + } _de.setAttribute( "width", _w->width() ); _de.setAttribute( "height", _w->height() ); _de.setAttribute( "visible", _w->isVisible() ); @@ -629,7 +637,10 @@ void mainWindow::restoreWidgetState( QWidget * _w, const QDomElement & _de ) if( !r.isNull() ) { _w->show(); - _w->parentWidget()->move( r.topLeft() ); + if( _w->parentWidget() != NULL ) + { + _w->parentWidget()->move( r.topLeft() ); + } _w->setShown( _de.attribute( "visible" ).toInt() ); _w->resize( r.size() ); }