mirror of
https://github.com/cookiengineer/audacity
synced 2025-12-14 16:46:28 +01: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:
@@ -22,8 +22,8 @@
|
|||||||
#include "AColor.h"
|
#include "AColor.h"
|
||||||
#include "MixerBoard.h"
|
#include "MixerBoard.h"
|
||||||
#include "Project.h"
|
#include "Project.h"
|
||||||
#ifdef USE_MIDI
|
#ifdef EXPERIMENTAL_MIDI_OUT
|
||||||
#include "NoteTrack.h"
|
#include "NoteTrack.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "../images/MusicalInstruments.h"
|
#include "../images/MusicalInstruments.h"
|
||||||
@@ -124,6 +124,7 @@ MixerTrackCluster::MixerTrackCluster(wxWindow* parent,
|
|||||||
mNoteTrack = (NoteTrack*) pLeftTrack;
|
mNoteTrack = (NoteTrack*) pLeftTrack;
|
||||||
mTrack = pLeftTrack;
|
mTrack = pLeftTrack;
|
||||||
} else {
|
} else {
|
||||||
|
wxASSERT(pLeftTrack->GetKind() == Track::Wave);
|
||||||
mTrack = mLeftTrack = pLeftTrack;
|
mTrack = mLeftTrack = pLeftTrack;
|
||||||
mNoteTrack = NULL;
|
mNoteTrack = NULL;
|
||||||
}
|
}
|
||||||
@@ -162,7 +163,7 @@ MixerTrackCluster::MixerTrackCluster(wxWindow* parent,
|
|||||||
mSlider_Gain =
|
mSlider_Gain =
|
||||||
new MixerTrackSlider(
|
new MixerTrackSlider(
|
||||||
this, ID_SLIDER_GAIN,
|
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"),
|
_("Velocity"),
|
||||||
ctrlPos, ctrlSize, VEL_SLIDER, true,
|
ctrlPos, ctrlSize, VEL_SLIDER, true,
|
||||||
true, 0.0, wxVERTICAL);
|
true, 0.0, wxVERTICAL);
|
||||||
@@ -171,7 +172,7 @@ MixerTrackCluster::MixerTrackCluster(wxWindow* parent,
|
|||||||
mSlider_Gain =
|
mSlider_Gain =
|
||||||
new MixerTrackSlider(
|
new MixerTrackSlider(
|
||||||
this, ID_SLIDER_GAIN,
|
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"),
|
_("Gain"),
|
||||||
ctrlPos, ctrlSize, DB_SLIDER, true,
|
ctrlPos, ctrlSize, DB_SLIDER, true,
|
||||||
true, 0.0, wxVERTICAL);
|
true, 0.0, wxVERTICAL);
|
||||||
@@ -382,7 +383,7 @@ void MixerTrackCluster::UpdateSolo()
|
|||||||
|
|
||||||
void MixerTrackCluster::UpdatePan()
|
void MixerTrackCluster::UpdatePan()
|
||||||
{
|
{
|
||||||
#ifdef USE_MIDI
|
#ifdef EXPERIMENTAL_MIDI_OUT
|
||||||
if (mNoteTrack) {
|
if (mNoteTrack) {
|
||||||
mSlider_Pan->Hide();
|
mSlider_Pan->Hide();
|
||||||
return;
|
return;
|
||||||
@@ -793,7 +794,8 @@ MixerBoard::~MixerBoard()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Reassign mixer input strips (MixerTrackClusters) to Track Clusters
|
// 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
|
// 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
|
// from audio to midi or midi to audio. This task is handled by
|
||||||
// UpdateForStateChange().
|
// UpdateForStateChange().
|
||||||
|
|||||||
@@ -61,8 +61,8 @@ class AudacityProject;
|
|||||||
class MixerBoard;
|
class MixerBoard;
|
||||||
class Track;
|
class Track;
|
||||||
class WaveTrack;
|
class WaveTrack;
|
||||||
#ifdef USE_MIDI
|
#ifdef EXPERIMENTAL_MIDI_OUT
|
||||||
class NoteTrack;
|
class NoteTrack;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class MixerTrackCluster : public wxPanel
|
class MixerTrackCluster : public wxPanel
|
||||||
@@ -114,7 +114,7 @@ public:
|
|||||||
Track* mTrack; // either mLeftTrack or mNoteTrack, whichever is not NULL
|
Track* mTrack; // either mLeftTrack or mNoteTrack, whichever is not NULL
|
||||||
WaveTrack* mLeftTrack; // NULL if Note Track
|
WaveTrack* mLeftTrack; // NULL if Note Track
|
||||||
WaveTrack* mRightTrack; // NULL if mono
|
WaveTrack* mRightTrack; // NULL if mono
|
||||||
#ifdef USE_MIDI
|
#ifdef EXPERIMENTAL_MIDI_OUT
|
||||||
NoteTrack* mNoteTrack; // NULL if Wave Track
|
NoteTrack* mNoteTrack; // NULL if Wave Track
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user