Audacity  2.2.0
TrackPanel.cpp File Reference

Implements TrackPanel and TrackInfo. More...

#include "Audacity.h"
#include "Experimental.h"
#include "TrackPanel.h"
#include "Project.h"
#include "TrackPanelCellIterator.h"
#include "TrackPanelMouseEvent.h"
#include "TrackPanelResizeHandle.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 "UIHandle.h"
#include "HitTestResult.h"
#include "WaveTrack.h"
#include "toolbars/ControlToolBar.h"
#include "toolbars/ToolsToolBar.h"
#include "../images/Cursors.h"
#include "widgets/ASlider.h"
#include "widgets/Ruler.h"
#include <algorithm>
#include "TrackPanelDrawingContext.h"
#include "tracks/ui/TrackControls.h"
#include "tracks/ui/TrackButtonHandles.h"
#include "tracks/playabletrack/notetrack/ui/NoteTrackButtonHandle.h"
#include "tracks/playabletrack/wavetrack/ui/WaveTrackSliderHandles.h"
#include "tracks/playabletrack/ui/PlayableTrackButtonHandles.h"

Classes

struct  TrackInfo::TCPLine
 

Macros

#define RANGE(array)   (array), (array) + sizeof(array)/sizeof(*(array))
 
#define TITLE_ITEMS
 
#define MUTE_SOLO_ITEMS(extra)
 
#define STATUS_ITEMS
 
#define COMMON_ITEMS   TITLE_ITEMS
 

Enumerations

enum  : unsigned
 

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 *pXpm[36], int HotX, int HotY)
 
static TrackPanelTrackPanelFactory (wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, const std::shared_ptr< TrackList > &tracks, ViewInfo *viewInfo, TrackPanelListener *listener, AdornedRulerPanel *ruler)
 

Variables

static const int TitleSoloBorderOverlap = 1
 

Detailed Description

Implements TrackPanel and TrackInfo.

Todo:
Refactoring of the TrackPanel, possibly as described in Track Panel Refactor

TrackPanel.cpp is currently some of the worst code in Audacity. It's not really unreadable, there's just way too much stuff in this one file. Rather than apply a quick fix, the long-term plan is to create a GUITrack class that knows how to draw itself and handle events. Then this class just helps coordinate between tracks.

Plans under discussion are described in Track Panel Refactor

Macro Definition Documentation

#define COMMON_ITEMS   TITLE_ITEMS
#define MUTE_SOLO_ITEMS (   extra)
Value:
{ kItemMute | kItemSolo, kTrackInfoBtnSize + 1, extra, \
static void MuteAndSoloDrawFunction(TrackPanelDrawingContext &context, const wxRect &rect, const Track *pTrack)
Definition: TrackPanel.cpp:2373
Definition: TrackPanel.h:584
#define RANGE (   array)    (array), (array) + sizeof(array)/sizeof(*(array))
#define STATUS_ITEMS
Value:
{ kItemStatusInfo1, 12, 0, \
{ kItemStatusInfo2, 12, 0, \
static void Status1DrawFunction(TrackPanelDrawingContext &context, const wxRect &rect, const Track *pTrack)
Definition: TrackPanel.cpp:2413
static void Status2DrawFunction(TrackPanelDrawingContext &context, const wxRect &rect, const Track *pTrack)
Definition: TrackPanel.cpp:2443
#define TITLE_ITEMS
Value:
{ kItemBarButtons, kTrackInfoBtnSize, 0, \
static void CloseTitleDrawFunction(TrackPanelDrawingContext &context, const wxRect &rect, const Track *pTrack)
Definition: TrackPanel.cpp:2073
Definition: TrackPanel.h:584

Enumeration Type Documentation

anonymous enum : unsigned

Function Documentation

std::unique_ptr<wxCursor> MakeCursor ( int   WXUNUSEDCursorId,
const char *  pXpm[36],
int  HotX,
int  HotY 
)
static TrackPanel* TrackPanelFactory ( wxWindow *  parent,
wxWindowID  id,
const wxPoint &  pos,
const wxSize &  size,
const std::shared_ptr< TrackList > &  tracks,
ViewInfo viewInfo,
TrackPanelListener listener,
AdornedRulerPanel ruler 
)
static

References safenew.

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

Variable Documentation

const int TitleSoloBorderOverlap = 1
static