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 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 diff --git a/CMakeLists.txt b/CMakeLists.txt index c8fa4f7ff..8e1d1b5d4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -364,13 +364,22 @@ 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() -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") +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 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/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; + diff --git a/src/core/AutomationPattern.cpp b/src/core/AutomationPattern.cpp index ac69b6539..ecfa30d3f 100644 --- a/src/core/AutomationPattern.cpp +++ b/src/core/AutomationPattern.cpp @@ -441,23 +441,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 ) 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/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..a16f56330 100644 --- a/src/core/SampleRecordHandle.cpp +++ b/src/core/SampleRecordHandle.cpp @@ -30,7 +30,7 @@ #include "Pattern.h" #include "SampleBuffer.h" #include "SampleTrack.h" - +#include "debug.h" SampleRecordHandle::SampleRecordHandle( SampleTCO* tco ) : @@ -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/AutomationPatternView.cpp b/src/gui/AutomationPatternView.cpp index 6e372de4a..fb3a5d042 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/gui/SetupDialog.cpp b/src/gui/SetupDialog.cpp index a29114f8b..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 ); @@ -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; diff --git a/src/gui/editors/AutomationEditor.cpp b/src/gui/editors/AutomationEditor.cpp index c0638fc9f..c5da787a3 100644 --- a/src/gui/editors/AutomationEditor.cpp +++ b/src/gui/editors/AutomationEditor.cpp @@ -1905,9 +1905,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/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index 4aeae3c47..cfb444f7b 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -3777,9 +3777,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/tracks/BBTrack.cpp b/src/tracks/BBTrack.cpp index b3f494255..90d5da2f7 100644 --- a/src/tracks/BBTrack.cpp +++ b/src/tracks/BBTrack.cpp @@ -216,7 +216,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(); @@ -224,10 +224,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 c2713261e..7a7acd43a 100644 --- a/src/tracks/Pattern.cpp +++ b/src/tracks/Pattern.cpp @@ -908,11 +908,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 9dbdfba49..915de3e2d 100644 --- a/src/tracks/SampleTrack.cpp +++ b/src/tracks/SampleTrack.cpp @@ -341,9 +341,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() );