mirror of
https://github.com/cookiengineer/audacity
synced 2025-09-18 09:00:52 +02:00
TrackPanel still draws Mute and Solo, but no longer handles clicks on them...
... also implemented ESC key for those drags
This commit is contained in:
parent
c6e7e5d99b
commit
5ee73f944d
@ -1205,16 +1205,12 @@
|
||||
28FE4A080ABF4E960056F5C4 /* mmx_optimized.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28FE4A060ABF4E960056F5C4 /* mmx_optimized.cpp */; };
|
||||
28FE4A090ABF4E960056F5C4 /* sse_optimized.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28FE4A070ABF4E960056F5C4 /* sse_optimized.cpp */; };
|
||||
5E000A211EC7B5D500E8FD93 /* SampleHandle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E000A1F1EC7B5D500E8FD93 /* SampleHandle.cpp */; };
|
||||
5E7396441DAFD8C600BA0A4D /* TimeShiftHandle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E7396421DAFD8C600BA0A4D /* TimeShiftHandle.cpp */; };
|
||||
5E7396471DAFD8F200BA0A4D /* EnvelopeHandle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E7396451DAFD8F200BA0A4D /* EnvelopeHandle.cpp */; };
|
||||
5E73964A1DAFD91D00BA0A4D /* CutlineHandle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E7396481DAFD91D00BA0A4D /* CutlineHandle.cpp */; };
|
||||
5E73964D1DAFD95B00BA0A4D /* ButtonHandle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E73964B1DAFD95B00BA0A4D /* ButtonHandle.cpp */; };
|
||||
5E7396501DAFD98400BA0A4D /* SliderHandle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E73964E1DAFD98400BA0A4D /* SliderHandle.cpp */; };
|
||||
5E02BFF21D1164DF00EB7578 /* Distortion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E02BFF01D1164DF00EB7578 /* Distortion.cpp */; };
|
||||
5E07842E1DEE6B8600CA76EA /* FileException.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E07842C1DEE6B8600CA76EA /* FileException.cpp */; };
|
||||
5E0784311DF1E4F400CA76EA /* UserException.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E07842F1DF1E4F400CA76EA /* UserException.cpp */; };
|
||||
5E0A0E311D23019A00CD2567 /* MenusMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E0A0E301D23019A00CD2567 /* MenusMac.cpp */; };
|
||||
5E2A19941EED688500217B58 /* SelectionState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E2A19921EED688500217B58 /* SelectionState.cpp */; };
|
||||
5E10D9061EC8F81300B3AC57 /* PlayableTrackButtonHandles.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E10D9041EC8F81300B3AC57 /* PlayableTrackButtonHandles.cpp */; };
|
||||
5E15123D1DB000C000702E29 /* UIHandle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E15123B1DB000C000702E29 /* UIHandle.cpp */; };
|
||||
5E15125A1DB000DC00702E29 /* LabelTrackControls.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E1512401DB000DC00702E29 /* LabelTrackControls.cpp */; };
|
||||
5E15125B1DB000DC00702E29 /* LabelTrackUI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E1512421DB000DC00702E29 /* LabelTrackUI.cpp */; };
|
||||
@ -1228,6 +1224,11 @@
|
||||
5E1512701DB0010C00702E29 /* TrackVRulerControls.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E15126B1DB0010C00702E29 /* TrackVRulerControls.cpp */; };
|
||||
5E73963B1DAFD82D00BA0A4D /* PopupMenuTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E7396391DAFD82D00BA0A4D /* PopupMenuTable.cpp */; };
|
||||
5E73963E1DAFD86000BA0A4D /* ZoomHandle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E73963C1DAFD86000BA0A4D /* ZoomHandle.cpp */; };
|
||||
5E7396441DAFD8C600BA0A4D /* TimeShiftHandle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E7396421DAFD8C600BA0A4D /* TimeShiftHandle.cpp */; };
|
||||
5E7396471DAFD8F200BA0A4D /* EnvelopeHandle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E7396451DAFD8F200BA0A4D /* EnvelopeHandle.cpp */; };
|
||||
5E73964A1DAFD91D00BA0A4D /* CutlineHandle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E7396481DAFD91D00BA0A4D /* CutlineHandle.cpp */; };
|
||||
5E73964D1DAFD95B00BA0A4D /* ButtonHandle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E73964B1DAFD95B00BA0A4D /* ButtonHandle.cpp */; };
|
||||
5E7396501DAFD98400BA0A4D /* SliderHandle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E73964E1DAFD98400BA0A4D /* SliderHandle.cpp */; };
|
||||
5E74D2E31CC4429700D88B0B /* EditCursorOverlay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E74D2DD1CC4429700D88B0B /* EditCursorOverlay.cpp */; };
|
||||
5E74D2E41CC4429700D88B0B /* PlayIndicatorOverlay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E74D2DF1CC4429700D88B0B /* PlayIndicatorOverlay.cpp */; };
|
||||
5E74D2E51CC4429700D88B0B /* Scrubbing.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E74D2E11CC4429700D88B0B /* Scrubbing.cpp */; };
|
||||
@ -3009,16 +3010,6 @@
|
||||
28FEC1B21A12B6FB00FACE48 /* EffectAutomationParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EffectAutomationParameters.h; path = ../include/audacity/EffectAutomationParameters.h; sourceTree = SOURCE_ROOT; };
|
||||
5E000A1F1EC7B5D500E8FD93 /* SampleHandle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SampleHandle.cpp; sourceTree = "<group>"; };
|
||||
5E000A201EC7B5D500E8FD93 /* SampleHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SampleHandle.h; sourceTree = "<group>"; };
|
||||
5E7396421DAFD8C600BA0A4D /* TimeShiftHandle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TimeShiftHandle.cpp; sourceTree = "<group>"; };
|
||||
5E7396431DAFD8C600BA0A4D /* TimeShiftHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TimeShiftHandle.h; sourceTree = "<group>"; };
|
||||
5E7396451DAFD8F200BA0A4D /* EnvelopeHandle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EnvelopeHandle.cpp; sourceTree = "<group>"; };
|
||||
5E7396461DAFD8F200BA0A4D /* EnvelopeHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EnvelopeHandle.h; sourceTree = "<group>"; };
|
||||
5E7396481DAFD91D00BA0A4D /* CutlineHandle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CutlineHandle.cpp; sourceTree = "<group>"; };
|
||||
5E7396491DAFD91D00BA0A4D /* CutlineHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CutlineHandle.h; sourceTree = "<group>"; };
|
||||
5E73964B1DAFD95B00BA0A4D /* ButtonHandle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ButtonHandle.cpp; sourceTree = "<group>"; };
|
||||
5E73964C1DAFD95B00BA0A4D /* ButtonHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ButtonHandle.h; sourceTree = "<group>"; };
|
||||
5E73964E1DAFD98400BA0A4D /* SliderHandle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SliderHandle.cpp; sourceTree = "<group>"; };
|
||||
5E73964F1DAFD98400BA0A4D /* SliderHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SliderHandle.h; sourceTree = "<group>"; };
|
||||
5E02BFF01D1164DF00EB7578 /* Distortion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Distortion.cpp; sourceTree = "<group>"; };
|
||||
5E02BFF11D1164DF00EB7578 /* Distortion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Distortion.h; sourceTree = "<group>"; };
|
||||
5E07842C1DEE6B8600CA76EA /* FileException.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileException.cpp; sourceTree = "<group>"; };
|
||||
@ -3028,6 +3019,8 @@
|
||||
5E0A0E301D23019A00CD2567 /* MenusMac.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = MenusMac.cpp; sourceTree = "<group>"; };
|
||||
5E2A19921EED688500217B58 /* SelectionState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SelectionState.cpp; sourceTree = "<group>"; };
|
||||
5E2A19931EED688500217B58 /* SelectionState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectionState.h; sourceTree = "<group>"; };
|
||||
5E10D9041EC8F81300B3AC57 /* PlayableTrackButtonHandles.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlayableTrackButtonHandles.cpp; sourceTree = "<group>"; };
|
||||
5E10D9051EC8F81300B3AC57 /* PlayableTrackButtonHandles.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlayableTrackButtonHandles.h; sourceTree = "<group>"; };
|
||||
5E1512381DB000C000702E29 /* HitTestResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HitTestResult.h; sourceTree = "<group>"; };
|
||||
5E1512391DB000C000702E29 /* RefreshCode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RefreshCode.h; sourceTree = "<group>"; };
|
||||
5E15123A1DB000C000702E29 /* TrackPanelMouseEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TrackPanelMouseEvent.h; sourceTree = "<group>"; };
|
||||
@ -3055,6 +3048,16 @@
|
||||
5E7396391DAFD82D00BA0A4D /* PopupMenuTable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PopupMenuTable.cpp; sourceTree = "<group>"; };
|
||||
5E73963C1DAFD86000BA0A4D /* ZoomHandle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ZoomHandle.cpp; sourceTree = "<group>"; };
|
||||
5E73963D1DAFD86000BA0A4D /* ZoomHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZoomHandle.h; sourceTree = "<group>"; };
|
||||
5E7396421DAFD8C600BA0A4D /* TimeShiftHandle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TimeShiftHandle.cpp; sourceTree = "<group>"; };
|
||||
5E7396431DAFD8C600BA0A4D /* TimeShiftHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TimeShiftHandle.h; sourceTree = "<group>"; };
|
||||
5E7396451DAFD8F200BA0A4D /* EnvelopeHandle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EnvelopeHandle.cpp; sourceTree = "<group>"; };
|
||||
5E7396461DAFD8F200BA0A4D /* EnvelopeHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EnvelopeHandle.h; sourceTree = "<group>"; };
|
||||
5E7396481DAFD91D00BA0A4D /* CutlineHandle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CutlineHandle.cpp; sourceTree = "<group>"; };
|
||||
5E7396491DAFD91D00BA0A4D /* CutlineHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CutlineHandle.h; sourceTree = "<group>"; };
|
||||
5E73964B1DAFD95B00BA0A4D /* ButtonHandle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ButtonHandle.cpp; sourceTree = "<group>"; };
|
||||
5E73964C1DAFD95B00BA0A4D /* ButtonHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ButtonHandle.h; sourceTree = "<group>"; };
|
||||
5E73964E1DAFD98400BA0A4D /* SliderHandle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SliderHandle.cpp; sourceTree = "<group>"; };
|
||||
5E73964F1DAFD98400BA0A4D /* SliderHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SliderHandle.h; sourceTree = "<group>"; };
|
||||
5E74D2D91CC4427B00D88B0B /* TrackPanelCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TrackPanelCell.h; sourceTree = "<group>"; };
|
||||
5E74D2DA1CC4427B00D88B0B /* TrackPanelCellIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TrackPanelCellIterator.h; sourceTree = "<group>"; };
|
||||
5E74D2DD1CC4429700D88B0B /* EditCursorOverlay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EditCursorOverlay.cpp; sourceTree = "<group>"; };
|
||||
@ -5689,6 +5692,15 @@
|
||||
path = expat/lib;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
5E10D9031EC8F81300B3AC57 /* ui */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
5E10D9041EC8F81300B3AC57 /* PlayableTrackButtonHandles.cpp */,
|
||||
5E10D9051EC8F81300B3AC57 /* PlayableTrackButtonHandles.h */,
|
||||
);
|
||||
path = ui;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
5E15123E1DB000DC00702E29 /* labeltrack */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@ -5773,6 +5785,7 @@
|
||||
5EA018191EC7B226001F2996 /* playabletrack */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
5E10D9031EC8F81300B3AC57 /* ui */,
|
||||
5EA0181A1EC7B226001F2996 /* notetrack */,
|
||||
5EA018211EC7B226001F2996 /* wavetrack */,
|
||||
);
|
||||
@ -7798,6 +7811,7 @@
|
||||
289E750A1006D0BD00CEF79B /* MixerBoard.cpp in Sources */,
|
||||
28BD8AB1101DF4C700686679 /* BatchEvalCommand.cpp in Sources */,
|
||||
28BD8AB2101DF4C700686679 /* CommandDirectory.cpp in Sources */,
|
||||
5E10D9061EC8F81300B3AC57 /* PlayableTrackButtonHandles.cpp in Sources */,
|
||||
28BD8AB3101DF4C700686679 /* ExecMenuCommand.cpp in Sources */,
|
||||
28BD8AB4101DF4C700686679 /* GetAllMenuCommands.cpp in Sources */,
|
||||
28948427101DF8FC005B0713 /* EffectsPrefs.cpp in Sources */,
|
||||
|
@ -559,6 +559,8 @@ audacity_SOURCES = \
|
||||
tracks/playabletrack/notetrack/ui/NoteTrackUI.cpp \
|
||||
tracks/playabletrack/notetrack/ui/NoteTrackVRulerControls.cpp \
|
||||
tracks/playabletrack/notetrack/ui/NoteTrackVRulerControls.h \
|
||||
tracks/playabletrack/ui/PlayableTrackButtonHandles.cpp \
|
||||
tracks/playabletrack/ui/PlayableTrackButtonHandles.h \
|
||||
tracks/playabletrack/wavetrack/ui/CutlineHandle.cpp \
|
||||
tracks/playabletrack/wavetrack/ui/CutlineHandle.h \
|
||||
tracks/playabletrack/wavetrack/ui/SampleHandle.cpp \
|
||||
|
@ -1133,8 +1133,6 @@ void TrackPanel::HandleInterruptedDrag()
|
||||
case IsResizing:
|
||||
case IsResizingBetweenLinkedTracks:
|
||||
case IsResizingBelowLinkedTracks:
|
||||
case IsMuting:
|
||||
case IsSoloing:
|
||||
case IsMinimizing:
|
||||
case IsPopping:
|
||||
sendEvent = false;
|
||||
@ -3543,42 +3541,6 @@ void TrackPanel::HandlePopping(wxMouseEvent & event)
|
||||
}
|
||||
}
|
||||
|
||||
/// Handle when the mute or solo button is pressed for some track.
|
||||
void TrackPanel::HandleMutingSoloing(wxMouseEvent & event, bool solo)
|
||||
{
|
||||
Track *t = mCapturedTrack;
|
||||
wxRect rect = mCapturedRect;
|
||||
|
||||
if( t==NULL ){
|
||||
wxASSERT(false);// Soloing or muting but no captured track!
|
||||
SetCapturedTrack( NULL );
|
||||
return;
|
||||
}
|
||||
|
||||
wxRect buttonRect;
|
||||
mTrackInfo.GetMuteSoloRect(rect, buttonRect, solo, HasSoloButton(), t);
|
||||
|
||||
wxClientDC dc(this);
|
||||
|
||||
if (event.Dragging()){
|
||||
mTrackInfo.DrawMuteSolo(&dc, rect, t, buttonRect.Contains(event.m_x, event.m_y),
|
||||
solo, HasSoloButton());
|
||||
}
|
||||
else if (event.LeftUp() )
|
||||
{
|
||||
if (buttonRect.Contains(event.m_x, event.m_y))
|
||||
{
|
||||
// For either, MakeParentPushState to make the track state dirty.
|
||||
if(solo)
|
||||
GetProject()->DoTrackSolo(t, event.ShiftDown());
|
||||
else
|
||||
GetProject()->DoTrackMute(t, event.ShiftDown());
|
||||
}
|
||||
SetCapturedTrack( NULL );
|
||||
Refresh(false);
|
||||
}
|
||||
}
|
||||
|
||||
void TrackPanel::HandleMinimizing(wxMouseEvent & event)
|
||||
{
|
||||
Track *t = mCapturedTrack;
|
||||
@ -3990,11 +3952,6 @@ void TrackPanel::HandleLabelClick(wxMouseEvent & event)
|
||||
|
||||
if (isleft && t->GetKind() == Track::Wave)
|
||||
{
|
||||
// DM: Check Mute and Solo buttons on WaveTracks:
|
||||
if (MuteSoloFunc(t, rect, event.m_x, event.m_y, false) ||
|
||||
MuteSoloFunc(t, rect, event.m_x, event.m_y, true))
|
||||
return;
|
||||
|
||||
if (GainFunc(t, rect, event, event.m_x, event.m_y))
|
||||
return;
|
||||
|
||||
@ -4006,10 +3963,6 @@ void TrackPanel::HandleLabelClick(wxMouseEvent & event)
|
||||
else if (t->GetKind() == Track::Note)
|
||||
{
|
||||
#ifdef EXPERIMENTAL_MIDI_OUT
|
||||
if (isleft && (MuteSoloFunc(t, rect, event.m_x, event.m_y, false) ||
|
||||
MuteSoloFunc(t, rect, event.m_x, event.m_y, true)))
|
||||
return;
|
||||
|
||||
if (isleft && VelocityFunc(t, rect, event, event.m_x, event.m_y))
|
||||
return;
|
||||
wxRect midiRect;
|
||||
@ -4176,28 +4129,6 @@ bool TrackPanel::VelocityFunc(Track * t, wxRect rect, wxMouseEvent &event,
|
||||
}
|
||||
#endif
|
||||
|
||||
/// Mute or solo the given track (t). If solo is true, we're
|
||||
/// soloing, otherwise we're muting. Basically, check and see
|
||||
/// whether x and y fall within the area of the appropriate button.
|
||||
bool TrackPanel::MuteSoloFunc(Track * t, wxRect rect, int x, int y,
|
||||
bool solo)
|
||||
{
|
||||
wxRect buttonRect;
|
||||
//rect.width +=4;
|
||||
mTrackInfo.GetMuteSoloRect(rect, buttonRect, solo, HasSoloButton(), t);
|
||||
if ( TrackInfo::HideTopItem( rect, buttonRect ) )
|
||||
return false;
|
||||
if (!buttonRect.Contains(x, y))
|
||||
return false;
|
||||
|
||||
wxClientDC dc(this);
|
||||
SetCapturedTrack( t, solo ? IsSoloing : IsMuting);
|
||||
mCapturedRect = rect;
|
||||
|
||||
mTrackInfo.DrawMuteSolo(&dc, rect, t, true, solo, HasSoloButton());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TrackPanel::MinimizeFunc(Track * t, wxRect rect, int x, int y)
|
||||
{
|
||||
wxRect buttonRect;
|
||||
@ -5118,12 +5049,6 @@ try
|
||||
case IsPopping:
|
||||
HandlePopping(event);
|
||||
break;
|
||||
case IsMuting:
|
||||
HandleMutingSoloing(event, false);
|
||||
break;
|
||||
case IsSoloing:
|
||||
HandleMutingSoloing(event, true);
|
||||
break;
|
||||
case IsResizing:
|
||||
case IsResizingBetweenLinkedTracks:
|
||||
case IsResizingBelowLinkedTracks:
|
||||
|
@ -209,7 +209,6 @@ public:
|
||||
static void GetMidiControlsRect(const wxRect & rect, wxRect &dest);
|
||||
#endif
|
||||
|
||||
public:
|
||||
static bool HideTopItem( const wxRect &rect, const wxRect &subRect,
|
||||
int allowance = 0 );
|
||||
|
||||
@ -494,7 +493,6 @@ protected:
|
||||
virtual void CalculateRearrangingThresholds(wxMouseEvent & event);
|
||||
virtual void HandleClosing(wxMouseEvent & event);
|
||||
virtual void HandlePopping(wxMouseEvent & event);
|
||||
virtual void HandleMutingSoloing(wxMouseEvent & event, bool solo);
|
||||
virtual void HandleMinimizing(wxMouseEvent & event);
|
||||
virtual void HandleSliders(wxMouseEvent &event, bool pan);
|
||||
#ifdef EXPERIMENTAL_MIDI_OUT
|
||||
@ -508,7 +506,6 @@ protected:
|
||||
virtual bool CloseFunc(Track * t, wxRect rect, int x, int y);
|
||||
virtual bool PopupFunc(Track * t, wxRect rect, int x, int y);
|
||||
|
||||
virtual bool MuteSoloFunc(Track *t, wxRect rect, int x, int f, bool solo);
|
||||
virtual bool MinimizeFunc(Track *t, wxRect rect, int x, int f);
|
||||
virtual bool GainFunc(Track * t, wxRect rect, wxMouseEvent &event,
|
||||
int x, int y);
|
||||
|
@ -13,7 +13,11 @@ Paul Licameli split from TrackPanel.cpp
|
||||
#ifdef USE_MIDI
|
||||
|
||||
#include "NoteTrackControls.h"
|
||||
#include "../../ui/PlayableTrackButtonHandles.h"
|
||||
|
||||
#include "../../../../HitTestResult.h"
|
||||
#include "../../../../Track.h"
|
||||
#include "../../../../TrackPanelMouseEvent.h"
|
||||
|
||||
NoteTrackControls::NoteTrackControls()
|
||||
{
|
||||
@ -30,10 +34,28 @@ NoteTrackControls::~NoteTrackControls()
|
||||
}
|
||||
|
||||
HitTestResult NoteTrackControls::HitTest
|
||||
(const TrackPanelMouseEvent & event,
|
||||
(const TrackPanelMouseEvent & evt,
|
||||
const AudacityProject *pProject)
|
||||
{
|
||||
return TrackControls::HitTest(event, pProject);
|
||||
const wxMouseEvent &event = evt.event;
|
||||
const wxRect &rect = evt.rect;
|
||||
if (event.Button(wxMOUSE_BTN_LEFT)) {
|
||||
if (mpTrack->GetKind() == Track::Note) {
|
||||
auto track = GetTrack();
|
||||
HitTestResult result;
|
||||
if (NULL !=
|
||||
(result = MuteButtonHandle::HitTest
|
||||
(event, rect, pProject, track)).handle)
|
||||
return result;
|
||||
|
||||
if (NULL !=
|
||||
(result = SoloButtonHandle::HitTest
|
||||
(event, rect, pProject, track)).handle)
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
return TrackControls::HitTest(evt, pProject);
|
||||
}
|
||||
|
||||
#endif
|
113
src/tracks/playabletrack/ui/PlayableTrackButtonHandles.cpp
Normal file
113
src/tracks/playabletrack/ui/PlayableTrackButtonHandles.cpp
Normal file
@ -0,0 +1,113 @@
|
||||
/**********************************************************************
|
||||
|
||||
Audacity: A Digital Audio Editor
|
||||
|
||||
PlayableTrackButtonHandles.cpp
|
||||
|
||||
Paul Licameli split from TrackPanel.cpp
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#include "PlayableTrackButtonHandles.h"
|
||||
|
||||
#include "../../../HitTestResult.h"
|
||||
#include "../../../Project.h"
|
||||
#include "../../../RefreshCode.h"
|
||||
#include "../../../Track.h"
|
||||
#include "../../../TrackPanel.h"
|
||||
#include "../../../TrackPanelMouseEvent.h"
|
||||
|
||||
MuteButtonHandle::MuteButtonHandle()
|
||||
: ButtonHandle{ TrackPanel::IsMuting }
|
||||
{
|
||||
}
|
||||
|
||||
MuteButtonHandle::~MuteButtonHandle()
|
||||
{
|
||||
}
|
||||
|
||||
MuteButtonHandle &MuteButtonHandle::Instance()
|
||||
{
|
||||
static MuteButtonHandle instance;
|
||||
return instance;
|
||||
}
|
||||
|
||||
UIHandle::Result MuteButtonHandle::CommitChanges
|
||||
(const wxMouseEvent &event, AudacityProject *pProject, wxWindow *)
|
||||
{
|
||||
if ( dynamic_cast< PlayableTrack* >( mpTrack ) )
|
||||
pProject->DoTrackMute(mpTrack, event.ShiftDown());
|
||||
|
||||
return RefreshCode::RefreshNone;
|
||||
}
|
||||
|
||||
HitTestResult MuteButtonHandle::HitTest
|
||||
(const wxMouseEvent &event, const wxRect &rect,
|
||||
const AudacityProject *pProject, const Track *pTrack)
|
||||
{
|
||||
wxRect buttonRect;
|
||||
if ( pTrack )
|
||||
TrackInfo::GetMuteSoloRect(rect, buttonRect, false,
|
||||
!pProject->IsSoloNone(), pTrack);
|
||||
if ( TrackInfo::HideTopItem( rect, buttonRect ) )
|
||||
return {};
|
||||
|
||||
if ( pTrack && buttonRect.Contains(event.m_x, event.m_y) ) {
|
||||
Instance().mRect = buttonRect;
|
||||
return {
|
||||
HitPreview(),
|
||||
&Instance()
|
||||
};
|
||||
}
|
||||
else
|
||||
return {};
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
SoloButtonHandle::SoloButtonHandle()
|
||||
: ButtonHandle{ TrackPanel::IsSoloing }
|
||||
{
|
||||
}
|
||||
|
||||
SoloButtonHandle::~SoloButtonHandle()
|
||||
{
|
||||
}
|
||||
|
||||
SoloButtonHandle &SoloButtonHandle::Instance()
|
||||
{
|
||||
static SoloButtonHandle instance;
|
||||
return instance;
|
||||
}
|
||||
|
||||
UIHandle::Result SoloButtonHandle::CommitChanges
|
||||
(const wxMouseEvent &event, AudacityProject *pProject, wxWindow *pParent)
|
||||
{
|
||||
if ( dynamic_cast< PlayableTrack* >( mpTrack ) )
|
||||
pProject->DoTrackSolo(mpTrack, event.ShiftDown());
|
||||
|
||||
return RefreshCode::RefreshNone;
|
||||
}
|
||||
|
||||
HitTestResult SoloButtonHandle::HitTest
|
||||
(const wxMouseEvent &event, const wxRect &rect,
|
||||
const AudacityProject *pProject, const Track *pTrack)
|
||||
{
|
||||
wxRect buttonRect;
|
||||
if ( pTrack )
|
||||
TrackInfo::GetMuteSoloRect(rect, buttonRect, true,
|
||||
!pProject->IsSoloNone(), pTrack);
|
||||
|
||||
if ( TrackInfo::HideTopItem( rect, buttonRect ) )
|
||||
return {};
|
||||
|
||||
if ( pTrack && buttonRect.Contains(event.m_x, event.m_y) ) {
|
||||
Instance().mRect = buttonRect;
|
||||
return HitTestResult(
|
||||
HitPreview(),
|
||||
&Instance()
|
||||
);
|
||||
}
|
||||
else
|
||||
return HitTestResult();
|
||||
}
|
64
src/tracks/playabletrack/ui/PlayableTrackButtonHandles.h
Normal file
64
src/tracks/playabletrack/ui/PlayableTrackButtonHandles.h
Normal file
@ -0,0 +1,64 @@
|
||||
/**********************************************************************
|
||||
|
||||
Audacity: A Digital Audio Editor
|
||||
|
||||
PlayableTrackButtonHandles.h
|
||||
|
||||
Paul Licameli split from TrackPanel.cpp
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef __AUDACITY_PLAYABLE_TRACK_BUTTON_HANDLES__
|
||||
#define __AUDACITY_PLAYABLE_TRACK_BUTTON_HANDLES__
|
||||
|
||||
#include "../../ui/ButtonHandle.h"
|
||||
|
||||
struct HitTestResult;
|
||||
|
||||
class MuteButtonHandle final : public ButtonHandle
|
||||
{
|
||||
MuteButtonHandle(const MuteButtonHandle&) = delete;
|
||||
MuteButtonHandle &operator=(const MuteButtonHandle&) = delete;
|
||||
|
||||
MuteButtonHandle();
|
||||
virtual ~MuteButtonHandle();
|
||||
static MuteButtonHandle& Instance();
|
||||
|
||||
protected:
|
||||
Result CommitChanges
|
||||
(const wxMouseEvent &event, AudacityProject *pProject, wxWindow *pParent)
|
||||
override;
|
||||
|
||||
bool StopsOnKeystroke () override { return true; }
|
||||
|
||||
public:
|
||||
static HitTestResult HitTest
|
||||
(const wxMouseEvent &event, const wxRect &rect,
|
||||
const AudacityProject *pProject, const Track *pTrack);
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class SoloButtonHandle final : public ButtonHandle
|
||||
{
|
||||
SoloButtonHandle(const SoloButtonHandle&) = delete;
|
||||
SoloButtonHandle &operator=(const SoloButtonHandle&) = delete;
|
||||
|
||||
SoloButtonHandle();
|
||||
virtual ~SoloButtonHandle();
|
||||
static SoloButtonHandle& Instance();
|
||||
|
||||
protected:
|
||||
Result CommitChanges
|
||||
(const wxMouseEvent &event, AudacityProject *pProject, wxWindow *pParent)
|
||||
override;
|
||||
|
||||
bool StopsOnKeystroke () override { return true; }
|
||||
|
||||
public:
|
||||
static HitTestResult HitTest
|
||||
(const wxMouseEvent &event, const wxRect &rect,
|
||||
const AudacityProject *pProject, const Track *pTrack);
|
||||
};
|
||||
|
||||
#endif
|
@ -10,7 +10,12 @@ Paul Licameli split from TrackPanel.cpp
|
||||
|
||||
#include "../../../../Audacity.h"
|
||||
#include "WaveTrackControls.h"
|
||||
#include "../../ui/PlayableTrackButtonHandles.h"
|
||||
|
||||
#include "../../../../HitTestResult.h"
|
||||
#include "../../../../Track.h"
|
||||
#include "../../../../TrackPanel.h"
|
||||
#include "../../../../TrackPanelMouseEvent.h"
|
||||
|
||||
WaveTrackControls::WaveTrackControls()
|
||||
{
|
||||
@ -28,8 +33,26 @@ WaveTrackControls::~WaveTrackControls()
|
||||
|
||||
|
||||
HitTestResult WaveTrackControls::HitTest
|
||||
(const TrackPanelMouseEvent & event,
|
||||
(const TrackPanelMouseEvent & evt,
|
||||
const AudacityProject *pProject)
|
||||
{
|
||||
return TrackControls::HitTest(event, pProject);
|
||||
const wxMouseEvent &event = evt.event;
|
||||
const wxRect &rect = evt.rect;
|
||||
if (event.Button(wxMOUSE_BTN_LEFT)) {
|
||||
if (mpTrack->GetKind() == Track::Wave) {
|
||||
auto track = GetTrack();
|
||||
HitTestResult result;
|
||||
if (NULL !=
|
||||
(result = MuteButtonHandle::HitTest
|
||||
(event, rect, pProject, track)).handle)
|
||||
return result;
|
||||
|
||||
if (NULL !=
|
||||
(result = SoloButtonHandle::HitTest
|
||||
(event, rect, pProject, track)).handle)
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
return TrackControls::HitTest(evt, pProject);
|
||||
}
|
||||
|
@ -230,6 +230,7 @@
|
||||
<ClCompile Include="..\..\..\src\tracks\playabletrack\notetrack\ui\NoteTrackControls.cpp" />
|
||||
<ClCompile Include="..\..\..\src\tracks\playabletrack\notetrack\ui\NoteTrackUI.cpp" />
|
||||
<ClCompile Include="..\..\..\src\tracks\playabletrack\notetrack\ui\NoteTrackVRulerControls.cpp" />
|
||||
<ClCompile Include="..\..\..\src\tracks\playabletrack\ui\PlayableTrackButtonHandles.cpp" />
|
||||
<ClCompile Include="..\..\..\src\tracks\playabletrack\wavetrack\ui\CutlineHandle.cpp" />
|
||||
<ClCompile Include="..\..\..\src\tracks\playabletrack\wavetrack\ui\SampleHandle.cpp" />
|
||||
<ClCompile Include="..\..\..\src\tracks\playabletrack\wavetrack\ui\WaveTrackControls.cpp" />
|
||||
@ -496,6 +497,7 @@
|
||||
<ClInclude Include="..\..\..\src\TrackPanelMouseEvent.h" />
|
||||
<ClInclude Include="..\..\..\src\tracks\playabletrack\notetrack\ui\NoteTrackControls.h" />
|
||||
<ClInclude Include="..\..\..\src\tracks\playabletrack\notetrack\ui\NoteTrackVRulerControls.h" />
|
||||
<ClInclude Include="..\..\..\src\tracks\playabletrack\ui\PlayableTrackButtonHandles.h" />
|
||||
<ClInclude Include="..\..\..\src\tracks\playabletrack\wavetrack\ui\CutlineHandle.h" />
|
||||
<ClInclude Include="..\..\..\src\tracks\playabletrack\wavetrack\ui\SampleHandle.h" />
|
||||
<ClInclude Include="..\..\..\src\tracks\playabletrack\wavetrack\ui\WaveTrackControls.h" />
|
||||
@ -1185,4 +1187,4 @@
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
<Import Project="..\..\ny.targets" />
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
</Project>
|
@ -102,6 +102,9 @@
|
||||
<Filter Include="src\tracks\playabletrack\notetrack\ui">
|
||||
<UniqueIdentifier>{355a925b-a166-4405-aff8-894bfa027ad3}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="src\tracks\playabletrack\ui">
|
||||
<UniqueIdentifier>{1af54030-3637-42e2-8339-b48bf05b8564}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\src\AboutDialog.cpp">
|
||||
@ -1010,6 +1013,9 @@
|
||||
<ClCompile Include="..\..\..\src\tracks\ui\SliderHandle.cpp">
|
||||
<Filter>src\tracks\ui</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\tracks\playabletrack\ui\PlayableTrackButtonHandles.cpp">
|
||||
<Filter>src\tracks\playabletrack\ui</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\src\AboutDialog.h">
|
||||
@ -2014,6 +2020,9 @@
|
||||
<ClInclude Include="..\..\..\src\tracks\ui\SliderHandle.h">
|
||||
<Filter>src\tracks\ui</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\tracks\playabletrack\ui\PlayableTrackButtonHandles.h">
|
||||
<Filter>src\tracks\playabletrack\ui</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="..\..\audacity.ico">
|
||||
@ -2237,4 +2246,4 @@
|
||||
<Filter>plug-ins</Filter>
|
||||
</copy>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
</Project>
|
Loading…
x
Reference in New Issue
Block a user