Audacity 3.2.0
Classes | Namespaces | Macros | Enumerations | Functions | Variables
TrackPanel.cpp File Reference

Implements TrackPanel. More...

#include "TrackPanel.h"
#include "TrackPanelConstants.h"
#include <wx/setup.h>
#include "AdornedRulerPanel.h"
#include "tracks/ui/CommonTrackPanelCell.h"
#include "KeyboardCapture.h"
#include "PendingTracks.h"
#include "Project.h"
#include "ProjectAudioIO.h"
#include "ProjectAudioManager.h"
#include "ProjectHistory.h"
#include "ProjectWindows.h"
#include "ProjectSettings.h"
#include "ProjectStatus.h"
#include "ProjectTimeRuler.h"
#include "ProjectWindow.h"
#include "SyncLock.h"
#include "Theme.h"
#include "TrackArt.h"
#include "TrackPanelMouseEvent.h"
#include "UndoManager.h"
#include "UIHandle.h"
#include "AColor.h"
#include "AllThemeResources.h"
#include "AudioIO.h"
#include "float_cast.h"
#include "Prefs.h"
#include "RefreshCode.h"
#include "TrackArtist.h"
#include "TrackPanelAx.h"
#include "TrackPanelResizerCell.h"
#include "Viewport.h"
#include "WaveTrack.h"
#include "FrameStatistics.h"
#include "tracks/ui/TrackControls.h"
#include "tracks/ui/ChannelView.h"
#include "tracks/ui/ChannelVRulerControls.h"
#include "../images/Cursors.h"
#include <algorithm>
#include <wx/dc.h>
#include <wx/dcclient.h>
#include <wx/graphics.h>
#include "RealtimeEffectManager.h"
#include "TrackPanelDrawingContext.h"
Include dependency graph for TrackPanel.cpp:

Go to the source code of this file.

Classes

struct  anonymous_namespace{TrackPanel.cpp}::EmptyCell
 
struct  anonymous_namespace{TrackPanel.cpp}::VRulerAndChannel
 
struct  anonymous_namespace{TrackPanel.cpp}::VRulersAndChannels
 
struct  anonymous_namespace{TrackPanel.cpp}::HorizontalGroup
 
struct  anonymous_namespace{TrackPanel.cpp}::ChannelStack
 
struct  anonymous_namespace{TrackPanel.cpp}::LabeledChannelGroup
 
struct  anonymous_namespace{TrackPanel.cpp}::ResizingChannelGroup
 
struct  anonymous_namespace{TrackPanel.cpp}::Subgroup
 
struct  anonymous_namespace{TrackPanel.cpp}::MainGroup
 

Namespaces

namespace  anonymous_namespace{TrackPanel.cpp}
 

Macros

#define CURSORS_SIZE32
 

Enumerations

enum  : int {
  anonymous_namespace{TrackPanel.cpp}::DisplaceX = 7 , anonymous_namespace{TrackPanel.cpp}::DisplaceY = 1 , anonymous_namespace{TrackPanel.cpp}::MarginX = 8 , anonymous_namespace{TrackPanel.cpp}::MarginY = 2 ,
  anonymous_namespace{TrackPanel.cpp}::MarginsX = 2 * MarginX , anonymous_namespace{TrackPanel.cpp}::MarginsY = 2 * MarginY
}
 

Functions

template<class A , class B , class DIST >
bool within (A a, B b, DIST d)
 
std::unique_ptr< wxCursor > MakeCursor (int WXUNUSED(CursorId), const char *const pXpm[36], int HotX, int HotY)
 
std::shared_ptr< Trackanonymous_namespace{TrackPanel.cpp}::FindTrack (TrackPanelCell *pCell)
 
std::vector< int > anonymous_namespace{TrackPanel.cpp}::FindAdjustedChannelHeights (Track &t)
 
Trackanonymous_namespace{TrackPanel.cpp}::GetTrack (Channel &channel)
 
const Trackanonymous_namespace{TrackPanel.cpp}::GetTrack (const Channel &channel)
 
void anonymous_namespace{TrackPanel.cpp}::GetTrackNameExtent (wxDC &dc, const Channel &channel, wxCoord *pW, wxCoord *pH)
 
wxRect anonymous_namespace{TrackPanel.cpp}::GetTrackNameRect (int leftOffset, const wxRect &trackRect, wxCoord textWidth, wxCoord textHeight)
 

Variables

AttachedWindows::RegisteredFactory anonymous_namespace{TrackPanel.cpp}::sKey
 

Detailed Description

Implements TrackPanel.

Definition in file TrackPanel.cpp.

Macro Definition Documentation

◆ CURSORS_SIZE32

#define CURSORS_SIZE32

Function Documentation

◆ MakeCursor()

std::unique_ptr< wxCursor > MakeCursor ( int   WXUNUSEDCursorId,
const char *const  pXpm[36],
int  HotX,
int  HotY 
)

Makes a cursor from an XPM, uses CursorId as a fallback. TODO: Move this function to some other source file for reuse elsewhere.

Definition at line 189 of file TrackPanel.cpp.

190{
191#define CURSORS_SIZE32
192#ifdef CURSORS_SIZE32
193 const int HotAdjust =0;
194#else
195 const int HotAdjust =8;
196#endif
197
198 wxImage Image = wxImage(wxBitmap(pXpm).ConvertToImage());
199 Image.SetMaskColour(255,0,0);
200 Image.SetMask();// Enable mask.
201
202 Image.SetOption( wxIMAGE_OPTION_CUR_HOTSPOT_X, HotX-HotAdjust );
203 Image.SetOption( wxIMAGE_OPTION_CUR_HOTSPOT_Y, HotY-HotAdjust );
204 return std::make_unique<wxCursor>( Image );
205}
wxImage(22, 22)

References wxImage().

Referenced by anonymous_namespace{BrushHandle.cpp}::CrosshairCursor(), anonymous_namespace{SelectHandle.cpp}::EnvelopeCursor(), LabelTextHandle::HitPreview(), CutlineHandle::HitPreview(), AffordanceHandle::HitPreview(), TimeShiftHandle::HitPreview(), NoteTrackVZoomHandle::HitPreview(), ZoomHandle::HitPreview(), SampleHandle::HitPreview(), StretchHandle::HitPreview(), WaveClipAdjustBorderHandle::HitPreviewStretch(), WaveClipAdjustBorderHandle::HitPreviewTrim(), AdornedRulerPanel::MovePlayRegionHandle::MovePlayRegionHandle(), SubViewAdjustHandle::Preview(), SubViewRearrangeHandle::Preview(), LabelGlyphHandle::Preview(), WaveClipTitleEditHandle::Preview(), EnvelopeHandle::Preview(), TrackSelectHandle::Preview(), anonymous_namespace{SelectHandle.cpp}::SelectCursor(), and anonymous_namespace{SelectHandle.cpp}::SetTipAndCursorForBoundary().

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

◆ within()

template<class A , class B , class DIST >
bool within ( A  a,
b,
DIST  d 
)

Definition at line 170 of file TrackPanel.cpp.

171{
172 return (a > b - d) && (a < b + d);
173}

Referenced by TrackArt::DrawBackgroundWithSelection(), StretchHandle::HitTest(), and NoteTrack::MakeExportableSeq().

Here is the caller graph for this function: