Skip to content

Commit

Permalink
Merge pull request audacity#5535 from Paul-Licameli/Break-TrackInfo-c…
Browse files Browse the repository at this point in the history
…ycle

Break track info cycle

Break dependency cycle of CommonTrackControls, TrackButtonHandles, TrackInfo
  • Loading branch information
Paul-Licameli authored Nov 17, 2023
2 parents c2b63b6 + f6e65d1 commit 86a6b6d
Show file tree
Hide file tree
Showing 68 changed files with 936 additions and 685 deletions.
6 changes: 6 additions & 0 deletions src/AdornedRulerPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ class AdornedRulerPanel::CommonRulerHandle : public UIHandle
, mChoice( menuChoice )
{}

std::shared_ptr<const Channel> FindChannel() const override
{ return nullptr; }

bool Clicked() const { return mClicked != Button::None; }

static UIHandle::Result NeedChangeHighlight(
Expand Down Expand Up @@ -922,6 +925,9 @@ class PlayheadHandle : public UIHandle
, mX( xx )
{}

std::shared_ptr<const Channel> FindChannel() const override
{ return nullptr; }

static UIHandle::Result NeedChangeHighlight(
const PlayheadHandle &oldState, const PlayheadHandle &newState)
{
Expand Down
2 changes: 2 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,8 @@ list( APPEND SOURCES
tracks/ui/CommonChannelView.h
tracks/ui/CommonTrackControls.cpp
tracks/ui/CommonTrackControls.h
tracks/ui/CommonTrackInfo.cpp
tracks/ui/CommonTrackInfo.h
tracks/ui/CommonTrackPanelCell.cpp
tracks/ui/CommonTrackPanelCell.h
tracks/ui/EditCursorOverlay.cpp
Expand Down
3 changes: 3 additions & 0 deletions src/CellularPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,9 @@ class DefaultRightButtonHandler : public UIHandle {

~DefaultRightButtonHandler() override;

std::shared_ptr<const Channel> FindChannel() const override
{ return nullptr; }

virtual Result Click
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override
{
Expand Down
3 changes: 2 additions & 1 deletion src/EnvelopeEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "TrackArtist.h"
#include "TrackPanelDrawingContext.h"
#include "ViewInfo.h"
#include "tracks/ui/EnvelopeHandle.h"

namespace {
void DrawPoint(wxDC & dc, const wxRect & r, int x, int y, bool top)
Expand All @@ -45,7 +46,7 @@ void EnvelopeEditor::DrawPoints(const Envelope &env,
bool highlight = false;
#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
auto target = dynamic_cast<EnvelopeHandle*>(context.target.get());
highlight = target && target->GetEnvelope() == this;
highlight = target && target->GetEnvelope() == &env;
#endif
wxPen &pen = highlight ? AColor::uglyPen : AColor::envelopePen;
dc.SetPen( pen );
Expand Down
Loading

0 comments on commit 86a6b6d

Please sign in to comment.