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 "CellularPanel.h"
#include "../images/Cursors.h"
#include "HitTestResult.h"
#include "Menus.h"
#include "Prefs.h"
#include "Project.h"
#include "ProjectAudioIO.h"
#include "ProjectAudioManager.h"
#include "ProjectWindows.h"
#include "ProjectStatus.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 "tracks/ui/Scrubbing.h"
#include "tracks/ui/TrackView.h"
#include "widgets/AButton.h"
#include "widgets/AudacityMessageBox.h"
#include "widgets/Grabber.h"
#include "widgets/wxWidgetsWindowPlacement.h"
#include <wx/dcclient.h>
#include <wx/menu.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  {
  OnSyncQuickPlaySelID = 7000 , 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)
 

Variables

 wxEVT_COMMAND_BUTTON_CLICKED
 
static auto handOpenCursor
 
AttachedWindows::RegisteredFactory anonymous_namespace{AdornedRulerPanel.cpp}::sKey
 
constexpr double SelectionOpacity = 0.2
 

Macro Definition Documentation

◆ PLAY_REGION_GLOBAL_OFFSET_Y

#define PLAY_REGION_GLOBAL_OFFSET_Y   7

Definition at line 73 of file AdornedRulerPanel.cpp.

◆ PLAY_REGION_RECT_HEIGHT

#define PLAY_REGION_RECT_HEIGHT   3

Definition at line 72 of file AdornedRulerPanel.cpp.

◆ PLAY_REGION_RECT_WIDTH

#define PLAY_REGION_RECT_WIDTH   1

Definition at line 71 of file AdornedRulerPanel.cpp.

◆ PLAY_REGION_TRIANGLE_SIZE

#define PLAY_REGION_TRIANGLE_SIZE   6

Definition at line 70 of file AdornedRulerPanel.cpp.

◆ SELECT_TOLERANCE_PIXEL

#define SELECT_TOLERANCE_PIXEL   4

Definition at line 68 of file AdornedRulerPanel.cpp.

Typedef Documentation

◆ ColorId

using ColorId = decltype(clrTrackInfo)

Definition at line 2382 of file AdornedRulerPanel.cpp.

Enumeration Type Documentation

◆ anonymous enum

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

Definition at line 75 of file AdornedRulerPanel.cpp.

75 : int {
79
80 TopMargin = 1,
81 BottomMargin = 2, // for bottom bevel and bottom line
82 LeftMargin = 1,
83
84 RightMargin = 1,
85};
@ IndicatorOffset
@ IndicatorSmallWidth
@ LeftMargin
@ RightMargin
@ TopMargin
@ IndicatorMediumWidth
@ BottomMargin

◆ anonymous enum

anonymous enum
Enumerator
ScrubHeight 
ProperRulerHeight 

Definition at line 87 of file AdornedRulerPanel.cpp.

87 {
88 ScrubHeight = 14,
90};
@ ProperRulerHeight
@ ScrubHeight

◆ anonymous enum

anonymous enum
Enumerator
OnSyncQuickPlaySelID 
OnAutoScrollID 
OnTogglePlayRegionID 
OnClearPlayRegionID 
OnSetPlayRegionToSelectionID 
OnTogglePinnedStateID 

Definition at line 668 of file AdornedRulerPanel.cpp.

668 {
675};
@ OnTogglePinnedStateID
@ OnSetPlayRegionToSelectionID
@ OnClearPlayRegionID
@ OnAutoScrollID
@ OnTogglePlayRegionID
@ OnSyncQuickPlaySelID

Function Documentation

◆ AlphaBlend()

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

Definition at line 2404 of file AdornedRulerPanel.cpp.

2405{
2406 const auto &fgc = theTheme.Colour(fg);
2407 const auto &bgc = theTheme.Colour(bg);
2408 return wxColour{
2409 wxColour::AlphaBlend(fgc.Red(), bgc.Red(), alpha),
2410 wxColour::AlphaBlend(fgc.Green(), bgc.Green(), alpha),
2411 wxColour::AlphaBlend(fgc.Blue(), bgc.Blue(), alpha)
2412 };
2413}
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 105 of file AdornedRulerPanel.cpp.

106{
107 return std::max((int)(ScrubHeight - TopMargin),
108 (int)(IndicatorMediumWidth));
109}

References IndicatorMediumWidth, ScrubHeight, and TopMargin.

Referenced by IndicatorBigWidth().

Here is the caller graph for this function:

◆ IndicatorBigWidth()

int IndicatorBigWidth ( )
inline

Definition at line 111 of file AdornedRulerPanel.cpp.

112{
114}
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 92 of file AdornedRulerPanel.cpp.

93{
94 return ((width / 2) * 3) / 2;
95}

Referenced by AdornedRulerPanel::DoDrawScrubIndicator().

Here is the caller graph for this function:

◆ IndicatorWidthForHeight()

int IndicatorWidthForHeight ( int  height)
inline

Definition at line 97 of file AdornedRulerPanel.cpp.

98{
99 // Not an exact inverse of the above, with rounding, but good enough
100 return std::max(static_cast<int>(IndicatorSmallWidth),
101 (((height) * 2) / 3) * 2
102 );
103}

References IndicatorSmallWidth.

Referenced by IndicatorBigWidth().

Here is the caller graph for this function:

◆ TimelineBackgroundColor()

ColorId TimelineBackgroundColor ( )
inline

Definition at line 2384 of file AdornedRulerPanel.cpp.

2385{
2386 return clrTrackInfo;
2387}

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

Here is the caller graph for this function:

◆ TimelineLimitsColor()

ColorId TimelineLimitsColor ( )
inline

Definition at line 2394 of file AdornedRulerPanel.cpp.

2395{
2396 return TimelineTextColor();
2397}
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 2399 of file AdornedRulerPanel.cpp.

2400{
2401 return isActive ? clrRulerBackground : clrClipAffordanceInactiveBrush;
2402}

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

Here is the caller graph for this function:

◆ TimelineTextColor()

ColorId TimelineTextColor ( )
inline

Definition at line 2389 of file AdornedRulerPanel.cpp.

2390{
2391 return clrTrackPanelText;
2392}

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

Here is the caller graph for this function:

Variable Documentation

◆ handOpenCursor

auto handOpenCursor
static
Initial value:
=
MakeCursor(wxCURSOR_HAND, RearrangeCursorXpm, 16, 16)
std::unique_ptr< wxCursor > MakeCursor(int WXUNUSED(CursorId), const char *const pXpm[36], int HotX, int HotY)
Definition: TrackPanel.cpp:184

Definition at line 770 of file AdornedRulerPanel.cpp.

Referenced by AffordanceHandle::HitPreview(), and LabelGlyphHandle::Preview().

◆ SelectionOpacity

constexpr double SelectionOpacity = 0.2
constexpr

◆ wxEVT_COMMAND_BUTTON_CLICKED

wxEVT_COMMAND_BUTTON_CLICKED