From 39a3b4c6cb660c3865f92bb55ca0b25cf1db6b38 Mon Sep 17 00:00:00 2001 From: Wong Cho Ching Date: Wed, 29 Jan 2014 19:57:13 +0800 Subject: [PATCH] set m_effectId to random value when it is not loaded from project. --- .../peak_controller_effect_controls.cpp | 17 +++++++++++++++-- plugins/zynaddsubfx/fltk/fltk-config | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/plugins/peak_controller_effect/peak_controller_effect_controls.cpp b/plugins/peak_controller_effect/peak_controller_effect_controls.cpp index 18d66a417..aaeec368a 100644 --- a/plugins/peak_controller_effect/peak_controller_effect_controls.cpp +++ b/plugins/peak_controller_effect/peak_controller_effect_controls.cpp @@ -61,8 +61,21 @@ void PeakControllerEffectControls::loadSettings( const QDomElement & _this ) m_absModel.loadSettings( _this, "abs" ); m_amountMultModel.loadSettings( _this, "amountmult" ); - int effectId = _this.attribute( "effectId" ).toInt(); - m_effect->m_effectId = effectId; + /*If the peak controller effect is NOT loaded from project, + * m_effectId stored is useless. + * Reason to assign a random number to it: + * If the user clone the instrument, and m_effectId is cloned, and + * m_effectId is copied, then there would be two instruments + * having the same id. + */ + if( engine::getSong()->isLoadingProject() == true ) + { + m_effect->m_effectId = _this.attribute( "effectId" ).toInt(); + } + else + { + m_effect->m_effectId = rand(); + } if( m_effect->m_autoController && ( engine::getSong()->isLoadingProject() == true || presetPreviewPlayHandle::isPreviewing() == false ) ) { diff --git a/plugins/zynaddsubfx/fltk/fltk-config b/plugins/zynaddsubfx/fltk/fltk-config index 97ed9a514..f079deada 100755 --- a/plugins/zynaddsubfx/fltk/fltk-config +++ b/plugins/zynaddsubfx/fltk/fltk-config @@ -46,7 +46,7 @@ libdir=/usr/local/lib srcdir=. # compiler names -CC="gcc" +CC="cc" CXX="c++" # flags for C++ compiler: