From a54c54097f1d62fb4b2ac67d12ac322dedcf93bb Mon Sep 17 00:00:00 2001 From: Oskar Wallgren Date: Mon, 12 Mar 2018 14:49:45 +0100 Subject: [PATCH 01/38] Draw the entire length of a notes pitch bend info (#4233) --- src/gui/editors/PianoRoll.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index c2ab9feff..13b1dd4a7 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -889,10 +889,6 @@ void PianoRoll::drawDetuningInfo( QPainter & _p, const Note * _n, int _x, for( timeMap::ConstIterator it = map.begin(); it != map.end(); ++it ) { int pos_ticks = it.key(); - if( pos_ticks > _n->length() ) - { - break; - } int pos_x = _x + pos_ticks * m_ppt / MidiTime::ticksPerTact(); const float level = it.value(); From b4e78065e7fe043b2e423f81340d2b3b5fbc7e5a Mon Sep 17 00:00:00 2001 From: Hyunjin Song Date: Wed, 14 Mar 2018 14:48:18 +0900 Subject: [PATCH 02/38] Fix some bugs with LFO waveform drag&drop (#4227) * Change to user-wave mode and update display after dropping a sample * Fix broken drag&drop from sample tracks --- src/gui/widgets/EnvelopeAndLfoView.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gui/widgets/EnvelopeAndLfoView.cpp b/src/gui/widgets/EnvelopeAndLfoView.cpp index 4d61e814c..4131a956e 100644 --- a/src/gui/widgets/EnvelopeAndLfoView.cpp +++ b/src/gui/widgets/EnvelopeAndLfoView.cpp @@ -393,14 +393,20 @@ void EnvelopeAndLfoView::dropEvent( QDropEvent * _de ) m_params->m_userWave.setAudioFile( StringPairDrag::decodeValue( _de ) ); m_userLfoBtn->model()->setValue( true ); + m_params->m_lfoWaveModel.setValue(EnvelopeAndLfoParameters::UserDefinedWave); _de->accept(); + update(); } else if( type == QString( "tco_%1" ).arg( Track::SampleTrack ) ) { DataFile dataFile( value.toUtf8() ); - m_params->m_userWave.setAudioFile( dataFile.content().firstChild().toElement(). attribute( "src" ) ); + m_params->m_userWave.setAudioFile( dataFile.content(). + firstChildElement().firstChildElement(). + firstChildElement().attribute( "src" ) ); m_userLfoBtn->model()->setValue( true ); + m_params->m_lfoWaveModel.setValue(EnvelopeAndLfoParameters::UserDefinedWave); _de->accept(); + update(); } } From 1e777cf94570a85139c11a41143dc2544ca4319e Mon Sep 17 00:00:00 2001 From: curlymorphic Date: Sat, 17 Mar 2018 22:25:12 +0000 Subject: [PATCH 03/38] Remove audio artifacts when automating the Equliser parameters. The Equliser pluging uses biquad filters, These do not like having there parameters updating during processing, and are know to produce clicks and DC biasing. A twin filter system has been employed with a cross fade, to interpolate between parameters. This has removed for the use of sample exactness, as the filter is only updated once per frame, with interpolation provided by the crossfade. The same filters are used as pervious, ensuring unautomated filtering remains unchanged. --- plugins/Eq/EqEffect.cpp | 170 +++++++++++++--------------------------- plugins/Eq/EqFilter.h | 37 ++++++++- 2 files changed, 91 insertions(+), 116 deletions(-) diff --git a/plugins/Eq/EqEffect.cpp b/plugins/Eq/EqEffect.cpp index 4a10b672e..8d37b29ac 100644 --- a/plugins/Eq/EqEffect.cpp +++ b/plugins/Eq/EqEffect.cpp @@ -70,6 +70,8 @@ EqEffect::~EqEffect() bool EqEffect::processAudioBuffer( sampleFrame *buf, const fpp_t frames ) { + const int sampleRate = Engine::mixer()->processingSampleRate(); + //wet/dry controls const float dry = dryLevel(); const float wet = wetLevel(); @@ -93,59 +95,6 @@ bool EqEffect::processAudioBuffer( sampleFrame *buf, const fpp_t frames ) float highShelfFreq = m_eqControls.m_highShelfFreqModel.value(); float lpFreq = m_eqControls.m_lpFreqModel.value(); - ValueBuffer *hpResBuffer = m_eqControls.m_hpResModel.valueBuffer(); - ValueBuffer *lowShelfResBuffer = m_eqControls.m_lowShelfResModel.valueBuffer(); - ValueBuffer *para1BwBuffer = m_eqControls.m_para1BwModel.valueBuffer(); - ValueBuffer *para2BwBuffer = m_eqControls.m_para2BwModel.valueBuffer(); - ValueBuffer *para3BwBuffer = m_eqControls.m_para3BwModel.valueBuffer(); - ValueBuffer *para4BwBuffer = m_eqControls.m_para4BwModel.valueBuffer(); - ValueBuffer *highShelfResBuffer = m_eqControls.m_highShelfResModel.valueBuffer(); - ValueBuffer *lpResBuffer = m_eqControls.m_lpResModel.valueBuffer(); - - ValueBuffer *hpFreqBuffer = m_eqControls.m_hpFeqModel.valueBuffer(); - ValueBuffer *lowShelfFreqBuffer = m_eqControls.m_lowShelfFreqModel.valueBuffer(); - ValueBuffer *para1FreqBuffer = m_eqControls.m_para1FreqModel.valueBuffer(); - ValueBuffer *para2FreqBuffer = m_eqControls.m_para2FreqModel.valueBuffer(); - ValueBuffer *para3FreqBuffer = m_eqControls.m_para3FreqModel.valueBuffer(); - ValueBuffer *para4FreqBuffer = m_eqControls.m_para4FreqModel.valueBuffer(); - ValueBuffer *highShelfFreqBuffer = m_eqControls.m_highShelfFreqModel.valueBuffer(); - ValueBuffer *lpFreqBuffer = m_eqControls.m_lpFreqModel.valueBuffer(); - - int hpResInc = hpResBuffer ? 1 : 0; - int lowShelfResInc = lowShelfResBuffer ? 1 : 0; - int para1BwInc = para1BwBuffer ? 1 : 0; - int para2BwInc = para2BwBuffer ? 1 : 0; - int para3BwInc = para3BwBuffer ? 1 : 0; - int para4BwInc = para4BwBuffer ? 1 : 0; - int highShelfResInc = highShelfResBuffer ? 1 : 0; - int lpResInc = lpResBuffer ? 1 : 0; - - int hpFreqInc = hpFreqBuffer ? 1 : 0; - int lowShelfFreqInc = lowShelfFreqBuffer ? 1 : 0; - int para1FreqInc = para1FreqBuffer ? 1 : 0; - int para2FreqInc = para2FreqBuffer ? 1 : 0; - int para3FreqInc = para3FreqBuffer ? 1 : 0; - int para4FreqInc = para4FreqBuffer ? 1 : 0; - int highShelfFreqInc = highShelfFreqBuffer ? 1 : 0; - int lpFreqInc = lpFreqBuffer ? 1 : 0; - - float *hpResPtr = hpResBuffer ? &( hpResBuffer->values()[ 0 ] ) : &hpRes; - float *lowShelfResPtr = lowShelfResBuffer ? &( lowShelfResBuffer->values()[ 0 ] ) : &lowShelfRes; - float *para1BwPtr = para1BwBuffer ? &( para1BwBuffer->values()[ 0 ] ) : ¶1Bw; - float *para2BwPtr = para2BwBuffer ? &( para2BwBuffer->values()[ 0 ] ) : ¶2Bw; - float *para3BwPtr = para3BwBuffer ? &( para3BwBuffer->values()[ 0 ] ) : ¶3Bw; - float *para4BwPtr = para4BwBuffer ? &( para4BwBuffer->values()[ 0 ] ) : ¶4Bw; - float *highShelfResPtr = highShelfResBuffer ? &( highShelfResBuffer->values()[ 0 ] ) : &highShelfRes; - float *lpResPtr = lpResBuffer ? &( lpResBuffer->values()[ 0 ] ) : &lpRes; - - float *hpFreqPtr = hpFreqBuffer ? &( hpFreqBuffer->values()[ 0 ] ) : &hpFreq; - float *lowShelfFreqPtr = lowShelfFreqBuffer ? &( lowShelfFreqBuffer->values()[ 0 ] ) : &lowShelfFreq; - float *para1FreqPtr = para1FreqBuffer ? &(para1FreqBuffer->values()[ 0 ] ) : ¶1Freq; - float *para2FreqPtr = para2FreqBuffer ? &(para2FreqBuffer->values()[ 0 ] ) : ¶2Freq; - float *para3FreqPtr = para3FreqBuffer ? &(para3FreqBuffer->values()[ 0 ] ) : ¶3Freq; - float *para4FreqPtr = para4FreqBuffer ? &(para4FreqBuffer->values()[ 0 ] ) : ¶4Freq; - float *hightShelfFreqPtr = highShelfFreqBuffer ? &(highShelfFreqBuffer->values()[ 0 ] ) : &highShelfFreq; - float *lpFreqPtr = lpFreqBuffer ? &(lpFreqBuffer ->values()[ 0 ] ) : &lpFreq; bool hpActive = m_eqControls.m_hpActiveModel.value(); bool hp24Active = m_eqControls.m_hp24Model.value(); @@ -167,6 +116,29 @@ bool EqEffect::processAudioBuffer( sampleFrame *buf, const fpp_t frames ) float para4Gain = m_eqControls.m_para4GainModel.value(); float highShelfGain = m_eqControls.m_highShelfGainModel.value(); + //set all filter parameters once per frame, EqFilter handles + //smooth xfading, reducing pops clicks and dc bias offsets + + m_hp12.setParameters( sampleRate, hpFreq, hpRes, 1 ); + m_hp24.setParameters( sampleRate, hpFreq, hpRes, 1 ); + m_hp480.setParameters( sampleRate, hpFreq, hpRes, 1 ); + m_lp480.setParameters( sampleRate, lpFreq, lpRes, 1 ); + m_hp481.setParameters( sampleRate, hpFreq, hpRes, 1 ); + m_lp481.setParameters( sampleRate, hpFreq, hpRes, 1 ); + m_lowShelf.setParameters( sampleRate, lowShelfFreq, lowShelfRes, lowShelfGain ); + m_para1.setParameters( sampleRate, para1Freq, para1Bw, para1Gain ); + m_para2.setParameters( sampleRate, para2Freq, para2Bw, para2Gain ); + m_para3.setParameters( sampleRate, para3Freq, para3Bw, para3Gain ); + m_para4.setParameters( sampleRate, para4Freq, para4Bw, para4Gain ); + m_highShelf.setParameters( sampleRate, highShelfFreq, highShelfRes, highShelfGain ); + m_lp12.setParameters( sampleRate, lpFreq, lpRes, 1 ); + m_lp24.setParameters( sampleRate, lpFreq, lpRes, 1 ); + m_lp480.setParameters( sampleRate, lpFreq, lpRes, 1 ); + m_lp480.setParameters( sampleRate, lpFreq, lpRes, 1 ); + + + + if( !isEnabled() || !isRunning () ) { return( false ); @@ -191,7 +163,6 @@ bool EqEffect::processAudioBuffer( sampleFrame *buf, const fpp_t frames ) } const float outGain = m_outGain; - const int sampleRate = Engine::mixer()->processingSampleRate(); sampleFrame m_inPeak = { 0, 0 }; if(m_eqControls.m_analyseInModel.value( true ) && outSum > 0 ) @@ -207,99 +178,87 @@ bool EqEffect::processAudioBuffer( sampleFrame *buf, const fpp_t frames ) 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; - for( fpp_t f = 0; f < frames; f++) + float periodProgress = 0.0f; // percentage of period processed + for( fpp_t f = 0; f < frames; ++f) { + periodProgress = (float)f / (float)(frames-1); //wet dry buffer dryS[0] = buf[f][0]; dryS[1] = buf[f][1]; if( hpActive ) { - m_hp12.setParameters( sampleRate, *hpFreqPtr, *hpResPtr, 1 ); - buf[f][0] = m_hp12.update( buf[f][0], 0 ); - buf[f][1] = m_hp12.update( buf[f][1], 1 ); + buf[f][0] = m_hp12.update( buf[f][0], 0, periodProgress ); + buf[f][1] = m_hp12.update( buf[f][1], 1, periodProgress ); if( hp24Active || hp48Active ) { - m_hp24.setParameters( sampleRate, *hpFreqPtr, *hpResPtr, 1 ); - buf[f][0] = m_hp24.update( buf[f][0], 0 ); - buf[f][1] = m_hp24.update( buf[f][1], 1 ); + buf[f][0] = m_hp24.update( buf[f][0], 0, periodProgress ); + buf[f][1] = m_hp24.update( buf[f][1], 1, periodProgress ); } if( hp48Active ) { - m_hp480.setParameters( sampleRate, *hpFreqPtr, *hpResPtr, 1 ); - buf[f][0] = m_hp480.update( buf[f][0], 0 ); - buf[f][1] = m_hp480.update( buf[f][1], 1 ); + buf[f][0] = m_hp480.update( buf[f][0], 0, periodProgress ); + buf[f][1] = m_hp480.update( buf[f][1], 1, periodProgress ); - m_hp481.setParameters( sampleRate, *hpFreqPtr, *hpResPtr, 1 ); - buf[f][0] = m_hp481.update( buf[f][0], 0 ); - buf[f][1] = m_hp481.update( buf[f][1], 1 ); + buf[f][0] = m_hp481.update( buf[f][0], 0, periodProgress ); + buf[f][1] = m_hp481.update( buf[f][1], 1, periodProgress ); } } if( lowShelfActive ) { - m_lowShelf.setParameters( sampleRate, *lowShelfFreqPtr, *lowShelfResPtr, lowShelfGain ); - buf[f][0] = m_lowShelf.update( buf[f][0], 0 ); - buf[f][1] = m_lowShelf.update( buf[f][1], 1 ); + buf[f][0] = m_lowShelf.update( buf[f][0], 0, periodProgress ); + buf[f][1] = m_lowShelf.update( buf[f][1], 1, periodProgress ); } if( para1Active ) { - m_para1.setParameters( sampleRate, *para1FreqPtr, *para1BwPtr, para1Gain ); - buf[f][0] = m_para1.update( buf[f][0], 0 ); - buf[f][1] = m_para1.update( buf[f][1], 1 ); + buf[f][0] = m_para1.update( buf[f][0], 0, periodProgress ); + buf[f][1] = m_para1.update( buf[f][1], 1, periodProgress ); } if( para2Active ) { - m_para2.setParameters( sampleRate, *para2FreqPtr, *para2BwPtr, para2Gain ); - buf[f][0] = m_para2.update( buf[f][0], 0 ); - buf[f][1] = m_para2.update( buf[f][1], 1 ); + buf[f][0] = m_para2.update( buf[f][0], 0, periodProgress ); + buf[f][1] = m_para2.update( buf[f][1], 1, periodProgress ); } if( para3Active ) { - m_para3.setParameters( sampleRate, *para3FreqPtr, *para3BwPtr, para3Gain ); - buf[f][0] = m_para3.update( buf[f][0], 0 ); - buf[f][1] = m_para3.update( buf[f][1], 1 ); + buf[f][0] = m_para3.update( buf[f][0], 0, periodProgress ); + buf[f][1] = m_para3.update( buf[f][1], 1, periodProgress ); } if( para4Active ) { - m_para4.setParameters( sampleRate, *para4FreqPtr, *para4BwPtr, para4Gain ); - buf[f][0] = m_para4.update( buf[f][0], 0 ); - buf[f][1] = m_para4.update( buf[f][1], 1 ); + buf[f][0] = m_para4.update( buf[f][0], 0, periodProgress ); + buf[f][1] = m_para4.update( buf[f][1], 1, periodProgress ); } if( highShelfActive ) { - m_highShelf.setParameters( sampleRate, *hightShelfFreqPtr, *highShelfResPtr, highShelfGain ); - buf[f][0] = m_highShelf.update( buf[f][0], 0 ); - buf[f][1] = m_highShelf.update( buf[f][1], 1 ); + buf[f][0] = m_highShelf.update( buf[f][0], 0, periodProgress ); + buf[f][1] = m_highShelf.update( buf[f][1], 1, periodProgress ); } if( lpActive ){ - m_lp12.setParameters( sampleRate, *lpFreqPtr, *lpResPtr, 1 ); - buf[f][0] = m_lp12.update( buf[f][0], 0 ); - buf[f][1] = m_lp12.update( buf[f][1], 1 ); + buf[f][0] = m_lp12.update( buf[f][0], 0, periodProgress ); + buf[f][1] = m_lp12.update( buf[f][1], 1, periodProgress ); if( lp24Active || lp48Active ) { - m_lp24.setParameters( sampleRate, *lpFreqPtr, *lpResPtr, 1 ); - buf[f][0] = m_lp24.update( buf[f][0], 0 ); - buf[f][1] = m_lp24.update( buf[f][1], 1 ); + buf[f][0] = m_lp24.update( buf[f][0], 0, periodProgress ); + buf[f][1] = m_lp24.update( buf[f][1], 1, periodProgress ); } if( lp48Active ) { - m_lp480.setParameters( sampleRate, *lpFreqPtr, *lpResPtr, 1 ); - buf[f][0] = m_lp480.update( buf[f][0], 0 ); - buf[f][1] = m_lp480.update( buf[f][1], 1 ); + buf[f][0] = m_lp480.update( buf[f][0], 0, periodProgress ); + buf[f][1] = m_lp480.update( buf[f][1], 1, periodProgress ); - m_lp481.setParameters( sampleRate, *lpFreqPtr, *lpResPtr, 1 ); - buf[f][0] = m_lp481.update( buf[f][0], 0 ); - buf[f][1] = m_lp481.update( buf[f][1], 1 ); + buf[f][0] = m_lp481.update( buf[f][0], 0, periodProgress ); + buf[f][1] = m_lp481.update( buf[f][1], 1, periodProgress ); } } @@ -307,24 +266,7 @@ bool EqEffect::processAudioBuffer( sampleFrame *buf, const fpp_t frames ) buf[f][1] = ( dry * dryS[1] ) + ( wet * buf[f][1] ); buf[f][0] = ( dry * dryS[0] ) + ( wet * buf[f][0] ); - //increment pointers if needed - hpResPtr += hpResInc; - lowShelfResPtr += lowShelfResInc; - para1BwPtr += para1BwInc; - para2BwPtr += para2BwInc; - para3BwPtr += para3BwInc; - para4BwPtr += para4BwInc; - highShelfResPtr += highShelfResInc; - lpResPtr += lpResInc; - hpFreqPtr += hpFreqInc; - lowShelfFreqPtr += lowShelfFreqInc; - para1FreqPtr += para1FreqInc; - para2FreqPtr += para2FreqInc; - para3FreqPtr += para3FreqInc; - para4FreqPtr += para4FreqInc; - hightShelfFreqPtr += highShelfFreqInc; - lpFreqPtr += lpFreqInc; } sampleFrame outPeak = { 0, 0 }; diff --git a/plugins/Eq/EqFilter.h b/plugins/Eq/EqFilter.h index 471152699..5223fdeda 100644 --- a/plugins/Eq/EqFilter.h +++ b/plugins/Eq/EqFilter.h @@ -31,11 +31,11 @@ /// /// \brief The EqFilter class. /// A wrapper for the StereoBiQuad class, giving it freq, res, and gain controls. -/// It is designed to process periods in one pass, with recalculation of coefficents +/// Used on a per channel per frame basis with recalculation of coefficents /// upon parameter changes. The intention is to use this as a bass class, children override /// the calcCoefficents() function, providing the coefficents a1, a2, b0, b1, b2. /// -class EqFilter : public StereoBiQuad +class EqFilter { public: EqFilter() : @@ -114,7 +114,28 @@ public: } + /// + /// \brief update + /// filters using two BiQuads, then crossfades, + /// depending on on percentage of period processes + /// \param in + /// \param ch + /// \param frameProgress percentage of frame processed + /// \return + /// + inline float update( float in, ch_cnt_t ch, float frameProgress) + { + float initailF = m_biQuadFrameInitial.update( in, ch ); + float targetF = m_biQuadFrameTarget.update( in, ch ); + if(frameProgress > 0.99999 ) + { + m_biQuadFrameInitial= m_biQuadFrameTarget; + } + + return (1.0f-frameProgress) * initailF + frameProgress * targetF; + + } protected: @@ -127,11 +148,23 @@ protected: } + inline void setCoeffs( float a1, float a2, float b0, float b1, float b2 ) + { + m_biQuadFrameTarget.setCoeffs( a1, a2, b0, b1, b2 ); + } + + + + + + float m_sampleRate; float m_freq; float m_res; float m_gain; float m_bw; + StereoBiQuad m_biQuadFrameInitial; + StereoBiQuad m_biQuadFrameTarget; }; From 6cd5317e0980497b66a72f25c808be787b2c9f02 Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Sun, 18 Mar 2018 13:36:05 -0400 Subject: [PATCH 04/38] Fix C++ standards library portability issue. (#4261) Fix C++ standards library portability issue. Cherry-pick of upstream 2.5 patches: zynaddsubfx/zynaddsubfx@417d49b, zynaddsubfx/zynaddsubfx@edca8ab Closes #4152 --- .../zynaddsubfx/src/DSP/FFTwrapper.h | 19 +++++++++++++++++++ .../src/Params/PADnoteParameters.cpp | 2 +- .../zynaddsubfx/src/Synth/OscilGen.cpp | 6 +++--- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/plugins/zynaddsubfx/zynaddsubfx/src/DSP/FFTwrapper.h b/plugins/zynaddsubfx/zynaddsubfx/src/DSP/FFTwrapper.h index 1d61e2e53..c79bd211b 100644 --- a/plugins/zynaddsubfx/zynaddsubfx/src/DSP/FFTwrapper.h +++ b/plugins/zynaddsubfx/zynaddsubfx/src/DSP/FFTwrapper.h @@ -49,5 +49,24 @@ class FFTwrapper fftwf_plan planfftw, planfftw_inv; }; +/* + * The "std::polar" template has no clear definition for the range of + * the input parameters, and some C++ standard library implementations + * don't accept negative amplitude among others. Define our own + * FFTpolar template, which works like we expect it to. + */ +template +std::complex<_Tp> +FFTpolar(const _Tp& __rho, const _Tp& __theta = _Tp(0)) +{ + _Tp __x = __rho * cos(__theta); + if (std::isnan(__x)) + __x = 0; + _Tp __y = __rho * sin(__theta); + if (std::isnan(__y)) + __y = 0; + return std::complex<_Tp>(__x, __y); +} + void FFT_cleanup(); #endif diff --git a/plugins/zynaddsubfx/zynaddsubfx/src/Params/PADnoteParameters.cpp b/plugins/zynaddsubfx/zynaddsubfx/src/Params/PADnoteParameters.cpp index d0572cac3..136ee50e6 100644 --- a/plugins/zynaddsubfx/zynaddsubfx/src/Params/PADnoteParameters.cpp +++ b/plugins/zynaddsubfx/zynaddsubfx/src/Params/PADnoteParameters.cpp @@ -615,7 +615,7 @@ void PADnoteParameters::applyparameters(bool lockmutex) newsample.smp[0] = 0.0f; for(int i = 1; i < spectrumsize; ++i) //randomize the phases - fftfreqs[i] = std::polar(spectrum[i], (float)RND * 6.29f); + fftfreqs[i] = FFTpolar(spectrum[i], (float)RND * 6.29f); fft->freqs2smps(fftfreqs, newsample.smp); //that's all; here is the only ifft for the whole sample; no windows are used ;-) diff --git a/plugins/zynaddsubfx/zynaddsubfx/src/Synth/OscilGen.cpp b/plugins/zynaddsubfx/zynaddsubfx/src/Synth/OscilGen.cpp index 6cd89dcc6..7e24a5a6b 100644 --- a/plugins/zynaddsubfx/zynaddsubfx/src/Synth/OscilGen.cpp +++ b/plugins/zynaddsubfx/zynaddsubfx/src/Synth/OscilGen.cpp @@ -533,7 +533,7 @@ void OscilGen::spectrumadjust() mag = 1.0f; break; } - oscilFFTfreqs[i] = std::polar(mag, phase); + oscilFFTfreqs[i] = FFTpolar(mag, phase); } } @@ -629,7 +629,7 @@ void OscilGen::prepare() int k = i * (j + 1); if(k >= synth->oscilsize / 2) break; - oscilFFTfreqs[k] += basefuncFFTfreqs[i] * std::polar( + oscilFFTfreqs[k] += basefuncFFTfreqs[i] * FFTpolar( hmag[j], hphase[j] * k); } @@ -857,7 +857,7 @@ short int OscilGen::get(float *smps, float freqHz, int resonance) const float rnd = PI * powf((Prand - 64.0f) / 64.0f, 2.0f); for(int i = 1; i < nyquist - 1; ++i) //to Nyquist only for AntiAliasing outoscilFFTfreqs[i] *= - std::polar(1.0f, (float)(rnd * i * RND)); + FFTpolar(1.0f, (float)(rnd * i * RND)); } //Harmonic Amplitude Randomness From 7a8a925b8358ad838e4c3addb53257a9d9099230 Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Mon, 19 Mar 2018 12:18:47 -0400 Subject: [PATCH 05/38] Fix toFloat Qt5 regression (#4244) Closes #4241 --- plugins/zynaddsubfx/zynaddsubfx/src/Misc/QtXmlWrapper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/zynaddsubfx/zynaddsubfx/src/Misc/QtXmlWrapper.cpp b/plugins/zynaddsubfx/zynaddsubfx/src/Misc/QtXmlWrapper.cpp index 3ceca31ef..3ebc2eeec 100644 --- a/plugins/zynaddsubfx/zynaddsubfx/src/Misc/QtXmlWrapper.cpp +++ b/plugins/zynaddsubfx/zynaddsubfx/src/Misc/QtXmlWrapper.cpp @@ -505,7 +505,7 @@ float QtXmlWrapper::getparreal(const char *name, float defaultpar) const return defaultpar; } - return tmp.attribute( "value" ).toFloat(); + return QLocale().toFloat( tmp.attribute( "value" ) ); } float QtXmlWrapper::getparreal(const char *name, From 0d1c874a60c9020ef9c1105937aa81c17487dc8b Mon Sep 17 00:00:00 2001 From: Umcaruje Date: Mon, 19 Mar 2018 17:35:15 +0100 Subject: [PATCH 06/38] Change selected notes color (#4243) --- data/themes/default/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/themes/default/style.css b/data/themes/default/style.css index 8da7522fd..314ca98c7 100644 --- a/data/themes/default/style.css +++ b/data/themes/default/style.css @@ -144,7 +144,7 @@ PianoRoll { qproperty-noteColor: #0bd556; qproperty-noteOpacity: 165; qproperty-noteBorders: false; /* boolean property, set false to have borderless notes */ - qproperty-selectedNoteColor: #006b65; + qproperty-selectedNoteColor: #064d79; qproperty-barColor: #078f3a; qproperty-markedSemitoneColor: #06170E; /* Grid colors */ From fc5fc1cbaaca799a73d9977e42b0cec4d65bdfd0 Mon Sep 17 00:00:00 2001 From: Orbital Ink <31394502+Anonymouqs@users.noreply.github.com> Date: Mon, 19 Mar 2018 12:23:00 -0500 Subject: [PATCH 07/38] Change Detune To Pitch Bend in Piano Roll (#4194) --- src/gui/editors/PianoRoll.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index 13b1dd4a7..98c84a524 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -4076,14 +4076,14 @@ PianoRollWindow::PianoRollWindow() : QAction* drawAction = editModeGroup->addAction( embed::getIconPixmap( "edit_draw" ), tr( "Draw mode (Shift+D)" ) ); QAction* eraseAction = editModeGroup->addAction( embed::getIconPixmap( "edit_erase" ), tr("Erase mode (Shift+E)" ) ); QAction* selectAction = editModeGroup->addAction( embed::getIconPixmap( "edit_select" ), tr( "Select mode (Shift+S)" ) ); - QAction* detuneAction = editModeGroup->addAction( embed::getIconPixmap( "automation" ), tr("Detune mode (Shift+T)" ) ); + QAction* pitchBendAction = editModeGroup->addAction( embed::getIconPixmap( "automation" ), tr("Pitch Bend mode (Shift+T)" ) ); drawAction->setChecked( true ); drawAction->setShortcut( Qt::SHIFT | Qt::Key_D ); eraseAction->setShortcut( Qt::SHIFT | Qt::Key_E ); selectAction->setShortcut( Qt::SHIFT | Qt::Key_S ); - detuneAction->setShortcut( Qt::SHIFT | Qt::Key_T ); + pitchBendAction->setShortcut( Qt::SHIFT | Qt::Key_T ); drawAction->setWhatsThis( tr( "Click here and draw mode will be activated. In this " @@ -4111,8 +4111,8 @@ PianoRollWindow::PianoRollWindow() : #else "Ctrl" ) ); #endif - detuneAction->setWhatsThis( - tr( "Click here and detune mode will be activated. " + pitchBendAction->setWhatsThis( + tr( "Click here and Pitch Bend mode will be activated. " "In this mode you can click a note to open its " "automation detuning. You can utilize this to slide " "notes from one to another. You can also press " @@ -4126,7 +4126,7 @@ PianoRollWindow::PianoRollWindow() : notesActionsToolBar->addAction( drawAction ); notesActionsToolBar->addAction( eraseAction ); notesActionsToolBar->addAction( selectAction ); - notesActionsToolBar->addAction( detuneAction ); + notesActionsToolBar->addAction( pitchBendAction ); notesActionsToolBar->addSeparator(); notesActionsToolBar->addAction( quantizeAction ); From 87e6b48df73518b4c43db118374f2d94e034edde Mon Sep 17 00:00:00 2001 From: Noah Brecht Date: Tue, 20 Mar 2018 23:13:42 -0400 Subject: [PATCH 08/38] Fix ui glitch where track ticks did not line up (#4171) --- src/tracks/Pattern.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tracks/Pattern.cpp b/src/tracks/Pattern.cpp index e726ca2ee..01d51fbae 100644 --- a/src/tracks/Pattern.cpp +++ b/src/tracks/Pattern.cpp @@ -884,7 +884,7 @@ void PatternView::paintEvent( QPaintEvent * ) const float ppt = fixedTCOs() ? ( parentWidget()->width() - 2 * TCO_BORDER_WIDTH ) / (float) m_pat->length().getTact() : - ( width() - 2 * TCO_BORDER_WIDTH ) + ( width() - TCO_BORDER_WIDTH ) / (float) m_pat->length().getTact(); const int x_base = TCO_BORDER_WIDTH; From ac543ffc750d95023f1d58c41647402c9a3e1fc4 Mon Sep 17 00:00:00 2001 From: Hyunjin Song Date: Thu, 22 Mar 2018 12:39:17 +0900 Subject: [PATCH 09/38] Play correct note when dragging left side of virtual keyboard (#4265) --- src/gui/PianoView.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/gui/PianoView.cpp b/src/gui/PianoView.cpp index 351806936..2a64e72dd 100644 --- a/src/gui/PianoView.cpp +++ b/src/gui/PianoView.cpp @@ -327,7 +327,9 @@ void PianoView::modelChanged() */ int PianoView::getKeyFromMouse( const QPoint & _p ) const { - int key_num = (int)( (float) _p.x() / (float) PW_WHITE_KEY_WIDTH ); + int offset = _p.x() % PW_WHITE_KEY_WIDTH; + if( offset < 0 ) offset += PW_WHITE_KEY_WIDTH; + int key_num = ( _p.x() - offset) / PW_WHITE_KEY_WIDTH; for( int i = 0; i <= key_num; ++i ) { @@ -336,6 +338,13 @@ int PianoView::getKeyFromMouse( const QPoint & _p ) const ++key_num; } } + for( int i = 0; i >= key_num; --i ) + { + if ( Piano::isBlackKey( m_startKey+i ) ) + { + --key_num; + } + } key_num += m_startKey; @@ -345,16 +354,14 @@ int PianoView::getKeyFromMouse( const QPoint & _p ) const // then do extra checking whether the mouse-cursor is over // a black key if( key_num > 0 && Piano::isBlackKey( key_num-1 ) && - _p.x() % PW_WHITE_KEY_WIDTH <= - ( PW_WHITE_KEY_WIDTH / 2 ) - - ( PW_BLACK_KEY_WIDTH / 2 ) ) + offset <= ( PW_WHITE_KEY_WIDTH / 2 ) - + ( PW_BLACK_KEY_WIDTH / 2 ) ) { --key_num; } if( key_num < NumKeys - 1 && Piano::isBlackKey( key_num+1 ) && - _p.x() % PW_WHITE_KEY_WIDTH >= - ( PW_WHITE_KEY_WIDTH - - PW_BLACK_KEY_WIDTH / 2 ) ) + offset >= ( PW_WHITE_KEY_WIDTH - + PW_BLACK_KEY_WIDTH / 2 ) ) { ++key_num; } From 3673e84ac12dd748b61f6ac1f8d5e6fdc2b86448 Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Mon, 26 Mar 2018 21:51:55 -0400 Subject: [PATCH 10/38] Allow relative paths on non-existent directories (#4271) * Use cleanPath for calculating relative directories Closes #4267 --- src/core/ConfigManager.cpp | 2 +- src/core/SampleBuffer.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/ConfigManager.cpp b/src/core/ConfigManager.cpp index a99223a9d..2d89d76b1 100644 --- a/src/core/ConfigManager.cpp +++ b/src/core/ConfigManager.cpp @@ -227,7 +227,7 @@ bool ConfigManager::hasWorkingDir() const void ConfigManager::setWorkingDir( const QString & wd ) { - m_workingDir = ensureTrailingSlash( QFileInfo( wd ).canonicalFilePath() ); + m_workingDir = ensureTrailingSlash( QDir::cleanPath( wd ) ); } diff --git a/src/core/SampleBuffer.cpp b/src/core/SampleBuffer.cpp index 141085dd2..5fc640cb6 100644 --- a/src/core/SampleBuffer.cpp +++ b/src/core/SampleBuffer.cpp @@ -1416,7 +1416,7 @@ QString SampleBuffer::tryToMakeRelative( const QString & file ) if( QFileInfo( file ).isRelative() == false ) { // Normalize the path - QString f = QFileInfo( file ).canonicalFilePath().replace( QDir::separator(), '/' ); + QString f( QDir::cleanPath( file ) ); // First, look in factory samples // Isolate "samples/" from "data:/samples/" @@ -1425,7 +1425,7 @@ QString SampleBuffer::tryToMakeRelative( const QString & file ) // Iterate over all valid "data:/" searchPaths for ( const QString & path : QDir::searchPaths( "data" ) ) { - QString samplesPath = QString( path + samplesSuffix ).replace( QDir::separator(), '/' ); + QString samplesPath = QDir::cleanPath( path + samplesSuffix ) + "/"; if ( f.startsWith( samplesPath ) ) { return QString( f ).mid( samplesPath.length() ); From 1df461d64db73da03ee6c0df5bdb2e6f87c2a770 Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Fri, 30 Mar 2018 14:13:31 -0400 Subject: [PATCH 11/38] Fix VSTs on Fedora 27 (#4276) --- cmake/modules/FindWine.cmake | 2 +- plugins/vst_base/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/modules/FindWine.cmake b/cmake/modules/FindWine.cmake index 458df0653..8771ff3f3 100644 --- a/cmake/modules/FindWine.cmake +++ b/cmake/modules/FindWine.cmake @@ -9,7 +9,7 @@ LIST(APPEND CMAKE_PREFIX_PATH /opt/wine-stable /opt/wine-devel /opt/wine-staging) -FIND_PATH(WINE_INCLUDE_DIR windows/windows.h PATH_SUFFIXES wine) +FIND_PATH(WINE_INCLUDE_DIR windows/windows.h PATH_SUFFIXES wine wine/wine) FIND_LIBRARY(WINE_LIBRARY NAMES wine PATH_SUFFIXES wine i386-linux-gnu/wine) FIND_PROGRAM(WINE_CXX NAMES wineg++ winegcc winegcc64 winegcc32) diff --git a/plugins/vst_base/CMakeLists.txt b/plugins/vst_base/CMakeLists.txt index cd2f32fbd..67e52a9ff 100644 --- a/plugins/vst_base/CMakeLists.txt +++ b/plugins/vst_base/CMakeLists.txt @@ -52,6 +52,7 @@ SET(WINE_CXX_ARGS -I${CMAKE_BINARY_DIR} -I${CMAKE_SOURCE_DIR}/include -I${WINE_INCLUDE_BASE_DIR} + -I${WINE_INCLUDE_DIR}/windows -L${WINE_LIBRARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/RemoteVstPlugin.cpp -std=c++0x From ee910d38fec666cfac82ab9edc13bea25e730805 Mon Sep 17 00:00:00 2001 From: Umcaruje Date: Mon, 2 Apr 2018 19:33:01 +0200 Subject: [PATCH 12/38] Fix marked semitones in the piano roll (#4239) * Fix marked semitones in the piano roll * Don't draw in invalid patterns * update classic theme * Fix contrast * update classic theme --- data/themes/classic/style.css | 2 +- data/themes/default/style.css | 2 +- src/gui/editors/PianoRoll.cpp | 35 ++++++++++++++++------------------- 3 files changed, 18 insertions(+), 21 deletions(-) diff --git a/data/themes/classic/style.css b/data/themes/classic/style.css index 21a3b1551..55f82e4b3 100644 --- a/data/themes/classic/style.css +++ b/data/themes/classic/style.css @@ -127,7 +127,7 @@ PianoRoll { qproperty-noteBorders: true; /* boolean property, set false to have borderless notes */ qproperty-selectedNoteColor: rgb( 0, 125, 255 ); qproperty-barColor: #4afd85; - qproperty-markedSemitoneColor: rgba( 40, 40, 40, 200 ); + qproperty-markedSemitoneColor: rgba( 0, 255, 200, 60 ); /* Grid colors */ qproperty-lineColor: rgba( 128, 128, 128, 80 ); qproperty-beatLineColor: rgba( 128, 128, 128, 160 ); diff --git a/data/themes/default/style.css b/data/themes/default/style.css index 314ca98c7..8493abbf3 100644 --- a/data/themes/default/style.css +++ b/data/themes/default/style.css @@ -146,7 +146,7 @@ PianoRoll { qproperty-noteBorders: false; /* boolean property, set false to have borderless notes */ qproperty-selectedNoteColor: #064d79; qproperty-barColor: #078f3a; - qproperty-markedSemitoneColor: #06170E; + qproperty-markedSemitoneColor: rgba(255, 255, 255, 30); /* Grid colors */ qproperty-lineColor: #292929; qproperty-beatLineColor: #2d6b45; diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index 98c84a524..dbec84357 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -2633,23 +2633,6 @@ void PianoRoll::paintEvent(QPaintEvent * pe ) int key = m_startKey; - // display note marks before drawing other lines - for( int i = 0; i < m_markedSemiTones.size(); i++ ) - { - const int key_num = m_markedSemiTones.at( i ); - const int y = keyAreaBottom() + 5 - - KEY_LINE_HEIGHT * ( key_num - m_startKey + 1 ); - - if( y > keyAreaBottom() ) - { - break; - } - - p.fillRect( WHITE_KEY_WIDTH + 1, y - KEY_LINE_HEIGHT / 2, width() - 10, KEY_LINE_HEIGHT, - markedSemitoneColor() ); - } - - // draw all white keys... for( int y = key_line_y + 1 + y_offset; y > PR_TOP_MARGIN; key_line_y -= KEY_LINE_HEIGHT, ++keys_processed ) @@ -2913,7 +2896,6 @@ void PianoRoll::paintEvent(QPaintEvent * pe ) } } - // Draw the vertical beat lines int ticksPerBeat = DefaultTicksPerTact / Engine::getSong()->getTimeSigModel().getDenominator(); @@ -2934,8 +2916,23 @@ void PianoRoll::paintEvent(QPaintEvent * pe ) p.setPen( barLineColor() ); p.drawLine( x, PR_TOP_MARGIN, x, height() - PR_BOTTOM_MARGIN ); } - } + // draw marked semitones after the grid + for( int i = 0; i < m_markedSemiTones.size(); i++ ) + { + const int key_num = m_markedSemiTones.at( i ); + const int y = keyAreaBottom() + 5 + - KEY_LINE_HEIGHT * ( key_num - m_startKey + 1 ); + + if( y > keyAreaBottom() ) + { + break; + } + + p.fillRect( WHITE_KEY_WIDTH + 1, y - KEY_LINE_HEIGHT / 2, width() - 10, KEY_LINE_HEIGHT + 1, + markedSemitoneColor() ); + } + } // following code draws all notes in visible area // and the note editing stuff (volume, panning, etc) From b77027d6fb7a935ee16695ef4ab7b8f4976659c5 Mon Sep 17 00:00:00 2001 From: Umcaruje Date: Mon, 2 Apr 2018 19:36:07 +0200 Subject: [PATCH 13/38] Fix MDI subwindow buttons contrast in the MenuBar (#4242) * Fix MDI subwindow buttons contrast in the MenuBar * Hard code the button color in LmmsStyle.cpp (thanks @PhysSong) * Fix code formatting --- src/gui/LmmsStyle.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gui/LmmsStyle.cpp b/src/gui/LmmsStyle.cpp index b883a2b2f..e57e29e47 100644 --- a/src/gui/LmmsStyle.cpp +++ b/src/gui/LmmsStyle.cpp @@ -177,6 +177,13 @@ void LmmsStyle::drawComplexControl( ComplexControl control, return; } } + else if (control == CC_MdiControls) + { + QStyleOptionComplex so(*option); + so.palette.setColor(QPalette::Button, QColor(223, 228, 236)); + QProxyStyle::drawComplexControl(control, &so, painter, widget); + return; + } /* else if( control == CC_ScrollBar ) { painter->fillRect( option->rect, QApplication::palette().color( QPalette::Active, @@ -365,4 +372,3 @@ void LmmsStyle::hoverColors( bool sunken, bool hover, bool active, QColor& color blend = QColor( 33, 33, 33 ); } } - From d30a22487e138c1e4c1fa2b3b62e0dc14f24fdd8 Mon Sep 17 00:00:00 2001 From: Dominic Clark Date: Tue, 3 Apr 2018 19:08:53 +0100 Subject: [PATCH 14/38] Don't call setParameter from audioMasterAutomate (#4279) --- plugins/vst_base/RemoteVstPlugin.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/vst_base/RemoteVstPlugin.cpp b/plugins/vst_base/RemoteVstPlugin.cpp index 04ff97731..71ebf74c0 100644 --- a/plugins/vst_base/RemoteVstPlugin.cpp +++ b/plugins/vst_base/RemoteVstPlugin.cpp @@ -1450,7 +1450,6 @@ intptr_t RemoteVstPlugin::hostCallback( AEffect * _effect, int32_t _opcode, case audioMasterAutomate: SHOW_CALLBACK( "amc: audioMasterAutomate\n" ); // index, value, returns 0 - _effect->setParameter( _effect, _index, _opt ); return 0; case audioMasterVersion: From 00f9590b18e3095425f440d4816964d36e9ef489 Mon Sep 17 00:00:00 2001 From: Hyunjin Song Date: Wed, 4 Apr 2018 09:06:58 +0900 Subject: [PATCH 15/38] Fix preset preview issues with peak controllers (#3904) --- plugins/peak_controller_effect/peak_controller_effect.cpp | 3 ++- .../peak_controller_effect_controls.cpp | 7 ------- src/core/PeakController.cpp | 7 +------ 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/plugins/peak_controller_effect/peak_controller_effect.cpp b/plugins/peak_controller_effect/peak_controller_effect.cpp index 59c91f3d1..d4d81b137 100644 --- a/plugins/peak_controller_effect/peak_controller_effect.cpp +++ b/plugins/peak_controller_effect/peak_controller_effect.cpp @@ -26,6 +26,7 @@ #include "Controller.h" #include "Song.h" +#include "PresetPreviewPlayHandle.h" #include "PeakController.h" #include "peak_controller_effect.h" #include "lmms_math.h" @@ -67,7 +68,7 @@ PeakControllerEffect::PeakControllerEffect( m_autoController( NULL ) { m_autoController = new PeakController( Engine::getSong(), this ); - if( !Engine::getSong()->isLoadingProject() ) + if( !Engine::getSong()->isLoadingProject() && !PresetPreviewPlayHandle::isPreviewing() ) { Engine::getSong()->addController( m_autoController ); } diff --git a/plugins/peak_controller_effect/peak_controller_effect_controls.cpp b/plugins/peak_controller_effect/peak_controller_effect_controls.cpp index 2f634cbea..3508f869a 100644 --- a/plugins/peak_controller_effect/peak_controller_effect_controls.cpp +++ b/plugins/peak_controller_effect/peak_controller_effect_controls.cpp @@ -29,7 +29,6 @@ #include "PeakController.h" #include "peak_controller_effect_controls.h" #include "peak_controller_effect.h" -#include "PresetPreviewPlayHandle.h" #include "Song.h" @@ -80,12 +79,6 @@ void PeakControllerEffectControls::loadSettings( const QDomElement & _this ) { m_effect->m_effectId = rand(); } - - if( m_effect->m_autoController && PresetPreviewPlayHandle::isPreviewing() == true ) - { - delete m_effect->m_autoController; - m_effect->m_autoController = 0; - } } diff --git a/src/core/PeakController.cpp b/src/core/PeakController.cpp index 976e3c96e..9e5e654a6 100644 --- a/src/core/PeakController.cpp +++ b/src/core/PeakController.cpp @@ -33,7 +33,6 @@ #include "Mixer.h" #include "EffectChain.h" #include "plugins/peak_controller_effect/peak_controller_effect.h" -#include "PresetPreviewPlayHandle.h" PeakControllerEffectVector PeakController::s_effects; int PeakController::m_getCount; @@ -64,11 +63,7 @@ PeakController::PeakController( Model * _parent, PeakController::~PeakController() { - //EffectChain::loadSettings() appends effect to EffectChain::m_effects - //When it's previewing, EffectChain::loadSettings() is not called - //Therefore, we shouldn't call removeEffect() as it is not even appended. - //NB: Most XML setting are loaded on preview, except controller fx. - if( m_peakEffect != NULL && m_peakEffect->effectChain() != NULL && PresetPreviewPlayHandle::isPreviewing() == false ) + if( m_peakEffect != NULL && m_peakEffect->effectChain() != NULL ) { m_peakEffect->effectChain()->removeEffect( m_peakEffect ); } From e554a4c4b093ea4c319cceed98f4495484da37b0 Mon Sep 17 00:00:00 2001 From: Hussam Eddin Alhomsi Date: Wed, 11 Apr 2018 13:39:43 +0300 Subject: [PATCH 16/38] Better behavior when left-clicking a TCO (#4290) Instead of calling MouseMoveEvent(), the TCO's "text float" text and position are updated. This prevents left-clicking the right edge of a resizable TCO from decreasing its size. Also, removed an unused variable: m_oldTime --- include/Track.h | 2 -- src/core/Track.cpp | 30 ++++++++++++++++++++---------- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/include/Track.h b/include/Track.h index dcb1648e0..00ee5d0a6 100644 --- a/include/Track.h +++ b/include/Track.h @@ -290,8 +290,6 @@ private: TextFloat * m_hint; - MidiTime m_oldTime;// used for undo/redo while mouse-button is pressed - // qproperty fields QColor m_mutedColor; QColor m_mutedBackgroundColor; diff --git a/src/core/Track.cpp b/src/core/Track.cpp index 65187f552..88266d36c 100644 --- a/src/core/Track.cpp +++ b/src/core/Track.cpp @@ -701,10 +701,8 @@ void TrackContentObjectView::mousePressEvent( QMouseEvent * me ) if( me->x() < width() - RESIZE_GRIP_WIDTH ) { m_action = Move; - m_oldTime = m_tco->startPosition(); QCursor c( Qt::SizeAllCursor ); QApplication::setOverrideCursor( c ); - s_textFloat->setTitle( tr( "Current position" ) ); delete m_hint; m_hint = TextFloat::displayMessage( tr( "Hint" ), tr( "Press <%1> and drag to make " @@ -715,14 +713,18 @@ void TrackContentObjectView::mousePressEvent( QMouseEvent * me ) "Ctrl"), #endif embed::getIconPixmap( "hint" ), 0 ); + s_textFloat->setTitle( tr( "Current position" ) ); + s_textFloat->setText( QString( "%1:%2" ). + arg( m_tco->startPosition().getTact() + 1 ). + arg( m_tco->startPosition().getTicks() % + MidiTime::ticksPerTact() ) ); + s_textFloat->moveGlobal( this, QPoint( width() + 2, height() + 2 ) ); } else if( !m_tco->getAutoResize() ) { m_action = Resize; - m_oldTime = m_tco->length(); QCursor c( Qt::SizeHorCursor ); QApplication::setOverrideCursor( c ); - s_textFloat->setTitle( tr( "Current length" ) ); delete m_hint; m_hint = TextFloat::displayMessage( tr( "Hint" ), tr( "Press <%1> for free " @@ -733,10 +735,20 @@ void TrackContentObjectView::mousePressEvent( QMouseEvent * me ) "Ctrl"), #endif embed::getIconPixmap( "hint" ), 0 ); + s_textFloat->setTitle( tr( "Current length" ) ); + s_textFloat->setText( tr( "%1:%2 (%3:%4 to %5:%6)" ). + arg( m_tco->length().getTact() ). + arg( m_tco->length().getTicks() % + MidiTime::ticksPerTact() ). + arg( m_tco->startPosition().getTact() + 1 ). + arg( m_tco->startPosition().getTicks() % + MidiTime::ticksPerTact() ). + arg( m_tco->endPosition().getTact() + 1 ). + arg( m_tco->endPosition().getTicks() % + MidiTime::ticksPerTact() ) ); + s_textFloat->moveGlobal( this, QPoint( width() + 2, height() + 2) ); } // s_textFloat->reparent( this ); - // setup text-float as if TCO was already moved/resized - mouseMoveEvent( me ); s_textFloat->show(); } else if( me->button() == Qt::RightButton ) @@ -846,8 +858,7 @@ void TrackContentObjectView::mouseMoveEvent( QMouseEvent * me ) arg( m_tco->startPosition().getTact() + 1 ). arg( m_tco->startPosition().getTicks() % MidiTime::ticksPerTact() ) ); - s_textFloat->moveGlobal( this, QPoint( width() + 2, - height() + 2 ) ); + s_textFloat->moveGlobal( this, QPoint( width() + 2, height() + 2 ) ); } else if( m_action == MoveSelection ) { @@ -906,8 +917,7 @@ void TrackContentObjectView::mouseMoveEvent( QMouseEvent * me ) arg( m_tco->endPosition().getTact() + 1 ). arg( m_tco->endPosition().getTicks() % MidiTime::ticksPerTact() ) ); - s_textFloat->moveGlobal( this, QPoint( width() + 2, - height() + 2) ); + s_textFloat->moveGlobal( this, QPoint( width() + 2, height() + 2) ); } else { From 07a23c4e3b5c16c60ac6a5a89c9330bbd513cb49 Mon Sep 17 00:00:00 2001 From: Oskar Wallgren Date: Sun, 15 Apr 2018 15:44:38 +0200 Subject: [PATCH 17/38] Allways remove infs/nans (#3706) When exporting a project lmms performs extra tests for bad data. The tests are for infs and nans. Switching these tests on for all occasions as the extra performance hit would be in the order of only ~2% and the problems, when it hits the end user, are hard to debug and/or work around. After testing for inf/nan we clamp the sound to +/-4.0f as sometimes you will get large transients passing through (an issue that is currently only present when exporting). Fixes: #1048 --- src/core/EffectChain.cpp | 12 +++--------- src/core/FxMixer.cpp | 13 ++++--------- src/core/MixHelpers.cpp | 4 ++++ 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/src/core/EffectChain.cpp b/src/core/EffectChain.cpp index a1aea9d3a..efadca525 100644 --- a/src/core/EffectChain.cpp +++ b/src/core/EffectChain.cpp @@ -202,11 +202,8 @@ bool EffectChain::processAudioBuffer( sampleFrame * _buf, const fpp_t _frames, b { return false; } - const bool exporting = Engine::getSong()->isExporting(); - if( exporting ) // strip infs/nans if exporting - { - MixHelpers::sanitize( _buf, _frames ); - } + + MixHelpers::sanitize( _buf, _frames ); bool moreEffects = false; for( EffectList::Iterator it = m_effects.begin(); it != m_effects.end(); ++it ) @@ -214,10 +211,7 @@ bool EffectChain::processAudioBuffer( sampleFrame * _buf, const fpp_t _frames, b if( hasInputNoise || ( *it )->isRunning() ) { moreEffects |= ( *it )->processAudioBuffer( _buf, _frames ); - if( exporting ) // strip infs/nans if exporting - { - MixHelpers::sanitize( _buf, _frames ); - } + MixHelpers::sanitize( _buf, _frames ); } } diff --git a/src/core/FxMixer.cpp b/src/core/FxMixer.cpp index 5ac23639a..62b68b7a3 100644 --- a/src/core/FxMixer.cpp +++ b/src/core/FxMixer.cpp @@ -117,7 +117,6 @@ void FxChannel::unmuteForSolo() void FxChannel::doProcessing() { const fpp_t fpp = Engine::mixer()->framesPerPeriod(); - const bool exporting = Engine::getSong()->isExporting(); if( m_muted == false ) { @@ -140,25 +139,21 @@ void FxChannel::doProcessing() if( ! volBuf && ! sendBuf ) // neither volume nor send has sample-exact data... { const float v = sender->m_volumeModel.value() * sendModel->value(); - if( exporting ) { MixHelpers::addSanitizedMultiplied( m_buffer, ch_buf, v, fpp ); } - else { MixHelpers::addMultiplied( m_buffer, ch_buf, v, fpp ); } + MixHelpers::addSanitizedMultiplied( m_buffer, ch_buf, v, fpp ); } else if( volBuf && sendBuf ) // both volume and send have sample-exact data { - if( exporting ) { MixHelpers::addSanitizedMultipliedByBuffers( m_buffer, ch_buf, volBuf, sendBuf, fpp ); } - else { MixHelpers::addMultipliedByBuffers( m_buffer, ch_buf, volBuf, sendBuf, fpp ); } + MixHelpers::addSanitizedMultipliedByBuffers( m_buffer, ch_buf, volBuf, sendBuf, fpp ); } else if( volBuf ) // volume has sample-exact data but send does not { const float v = sendModel->value(); - if( exporting ) { MixHelpers::addSanitizedMultipliedByBuffer( m_buffer, ch_buf, v, volBuf, fpp ); } - else { MixHelpers::addMultipliedByBuffer( m_buffer, ch_buf, v, volBuf, fpp ); } + MixHelpers::addSanitizedMultipliedByBuffer( m_buffer, ch_buf, v, volBuf, fpp ); } else // vice versa { const float v = sender->m_volumeModel.value(); - if( exporting ) { MixHelpers::addSanitizedMultipliedByBuffer( m_buffer, ch_buf, v, sendBuf, fpp ); } - else { MixHelpers::addMultipliedByBuffer( m_buffer, ch_buf, v, sendBuf, fpp ); } + MixHelpers::addSanitizedMultipliedByBuffer( m_buffer, ch_buf, v, sendBuf, fpp ); } m_hasInput = true; } diff --git a/src/core/MixHelpers.cpp b/src/core/MixHelpers.cpp index 001aa05cc..60fa778af 100644 --- a/src/core/MixHelpers.cpp +++ b/src/core/MixHelpers.cpp @@ -82,6 +82,10 @@ bool sanitize( sampleFrame * src, int frames ) src[f][c] = 0.0f; found = true; } + else + { + src[f][c] = qBound( -4.0f, src[f][c], 4.0f ); + } } } return found; From 18a4346fd58207ddf23b5abfa081b809f07a88f6 Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Fri, 20 Apr 2018 15:41:08 -0400 Subject: [PATCH 18/38] Better default working directory (#4288) * Better default working directory Closes #1135 --- src/core/ConfigManager.cpp | 15 ++++++++++++++- src/gui/GuiApplication.cpp | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/core/ConfigManager.cpp b/src/core/ConfigManager.cpp index 2d89d76b1..177a90437 100644 --- a/src/core/ConfigManager.cpp +++ b/src/core/ConfigManager.cpp @@ -26,6 +26,11 @@ #include #include #include +#if QT_VERSION >= 0x050000 +#include +#else +#include +#endif #include #include "ConfigManager.h" @@ -50,7 +55,11 @@ ConfigManager * ConfigManager::s_instanceOfMe = NULL; ConfigManager::ConfigManager() : m_lmmsRcFile( QDir::home().absolutePath() +"/.lmmsrc.xml" ), - m_workingDir( QDir::home().absolutePath() + "/lmms/"), + #if QT_VERSION >= 0x050000 + m_workingDir( QStandardPaths::writableLocation( QStandardPaths::DocumentsLocation ) + "/lmms/"), + #else + m_workingDir( QDesktopServices::storageLocation( QDesktopServices::DocumentsLocation ) + "/lmms/"), + #endif m_dataDir( "data:/" ), m_artworkDir( defaultArtworkDir() ), m_vstDir( m_workingDir + "vst/" ), @@ -58,6 +67,10 @@ ConfigManager::ConfigManager() : m_sf2Dir( m_workingDir + SF2_PATH ), m_version( defaultVersion() ) { + // Detect < 1.2.0 working directory as a courtesy + if ( QFileInfo( QDir::home().absolutePath() + "/lmms/projects/" ).exists() ) + m_workingDir = QDir::home().absolutePath() + "/lmms/"; + if (! qgetenv("LMMS_DATA_DIR").isEmpty()) QDir::addSearchPath("data", QString::fromLocal8Bit(qgetenv("LMMS_DATA_DIR"))); diff --git a/src/gui/GuiApplication.cpp b/src/gui/GuiApplication.cpp index e82d95b9a..2c577868c 100644 --- a/src/gui/GuiApplication.cpp +++ b/src/gui/GuiApplication.cpp @@ -59,7 +59,7 @@ GuiApplication::GuiApplication() QApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true); #endif - // prompt the user to create the LMMS working directory (e.g. ~/lmms) if it doesn't exist + // prompt the user to create the LMMS working directory (e.g. ~/Documents/lmms) if it doesn't exist if ( !ConfigManager::inst()->hasWorkingDir() && QMessageBox::question( NULL, tr( "Working directory" ), From 22ca47abba996034f59e5e540eb728fe02161f47 Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Fri, 20 Apr 2018 15:46:13 -0400 Subject: [PATCH 19/38] Disable fluidsynth audio backends if possible (#4300) Closes #649 Partially reverts #3446 --- .travis/osx..install.sh | 8 +----- cmake/apple/fluid-synth.rb | 42 ------------------------------- plugins/sf2_player/sf2_player.cpp | 6 +++++ 3 files changed, 7 insertions(+), 49 deletions(-) delete mode 100644 cmake/apple/fluid-synth.rb diff --git a/.travis/osx..install.sh b/.travis/osx..install.sh index 3fb1df701..45a6762d1 100644 --- a/.travis/osx..install.sh +++ b/.travis/osx..install.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -PACKAGES="cmake pkgconfig fftw libogg libvorbis lame libsndfile libsamplerate jack sdl libgig libsoundio stk portaudio node fltk" +PACKAGES="cmake pkgconfig fftw libogg libvorbis lame libsndfile libsamplerate jack sdl libgig libsoundio stk fluid-synth portaudio node fltk" if [ $QT5 ]; then PACKAGES="$PACKAGES qt5" @@ -10,10 +10,4 @@ fi brew install $PACKAGES ccache -# Recompile fluid-synth without CoreAudio per issues #649 -# Changes to fluid-synth.rb must be pushed to URL prior to use -url=$(git remote get-url origin) -branch=$(git symbolic-ref --short HEAD) -brew install --build-from-source $url/raw/$branch/cmake/apple/fluid-synth.rb - sudo npm install -g appdmg diff --git a/cmake/apple/fluid-synth.rb b/cmake/apple/fluid-synth.rb deleted file mode 100644 index d05fb4d65..000000000 --- a/cmake/apple/fluid-synth.rb +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (c) 2009-present, Homebrew contributors -# License: BSD 2-Clause - -class FluidSynth < Formula - desc "Real-time software synthesizer based on the SoundFont 2 specs" - homepage "http://www.fluidsynth.org" - url "https://downloads.sourceforge.net/project/fluidsynth/fluidsynth-1.1.6/fluidsynth-1.1.6.tar.gz" - sha256 "50853391d9ebeda9b4db787efb23f98b1e26b7296dd2bb5d0d96b5bccee2171c" - - bottle do - cellar :any - rebuild 1 - sha256 "ee86f0e263db0610a340592d725bd2c05bc5ed1bfa6eb496ae304297de261ae0" => :sierra - sha256 "dfe31491d27c3c29ff4686900984e5884f89cd249d82b3dba4ad077f7bbe9057" => :el_capitan - sha256 "6938c03a61b696870de92435dc0a6e6118fbb0d68adcd0d17ec8d30c2f7eee20" => :yosemite - sha256 "5c5e00f88e45dd661c15f0e13793f9cc96f285b08200145ce8b77982350a5625" => :mavericks - sha256 "83b972cf7aec57e78dc1c1a6b3e286d8b9bf2a2622e174bca42efa8576e36e5f" => :mountain_lion - end - - depends_on "pkg-config" => :build - depends_on "cmake" => :build - depends_on "glib" - depends_on "libsndfile" => :optional - depends_on "portaudio" => :optional - - def install - args = std_cmake_args - args << "-Denable-framework=OFF" << "-DLIB_SUFFIX=" - args << "-Denable-portaudio=ON" if build.with? "portaudio" - args << "-Denable-libsndfile=OFF" if build.without? "libsndfile" - args << "-Denable-coreaudio=OFF" # Per lmms/issues/649 - - mkdir "build" do - system "cmake", "..", *args - system "make", "install" - end - end - - test do - assert_match /#{version}/, shell_output("#{bin}/fluidsynth --version") - end -end diff --git a/plugins/sf2_player/sf2_player.cpp b/plugins/sf2_player/sf2_player.cpp index 1ff7a5ae6..24551ac98 100644 --- a/plugins/sf2_player/sf2_player.cpp +++ b/plugins/sf2_player/sf2_player.cpp @@ -113,6 +113,12 @@ sf2Instrument::sf2Instrument( InstrumentTrack * _instrument_track ) : m_notesRunning[i] = 0; } + +#if FLUIDSYNTH_VERSION_MAJOR >= 1 && FLUIDSYNTH_VERSION_MINOR >= 1 && FLUIDSYNTH_VERSION_MICRO >= 9 + // Deactivate all audio drivers in fluidsynth + const char *none[] = { NULL }; + fluid_audio_driver_register( none ); +#endif m_settings = new_fluid_settings(); //fluid_settings_setint( m_settings, (char *) "audio.period-size", engine::mixer()->framesPerPeriod() ); From aaee2ecb1520cdc6523b49f0bb603226b80fddc5 Mon Sep 17 00:00:00 2001 From: tresf Date: Fri, 20 Apr 2018 21:50:59 -0400 Subject: [PATCH 20/38] Better fluidsynth version detection Per #4300 comment --- plugins/sf2_player/sf2_player.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/sf2_player/sf2_player.cpp b/plugins/sf2_player/sf2_player.cpp index 24551ac98..742f5fb8e 100644 --- a/plugins/sf2_player/sf2_player.cpp +++ b/plugins/sf2_player/sf2_player.cpp @@ -114,7 +114,7 @@ sf2Instrument::sf2Instrument( InstrumentTrack * _instrument_track ) : } -#if FLUIDSYNTH_VERSION_MAJOR >= 1 && FLUIDSYNTH_VERSION_MINOR >= 1 && FLUIDSYNTH_VERSION_MICRO >= 9 +#if QT_VERSION_CHECK(FLUIDSYNTH_VERSION_MAJOR, FLUIDSYNTH_VERSION_MINOR, FLUIDSYNTH_VERSION_MICRO) >= QT_VERSION_CHECK(1,1,9) // Deactivate all audio drivers in fluidsynth const char *none[] = { NULL }; fluid_audio_driver_register( none ); From 33368bd9d05ce42a0cf5af1594b996548ecf12c3 Mon Sep 17 00:00:00 2001 From: Lukas W Date: Sat, 21 Apr 2018 13:31:14 +0200 Subject: [PATCH 21/38] Revert CONTRIBUTOR file removal This reverts commit 30f1e52be35ed35f8e0e40f876620ce49007be62. # Conflicts: # CMakeLists.txt --- CMakeLists.txt | 16 ++++++++++++++++ doc/CONTRIBUTORS | 0 src/CMakeLists.txt | 5 +---- 3 files changed, 17 insertions(+), 4 deletions(-) delete mode 100644 doc/CONTRIBUTORS diff --git a/CMakeLists.txt b/CMakeLists.txt index 858e310c1..f22e2dfa3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -497,6 +497,22 @@ FILE(REMOVE include/lmmsconfig.h) FILE(GLOB LMMS_INCLUDES "${CMAKE_SOURCE_DIR}/include/*.h") LIST(SORT LMMS_INCLUDES) +# Get list of all committers from git history, ordered by number of commits. +# The CONTRIBUTORS file is used by AboutDialog. This information can be provided +# with -DCONTRIBUTORS=/path/to/CONTRIBUTORS instead. For instance, to generate +# this file for version 1.1.3, the command is: +# git shortlog -sne v1.1.3 | cut -c8- +FIND_PACKAGE(Git) +IF(GIT_FOUND AND NOT CONTRIBUTORS) + SET(CONTRIBUTORS "${CMAKE_BINARY_DIR}/CONTRIBUTORS") + EXECUTE_PROCESS( + COMMAND "${GIT_EXECUTABLE}" shortlog -sne + COMMAND cut -c8- + OUTPUT_FILE "${CONTRIBUTORS}" + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" + TIMEOUT 1) +ENDIF() + # embedded resources stuff IF(WIN32 OR WIN64) # compile buildtools native diff --git a/doc/CONTRIBUTORS b/doc/CONTRIBUTORS deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 718a6fc1d..17695b5a0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -43,10 +43,7 @@ IF(WIN32) DEPENDS "${CMAKE_BINARY_DIR}/lmms.rc") ENDIF() -SET(lmms_EMBEDDED_RESOURCES - "${CMAKE_SOURCE_DIR}/doc/AUTHORS" - "${CMAKE_SOURCE_DIR}/LICENSE.txt" - "${CMAKE_SOURCE_DIR}/doc/CONTRIBUTORS") +SET(lmms_EMBEDDED_RESOURCES "${CMAKE_SOURCE_DIR}/doc/AUTHORS" "${CMAKE_SOURCE_DIR}/LICENSE.txt" "${CONTRIBUTORS}") SET(LMMS_ER_H "${CMAKE_CURRENT_BINARY_DIR}/embedded_resources.h") ADD_CUSTOM_COMMAND(OUTPUT "${LMMS_ER_H}" COMMAND "${BIN2RES}" ARGS ${lmms_EMBEDDED_RESOURCES} > "${LMMS_ER_H}" DEPENDS bin2res) From 50eada6b2b846f419509b40feef8702a24c349fe Mon Sep 17 00:00:00 2001 From: Lukas W Date: Sat, 21 Apr 2018 13:33:35 +0200 Subject: [PATCH 22/38] Update project year --- CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f22e2dfa3..8f269ee64 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,8 +20,7 @@ INCLUDE(FindPkgConfig) STRING(TOUPPER "${CMAKE_PROJECT_NAME}" PROJECT_NAME_UCASE) -# Updated by maintenance tasks -SET(PROJECT_YEAR 2017) +SET(PROJECT_YEAR 2018) SET(PROJECT_AUTHOR "LMMS Developers") SET(PROJECT_URL "https://lmms.io") From d65fdd4ee6acde67ad0b8f0e3909eee3cd68efd9 Mon Sep 17 00:00:00 2001 From: Lukas W Date: Sun, 22 Apr 2018 08:34:46 +0200 Subject: [PATCH 23/38] Create no-response.yml --- .github/no-response.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .github/no-response.yml diff --git a/.github/no-response.yml b/.github/no-response.yml new file mode 100644 index 000000000..476165408 --- /dev/null +++ b/.github/no-response.yml @@ -0,0 +1,2 @@ +# Label requiring a response +responseRequiredLabel: "response required" From fce9326192ce99f48a1cd998a03e9d943544f07d Mon Sep 17 00:00:00 2001 From: Lukas W Date: Wed, 25 Apr 2018 11:00:13 +0200 Subject: [PATCH 24/38] Update rpmalloc to 1.3.0 Fixes #4055 --- src/3rdparty/rpmalloc/rpmalloc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rdparty/rpmalloc/rpmalloc b/src/3rdparty/rpmalloc/rpmalloc index 2e0479192..36b1942fb 160000 --- a/src/3rdparty/rpmalloc/rpmalloc +++ b/src/3rdparty/rpmalloc/rpmalloc @@ -1 +1 @@ -Subproject commit 2e0479192b8dfb15e0084969fdf06208cffbfd09 +Subproject commit 36b1942fbc309b139e56a03166ba19a87f28f26c From 386c471ed7fc1cc565be761927c2d7058512f4b9 Mon Sep 17 00:00:00 2001 From: Hussam Eddin Alhomsi Date: Thu, 26 Apr 2018 18:37:43 +0300 Subject: [PATCH 25/38] Limit the automation-editor scaled-level tooltip to the grid (#4308) --- src/gui/editors/AutomationEditor.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/gui/editors/AutomationEditor.cpp b/src/gui/editors/AutomationEditor.cpp index 3d4407e51..0234be0ab 100644 --- a/src/gui/editors/AutomationEditor.cpp +++ b/src/gui/editors/AutomationEditor.cpp @@ -1076,8 +1076,8 @@ void AutomationEditor::mouseMoveEvent(QMouseEvent * mouseEvent ) inline void AutomationEditor::drawCross( QPainter & p ) { QPoint mouse_pos = mapFromGlobal( QCursor::pos() ); - float level = getLevel( mouse_pos.y() ); int grid_bottom = height() - SCROLLBAR_SIZE - 1; + float level = getLevel( mouse_pos.y() ); float cross_y = m_y_auto ? grid_bottom - ( ( grid_bottom - TOP_MARGIN ) * ( level - m_minLevel ) @@ -1086,13 +1086,23 @@ inline void AutomationEditor::drawCross( QPainter & p ) p.setPen( crossColor() ); p.drawLine( VALUES_WIDTH, (int) cross_y, width(), (int) cross_y ); - p.drawLine( mouse_pos.x(), TOP_MARGIN, mouse_pos.x(), - height() - SCROLLBAR_SIZE ); + p.drawLine( mouse_pos.x(), TOP_MARGIN, mouse_pos.x(), height() - SCROLLBAR_SIZE ); + + QPoint tt_pos = QCursor::pos(); - tt_pos.ry() -= 64; - tt_pos.rx() += 32; + tt_pos.ry() -= 51; + tt_pos.rx() += 26; + float scaledLevel = m_pattern->firstObject()->scaledValue( level ); - QToolTip::showText( tt_pos, QString::number( scaledLevel ), this ); + + // Limit the scaled-level tooltip to the grid + if( mouse_pos.x() >= 0 && + mouse_pos.x() <= width() - SCROLLBAR_SIZE && + mouse_pos.y() >= 0 && + mouse_pos.y() <= height() - SCROLLBAR_SIZE ) + { + QToolTip::showText( tt_pos, QString::number( scaledLevel ), this ); + } } From 832e87725a7071e5f3c9533218a2eb39237b3cb0 Mon Sep 17 00:00:00 2001 From: Hyunin Song Date: Sun, 29 Apr 2018 21:55:15 +0900 Subject: [PATCH 26/38] Add dummy CircleCI config file --- .circleci/config.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000..7ad70d61a --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,11 @@ +# Dummy CircleCI Config File +version: 2 +jobs: + build: + machine: true + branches: + ignore: stable-1.2 + steps: + - run: + name: Dummy + command: echo "Dummy command to prevent error" \ No newline at end of file From 08573fc96db564283f8580ae79de48085665f9dc Mon Sep 17 00:00:00 2001 From: Hyunjin Song Date: Mon, 30 Apr 2018 14:54:34 +0900 Subject: [PATCH 27/38] Fix detuning crash after deleting the note being edited (#4324) --- src/gui/editors/PianoRoll.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index dbec84357..888425ddc 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -1334,8 +1335,8 @@ void PianoRoll::mousePressEvent(QMouseEvent * me ) if( m_editMode == ModeEditDetuning && noteUnderMouse() ) { - static AutomationPattern* detuningPattern = nullptr; - if (detuningPattern != nullptr) + static QPointer detuningPattern = nullptr; + if (detuningPattern.data() != nullptr) { detuningPattern->disconnect(this); } @@ -1345,7 +1346,7 @@ void PianoRoll::mousePressEvent(QMouseEvent * me ) n->createDetuning(); } detuningPattern = n->detuning()->automationPattern(); - connect(detuningPattern, SIGNAL(dataChanged()), this, SLOT(update())); + connect(detuningPattern.data(), SIGNAL(dataChanged()), this, SLOT(update())); gui->automationEditor()->open(detuningPattern); return; } From 4b36ba9f81d9473337d1038bcd4b56fa72ba8616 Mon Sep 17 00:00:00 2001 From: Hyunin Song Date: Wed, 2 May 2018 12:41:10 +0900 Subject: [PATCH 28/38] Fix a regression from #3711 --- src/core/Song.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/Song.cpp b/src/core/Song.cpp index 1d0e7ed20..775c0c588 100644 --- a/src/core/Song.cpp +++ b/src/core/Song.cpp @@ -601,7 +601,7 @@ void Song::setPlayPos( tick_t ticks, PlayModes playMode ) { tick_t ticksFromPlayMode = m_playPos[playMode].getTicks(); m_elapsedTicks += ticksFromPlayMode - ticks; - m_elapsedMilliSeconds[m_playMode] += MidiTime::ticksToMilliseconds( ticks - ticksFromPlayMode, getTempo() ); + m_elapsedMilliSeconds[playMode] += MidiTime::ticksToMilliseconds( ticks - ticksFromPlayMode, getTempo() ); m_playPos[playMode].setTicks( ticks ); m_playPos[playMode].setCurrentFrame( 0.0f ); From c1b2728d656a41345d76854fa28fcf597a774296 Mon Sep 17 00:00:00 2001 From: Hussam Eddin Alhomsi Date: Wed, 2 May 2018 09:04:39 +0300 Subject: [PATCH 29/38] Allow setting/moving points at the left edge of AE grid (#4323) --- src/gui/editors/AutomationEditor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/editors/AutomationEditor.cpp b/src/gui/editors/AutomationEditor.cpp index bb19ff0ee..2e0c68cd5 100644 --- a/src/gui/editors/AutomationEditor.cpp +++ b/src/gui/editors/AutomationEditor.cpp @@ -504,7 +504,7 @@ void AutomationEditor::mousePressEvent( QMouseEvent* mouseEvent ) int x = mouseEvent->x(); - if( x > VALUES_WIDTH ) + if( x >= VALUES_WIDTH ) { // set or move value From 68c9d227d041b2993ee9e4be29d7de583195d73c Mon Sep 17 00:00:00 2001 From: Matt Kline Date: Sun, 6 May 2018 16:32:10 -0700 Subject: [PATCH 30/38] Default some empty destructors Moving empty destructors out of the .cpp files and into headers allows them to be devirtualized in certain cases. (When the compiler can't "see" a function in a header, it must largely assume it's some black box that the linker will resolve.) While we're at it, use C++11's `= default` to define empty virtual desturctors for us. For some classes (e.g., Piano), nothing is derived from it, so we can mark the class as final and remove any explicit virtual dtor. There are many other places where this can be done, but this is a large enough patch as-is. --- include/AutomatableModelView.h | 2 +- include/AutomationPattern.h | 2 +- include/AutomationTrack.h | 4 ++-- include/BBTrack.h | 4 ++-- include/Fader.h | 2 +- include/FileBrowser.h | 4 ++-- include/Graph.h | 4 ++-- include/Instrument.h | 2 +- include/LcdSpinBox.h | 2 +- include/Pattern.h | 2 +- include/Piano.h | 3 +-- include/PianoView.h | 2 +- include/SampleTrack.h | 3 +-- include/TabBar.h | 2 +- include/TabWidget.h | 2 +- include/TimeDisplayWidget.h | 2 +- include/ToolButton.h | 2 +- src/core/AutomationPattern.cpp | 10 ---------- src/core/Instrument.cpp | 10 ---------- src/core/Piano.cpp | 13 ------------- src/gui/AutomatableModelView.cpp | 10 ---------- src/gui/FileBrowser.cpp | 20 -------------------- src/gui/PianoView.cpp | 13 ------------- src/gui/widgets/Fader.cpp | 6 ------ src/gui/widgets/Graph.cpp | 15 --------------- src/gui/widgets/LcdSpinBox.cpp | 8 -------- src/gui/widgets/SideBar.cpp | 5 ++--- src/gui/widgets/TabBar.cpp | 10 ---------- src/gui/widgets/TabWidget.cpp | 6 ------ src/gui/widgets/TimeDisplayWidget.cpp | 11 ----------- src/gui/widgets/ToolButton.cpp | 7 ------- src/tracks/AutomationTrack.cpp | 20 -------------------- src/tracks/BBTrack.cpp | 20 -------------------- src/tracks/Pattern.cpp | 13 ------------- src/tracks/SampleTrack.cpp | 10 ---------- 35 files changed, 23 insertions(+), 228 deletions(-) diff --git a/include/AutomatableModelView.h b/include/AutomatableModelView.h index ead5d81af..3b320434f 100644 --- a/include/AutomatableModelView.h +++ b/include/AutomatableModelView.h @@ -36,7 +36,7 @@ class EXPORT AutomatableModelView : public ModelView { public: AutomatableModelView( Model* model, QWidget* _this ); - virtual ~AutomatableModelView(); + virtual ~AutomatableModelView() = default; // some basic functions for convenience AutomatableModel* modelUntyped() diff --git a/include/AutomationPattern.h b/include/AutomationPattern.h index 0af7ea4fa..89dcfed7c 100644 --- a/include/AutomationPattern.h +++ b/include/AutomationPattern.h @@ -54,7 +54,7 @@ public: AutomationPattern( AutomationTrack * _auto_track ); AutomationPattern( const AutomationPattern & _pat_to_copy ); - virtual ~AutomationPattern(); + virtual ~AutomationPattern() = default; bool addObject( AutomatableModel * _obj, bool _search_dup = true ); diff --git a/include/AutomationTrack.h b/include/AutomationTrack.h index 733f5941c..195c21e9d 100644 --- a/include/AutomationTrack.h +++ b/include/AutomationTrack.h @@ -35,7 +35,7 @@ class AutomationTrack : public Track Q_OBJECT public: AutomationTrack( TrackContainer* tc, bool _hidden = false ); - virtual ~AutomationTrack(); + virtual ~AutomationTrack() = default; virtual bool play( const MidiTime & _start, const fpp_t _frames, const f_cnt_t _frame_base, int _tco_num = -1 ); @@ -63,7 +63,7 @@ class AutomationTrackView : public TrackView { public: AutomationTrackView( AutomationTrack* at, TrackContainerView* tcv ); - virtual ~AutomationTrackView(); + virtual ~AutomationTrackView() = default; virtual void dragEnterEvent( QDragEnterEvent * _dee ); virtual void dropEvent( QDropEvent * _de ); diff --git a/include/BBTrack.h b/include/BBTrack.h index aafeeaf71..9e72c4f04 100644 --- a/include/BBTrack.h +++ b/include/BBTrack.h @@ -41,7 +41,7 @@ class BBTCO : public TrackContentObject { public: BBTCO( Track * _track ); - virtual ~BBTCO(); + virtual ~BBTCO() = default; virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); virtual void loadSettings( const QDomElement & _this ); @@ -90,7 +90,7 @@ class BBTCOView : public TrackContentObjectView Q_OBJECT public: BBTCOView( TrackContentObject * _tco, TrackView * _tv ); - virtual ~BBTCOView(); + virtual ~BBTCOView() = default; QColor color() const { diff --git a/include/Fader.h b/include/Fader.h index be165f234..80359b4c6 100644 --- a/include/Fader.h +++ b/include/Fader.h @@ -68,7 +68,7 @@ public: Fader( FloatModel * _model, const QString & _name, QWidget * _parent ); Fader( FloatModel * _model, const QString & _name, QWidget * _parent, QPixmap * back, QPixmap * leds, QPixmap * knob ); - virtual ~Fader(); + virtual ~Fader() = default; void init(FloatModel * model, QString const & name); diff --git a/include/FileBrowser.h b/include/FileBrowser.h index f3daa48d1..91a58831d 100644 --- a/include/FileBrowser.h +++ b/include/FileBrowser.h @@ -51,7 +51,7 @@ public: FileBrowser( const QString & directories, const QString & filter, const QString & title, const QPixmap & pm, QWidget * parent, bool dirs_as_items = false, bool recurse = false ); - virtual ~FileBrowser(); + virtual ~FileBrowser() = default; private slots: void reloadTree( void ); @@ -85,7 +85,7 @@ class FileBrowserTreeWidget : public QTreeWidget Q_OBJECT public: FileBrowserTreeWidget( QWidget * parent ); - virtual ~FileBrowserTreeWidget(); + virtual ~FileBrowserTreeWidget() = default; protected: diff --git a/include/Graph.h b/include/Graph.h index 71e6da60b..dc1d1fe16 100644 --- a/include/Graph.h +++ b/include/Graph.h @@ -55,7 +55,7 @@ public: int _width = 132, int _height = 104 ); - virtual ~Graph(); + virtual ~Graph() = default; void setForeground( const QPixmap & _pixmap ); @@ -122,7 +122,7 @@ public: bool _default_constructed = false, float _step = 0.0 ); - virtual ~graphModel(); + virtual ~graphModel() = default; // TODO: saveSettings, loadSettings? diff --git a/include/Instrument.h b/include/Instrument.h index 9dd68ef98..ec7245dce 100644 --- a/include/Instrument.h +++ b/include/Instrument.h @@ -57,7 +57,7 @@ public: Instrument( InstrumentTrack * _instrument_track, const Descriptor * _descriptor ); - virtual ~Instrument(); + virtual ~Instrument() = default; // -------------------------------------------------------------------- // functions that can/should be re-implemented: diff --git a/include/LcdSpinBox.h b/include/LcdSpinBox.h index 0bac3ddc0..d6896f52b 100644 --- a/include/LcdSpinBox.h +++ b/include/LcdSpinBox.h @@ -38,7 +38,7 @@ public: LcdSpinBox( int numDigits, const QString& style, QWidget* parent, const QString& name = QString::null ); - virtual ~LcdSpinBox(); + virtual ~LcdSpinBox() = default; virtual void modelChanged() { diff --git a/include/Pattern.h b/include/Pattern.h index 189631412..235f504c4 100644 --- a/include/Pattern.h +++ b/include/Pattern.h @@ -163,7 +163,7 @@ class PatternView : public TrackContentObjectView public: PatternView( Pattern* pattern, TrackView* parent ); - virtual ~PatternView(); + virtual ~PatternView() = default; Q_PROPERTY(QColor noteFillColor READ getNoteFillColor WRITE setNoteFillColor) Q_PROPERTY(QColor noteBorderColor READ getNoteBorderColor WRITE setNoteBorderColor) diff --git a/include/Piano.h b/include/Piano.h index 1515d267d..633236f4a 100644 --- a/include/Piano.h +++ b/include/Piano.h @@ -31,7 +31,7 @@ class InstrumentTrack; class MidiEventProcessor; -class Piano : public Model +class Piano final : public Model { public: enum KeyTypes @@ -41,7 +41,6 @@ public: } ; Piano( InstrumentTrack* track ); - virtual ~Piano(); void setKeyState( int key, bool state ); diff --git a/include/PianoView.h b/include/PianoView.h index 935279a98..2a362c584 100644 --- a/include/PianoView.h +++ b/include/PianoView.h @@ -38,7 +38,7 @@ class PianoView : public QWidget, public ModelView Q_OBJECT public: PianoView( QWidget * _parent ); - virtual ~PianoView(); + virtual ~PianoView() = default; static int getKeyFromKeyEvent( QKeyEvent * _ke ); diff --git a/include/SampleTrack.h b/include/SampleTrack.h index 6d39ed355..decf52f3f 100644 --- a/include/SampleTrack.h +++ b/include/SampleTrack.h @@ -98,8 +98,7 @@ class SampleTCOView : public TrackContentObjectView public: SampleTCOView( SampleTCO * _tco, TrackView * _tv ); - virtual ~SampleTCOView(); - + virtual ~SampleTCOView() = default; public slots: void updateSample(); diff --git a/include/TabBar.h b/include/TabBar.h index 56900fda4..4ef0b1ac7 100644 --- a/include/TabBar.h +++ b/include/TabBar.h @@ -42,7 +42,7 @@ class EXPORT TabBar : public QWidget public: TabBar( QWidget * _parent, QBoxLayout::Direction _dir = QBoxLayout::LeftToRight ); - virtual ~TabBar(); + virtual ~TabBar() = default; TabButton * addTab( QWidget * _w, const QString & _text, int _id, bool _add_stretch = false, diff --git a/include/TabWidget.h b/include/TabWidget.h index 402d7c9cc..dacd2648b 100644 --- a/include/TabWidget.h +++ b/include/TabWidget.h @@ -37,7 +37,7 @@ class TabWidget : public QWidget Q_OBJECT public: TabWidget( const QString & _caption, QWidget * _parent, bool usePixmap = false ); - virtual ~TabWidget(); + virtual ~TabWidget() = default; void addTab( QWidget * w, const QString & name, const char *pixmap = NULL, int idx = -1 ); diff --git a/include/TimeDisplayWidget.h b/include/TimeDisplayWidget.h index 67ae4d6ca..175f159c9 100644 --- a/include/TimeDisplayWidget.h +++ b/include/TimeDisplayWidget.h @@ -37,7 +37,7 @@ class TimeDisplayWidget : public QWidget Q_OBJECT public: TimeDisplayWidget(); - virtual ~TimeDisplayWidget(); + virtual ~TimeDisplayWidget() = default; protected: diff --git a/include/ToolButton.h b/include/ToolButton.h index 62901f590..196ec48f0 100644 --- a/include/ToolButton.h +++ b/include/ToolButton.h @@ -42,7 +42,7 @@ public: QToolButton(_parent) { } - virtual ~ToolButton(); + virtual ~ToolButton() = default; } ; diff --git a/src/core/AutomationPattern.cpp b/src/core/AutomationPattern.cpp index 32b13f3f4..9345ad566 100644 --- a/src/core/AutomationPattern.cpp +++ b/src/core/AutomationPattern.cpp @@ -98,16 +98,6 @@ AutomationPattern::AutomationPattern( const AutomationPattern & _pat_to_copy ) : } } - - - -AutomationPattern::~AutomationPattern() -{ -} - - - - bool AutomationPattern::addObject( AutomatableModel * _obj, bool _search_dup ) { if( _search_dup && m_objects.contains(_obj) ) diff --git a/src/core/Instrument.cpp b/src/core/Instrument.cpp index 859882fd3..534bb783a 100644 --- a/src/core/Instrument.cpp +++ b/src/core/Instrument.cpp @@ -34,16 +34,6 @@ Instrument::Instrument( InstrumentTrack * _instrument_track, { } - - - -Instrument::~Instrument() -{ -} - - - - void Instrument::play( sampleFrame * ) { } diff --git a/src/core/Piano.cpp b/src/core/Piano.cpp index 7ea9cb2b0..565f1aa4f 100644 --- a/src/core/Piano.cpp +++ b/src/core/Piano.cpp @@ -70,19 +70,6 @@ Piano::Piano( InstrumentTrack* track ) : } - - - -/*! \brief Destroy this new keyboard display - * - */ -Piano::~Piano() -{ -} - - - - /*! \brief Turn a key on or off * * \param key the key number to change diff --git a/src/gui/AutomatableModelView.cpp b/src/gui/AutomatableModelView.cpp index 973e5c817..0597cf2f5 100644 --- a/src/gui/AutomatableModelView.cpp +++ b/src/gui/AutomatableModelView.cpp @@ -50,16 +50,6 @@ AutomatableModelView::AutomatableModelView( ::Model* model, QWidget* _this ) : widget()->setCursor( QCursor( embed::getIconPixmap( "hand" ), 3, 3 ) ); } - - - -AutomatableModelView::~AutomatableModelView() -{ -} - - - - void AutomatableModelView::addDefaultActions( QMenu* menu ) { AutomatableModel* model = modelUntyped(); diff --git a/src/gui/FileBrowser.cpp b/src/gui/FileBrowser.cpp index 4a0d22888..91804d136 100644 --- a/src/gui/FileBrowser.cpp +++ b/src/gui/FileBrowser.cpp @@ -112,16 +112,6 @@ FileBrowser::FileBrowser(const QString & directories, const QString & filter, show(); } - - - -FileBrowser::~FileBrowser() -{ -} - - - - bool FileBrowser::filterItems( const QString & filter, QTreeWidgetItem * item ) { // call with item=NULL to filter the entire tree @@ -338,16 +328,6 @@ FileBrowserTreeWidget::FileBrowserTreeWidget(QWidget * parent ) : } - - - -FileBrowserTreeWidget::~FileBrowserTreeWidget() -{ -} - - - - void FileBrowserTreeWidget::contextMenuEvent(QContextMenuEvent * e ) { FileItem * f = dynamic_cast( itemAt( e->pos() ) ); diff --git a/src/gui/PianoView.cpp b/src/gui/PianoView.cpp index 2a64e72dd..6e8464dd4 100644 --- a/src/gui/PianoView.cpp +++ b/src/gui/PianoView.cpp @@ -130,19 +130,6 @@ PianoView::PianoView( QWidget * _parent ) : } - - - -/*! \brief Destroy this piano display view - * - */ -PianoView::~PianoView() -{ -} - - - - /*! \brief Map a keyboard key being pressed to a note in our keyboard view * * \param _k The keyboard scan code of the key being pressed. diff --git a/src/gui/widgets/Fader.cpp b/src/gui/widgets/Fader.cpp index b634ba819..4317066ab 100644 --- a/src/gui/widgets/Fader.cpp +++ b/src/gui/widgets/Fader.cpp @@ -133,12 +133,6 @@ Fader::Fader( FloatModel * model, const QString & name, QWidget * parent, QPixma init(model, name); } - -Fader::~Fader() -{ -} - - void Fader::init(FloatModel * model, QString const & name) { setWindowTitle( name ); diff --git a/src/gui/widgets/Graph.cpp b/src/gui/widgets/Graph.cpp index 2cca2c424..ed57dcea6 100644 --- a/src/gui/widgets/Graph.cpp +++ b/src/gui/widgets/Graph.cpp @@ -56,13 +56,6 @@ Graph::Graph( QWidget * _parent, graphStyle _style, int _width, this, SLOT( updateGraph( ) ) ); } - -Graph::~Graph() -{ -} - - - void Graph::setForeground( const QPixmap &_pixmap ) { m_foreground = _pixmap; @@ -470,14 +463,6 @@ graphModel::graphModel( float _min, float _max, int _length, { } - - -graphModel::~graphModel() -{ -} - - - void graphModel::setRange( float _min, float _max ) { if( _min != m_minValue || _max != m_maxValue ) diff --git a/src/gui/widgets/LcdSpinBox.cpp b/src/gui/widgets/LcdSpinBox.cpp index 2dff70450..325c0171d 100644 --- a/src/gui/widgets/LcdSpinBox.cpp +++ b/src/gui/widgets/LcdSpinBox.cpp @@ -58,14 +58,6 @@ LcdSpinBox::LcdSpinBox( int numDigits, const QString& style, QWidget* parent, co { } - - -LcdSpinBox::~LcdSpinBox() -{ -} - - - void LcdSpinBox::update() { setValue( model()->value() + m_displayOffset ); diff --git a/src/gui/widgets/SideBar.cpp b/src/gui/widgets/SideBar.cpp index 2e6c2f048..01ea58919 100644 --- a/src/gui/widgets/SideBar.cpp +++ b/src/gui/widgets/SideBar.cpp @@ -41,9 +41,8 @@ public: m_orientation( _orientation ) { } - virtual ~SideBarButton() - { - } + + virtual ~SideBarButton() = default; Qt::Orientation orientation() const { diff --git a/src/gui/widgets/TabBar.cpp b/src/gui/widgets/TabBar.cpp index 115786be5..d40b41d98 100644 --- a/src/gui/widgets/TabBar.cpp +++ b/src/gui/widgets/TabBar.cpp @@ -41,16 +41,6 @@ TabBar::TabBar( QWidget * _parent, QBoxLayout::Direction _dir ) : setLayout( m_layout ); } - - - -TabBar::~TabBar() -{ -} - - - - TabButton * TabBar::addTab( QWidget * _w, const QString & _text, int _id, bool _add_stretch, bool _text_is_tooltip ) { diff --git a/src/gui/widgets/TabWidget.cpp b/src/gui/widgets/TabWidget.cpp index 6fde217c1..f06710098 100644 --- a/src/gui/widgets/TabWidget.cpp +++ b/src/gui/widgets/TabWidget.cpp @@ -61,12 +61,6 @@ TabWidget::TabWidget( const QString & caption, QWidget * parent, bool usePixmap } - -TabWidget::~TabWidget() -{ -} - - void TabWidget::addTab( QWidget * w, const QString & name, const char *pixmap, int idx ) { setFont( pointSize<8>( font() ) ); diff --git a/src/gui/widgets/TimeDisplayWidget.cpp b/src/gui/widgets/TimeDisplayWidget.cpp index 2805aa8f4..2ef764c34 100644 --- a/src/gui/widgets/TimeDisplayWidget.cpp +++ b/src/gui/widgets/TimeDisplayWidget.cpp @@ -58,17 +58,6 @@ TimeDisplayWidget::TimeDisplayWidget() : this, SLOT( updateTime() ) ); } - - - -TimeDisplayWidget::~TimeDisplayWidget() -{ -} - - - - - void TimeDisplayWidget::setDisplayMode( DisplayMode displayMode ) { m_displayMode = displayMode; diff --git a/src/gui/widgets/ToolButton.cpp b/src/gui/widgets/ToolButton.cpp index 2f89d8180..21363f66b 100644 --- a/src/gui/widgets/ToolButton.cpp +++ b/src/gui/widgets/ToolButton.cpp @@ -41,10 +41,3 @@ ToolButton::ToolButton( const QPixmap & _pixmap, const QString & _tooltip, ToolTip::add( this, _tooltip ); setIcon( _pixmap ); } - - - - -ToolButton::~ToolButton() -{ -} diff --git a/src/tracks/AutomationTrack.cpp b/src/tracks/AutomationTrack.cpp index 77693ace6..11c919f0e 100644 --- a/src/tracks/AutomationTrack.cpp +++ b/src/tracks/AutomationTrack.cpp @@ -40,16 +40,6 @@ AutomationTrack::AutomationTrack( TrackContainer* tc, bool _hidden ) : setName( tr( "Automation track" ) ); } - - - -AutomationTrack::~AutomationTrack() -{ -} - - - - bool AutomationTrack::play( const MidiTime & time_start, const fpp_t _frames, const f_cnt_t _frame_base, int _tco_num ) { @@ -108,16 +98,6 @@ AutomationTrackView::AutomationTrackView( AutomationTrack * _at, TrackContainerV setModel( _at ); } - - - -AutomationTrackView::~AutomationTrackView() -{ -} - - - - void AutomationTrackView::dragEnterEvent( QDragEnterEvent * _dee ) { StringPairDrag::processDragEnterEvent( _dee, "automatable_model" ); diff --git a/src/tracks/BBTrack.cpp b/src/tracks/BBTrack.cpp index 841050cc9..c37c1466f 100644 --- a/src/tracks/BBTrack.cpp +++ b/src/tracks/BBTrack.cpp @@ -61,16 +61,6 @@ BBTCO::BBTCO( Track * _track ) : setAutoResize( false ); } - - - -BBTCO::~BBTCO() -{ -} - - - - void BBTCO::saveSettings( QDomDocument & doc, QDomElement & element ) { element.setAttribute( "name", name() ); @@ -168,16 +158,6 @@ BBTCOView::BBTCOView( TrackContentObject * _tco, TrackView * _tv ) : setStyle( QApplication::style() ); } - - - -BBTCOView::~BBTCOView() -{ -} - - - - void BBTCOView::constructContextMenu( QMenu * _cm ) { QAction * a = new QAction( embed::getIconPixmap( "bb_track" ), diff --git a/src/tracks/Pattern.cpp b/src/tracks/Pattern.cpp index 560cd73f7..8218d16f6 100644 --- a/src/tracks/Pattern.cpp +++ b/src/tracks/Pattern.cpp @@ -616,19 +616,6 @@ PatternView::PatternView( Pattern* pattern, TrackView* parent ) : setStyle( QApplication::style() ); } - - - - - -PatternView::~PatternView() -{ -} - - - - - void PatternView::update() { ToolTip::add(this, m_pat->name()); diff --git a/src/tracks/SampleTrack.cpp b/src/tracks/SampleTrack.cpp index 28cda3ffd..7fda6512e 100644 --- a/src/tracks/SampleTrack.cpp +++ b/src/tracks/SampleTrack.cpp @@ -302,16 +302,6 @@ SampleTCOView::SampleTCOView( SampleTCO * _tco, TrackView * _tv ) : setStyle( QApplication::style() ); } - - - -SampleTCOView::~SampleTCOView() -{ -} - - - - void SampleTCOView::updateSample() { update(); From e8b69b97004ce2e6cf798c80e75a8a83bafd346a Mon Sep 17 00:00:00 2001 From: Premik Date: Thu, 10 May 2018 00:45:45 +0200 Subject: [PATCH 31/38] Zooming with mouse wheel center (#3835) * Horizontal mouse-wheel zooming. Ensure zoom center is always on the current mouse position. * Horizontal zoom using mouse wheel center on the mouse position. For the SongEditor too. * Wheel center on the Automation editor too. --- include/SongEditor.h | 1 + src/gui/editors/AutomationEditor.cpp | 11 +++++++++++ src/gui/editors/PianoRoll.cpp | 8 ++++++++ src/gui/editors/SongEditor.cpp | 14 ++++++++++++-- 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/include/SongEditor.h b/include/SongEditor.h index d6e904ace..e31d0f862 100644 --- a/include/SongEditor.h +++ b/include/SongEditor.h @@ -135,6 +135,7 @@ private: bool m_scrollBack; bool m_smoothScroll; + int m_widgetWidthTotal; EditMode m_mode; EditMode m_ctrlMode; // mode they were in before they hit ctrl diff --git a/src/gui/editors/AutomationEditor.cpp b/src/gui/editors/AutomationEditor.cpp index 2e0c68cd5..6743a7ca0 100644 --- a/src/gui/editors/AutomationEditor.cpp +++ b/src/gui/editors/AutomationEditor.cpp @@ -1680,6 +1680,17 @@ void AutomationEditor::wheelEvent(QWheelEvent * we ) x--; } x = qBound( 0, x, m_zoomingXModel.size() - 1 ); + + int mouseX = (we->x() - VALUES_WIDTH)* MidiTime::ticksPerTact(); + // ticks based on the mouse x-position where the scroll wheel was used + int ticks = mouseX / m_ppt; + // what would be the ticks in the new zoom level on the very same mouse x + int newTicks = mouseX / (DEFAULT_PPT * m_zoomXLevels[x]); + + // scroll so the tick "selected" by the mouse x doesn't move on the screen + m_leftRightScroll->setValue(m_leftRightScroll->value() + ticks - newTicks); + + m_zoomingXModel.setValue( x ); } else if( we->modifiers() & Qt::ShiftModifier diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index 17fc7bd2e..983d2eb7b 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -3296,6 +3296,14 @@ void PianoRoll::wheelEvent(QWheelEvent * we ) z--; } z = qBound( 0, z, m_zoomingModel.size() - 1 ); + + int x = (we->x() - WHITE_KEY_WIDTH)* MidiTime::ticksPerTact(); + // ticks based on the mouse x-position where the scroll wheel was used + int ticks = x / m_ppt; + // what would be the ticks in the new zoom level on the very same mouse x + int newTicks = x / (DEFAULT_PR_PPT * m_zoomLevels[z]); + // scroll so the tick "selected" by the mouse x doesn't move on the screen + m_leftRightScroll->setValue(m_leftRightScroll->value() + ticks - newTicks); // update combobox with zooming-factor m_zoomingModel.setValue( z ); } diff --git a/src/gui/editors/SongEditor.cpp b/src/gui/editors/SongEditor.cpp index 320003178..52e91a260 100644 --- a/src/gui/editors/SongEditor.cpp +++ b/src/gui/editors/SongEditor.cpp @@ -82,11 +82,11 @@ SongEditor::SongEditor( Song * song ) : { m_zoomingModel->setParent(this); // create time-line - int widgetTotal = ConfigManager::inst()->value( "ui", + m_widgetWidthTotal = ConfigManager::inst()->value( "ui", "compacttrackbuttons" ).toInt()==1 ? DEFAULT_SETTINGS_WIDGET_WIDTH_COMPACT + TRACK_OP_WIDTH_COMPACT : DEFAULT_SETTINGS_WIDGET_WIDTH + TRACK_OP_WIDTH; - m_timeLine = new TimeLineWidget( widgetTotal, 32, + m_timeLine = new TimeLineWidget( m_widgetWidthTotal, 32, pixelsPerTact(), m_song->m_playPos[Song::Mode_PlaySong], m_currentPosition, @@ -385,6 +385,16 @@ void SongEditor::wheelEvent( QWheelEvent * we ) z--; } z = qBound( 0, z, m_zoomingModel->size() - 1 ); + + + int x = (we->x() - m_widgetWidthTotal); + // tact based on the mouse x-position where the scroll wheel was used + int tact= x / pixelsPerTact(); + // what would be the tact in the new zoom level on the very same mouse x + int newTact = x / DEFAULT_PIXELS_PER_TACT / m_zoomLevels[z]; + // scroll so the tact "selected" by the mouse x doesn't move on the screen + m_leftRightScroll->setValue(m_leftRightScroll->value() + tact - newTact); + // update combobox with zooming-factor m_zoomingModel->setValue( z ); From d6d55cef7b3af692e72278f9e4a7d873d6c83506 Mon Sep 17 00:00:00 2001 From: Oskar Wallgren Date: Thu, 10 May 2018 12:05:44 +0200 Subject: [PATCH 32/38] Remove old commented out code (#4349) --- src/core/EnvelopeAndLfoParameters.cpp | 10 ---------- src/core/InstrumentFunctions.cpp | 10 ---------- 2 files changed, 20 deletions(-) diff --git a/src/core/EnvelopeAndLfoParameters.cpp b/src/core/EnvelopeAndLfoParameters.cpp index ef23654d3..cfa0e8dbb 100644 --- a/src/core/EnvelopeAndLfoParameters.cpp +++ b/src/core/EnvelopeAndLfoParameters.cpp @@ -380,22 +380,12 @@ void EnvelopeAndLfoParameters::loadSettings( const QDomElement & _this ) /* ### TODO: Old reversed sustain kept for backward compatibility with 4.15 file format*/ - if( _this.hasAttribute( "sus" ) ) { m_sustainModel.loadSettings( _this, "sus" ); m_sustainModel.setValue( 1.0 - m_sustainModel.value() ); } - // ### TODO: -/* // Keep compatibility with version 2.1 file format - if( _this.hasAttribute( "lfosyncmode" ) ) - { - m_lfoSpeedKnob->setSyncMode( - ( TempoSyncKnob::TtempoSyncMode ) _this.attribute( - "lfosyncmode" ).toInt() ); - }*/ - m_userWave.setAudioFile( _this.attribute( "userwavefile" ) ); updateSampleVars(); diff --git a/src/core/InstrumentFunctions.cpp b/src/core/InstrumentFunctions.cpp index 4bcbbb9f4..5a87b54dd 100644 --- a/src/core/InstrumentFunctions.cpp +++ b/src/core/InstrumentFunctions.cpp @@ -547,7 +547,6 @@ void InstrumentFunctionArpeggio::saveSettings( QDomDocument & _doc, QDomElement m_arpTimeModel.saveSettings( _doc, _this, "arptime" ); m_arpGateModel.saveSettings( _doc, _this, "arpgate" ); m_arpDirectionModel.saveSettings( _doc, _this, "arpdir" ); - m_arpModeModel.saveSettings( _doc, _this, "arpmode" ); } @@ -565,14 +564,5 @@ void InstrumentFunctionArpeggio::loadSettings( const QDomElement & _this ) m_arpTimeModel.loadSettings( _this, "arptime" ); m_arpGateModel.loadSettings( _this, "arpgate" ); m_arpDirectionModel.loadSettings( _this, "arpdir" ); -/* - // Keep compatibility with version 0.2.1 file format - if( _this.hasAttribute( "arpsyncmode" ) ) - { - m_arpTimeKnob->setSyncMode( - ( tempoSyncKnob::tempoSyncMode ) _this.attribute( - "arpsyncmode" ).toInt() ); - }*/ - m_arpModeModel.loadSettings( _this, "arpmode" ); } From 0d73f32c0394d9fe11786a4666ecc7472823852f Mon Sep 17 00:00:00 2001 From: Hussam Eddin Alhomsi Date: Fri, 11 May 2018 12:23:31 +0300 Subject: [PATCH 33/38] Reorder the main windows' buttons & shortcuts (#3938) Puts Project notes after Controller rack. --- src/gui/MainWindow.cpp | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 10f2442ec..384d88f09 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -561,33 +561,33 @@ void MainWindow::finalize() "for managing effects for your song. You can insert " "effects into different effect-channels." ) ); + ToolButton * controllers_window = new ToolButton( + embed::getIconPixmap( "controller" ), + tr( "Show/hide controller rack" ) + + " (F10)", + this, SLOT( toggleControllerRack() ), + m_toolBar ); + controllers_window->setShortcut( Qt::Key_F10 ); + ToolButton * project_notes_window = new ToolButton( embed::getIconPixmap( "project_notes" ), tr( "Show/hide project notes" ) + - " (F10)", + " (F11)", this, SLOT( toggleProjectNotesWin() ), m_toolBar ); - project_notes_window->setShortcut( Qt::Key_F10 ); + project_notes_window->setShortcut( Qt::Key_F11 ); project_notes_window->setWhatsThis( tr( "Click here to show or hide the " "project notes window. In this window you can put " "down your project notes.") ); - ToolButton * controllers_window = new ToolButton( - embed::getIconPixmap( "controller" ), - tr( "Show/hide controller rack" ) + - " (F11)", - this, SLOT( toggleControllerRack() ), - m_toolBar ); - controllers_window->setShortcut( Qt::Key_F11 ); - m_toolBarLayout->addWidget( song_editor_window, 1, 1 ); m_toolBarLayout->addWidget( bb_editor_window, 1, 2 ); m_toolBarLayout->addWidget( piano_roll_window, 1, 3 ); m_toolBarLayout->addWidget( automation_editor_window, 1, 4 ); m_toolBarLayout->addWidget( fx_mixer_window, 1, 5 ); - m_toolBarLayout->addWidget( project_notes_window, 1, 6 ); - m_toolBarLayout->addWidget( controllers_window, 1, 7 ); + m_toolBarLayout->addWidget( controllers_window, 1, 6 ); + m_toolBarLayout->addWidget( project_notes_window, 1, 7 ); m_toolBarLayout->setColumnStretch( 100, 1 ); // setup-dialog opened before? @@ -1227,15 +1227,14 @@ void MainWindow::updateViewMenu() tr( "FX Mixer" ) + " (F9)", this, SLOT( toggleFxMixerWin() ) ); - m_viewMenu->addAction(embed::getIconPixmap( "project_notes" ), - tr( "Project Notes" ) + " (F10)", - this, SLOT( toggleProjectNotesWin() ) - ); m_viewMenu->addAction(embed::getIconPixmap( "controller" ), - tr( "Controller Rack" ) + - " (F11)", + tr( "Controller Rack" ) + " (F10)", this, SLOT( toggleControllerRack() ) ); + m_viewMenu->addAction(embed::getIconPixmap( "project_notes" ), + tr( "Project Notes" ) + " (F11)", + this, SLOT( toggleProjectNotesWin() ) + ); m_viewMenu->addSeparator(); From 4585a07673bdd532cc42d8a2368f339018545fd4 Mon Sep 17 00:00:00 2001 From: SecondFlight Date: Sun, 13 May 2018 17:15:32 -0400 Subject: [PATCH 34/38] Allow renaming of FX mixer channels with the F2 and enter keys. (#4348) * Add f2 as a FX mixer rename shortcut. Enter doesn't work yet. * Add both enter keys, remove code duplication * Fix renaming with enter/return * Clean up --- include/FxLine.h | 5 ++++- include/FxMixerView.h | 2 ++ src/gui/FxMixerView.cpp | 11 +++++++++++ src/gui/widgets/FxLine.cpp | 19 +++++++++++++++++++ 4 files changed, 36 insertions(+), 1 deletion(-) diff --git a/include/FxLine.h b/include/FxLine.h index 46490044f..5bb04da2f 100644 --- a/include/FxLine.h +++ b/include/FxLine.h @@ -79,6 +79,10 @@ public: static const int FxLineHeight; + void renameChannel(); + + bool eventFilter (QObject *dist, QEvent *event); + private: void drawFxLine( QPainter* p, const FxLine *fxLine, bool isActive, bool sendToThis, bool receiveFromThis ); QString elideName( const QString & name ); @@ -98,7 +102,6 @@ private: QGraphicsView * m_view; private slots: - void renameChannel(); void renameFinished(); void removeChannel(); void removeUnusedChannels(); diff --git a/include/FxMixerView.h b/include/FxMixerView.h index 973195bb3..30c759838 100644 --- a/include/FxMixerView.h +++ b/include/FxMixerView.h @@ -100,6 +100,8 @@ public: void moveChannelLeft(int index, int focusIndex); void moveChannelRight(int index); + void renameChannel(int index); + // make sure the display syncs up with the fx mixer. // useful for loading projects void refreshDisplay(); diff --git a/src/gui/FxMixerView.cpp b/src/gui/FxMixerView.cpp index 8da1cb4e0..cbcfd0a47 100644 --- a/src/gui/FxMixerView.cpp +++ b/src/gui/FxMixerView.cpp @@ -491,6 +491,12 @@ void FxMixerView::moveChannelRight(int index) } +void FxMixerView::renameChannel(int index) +{ + m_fxChannelViews[index]->m_fxLine->renameChannel(); +} + + void FxMixerView::keyPressEvent(QKeyEvent * e) { @@ -527,6 +533,11 @@ void FxMixerView::keyPressEvent(QKeyEvent * e) addNewChannel(); } break; + case Qt::Key_Enter: + case Qt::Key_Return: + case Qt::Key_F2: + renameChannel( m_currentFxLine->channelIndex() ); + break; } } diff --git a/src/gui/widgets/FxLine.cpp b/src/gui/widgets/FxLine.cpp index c6e6fd9ae..309ef6a1c 100644 --- a/src/gui/widgets/FxLine.cpp +++ b/src/gui/widgets/FxLine.cpp @@ -34,6 +34,24 @@ #include "GuiApplication.h" #include "Song.h" +bool FxLine::eventFilter( QObject *dist, QEvent *event ) +{ + // If we are in a rename, capture the enter/return events and handle them + if ( event->type() == QEvent::KeyPress ) + { + QKeyEvent * keyEvent = static_cast(event); + if( keyEvent->key() == Qt::Key_Enter || keyEvent->key() == Qt::Key_Return ) + { + if( m_inRename ) + { + renameFinished(); + event->accept(); // Stop the event from propagating + return true; + } + } + } + return false; +} const int FxLine::FxLineHeight = 287; QPixmap * FxLine::s_sendBgArrow = NULL; @@ -100,6 +118,7 @@ FxLine::FxLine( QWidget * _parent, FxMixerView * _mv, int _channelIndex ) : m_renameLineEdit->setFixedWidth( 65 ); m_renameLineEdit->setFont( pointSizeF( font(), 7.5f ) ); m_renameLineEdit->setReadOnly( true ); + m_renameLineEdit->installEventFilter( this ); QGraphicsScene * scene = new QGraphicsScene(); scene->setSceneRect( 0, 0, 33, FxLineHeight ); From ea98ba4daefd4055ca98f05d31dbdd3522792a01 Mon Sep 17 00:00:00 2001 From: Matt Kline Date: Fri, 11 May 2018 23:16:19 -0700 Subject: [PATCH 35/38] FPTruncateMode: Removed unused variables on non-386 While we're at it, make fistp an inline function. Type safety is nice. --- plugins/LadspaEffect/caps/dsp/FPTruncateMode.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/plugins/LadspaEffect/caps/dsp/FPTruncateMode.h b/plugins/LadspaEffect/caps/dsp/FPTruncateMode.h index 354d062be..4fd1536ff 100644 --- a/plugins/LadspaEffect/caps/dsp/FPTruncateMode.h +++ b/plugins/LadspaEffect/caps/dsp/FPTruncateMode.h @@ -24,11 +24,9 @@ #define fistp(f,i) \ __asm__ ("fistpl %0" : "=m" (i) : "t" (f) : "st") #else /* ! __i386__ */ - #define fstcw(i) - #define fldcw(i) + #include - #define fistp(f,i) \ - i = (int) f + inline void fistp(float f, int32_t& i) { i = static_cast(f); } #endif namespace DSP { @@ -36,12 +34,13 @@ namespace DSP { class FPTruncateMode { public: - int cw0, cw1; /* fp control word */ +#ifdef __i386__ + int cw0; /* fp control word */ FPTruncateMode() { fstcw (cw0); - cw1 = cw0 | 0xC00; + const int cw1 = cw0 | 0xC00; fldcw (cw1); } @@ -49,6 +48,11 @@ class FPTruncateMode { fldcw (cw0); } +#else + // Avoid warnings about unused variables + FPTruncateMode() { (void)0; } + ~FPTruncateMode() { (void)0; } +#endif }; } /* namespace DSP */ From 9c0d50d42517c54eeb5ecde0f6b27db42091c3ac Mon Sep 17 00:00:00 2001 From: Matt Kline Date: Sat, 12 May 2018 00:09:29 -0700 Subject: [PATCH 36/38] plugins/LadspaEffect: Use C++11 The rest of LMMS is built against it, and almost every flavor of MinGW should support it these days. --- plugins/LadspaEffect/CMakeLists.txt | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/plugins/LadspaEffect/CMakeLists.txt b/plugins/LadspaEffect/CMakeLists.txt index 90eb27dff..5bfbc3284 100644 --- a/plugins/LadspaEffect/CMakeLists.txt +++ b/plugins/LadspaEffect/CMakeLists.txt @@ -4,13 +4,7 @@ BUILD_PLUGIN(ladspaeffect LadspaEffect.cpp LadspaControls.cpp LadspaControlDialo SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/ladspa") -# Enable C++11 for all except mingw builds -# TODO: Validate against modern mingw compiler -IF(NOT MINGW_PREFIX) - SET(CMAKE_CXX_STANDARD 11) -ELSE() - SET(CMAKE_CXX_STANDARD 98) -ENDIF() +SET(CMAKE_CXX_STANDARD 11) IF(WANT_CAPS) ADD_SUBDIRECTORY(caps) From 074d82f2aaa50992c776ab7b30c3c8434616365a Mon Sep 17 00:00:00 2001 From: Johannes Lorenz Date: Sat, 19 May 2018 08:52:54 +0200 Subject: [PATCH 37/38] CALF: Version bump, fix issues from #3987 --- plugins/LadspaEffect/calf/veal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/LadspaEffect/calf/veal b/plugins/LadspaEffect/calf/veal index 2841b05a3..fe628885b 160000 --- a/plugins/LadspaEffect/calf/veal +++ b/plugins/LadspaEffect/calf/veal @@ -1 +1 @@ -Subproject commit 2841b05a36e53116508a8a862f052e14dad00d67 +Subproject commit fe628885b761372b37136a3f2b7c3d56e179e3ba From 0fa7fbde0f86c7d68e2633008a8456497e3024b3 Mon Sep 17 00:00:00 2001 From: Hyunjin Song Date: Tue, 22 May 2018 16:34:14 +0900 Subject: [PATCH 38/38] Fix MSYS2 build --- cmake/build_win32.sh | 2 +- cmake/toolchains/MSYS-32.cmake | 6 ++++-- cmake/toolchains/MSYS-64.cmake | 5 ++--- cmake/toolchains/common/MSYS.cmake | 5 ++++- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/cmake/build_win32.sh b/cmake/build_win32.sh index e647f7c09..6fbf5287b 100755 --- a/cmake/build_win32.sh +++ b/cmake/build_win32.sh @@ -25,7 +25,7 @@ if [ -z "$MSYSCON" ]; then TOOLCHAIN="$DIR/toolchains/Ubuntu-MinGW-W64-$ARCH.cmake" fi else - CMAKE_OPTS="$CMAKE_OPTS -DLMMS_BUILD_MSYS=1" + TOOLCHAIN="$DIR/toolchains/MSYS-$ARCH.cmake" fi export PATH=$MINGW/bin:$PATH diff --git a/cmake/toolchains/MSYS-32.cmake b/cmake/toolchains/MSYS-32.cmake index d016e3ffd..698dd5437 100644 --- a/cmake/toolchains/MSYS-32.cmake +++ b/cmake/toolchains/MSYS-32.cmake @@ -1,2 +1,4 @@ -INCLUDE(common/Win32) -SET(LMMS_BUILD_MSYS 1) +INCLUDE(${CMAKE_CURRENT_LIST_DIR}/common/MSYS.cmake) +INCLUDE(${CMAKE_CURRENT_LIST_DIR}/common/Win32.cmake) + +SET(MINGW_PREFIX /mingw32) \ No newline at end of file diff --git a/cmake/toolchains/MSYS-64.cmake b/cmake/toolchains/MSYS-64.cmake index bce085b2d..8becd51b3 100644 --- a/cmake/toolchains/MSYS-64.cmake +++ b/cmake/toolchains/MSYS-64.cmake @@ -1,6 +1,5 @@ -INCLUDE(MSYS-32) -INCLUDE(Win64) -SET(LMMS_BUILD_MSYS 1) +INCLUDE(${CMAKE_CURRENT_LIST_DIR}/common/MSYS.cmake) +INCLUDE(${CMAKE_CURRENT_LIST_DIR}/common/Win64.cmake) SET(MINGW_PREFIX /mingw64) SET(MINGW_PREFIX32 /mingw32) diff --git a/cmake/toolchains/common/MSYS.cmake b/cmake/toolchains/common/MSYS.cmake index d31f60e6d..dc295d670 100644 --- a/cmake/toolchains/common/MSYS.cmake +++ b/cmake/toolchains/common/MSYS.cmake @@ -2,6 +2,7 @@ SET(CMAKE_FIND_ROOT_PATH ${MINGW_PREFIX}) SET(CMAKE_INSTALL_PREFIX ${MINGW_PREFIX}) + # Windows msys mingw ships with a mostly-suitable preconfigured environment SET(STRIP ${MINGW_PREFIX}/bin/strip) SET(CMAKE_RC_COMPILER ${MINGW_PREFIX}/bin/windres) @@ -31,4 +32,6 @@ SET(QT_OVERRIDE_LIBRARIES IF(LMMS_BUILD_MSYS AND CMAKE_BUILD_TYPE STREQUAL "Debug") # Override Qt debug libraries with release versions SET(QT_LIBRARIES "${QT_OVERRIDE_LIBRARIES}") -ENDIF() \ No newline at end of file +ENDIF() + +SET(LMMS_BUILD_MSYS 1) \ No newline at end of file