From 74bd58162e52ca473aaec1e2792bb105b1d56aea Mon Sep 17 00:00:00 2001 From: Daniel Winzen Date: Sat, 3 Jan 2015 13:53:49 +0100 Subject: [PATCH 01/12] Make saving of .bak files configurable --- include/SetupDialog.h | 2 ++ src/core/DataFile.cpp | 16 ++++++++++++---- src/gui/SetupDialog.cpp | 21 +++++++++++++++++++++ 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/include/SetupDialog.h b/include/SetupDialog.h index 96d865f40..0bdaffaa6 100644 --- a/include/SetupDialog.h +++ b/include/SetupDialog.h @@ -91,6 +91,7 @@ private slots: void toggleWarnAfterSetup( bool _enabled ); void toggleDisplaydBV( bool _enabled ); void toggleMMPZ( bool _enabled ); + void toggleDisableBackup( bool _enabled ); void toggleHQAudioDev( bool _enabled ); void openWorkingDir(); @@ -124,6 +125,7 @@ private: bool m_warnAfterSetup; bool m_displaydBV; bool m_MMPZ; + bool m_disableBackup; bool m_hqAudioDev; diff --git a/src/core/DataFile.cpp b/src/core/DataFile.cpp index ff0bf0d9b..7bf47ed67 100644 --- a/src/core/DataFile.cpp +++ b/src/core/DataFile.cpp @@ -248,10 +248,18 @@ bool DataFile::writeFile( const QString& filename ) // make sure the file has been written correctly if( QFileInfo( outfile.fileName() ).size() > 0 ) { - // remove old backup file - QFile::remove( fullNameBak ); - // move current file to backup file - QFile::rename( fullName, fullNameBak ); + if( ConfigManager::inst()->value( "app", "disablebackup" ).toInt() ) + { + // remove current file + QFile::remove( fullName ); + } + else + { + // remove old backup file + QFile::remove( fullNameBak ); + // move current file to backup file + QFile::rename( fullName, fullNameBak ); + } // move temporary file to current file QFile::rename( fullNameTemp, fullName ); diff --git a/src/gui/SetupDialog.cpp b/src/gui/SetupDialog.cpp index a29114f8b..7f6c3391b 100644 --- a/src/gui/SetupDialog.cpp +++ b/src/gui/SetupDialog.cpp @@ -94,6 +94,8 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) : m_displaydBV( ConfigManager::inst()->value( "app", "displaydbv" ).toInt() ), m_MMPZ( !ConfigManager::inst()->value( "app", "nommpz" ).toInt() ), + m_disableBackup( !ConfigManager::inst()->value( "app", + "disablebackup" ).toInt() ), m_hqAudioDev( ConfigManager::inst()->value( "mixer", "hqaudio" ).toInt() ), m_workingDir( ConfigManager::inst()->workingDir() ), @@ -300,6 +302,15 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) : connect( disableAutoquit, SIGNAL( toggled( bool ) ), this, SLOT( toggleDisableAutoquit( bool ) ) ); + LedCheckBox * disableBackup = new LedCheckBox( + tr( "Create backup file when saving a project" ), + misc_tw ); + labelNumber++; + disableBackup->move( XDelta, YDelta*labelNumber ); + disableBackup->setChecked( m_disableBackup ); + connect( disableBackup, SIGNAL( toggled( bool ) ), + this, SLOT( toggleDisableBackup( bool ) ) ); + misc_tw->setFixedHeight( YDelta*labelNumber + HeaderSize ); @@ -806,6 +817,8 @@ void SetupDialog::accept() QString::number( m_displaydBV ) ); ConfigManager::inst()->setValue( "app", "nommpz", QString::number( !m_MMPZ ) ); + ConfigManager::inst()->setValue( "app", "disablebackup", + QString::number( !m_disableBackup ) ); ConfigManager::inst()->setValue( "mixer", "hqaudio", QString::number( m_hqAudioDev ) ); ConfigManager::inst()->setValue( "ui", "smoothscroll", @@ -958,6 +971,14 @@ void SetupDialog::toggleMMPZ( bool _enabled ) +void SetupDialog::toggleDisableBackup( bool _enabled ) +{ + m_disableBackup = _enabled; +} + + + + void SetupDialog::toggleHQAudioDev( bool _enabled ) { m_hqAudioDev = _enabled; From 8b83dad22c45feac47e75193213d2b8489954f35 Mon Sep 17 00:00:00 2001 From: Dave French Date: Sun, 4 Jan 2015 17:19:32 +0000 Subject: [PATCH 02/12] EQ Removed DBvModel --- plugins/Eq/CMakeLists.txt | 4 ++-- plugins/Eq/DBvModel.cpp | 14 -------------- plugins/Eq/DBvModel.h | 31 ------------------------------- plugins/Eq/EqControls.h | 6 +++--- plugins/Eq/EqEffect.cpp | 16 +++++++++++++--- plugins/Eq/EqEffect.h | 3 +++ 6 files changed, 21 insertions(+), 53 deletions(-) delete mode 100644 plugins/Eq/DBvModel.cpp delete mode 100644 plugins/Eq/DBvModel.h diff --git a/plugins/Eq/CMakeLists.txt b/plugins/Eq/CMakeLists.txt index 75c9b2911..3cd4b8885 100644 --- a/plugins/Eq/CMakeLists.txt +++ b/plugins/Eq/CMakeLists.txt @@ -2,5 +2,5 @@ INCLUDE(BuildPlugin) INCLUDE_DIRECTORIES(${FFTW3F_INCLUDE_DIRS}) LINK_DIRECTORIES(${FFTW3F_LIBRARY_DIRS}) LINK_LIBRARIES(${FFTW3F_LIBRARIES}) -BUILD_PLUGIN(eq EqEffect.cpp EqControls.cpp EqControlsDialog.cpp EqFilter.h EqParameterWidget.cpp EqFader.h EqSpectrumView.h DBvModel.cpp DBvModel.h -MOCFILES EqControls.h EqParameterWidget.h EqFader.h DBvModel.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png") +BUILD_PLUGIN(eq EqEffect.cpp EqControls.cpp EqControlsDialog.cpp EqFilter.h EqParameterWidget.cpp EqFader.h EqSpectrumView.h +MOCFILES EqControls.h EqParameterWidget.h EqFader.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png") diff --git a/plugins/Eq/DBvModel.cpp b/plugins/Eq/DBvModel.cpp deleted file mode 100644 index 3bd128ea6..000000000 --- a/plugins/Eq/DBvModel.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "DBvModel.h" - -DBvModel::DBvModel(float val, float min, float max, float step, - Model *parent, const QString &displayName, - bool defaultConstructed) : - FloatModel( val, min, max, step, parent, displayName, defaultConstructed ) -{ - connect(this, SIGNAL( dataChanged() ), this,SLOT( calcAmp() ) ); -} - -void DBvModel::calcAmp() -{ - m_amp = dbvToAmp( value() ); -} diff --git a/plugins/Eq/DBvModel.h b/plugins/Eq/DBvModel.h deleted file mode 100644 index ef6d80a03..000000000 --- a/plugins/Eq/DBvModel.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef DBVMODEL -#define DBVMODEL - -#include "AutomatableModel.h" - - -class DBvModel : public FloatModel -{ - Q_OBJECT -public: - DBvModel( float val = 0, float min = 0, float max = 0, float step = 0, - Model * parent = NULL, - const QString& displayName = QString(), - bool defaultConstructed = false ); - inline float getAmp() const - { - return m_amp; - } - -private slots: - void calcAmp(); - -private: - float m_amp; -}; - - - - -#endif // DBVMODEL - diff --git a/plugins/Eq/EqControls.h b/plugins/Eq/EqControls.h index dfb75287e..5218b6a9f 100644 --- a/plugins/Eq/EqControls.h +++ b/plugins/Eq/EqControls.h @@ -28,7 +28,7 @@ #include "EffectControls.h" #include "EqControlsDialog.h" #include "Knob.h" -#include "DBvModel.h" + class EqEffect; @@ -83,8 +83,8 @@ public: private: EqEffect* m_effect; - DBvModel m_inGainModel; - DBvModel m_outGainModel; + FloatModel m_inGainModel; + FloatModel m_outGainModel; FloatModel m_lowShelfGainModel; FloatModel m_para1GainModel; FloatModel m_para2GainModel; diff --git a/plugins/Eq/EqEffect.cpp b/plugins/Eq/EqEffect.cpp index 3407c7953..885eebe2a 100644 --- a/plugins/Eq/EqEffect.cpp +++ b/plugins/Eq/EqEffect.cpp @@ -52,7 +52,9 @@ Plugin::Descriptor PLUGIN_EXPORT eq_plugin_descriptor = EqEffect::EqEffect(Model *parent, const Plugin::Descriptor::SubPluginFeatures::Key *key) : Effect( &eq_plugin_descriptor, parent, key ), - m_eqControls( this ) + m_eqControls( this ), + m_inGain( 1.0 ), + m_outGain( 1.0 ) { } @@ -73,13 +75,21 @@ bool EqEffect::processAudioBuffer(sampleFrame *buf, const fpp_t frames) { return( false ); } + if( m_eqControls.m_outGainModel.isValueChanged() ) + { + m_outGain = dbvToAmp(m_eqControls.m_outGainModel.value()); + } + if( m_eqControls.m_inGainModel.isValueChanged() ) + { + m_inGain = dbvToAmp(m_eqControls.m_inGainModel.value()); + } m_eqControls.m_inProgress = true; double outSum = 0.0; for( fpp_t f = 0; f < frames; ++f ) { outSum += buf[f][0]*buf[f][0] + buf[f][1]*buf[f][1]; } - const float outGain = m_eqControls.m_outGainModel.getAmp(); + const float outGain = m_outGain; const int sampleRate = Engine::mixer()->processingSampleRate(); sampleFrame m_inPeak = { 0, 0 }; @@ -91,7 +101,7 @@ bool EqEffect::processAudioBuffer(sampleFrame *buf, const fpp_t frames) { m_eqControls.m_inFftBands.clear(); } - gain(buf , frames, m_eqControls.m_inGainModel.getAmp() , &m_inPeak ); + gain(buf , frames, m_inGain , &m_inPeak ); m_eqControls.m_inPeakL = m_eqControls.m_inPeakL < m_inPeak[0] ? m_inPeak[0] : m_eqControls.m_inPeakL; m_eqControls.m_inPeakR = m_eqControls.m_inPeakR < m_inPeak[1] ? m_inPeak[1] : m_eqControls.m_inPeakR; diff --git a/plugins/Eq/EqEffect.h b/plugins/Eq/EqEffect.h index 654ae5bd2..63f76f3dd 100644 --- a/plugins/Eq/EqEffect.h +++ b/plugins/Eq/EqEffect.h @@ -85,6 +85,9 @@ private: EqLp12Filter m_lp480; EqLp12Filter m_lp481; + float m_inGain; + float m_outGain; + From 6e1e73b41f55e750fba33b3361002d13a18c1658 Mon Sep 17 00:00:00 2001 From: Spekular Date: Wed, 31 Dec 2014 18:03:49 +0100 Subject: [PATCH 03/12] Removes unnecessary cleanObject() calls and commented out code --- src/core/AutomationPattern.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/core/AutomationPattern.cpp b/src/core/AutomationPattern.cpp index 02566b65c..7420645e9 100644 --- a/src/core/AutomationPattern.cpp +++ b/src/core/AutomationPattern.cpp @@ -446,23 +446,15 @@ void AutomationPattern::flipX( int length ) for( int i = 0; i <= numPoints; i++ ) { tempValue = valueAt( ( iterate + i ).key() ); - cleanObjects(); MidiTime newTime = MidiTime( length - ( iterate + i ).key() ); tempMap[newTime] = tempValue; } } else { - //for ( int i = 0; ( iterate + i ).key() < length ; i++ ) - //{ - // tempValue = valueAt( ( iterate + i ).key() ); - //} - //putValue( MidiTime( length ) , tempValue, false); - //numPoints++; for( int i = 0; i <= numPoints; i++ ) { tempValue = valueAt( ( iterate + i ).key() ); - cleanObjects(); MidiTime newTime; if ( ( iterate + i ).key() <= length ) From 13357e57c43644cb82413da2d2abac3da1fe4f51 Mon Sep 17 00:00:00 2001 From: Lukas W Date: Tue, 6 Jan 2015 23:07:28 +0100 Subject: [PATCH 04/12] Change default build type * Remove hard-coded compile flags (-O2 and -g) * Make Release the default build type Fixes #1552 --- CMakeLists.txt | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c8fa4f7ff..e84ff400f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -368,9 +368,17 @@ IF (CMAKE_COMPILER_IS_GNUCXX AND ((CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL "4.8 SET(WERROR_FLAGS "${WERROR_FLAGS} -Wno-array-bounds") ENDIF() -SET(CMAKE_C_FLAGS "-O2 -g ${WERROR_FLAGS} ${CMAKE_C_FLAGS}") -SET(CMAKE_CXX_FLAGS "-O2 -g -fno-exceptions ${WERROR_FLAGS} ${CMAKE_CXX_FLAGS}") -SET(CMAKE_C_FLAGS_DEBUG "-DLMMS_DEBUG") +IF(NOT CMAKE_BUILD_TYPE) + message(STATUS "Setting build type to 'Release' as none was specified.") + set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE) + # Set the possible values of build type for cmake-gui + SET_PROPERTY(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" + "MinSizeRel" "RelWithDebInfo") +ENDIF() + +SET(CMAKE_C_FLAGS "${WERROR_FLAGS} ${CMAKE_C_FLAGS}") +SET(CMAKE_CXX_FLAGS "-fno-exceptions ${WERROR_FLAGS} ${CMAKE_CXX_FLAGS}") +SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DLMMS_DEBUG") # people simply updating git will still have this and mess up build with it From 421c071ab06fb1dc902b47ed55c9d88fe77132d9 Mon Sep 17 00:00:00 2001 From: Amadeus Folego Date: Wed, 7 Jan 2015 15:55:58 -0200 Subject: [PATCH 05/12] Fix muted track not highlighted on selection Fix #1239 --- src/gui/AutomationPatternView.cpp | 11 ++++++++--- src/tracks/BBTrack.cpp | 6 +++--- src/tracks/Pattern.cpp | 8 ++++++-- src/tracks/SampleTrack.cpp | 11 ++++++++--- 4 files changed, 25 insertions(+), 11 deletions(-) diff --git a/src/gui/AutomationPatternView.cpp b/src/gui/AutomationPatternView.cpp index 1c404e6ef..7885905f7 100644 --- a/src/gui/AutomationPatternView.cpp +++ b/src/gui/AutomationPatternView.cpp @@ -259,11 +259,16 @@ void AutomationPatternView::paintEvent( QPaintEvent * ) QLinearGradient lingrad( 0, 0, 0, height() ); QColor c; + if( !( m_pat->getTrack()->isMuted() || m_pat->isMuted() ) ) - c = isSelected() ? QColor( 0, 0, 224 ) - : styleColor; + c = styleColor; else - c = QColor( 80,80,80 ); + c = QColor( 80, 80, 80 ); + + if( isSelected() == true ) + { + c = QColor( qMax( c.red() - 128, 0 ), qMax( c.green() - 128, 0 ), 255 ); + } lingrad.setColorAt( 1, c.darker( 300 ) ); lingrad.setColorAt( 0, c ); diff --git a/src/tracks/BBTrack.cpp b/src/tracks/BBTrack.cpp index 5a76d56a0..011e5e826 100644 --- a/src/tracks/BBTrack.cpp +++ b/src/tracks/BBTrack.cpp @@ -215,7 +215,7 @@ void BBTCOView::paintEvent( QPaintEvent * ) { QPainter p( this ); - QColor col = m_bbTCO->m_useStyleColor + QColor col = m_bbTCO->m_useStyleColor ? p.pen().brush().color() : m_bbTCO->colorObj(); @@ -223,10 +223,10 @@ void BBTCOView::paintEvent( QPaintEvent * ) { col = QColor( 160, 160, 160 ); } + if( isSelected() == true ) { - col = QColor( qMax( col.red() - 128, 0 ), - qMax( col.green() - 128, 0 ), 255 ); + col = QColor( qMax( col.red() - 128, 0 ), qMax( col.green() - 128, 0 ), 255 ); } QLinearGradient lingrad( 0, 0, 0, height() ); diff --git a/src/tracks/Pattern.cpp b/src/tracks/Pattern.cpp index 727fbd948..dc61aa6d7 100644 --- a/src/tracks/Pattern.cpp +++ b/src/tracks/Pattern.cpp @@ -907,11 +907,15 @@ void PatternView::paintEvent( QPaintEvent * ) if(( m_pat->m_patternType != Pattern::BeatPattern ) && !( m_pat->getTrack()->isMuted() || m_pat->isMuted() )) - c = isSelected() ? QColor( 0, 0, 224 ) - : styleColor; + c = styleColor; else c = QColor( 80, 80, 80 ); + if( isSelected() == true ) + { + c = QColor( qMax( c.red() - 128, 0 ), qMax( c.green() - 128, 0 ), 255 ); + } + if( m_pat->m_patternType != Pattern::BeatPattern ) { lingrad.setColorAt( 1, c.darker( 300 ) ); diff --git a/src/tracks/SampleTrack.cpp b/src/tracks/SampleTrack.cpp index 891790af2..7e3be4f4c 100644 --- a/src/tracks/SampleTrack.cpp +++ b/src/tracks/SampleTrack.cpp @@ -340,9 +340,14 @@ void SampleTCOView::paintEvent( QPaintEvent * _pe ) QColor c; if( !( m_tco->getTrack()->isMuted() || m_tco->isMuted() ) ) - c = isSelected() ? QColor( 0, 0, 224 ) - : styleColor; - else c = QColor( 80, 80, 80 ); + c = styleColor; + else + c = QColor( 80, 80, 80 ); + + if( isSelected() == true ) + { + c = QColor( qMax( c.red() - 128, 0 ), qMax( c.green() - 128, 0 ), 255 ); + } QLinearGradient grad( 0, 0, 0, height() ); From db6f3e6e50b925ec2da383719a1d80a8259b724c Mon Sep 17 00:00:00 2001 From: tresf Date: Wed, 7 Jan 2015 23:28:16 -0500 Subject: [PATCH 06/12] Fix nes array bounds error --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e84ff400f..583a6e0fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -364,7 +364,7 @@ IF(NOT LMMS_BUILD_APPLE) ENDIF() # Due to a regression in gcc-4.8.X, we need to disable array-bounds check -IF (CMAKE_COMPILER_IS_GNUCXX AND ((CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL "4.8.0") OR (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.8.0"))) +IF (CMAKE_COMPILER_IS_GNUCXX AND ((CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL "4.8.0") OR (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.8.0") OR LMMS_BUILD_WIN32)) SET(WERROR_FLAGS "${WERROR_FLAGS} -Wno-array-bounds") ENDIF() From a43a6bb3babc1f80d001280ebfdd809414253925 Mon Sep 17 00:00:00 2001 From: Lukas W Date: Thu, 8 Jan 2015 10:07:27 +0100 Subject: [PATCH 07/12] Travis: Make verbose output --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6d79557ce..93ad9ea4b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ script: - if [ $TARGET_OS == win32 ]; then ../build_mingw32 || ../build_mingw32; fi - if [ $TARGET_OS == win64 ]; then ../build_mingw64 || ../build_mingw64; fi - if [ $TARGET_OS == linux ]; then cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .. && make -j4 VERBOSE=1; fi - - if [ $TARGET_OS != linux ]; then make; fi + - if [ $TARGET_OS != linux ]; then make VERBOSE=1; fi before_deploy: make package deploy: provider: releases From 78350045a2cc21898415f15a6a34106503e85083 Mon Sep 17 00:00:00 2001 From: "Raine M. Ekman" Date: Wed, 7 Jan 2015 08:14:48 +0200 Subject: [PATCH 08/12] Fix things that won't build if -DLMMS_DEBUG is in CXX_FLAGS. --- src/core/EffectChain.cpp | 2 +- src/core/SampleRecordHandle.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/EffectChain.cpp b/src/core/EffectChain.cpp index f7a15bcf7..5890566a3 100644 --- a/src/core/EffectChain.cpp +++ b/src/core/EffectChain.cpp @@ -221,7 +221,7 @@ bool EffectChain::processAudioBuffer( sampleFrame * _buf, const fpp_t _frames, b it = m_effects.end()-1; printf( "numerical overflow after processing " "plugin \"%s\"\n", ( *it )-> - publicName().toUtf8().constData() ); + descriptor()->name); break; } } diff --git a/src/core/SampleRecordHandle.cpp b/src/core/SampleRecordHandle.cpp index dc850cb70..233e12561 100644 --- a/src/core/SampleRecordHandle.cpp +++ b/src/core/SampleRecordHandle.cpp @@ -30,7 +30,9 @@ #include "Pattern.h" #include "SampleBuffer.h" #include "SampleTrack.h" - +#ifdef LMMS_DEBUG +#include +#endif SampleRecordHandle::SampleRecordHandle( SampleTCO* tco ) : From 2954ea3b43fcfa9ee11828d7e04478bd57430a36 Mon Sep 17 00:00:00 2001 From: "Raine M. Ekman" Date: Wed, 7 Jan 2015 08:20:48 +0200 Subject: [PATCH 09/12] ...and prefer "debug.h" to a straight include of --- src/core/SampleRecordHandle.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/core/SampleRecordHandle.cpp b/src/core/SampleRecordHandle.cpp index 233e12561..590333492 100644 --- a/src/core/SampleRecordHandle.cpp +++ b/src/core/SampleRecordHandle.cpp @@ -30,9 +30,7 @@ #include "Pattern.h" #include "SampleBuffer.h" #include "SampleTrack.h" -#ifdef LMMS_DEBUG -#include -#endif +#include "debug.h" SampleRecordHandle::SampleRecordHandle( SampleTCO* tco ) : From b5da3bf1ee0d45db731f7928c771718134a3fc69 Mon Sep 17 00:00:00 2001 From: Lukas W Date: Thu, 8 Jan 2015 10:21:54 +0100 Subject: [PATCH 10/12] Mailmap entries --- .mailmap | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.mailmap b/.mailmap index 067e8929c..59e5ec6f8 100644 --- a/.mailmap +++ b/.mailmap @@ -1,4 +1,6 @@ +Alexandre Almeida Tobias Doerffel +Dave French Paul Giblock Paul Giblock Andrew Kelley @@ -6,6 +8,14 @@ Andrew Kelley Janne Sinisalo Raine M. Ekman Raine M. Ekman -Lukas W +Lukas W Vesa +Vesa +Tres Finocchiaro +Tres Finocchiaro +Tres Finocchiaro +RĂ¼diger Ranft <_rdi_@web.de> +Spekular +unfa +mikobuntu Jonathan Aquilina From 94a779f3c6826d5704ae3d5148a552c62eca297f Mon Sep 17 00:00:00 2001 From: "Raine M. Ekman" Date: Wed, 7 Jan 2015 22:02:23 +0200 Subject: [PATCH 11/12] Add -DLMMS_DEBUG to CMAKE_CXX_FLAGS_DEBUG --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 583a6e0fa..8e1d1b5d4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -379,6 +379,7 @@ ENDIF() SET(CMAKE_C_FLAGS "${WERROR_FLAGS} ${CMAKE_C_FLAGS}") SET(CMAKE_CXX_FLAGS "-fno-exceptions ${WERROR_FLAGS} ${CMAKE_CXX_FLAGS}") SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DLMMS_DEBUG") +SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DLMMS_DEBUG") # people simply updating git will still have this and mess up build with it From 471cb04dc9e5028ebc74ab6d7cb60afd3839117c Mon Sep 17 00:00:00 2001 From: "Raine M. Ekman" Date: Thu, 8 Jan 2015 09:28:57 +0200 Subject: [PATCH 12/12] Removed #ifdefs around assert()s. --- src/core/SampleRecordHandle.cpp | 4 ++-- src/core/audio/AudioDevice.cpp | 4 ++-- src/core/audio/AudioSampleRecorder.cpp | 4 ++-- src/gui/AutomationEditor.cpp | 4 ++-- src/gui/PianoRoll.cpp | 4 ++-- src/gui/SetupDialog.cpp | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/core/SampleRecordHandle.cpp b/src/core/SampleRecordHandle.cpp index 590333492..a16f56330 100644 --- a/src/core/SampleRecordHandle.cpp +++ b/src/core/SampleRecordHandle.cpp @@ -116,9 +116,9 @@ void SampleRecordHandle::createSampleBuffer( SampleBuffer** sampleBuf ) // make sure buffer is cleaned up properly at the end... sampleFrame * data_ptr = data; -#ifdef LMMS_DEBUG + assert( data != NULL ); -#endif + // now copy all buffers into big buffer for( bufferList::const_iterator it = m_buffers.begin(); it != m_buffers.end(); ++it ) diff --git a/src/core/audio/AudioDevice.cpp b/src/core/audio/AudioDevice.cpp index 68b475cf7..7acbdbbf1 100644 --- a/src/core/audio/AudioDevice.cpp +++ b/src/core/audio/AudioDevice.cpp @@ -237,9 +237,9 @@ int AudioDevice::convertToS16( const surroundSampleFrame * _ab, void AudioDevice::clearS16Buffer( int_sample_t * _outbuf, const fpp_t _frames ) { -#ifdef LMMS_DEBUG + assert( _outbuf != NULL ); -#endif + memset( _outbuf, 0, _frames * channels() * BYTES_PER_INT_SAMPLE ); } diff --git a/src/core/audio/AudioSampleRecorder.cpp b/src/core/audio/AudioSampleRecorder.cpp index e239c7bb1..01d1091ac 100644 --- a/src/core/audio/AudioSampleRecorder.cpp +++ b/src/core/audio/AudioSampleRecorder.cpp @@ -76,9 +76,9 @@ void AudioSampleRecorder::createSampleBuffer( SampleBuffer** sampleBuf ) // make sure buffer is cleaned up properly at the end... sampleFrame * data_ptr = data; -#ifdef LMMS_DEBUG + assert( data != NULL ); -#endif + // now copy all buffers into big buffer for( BufferList::ConstIterator it = m_buffers.begin(); it != m_buffers.end(); ++it ) diff --git a/src/gui/AutomationEditor.cpp b/src/gui/AutomationEditor.cpp index 2d28bd8f1..474402be5 100644 --- a/src/gui/AutomationEditor.cpp +++ b/src/gui/AutomationEditor.cpp @@ -2385,9 +2385,9 @@ void AutomationEditor::zoomingXChanged() { const QString & zfac = m_zoomingXModel.currentText(); m_ppt = zfac.left( zfac.length() - 1 ).toInt() * DEFAULT_PPT / 100; -#ifdef LMMS_DEBUG + assert( m_ppt > 0 ); -#endif + m_timeLine->setPixelsPerTact( m_ppt ); update(); } diff --git a/src/gui/PianoRoll.cpp b/src/gui/PianoRoll.cpp index 97842c405..cfa98bc23 100644 --- a/src/gui/PianoRoll.cpp +++ b/src/gui/PianoRoll.cpp @@ -4194,9 +4194,9 @@ void PianoRoll::zoomingChanged() { const QString & zfac = m_zoomingModel.currentText(); m_ppt = zfac.left( zfac.length() - 1 ).toInt() * DEFAULT_PR_PPT / 100; -#ifdef LMMS_DEBUG + assert( m_ppt > 0 ); -#endif + m_timeLine->setPixelsPerTact( m_ppt ); update(); diff --git a/src/gui/SetupDialog.cpp b/src/gui/SetupDialog.cpp index 7f6c3391b..83bd357b7 100644 --- a/src/gui/SetupDialog.cpp +++ b/src/gui/SetupDialog.cpp @@ -73,9 +73,9 @@ inline void labelWidget( QWidget * _w, const QString & _txt ) f.setBold( true ); title->setFont( pointSize<12>( f ) ); -#ifdef LMMS_DEBUG + assert( dynamic_cast( _w->layout() ) != NULL ); -#endif + dynamic_cast( _w->layout() )->addSpacing( 5 ); dynamic_cast( _w->layout() )->addWidget( title ); dynamic_cast( _w->layout() )->addSpacing( 10 );