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

Implements TrackPanel. More...

#include "TrackPanel.h"
#include <wx/setup.h>
#include "AdornedRulerPanel.h"
#include "KeyboardCapture.h"
#include "Project.h"
#include "ProjectAudioIO.h"
#include "ProjectAudioManager.h"
#include "ProjectHistory.h"
#include "ProjectSettings.h"
#include "ProjectStatus.h"
#include "ProjectWindow.h"
#include "Theme.h"
#include "TrackPanelMouseEvent.h"
#include "TrackPanelResizeHandle.h"
#include "UndoManager.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 "WaveTrack.h"
#include "tracks/ui/TrackControls.h"
#include "tracks/ui/TrackView.h"
#include "tracks/ui/TrackVRulerControls.h"
#include "../images/Cursors.h"
#include <algorithm>
#include <wx/dc.h>
#include <wx/dcclient.h>
#include <wx/graphics.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}::ChannelGroup
 
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

 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)
 
void anonymous_namespace{TrackPanel.cpp}::GetTrackNameExtent (wxDC &dc, const Track *t, wxCoord *pW, wxCoord *pH)
 
wxRect anonymous_namespace{TrackPanel.cpp}::GetTrackNameRect (int leftOffset, const wxRect &trackRect, wxCoord textWidth, wxCoord textHeight)
 
void anonymous_namespace{TrackPanel.cpp}::DrawTrackName (int leftOffset, TrackPanelDrawingContext &context, const Track *t, const wxRect &rect)
 

Variables

AudacityProject::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 177 of file TrackPanel.cpp.

178 {
179 #define CURSORS_SIZE32
180 #ifdef CURSORS_SIZE32
181  const int HotAdjust =0;
182 #else
183  const int HotAdjust =8;
184 #endif
185 
186  wxImage Image = wxImage(wxBitmap(pXpm).ConvertToImage());
187  Image.SetMaskColour(255,0,0);
188  Image.SetMask();// Enable mask.
189 
190  Image.SetOption( wxIMAGE_OPTION_CUR_HOTSPOT_X, HotX-HotAdjust );
191  Image.SetOption( wxIMAGE_OPTION_CUR_HOTSPOT_Y, HotY-HotAdjust );
192  return std::make_unique<wxCursor>( Image );
193 }

Referenced by anonymous_namespace{SelectHandle.cpp}::EnvelopeCursor(), LabelTextHandle::HitPreview(), CutlineHandle::HitPreview(), TimeShiftHandle::HitPreview(), NoteTrackVZoomHandle::HitPreview(), WaveTrackVZoomHandle::HitPreview(), ZoomHandle::HitPreview(), SampleHandle::HitPreview(), StretchHandle::HitPreview(), anonymous_namespace{WaveTrackView.cpp}::SubViewAdjustHandle::Preview(), anonymous_namespace{WaveTrackView.cpp}::SubViewRearrangeHandle::Preview(), EnvelopeHandle::Preview(), TrackSelectHandle::Preview(), anonymous_namespace{SelectHandle.cpp}::SelectCursor(), and anonymous_namespace{SelectHandle.cpp}::SetTipAndCursorForBoundary().

Here is the caller graph for this function:

◆ within()

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

Definition at line 158 of file TrackPanel.cpp.

159 {
160  return (a > b - d) && (a < b + d);
161 }

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

Here is the caller graph for this function: