Audacity 3.2.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
AdornedRulerPanel::TrackPanelGuidelineOverlay Class Referencefinal
Inheritance diagram for AdornedRulerPanel::TrackPanelGuidelineOverlay:
[legend]
Collaboration diagram for AdornedRulerPanel::TrackPanelGuidelineOverlay:
[legend]

Public Member Functions

 TrackPanelGuidelineOverlay (AudacityProject *project)
 
- Public Member Functions inherited from Overlay
 Overlay ()=default
 
 Overlay (const Overlay &)=delete
 
Overlayoperator= (const Overlay &)=delete
 
virtual ~Overlay ()=0
 
virtual unsigned SequenceNumber () const =0
 This number determines an ordering of overlays, so that those with higher numbers overpaint those with lower numbers that intersect. More...
 
std::pair< wxRect, bool > GetRectangle (wxSize size)
 
virtual std::pair< wxRect, bool > DoGetRectangle (wxSize size)=0
 
virtual void Erase (wxDC &dc, wxDC &src)
 
virtual void Draw (OverlayPanel &panel, wxDC &dc)=0
 

Private Member Functions

void Update ()
 
unsigned SequenceNumber () const override
 This number determines an ordering of overlays, so that those with higher numbers overpaint those with lower numbers that intersect. More...
 
std::pair< wxRect, bool > DoGetRectangle (wxSize size) override
 
void Draw (OverlayPanel &panel, wxDC &dc) override
 

Private Attributes

friend ScrubbingRulerOverlay
 
friend AdornedRulerPanel
 
AudacityProjectmProject
 
std::shared_ptr< ScrubbingRulerOverlaymPartner { std::make_shared<ScrubbingRulerOverlay>(*this) }
 
bool mNewPreviewingScrub {}
 
int mOldQPIndicatorPos { -1 }
 
int mOldIndicatorSnapped { -1 }
 
bool mOldPreviewingScrub {}
 

Detailed Description

Definition at line 460 of file AdornedRulerPanel.cpp.

Constructor & Destructor Documentation

◆ TrackPanelGuidelineOverlay()

AdornedRulerPanel::TrackPanelGuidelineOverlay::TrackPanelGuidelineOverlay ( AudacityProject project)

Definition at line 602 of file AdornedRulerPanel.cpp.

605{
606}
const auto project

Member Function Documentation

◆ DoGetRectangle()

std::pair< wxRect, bool > AdornedRulerPanel::TrackPanelGuidelineOverlay::DoGetRectangle ( wxSize  size)
overrideprivatevirtual

Implements Overlay.

Definition at line 628 of file AdornedRulerPanel.cpp.

References size.

◆ Draw()

void AdornedRulerPanel::TrackPanelGuidelineOverlay::Draw ( OverlayPanel panel,
wxDC &  dc 
)
overrideprivatevirtual

Implements Overlay.

Definition at line 641 of file AdornedRulerPanel.cpp.

643{
644 mOldQPIndicatorPos = mPartner->mNewQPIndicatorPos;
645 mOldIndicatorSnapped = mPartner->mNewIndicatorSnapped;
647
648 if (mOldQPIndicatorPos >= 0) {
651 if (auto pHandle =
652 dynamic_cast<PlayRegionAdjustingHandle*>(ruler.Target().get());
653 pHandle != nullptr && pHandle->Clicked())
654 // Do not draw the quick-play guideline
655 return;
656 }
657
659 ? AColor::IndicatorColor(&dc, true) // Draw green line for preview.
660 : (mOldIndicatorSnapped >= 0)
661 ? AColor::SnapGuidePen(&dc) // Yellow snap guideline
662 : AColor::Light(&dc, false);
663
664 // Draw indicator in all visible tracks
665 auto pCellularPanel = dynamic_cast<CellularPanel*>( &panel );
666 if ( !pCellularPanel ) {
667 wxASSERT( false );
668 return;
669 }
670 pCellularPanel
671 ->VisitCells( [&]( const wxRect &rect, TrackPanelCell &cell ) {
672 const auto pChannelView = dynamic_cast<ChannelView*>(&cell);
673 if (!pChannelView)
674 return;
675
676 // Draw the NEW indicator in its NEW location
677 AColor::Line(dc,
679 rect.GetTop(),
681 rect.GetBottom());
682 } );
683 }
684}
AColor Manages color brushes and pens.
Definition: AColor.h:25
static void IndicatorColor(wxDC *dc, bool bIsNotRecording)
Definition: AColor.cpp:446
static void Line(wxDC &dc, wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
Definition: AColor.cpp:194
static AdornedRulerPanel & Get(AudacityProject &project)
Formerly part of TrackPanel, this abstract base class has no special knowledge of Track objects and i...
Definition: CellularPanel.h:34

References AdornedRulerPanel::CommonRulerHandle::Clicked(), AdornedRulerPanel::Get(), AColor::IndicatorColor(), AColor::Light(), AColor::Line(), AdornedRulerPanel::mProject, anonymous_namespace{TimeTrackVRulerControls.cpp}::ruler(), and AColor::SnapGuidePen().

Here is the call graph for this function:

◆ SequenceNumber()

unsigned AdornedRulerPanel::TrackPanelGuidelineOverlay::SequenceNumber ( ) const
overrideprivatevirtual

This number determines an ordering of overlays, so that those with higher numbers overpaint those with lower numbers that intersect.

Implements Overlay.

Definition at line 609 of file AdornedRulerPanel.cpp.

610{
611 return 30;
612}

◆ Update()

void AdornedRulerPanel::TrackPanelGuidelineOverlay::Update ( )
private

Definition at line 614 of file AdornedRulerPanel.cpp.

615{
616 const auto project = mProject;
617 auto &scrubber = Scrubber::Get( *project );
618 const auto ruler = &Get( *project );
619
620 // Determine the color of the line stroked over
621 // the track panel, green for scrub or yellow for snapped or white
623 ruler->LastCell() == ruler->mScrubbingCell &&
624 !scrubber.IsScrubbing();
625}
static Scrubber & Get(AudacityProject &project)
Definition: Scrubbing.cpp:186

References AdornedRulerPanel::Get(), Scrubber::Get(), AdornedRulerPanel::mProject, project, and anonymous_namespace{TimeTrackVRulerControls.cpp}::ruler().

Here is the call graph for this function:

Member Data Documentation

◆ AdornedRulerPanel

friend AdornedRulerPanel::TrackPanelGuidelineOverlay::AdornedRulerPanel
private

Definition at line 463 of file AdornedRulerPanel.cpp.

◆ mNewPreviewingScrub

bool AdornedRulerPanel::TrackPanelGuidelineOverlay::mNewPreviewingScrub {}
private

Definition at line 480 of file AdornedRulerPanel.cpp.

◆ mOldIndicatorSnapped

int AdornedRulerPanel::TrackPanelGuidelineOverlay::mOldIndicatorSnapped { -1 }
private

Definition at line 483 of file AdornedRulerPanel.cpp.

◆ mOldPreviewingScrub

bool AdornedRulerPanel::TrackPanelGuidelineOverlay::mOldPreviewingScrub {}
private

Definition at line 484 of file AdornedRulerPanel.cpp.

◆ mOldQPIndicatorPos

int AdornedRulerPanel::TrackPanelGuidelineOverlay::mOldQPIndicatorPos { -1 }
private

Definition at line 482 of file AdornedRulerPanel.cpp.

◆ mPartner

std::shared_ptr<ScrubbingRulerOverlay> AdornedRulerPanel::TrackPanelGuidelineOverlay::mPartner { std::make_shared<ScrubbingRulerOverlay>(*this) }
private

Definition at line 477 of file AdornedRulerPanel.cpp.

◆ mProject

AudacityProject* AdornedRulerPanel::TrackPanelGuidelineOverlay::mProject
private

Definition at line 475 of file AdornedRulerPanel.cpp.

◆ ScrubbingRulerOverlay

friend AdornedRulerPanel::TrackPanelGuidelineOverlay::ScrubbingRulerOverlay
private

Definition at line 462 of file AdornedRulerPanel.cpp.


The documentation for this class was generated from the following file: