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 = 1 ,
  BottomMargin = 2 , LeftMargin = 1 , RightMargin = 1
}
 
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 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.2
 
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 2398 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 = 1,
87 BottomMargin = 2, // for bottom bevel and bottom line
88 LeftMargin = 1,
89
90 RightMargin = 1,
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 2420 of file AdornedRulerPanel.cpp.

2421{
2422 const auto &fgc = theTheme.Colour(fg);
2423 const auto &bgc = theTheme.Colour(bg);
2424 return wxColour{
2425 wxColour::AlphaBlend(fgc.Red(), bgc.Red(), alpha),
2426 wxColour::AlphaBlend(fgc.Green(), bgc.Green(), alpha),
2427 wxColour::AlphaBlend(fgc.Blue(), bgc.Blue(), alpha)
2428 };
2429}
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 2400 of file AdornedRulerPanel.cpp.

2401{
2402 return clrTrackInfo;
2403}

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

Here is the caller graph for this function:

◆ TimelineLimitsColor()

ColorId TimelineLimitsColor ( )
inline

Definition at line 2410 of file AdornedRulerPanel.cpp.

2411{
2412 return TimelineTextColor();
2413}
ColorId TimelineTextColor()

References TimelineTextColor().

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

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 2415 of file AdornedRulerPanel.cpp.

2416{
2417 return isActive ? clrRulerBackground : clrClipAffordanceInactiveBrush;
2418}

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

Here is the caller graph for this function:

◆ TimelineTextColor()

ColorId TimelineTextColor ( )
inline

Definition at line 2405 of file AdornedRulerPanel.cpp.

2406{
2407 return clrTrackPanelText;
2408}

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.2
constexpr

◆ wxEVT_COMMAND_BUTTON_CLICKED

wxEVT_COMMAND_BUTTON_CLICKED