From ee7e35b3eba6e0218cbfa375409dfdeb1279f70c Mon Sep 17 00:00:00 2001 From: "v.audacity" Date: Sat, 6 Nov 2010 00:00:23 +0000 Subject: [PATCH] (Fix Bug 250 - Pan sliders sometimes not drawn in Mixer Board, P2) This bug was introduced in commit 10680 and caused in MixerTrackCluster::UpdatePan(), by using USE_MIDI (which is on in releases) instead of EXPERIMENTAL_MIDI_OUT (which is off). It checked whether a NoteTrack pointer was NULL, and if not, hid the Pan slider (not used in NoteTrack clusters). But an invalid pointer is non-null, so was causing the Pan slider to always be hidden. --- src/MixerBoard.cpp | 14 ++++++++------ src/MixerBoard.h | 6 +++--- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/MixerBoard.cpp b/src/MixerBoard.cpp index e9f293699..31faf5a23 100644 --- a/src/MixerBoard.cpp +++ b/src/MixerBoard.cpp @@ -22,8 +22,8 @@ #include "AColor.h" #include "MixerBoard.h" #include "Project.h" -#ifdef USE_MIDI -#include "NoteTrack.h" +#ifdef EXPERIMENTAL_MIDI_OUT + #include "NoteTrack.h" #endif #include "../images/MusicalInstruments.h" @@ -124,6 +124,7 @@ MixerTrackCluster::MixerTrackCluster(wxWindow* parent, mNoteTrack = (NoteTrack*) pLeftTrack; mTrack = pLeftTrack; } else { + wxASSERT(pLeftTrack->GetKind() == Track::Wave); mTrack = mLeftTrack = pLeftTrack; mNoteTrack = NULL; } @@ -162,7 +163,7 @@ MixerTrackCluster::MixerTrackCluster(wxWindow* parent, mSlider_Gain = new MixerTrackSlider( this, ID_SLIDER_GAIN, - /* i18n-hint: Title of the Gain slider, used to adjust the volume */ + /* i18n-hint: title of the MIDI Velocity slider */ _("Velocity"), ctrlPos, ctrlSize, VEL_SLIDER, true, true, 0.0, wxVERTICAL); @@ -171,7 +172,7 @@ MixerTrackCluster::MixerTrackCluster(wxWindow* parent, mSlider_Gain = new MixerTrackSlider( this, ID_SLIDER_GAIN, - /* i18n-hint: Title of the Gain slider, used to adjust the volume */ + /* i18n-hint: title of the Gain slider, used to adjust the volume */ _("Gain"), ctrlPos, ctrlSize, DB_SLIDER, true, true, 0.0, wxVERTICAL); @@ -382,7 +383,7 @@ void MixerTrackCluster::UpdateSolo() void MixerTrackCluster::UpdatePan() { -#ifdef USE_MIDI +#ifdef EXPERIMENTAL_MIDI_OUT if (mNoteTrack) { mSlider_Pan->Hide(); return; @@ -793,7 +794,8 @@ MixerBoard::~MixerBoard() } // Reassign mixer input strips (MixerTrackClusters) to Track Clusters -// both have the same order. If USE_MIDI, then Note Tracks appear in the +// both have the same order. +// If EXPERIMENTAL_MIDI_OUT, then Note Tracks appear in the // mixer, and we must be able to convert and reuse a MixerTrackCluster // from audio to midi or midi to audio. This task is handled by // UpdateForStateChange(). diff --git a/src/MixerBoard.h b/src/MixerBoard.h index 3e3307696..ce7dc6cae 100644 --- a/src/MixerBoard.h +++ b/src/MixerBoard.h @@ -61,8 +61,8 @@ class AudacityProject; class MixerBoard; class Track; class WaveTrack; -#ifdef USE_MIDI -class NoteTrack; +#ifdef EXPERIMENTAL_MIDI_OUT + class NoteTrack; #endif class MixerTrackCluster : public wxPanel @@ -114,7 +114,7 @@ public: Track* mTrack; // either mLeftTrack or mNoteTrack, whichever is not NULL WaveTrack* mLeftTrack; // NULL if Note Track WaveTrack* mRightTrack; // NULL if mono -#ifdef USE_MIDI +#ifdef EXPERIMENTAL_MIDI_OUT NoteTrack* mNoteTrack; // NULL if Wave Track #endif