1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-01 00:19:27 +02:00

(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.
This commit is contained in:
v.audacity 2010-11-06 00:00:23 +00:00
parent 7b99a6d7d7
commit ee7e35b3eb
2 changed files with 11 additions and 9 deletions

View File

@ -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().

View File

@ -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