Skip to content

Commit

Permalink
EXPERIMENTAL_MIDI_STRETCHING redone with constexpr if
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-Licameli committed Apr 15, 2024
1 parent 21cbb07 commit d813f42
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
7 changes: 0 additions & 7 deletions src/Experimental.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,6 @@ set( EXPERIMENTAL_OPTIONS_LIST
# EQ accelerated code
#EQ_SSE_THREADED

# JKC, 17 Aug 2017
# Enables the MIDI note stretching feature, which currently
# a) Is broken on Linux (Bug 1646)
# b) Crashes with Sync-Lock (Bug 1719)
# c) Needs UI design review.
#MIDI_STRETCHING

# USE_MIDI must be defined in order for SCOREALIGN to work
#SCOREALIGN

Expand Down
24 changes: 18 additions & 6 deletions src/tracks/playabletrack/notetrack/ui/NoteTrackView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ NoteTrackView::~NoteTrackView()
{
}

namespace Experimental {
/*
JKC, 17 Aug 2017
Enables the MIDI note stretching feature, which currently
a) Is broken on Linux (Bug 1646)
b) Crashes with Sync-Lock (Bug 1719)
c) Needs UI design review.
PRL: But treat this with respect. It's one of Roger's!
*/
constexpr bool MidiStretching = false;
}

std::vector<UIHandlePtr> NoteTrackView::DetailedHitTest(
const TrackPanelMouseState &state, const AudacityProject *pProject,
int, bool )
Expand All @@ -49,12 +61,12 @@ std::vector<UIHandlePtr> NoteTrackView::DetailedHitTest(
UIHandlePtr result;
std::vector<UIHandlePtr> results;
#ifdef USE_MIDI
#ifdef EXPERIMENTAL_MIDI_STRETCHING
result = StretchHandle::HitTest(
mStretchHandle, state, pProject, FindChannel<NoteTrack>());
if (result)
results.push_back(result);
#endif
if constexpr (Experimental::MidiStretching) {
result = StretchHandle::HitTest(
mStretchHandle, state, pProject, FindChannel<NoteTrack>());
if (result)
results.push_back(result);
}
#endif

return results;
Expand Down
3 changes: 0 additions & 3 deletions src/tracks/playabletrack/notetrack/ui/NoteTrackView.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ class NoteTrackView final : public CommonChannelView
const wxRect &rect, unsigned iPass ) override;

std::shared_ptr<CommonTrackCell> mpAffordanceCellControl;

#ifdef EXPERIMENTAL_MIDI_STRETCHING
std::weak_ptr<class StretchHandle> mStretchHandle;
#endif
};
#endif

0 comments on commit d813f42

Please sign in to comment.