From 3aff3306712f90c13a5494e1a9fcd68f5661f559 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Sun, 23 Apr 2017 07:58:11 -0400 Subject: [PATCH] Fix compilation of EXPERIMENTAL_OUTPUT_DISPLAY; fix a warning in it --- src/Track.h | 6 +++++- src/WaveTrack.cpp | 10 +++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/Track.h b/src/Track.h index 1122e52e8..c791511ae 100644 --- a/src/Track.h +++ b/src/Track.h @@ -199,7 +199,11 @@ class AUDACITY_DLL_API Track /* not final */ : public XMLTagHandler virtual void SetOffset (double o) { mOffset = o; } void SetChannel(int c) { mChannel = c; } - virtual void SetPan( float ){ ;}; +#ifdef EXPERIMENTAL_OUTPUT_DISPLAY + virtual bool SetPan( float ){ return false; } +#else + virtual void SetPan( float ){ ;} +#endif virtual void SetPanFromChannelType(){ ;}; // AS: Note that the dirManager is mutable. This is diff --git a/src/WaveTrack.cpp b/src/WaveTrack.cpp index 7b6a15349..8db8f7a37 100644 --- a/src/WaveTrack.cpp +++ b/src/WaveTrack.cpp @@ -428,12 +428,16 @@ bool WaveTrack::SetPan(float newPan) else mPan = newPan; - if(mDisplay == WaveTrack::Waveform && mChannel == Track::MonoChannel && (p == 0.0f && newPan != 0.0f || p != 0.0f && newPan == 0.0f) && mMonoAsVirtualStereo) + if(mDisplay == WaveTrack::Waveform && + mChannel == Track::MonoChannel && + ((p == 0.0f) != (newPan == 0.0f)) && + mMonoAsVirtualStereo) { panZero=true; - if(!mPan){ + if(!mPan) { mHeight = mHeight + mHeightv; - }else{ + } + else { temp = mHeight; mHeight = temp*mPerY; mHeightv = temp - mHeight;