Audacity 3.2.0
Classes | Namespaces | Macros | Typedefs | Enumerations | Functions | Variables
AdornedRulerPanel.cpp File Reference
#include "AdornedRulerPanel.h"
#include <wx/app.h>
#include <wx/setup.h>
#include <wx/tooltip.h>
#include "AColor.h"
#include "AllThemeResources.h"
#include "AudioIO.h"
#include "widgets/BasicMenu.h"
#include "Beats.h"
#include "CellularPanel.h"
#include "../images/Cursors.h"
#include "HitTestResult.h"
#include "Prefs.h"
#include "Project.h"
#include "ProjectAudioIO.h"
#include "ProjectAudioManager.h"
#include "ProjectWindows.h"
#include "ProjectStatus.h"
#include "ProjectTimeRuler.h"
#include "ProjectTimeSignature.h"
#include "ProjectWindow.h"
#include "RefreshCode.h"
#include "SelectUtilities.h"
#include "Snap.h"
#include "Track.h"
#include "TrackPanelMouseEvent.h"
#include "UIHandle.h"
#include "ViewInfo.h"
#include "prefs/TracksPrefs.h"
#include "prefs/ThemePrefs.h"
#include "toolbars/ToolBar.h"
#include "toolbars/ToolManager.h"
#include "tracks/ui/Scrubbing.h"
#include "tracks/ui/ChannelView.h"
#include "widgets/AButton.h"
#include "AudacityMessageBox.h"
#include "widgets/Grabber.h"
#include "widgets/LinearUpdater.h"
#include "widgets/BeatsFormat.h"
#include "widgets/TimeFormat.h"
#include "wxWidgetsWindowPlacement.h"
#include <wx/dcclient.h>
#include <wx/menu.h>
#include "CommandContext.h"
#include "CommonCommandFlags.h"
Include dependency graph for AdornedRulerPanel.cpp:

Go to the source code of this file.

Classes

class  AdornedRulerPanel::CommonRulerHandle
 
class  AdornedRulerPanel::PlayRegionAdjustingHandle
 
class  AdornedRulerPanel::ScrubbingRulerOverlay
 
class  AdornedRulerPanel::TrackPanelGuidelineOverlay
 
class  AdornedRulerPanel::CommonCell
 
class  AdornedRulerPanel::MovePlayRegionHandle
 
class  AdornedRulerPanel::ResizePlayRegionHandle
 
class  AdornedRulerPanel::NewPlayRegionHandle
 
class  anonymous_namespace{AdornedRulerPanel.cpp}::PlayheadHandle
 
class  AdornedRulerPanel::QPCell
 
class  AdornedRulerPanel::ScrubbingHandle
 
class  AdornedRulerPanel::ScrubbingCell
 
struct  AdornedRulerPanel::Subgroup
 
struct  AdornedRulerPanel::MainGroup
 

Namespaces

namespace  anonymous_namespace{AdornedRulerPanel.cpp}
 

Macros

#define SELECT_TOLERANCE_PIXEL   4
 
#define PLAY_REGION_TRIANGLE_SIZE   6
 
#define PLAY_REGION_RECT_WIDTH   1
 
#define PLAY_REGION_RECT_HEIGHT   3
 
#define PLAY_REGION_GLOBAL_OFFSET_Y   7
 

Typedefs

using ColorId = decltype(clrTrackInfo)
 

Enumerations

enum  : int {
  IndicatorSmallWidth = 9 , IndicatorMediumWidth = 13 , IndicatorOffset = 1 , TopMargin = 0 ,
  BottomMargin = 1 , LeftMargin = 0 , RightMargin = 0
}
 
enum  { ScrubHeight = 14 , ProperRulerHeight = 29 }
 
enum  {
  OnMinutesAndSecondsID = 7000 , OnBeatsAndMeasuresID , OnSyncQuickPlaySelID , OnAutoScrollID ,
  OnTogglePlayRegionID , OnClearPlayRegionID , OnSetPlayRegionToSelectionID , OnTogglePinnedStateID
}
 

Functions

int IndicatorHeightForWidth (int width)
 
int IndicatorWidthForHeight (int height)
 
int IndicatorBigHeight ()
 
int IndicatorBigWidth ()
 
 EVT_MENU (OnSetPlayRegionToSelectionID, AdornedRulerPanel::OnSetPlayRegionToSelection) EVT_COMMAND(OnTogglePinnedStateID
 
wxCoord anonymous_namespace{AdornedRulerPanel.cpp}::GetPlayHeadX (const AudacityProject *pProject)
 
double anonymous_namespace{AdornedRulerPanel.cpp}::GetPlayHeadFraction (const AudacityProject *pProject, wxCoord xx)
 
const TranslatableString anonymous_namespace{AdornedRulerPanel.cpp}::StartScrubbingMessage (const Scrubber &)
 
const TranslatableString anonymous_namespace{AdornedRulerPanel.cpp}::ContinueScrubbingMessage (const Scrubber &scrubber, bool clicked)
 
const TranslatableString anonymous_namespace{AdornedRulerPanel.cpp}::ScrubbingMessage (const Scrubber &scrubber, bool clicked)
 
ColorId TimelineBackgroundColor ()
 
ColorId TimelineTextColor ()
 
ColorId TimelineLimitsColor ()
 
ColorId TimelineSelectionColor ()
 
ColorId TimelineLoopRegionColor (bool isActive)
 
static wxColour AlphaBlend (ColorId fg, ColorId bg, double alpha)
 
void anonymous_namespace{AdornedRulerPanel.cpp}::OnTogglePinnedHead (const CommandContext &context)
 

Variables

 wxEVT_COMMAND_BUTTON_CLICKED
 
static std::unique_ptr< wxCursor > handOpenCursor = nullptr
 
AttachedWindows::RegisteredFactory anonymous_namespace{AdornedRulerPanel.cpp}::sKey
 
constexpr double SelectionOpacity = 0.4
 
AttachedItem anonymous_namespace{AdornedRulerPanel.cpp}::sAttachment
 

Macro Definition Documentation

◆ PLAY_REGION_GLOBAL_OFFSET_Y

#define PLAY_REGION_GLOBAL_OFFSET_Y   7

Definition at line 79 of file AdornedRulerPanel.cpp.

◆ PLAY_REGION_RECT_HEIGHT

#define PLAY_REGION_RECT_HEIGHT   3

Definition at line 78 of file AdornedRulerPanel.cpp.

◆ PLAY_REGION_RECT_WIDTH

#define PLAY_REGION_RECT_WIDTH   1

Definition at line 77 of file AdornedRulerPanel.cpp.

◆ PLAY_REGION_TRIANGLE_SIZE

#define PLAY_REGION_TRIANGLE_SIZE   6

Definition at line 76 of file AdornedRulerPanel.cpp.

◆ SELECT_TOLERANCE_PIXEL

#define SELECT_TOLERANCE_PIXEL   4

Definition at line 74 of file AdornedRulerPanel.cpp.

Typedef Documentation

◆ ColorId

using ColorId = decltype(clrTrackInfo)

Definition at line 2390 of file AdornedRulerPanel.cpp.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum : int
Enumerator
IndicatorSmallWidth 
IndicatorMediumWidth 
IndicatorOffset 
TopMargin 
BottomMargin 
LeftMargin 
RightMargin 

Definition at line 81 of file AdornedRulerPanel.cpp.

81 : int {
85
86 TopMargin = 0,
87 BottomMargin = 1, // for bottom bevel and bottom line
88 LeftMargin = 0,
89
90 RightMargin = 0,
91};
@ IndicatorOffset
@ IndicatorSmallWidth
@ LeftMargin
@ RightMargin
@ TopMargin
@ IndicatorMediumWidth
@ BottomMargin

◆ anonymous enum

anonymous enum
Enumerator
ScrubHeight 
ProperRulerHeight 

Definition at line 93 of file AdornedRulerPanel.cpp.

93 {
94 ScrubHeight = 14,
96};
@ ProperRulerHeight
@ ScrubHeight

◆ anonymous enum

anonymous enum
Enumerator
OnMinutesAndSecondsID 
OnBeatsAndMeasuresID 
OnSyncQuickPlaySelID 
OnAutoScrollID 
OnTogglePlayRegionID 
OnClearPlayRegionID 
OnSetPlayRegionToSelectionID 
OnTogglePinnedStateID 

Definition at line 694 of file AdornedRulerPanel.cpp.

694 {
703};
@ OnTogglePinnedStateID
@ OnBeatsAndMeasuresID
@ OnSetPlayRegionToSelectionID
@ OnClearPlayRegionID
@ OnAutoScrollID
@ OnTogglePlayRegionID
@ OnMinutesAndSecondsID
@ OnSyncQuickPlaySelID

Function Documentation

◆ AlphaBlend()

static wxColour AlphaBlend ( ColorId  fg,
ColorId  bg,
double  alpha 
)
inlinestatic

Definition at line 2417 of file AdornedRulerPanel.cpp.

2418{
2419 const auto &fgc = theTheme.Colour(fg);
2420 const auto &bgc = theTheme.Colour(bg);
2421 return wxColour{
2422 wxColour::AlphaBlend(fgc.Red(), bgc.Red(), alpha),
2423 wxColour::AlphaBlend(fgc.Green(), bgc.Green(), alpha),
2424 wxColour::AlphaBlend(fgc.Blue(), bgc.Blue(), alpha)
2425 };
2426}
static wxColour AlphaBlend(ColorId fg, ColorId bg, double alpha)
THEME_API Theme theTheme
Definition: Theme.cpp:82
wxColour & Colour(int iIndex)

References AlphaBlend(), ThemeBase::Colour(), and theTheme.

Referenced by AlphaBlend(), AdornedRulerPanel::DoDrawOverlap(), and AdornedRulerPanel::DoDrawSelection().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EVT_MENU()

◆ IndicatorBigHeight()

int IndicatorBigHeight ( )
inline

Definition at line 111 of file AdornedRulerPanel.cpp.

112{
113 return std::max((int)(ScrubHeight - TopMargin),
114 (int)(IndicatorMediumWidth));
115}

References IndicatorMediumWidth, ScrubHeight, and TopMargin.

Referenced by IndicatorBigWidth().

Here is the caller graph for this function:

◆ IndicatorBigWidth()

int IndicatorBigWidth ( )
inline

Definition at line 117 of file AdornedRulerPanel.cpp.

118{
120}
int IndicatorBigHeight()
int IndicatorWidthForHeight(int height)

References IndicatorBigHeight(), and IndicatorWidthForHeight().

Referenced by AdornedRulerPanel::ScrubbingRulerOverlay::DoGetRectangle(), and AdornedRulerPanel::ScrubbingRulerOverlay::Draw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IndicatorHeightForWidth()

int IndicatorHeightForWidth ( int  width)
inline

Definition at line 98 of file AdornedRulerPanel.cpp.

99{
100 return ((width / 2) * 3) / 2;
101}

Referenced by AdornedRulerPanel::DoDrawScrubIndicator().

Here is the caller graph for this function:

◆ IndicatorWidthForHeight()

int IndicatorWidthForHeight ( int  height)
inline

Definition at line 103 of file AdornedRulerPanel.cpp.

104{
105 // Not an exact inverse of the above, with rounding, but good enough
106 return std::max(static_cast<int>(IndicatorSmallWidth),
107 (((height) * 2) / 3) * 2
108 );
109}

References IndicatorSmallWidth.

Referenced by IndicatorBigWidth().

Here is the caller graph for this function:

◆ TimelineBackgroundColor()

ColorId TimelineBackgroundColor ( )
inline

Definition at line 2392 of file AdornedRulerPanel.cpp.

2393{
2394 return clrTimelineRulerBackground;
2395}

Referenced by AdornedRulerPanel::DoDrawBackground(), and AdornedRulerPanel::DoDrawSelection().

Here is the caller graph for this function:

◆ TimelineLimitsColor()

ColorId TimelineLimitsColor ( )
inline

Definition at line 2402 of file AdornedRulerPanel.cpp.

2403{
2404 return TimelineTextColor();
2405}
ColorId TimelineTextColor()

References TimelineTextColor().

Referenced by AdornedRulerPanel::DoDrawPlayRegionLimits().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TimelineLoopRegionColor()

ColorId TimelineLoopRegionColor ( bool  isActive)
inline

Definition at line 2412 of file AdornedRulerPanel.cpp.

2413{
2414 return isActive ? clrLoopEnabled : clrLoopDisabled;
2415}

Referenced by AdornedRulerPanel::DoDrawOverlap(), and AdornedRulerPanel::DoDrawPlayRegion().

Here is the caller graph for this function:

◆ TimelineSelectionColor()

ColorId TimelineSelectionColor ( )
inline

Definition at line 2407 of file AdornedRulerPanel.cpp.

2408{
2409 return clrRulerSelected;
2410}

Referenced by AdornedRulerPanel::DoDrawOverlap(), and AdornedRulerPanel::DoDrawSelection().

Here is the caller graph for this function:

◆ TimelineTextColor()

ColorId TimelineTextColor ( )
inline

Definition at line 2397 of file AdornedRulerPanel.cpp.

2398{
2399 return clrTrackPanelText;
2400}

Referenced by AdornedRulerPanel::DoDrawBackground(), AdornedRulerPanel::DoDrawMarks(), and TimelineLimitsColor().

Here is the caller graph for this function:

Variable Documentation

◆ handOpenCursor

std::unique_ptr<wxCursor> handOpenCursor = nullptr
static

◆ SelectionOpacity

constexpr double SelectionOpacity = 0.4
constexpr

◆ wxEVT_COMMAND_BUTTON_CLICKED

wxEVT_COMMAND_BUTTON_CLICKED