Audacity  2.2.0
TrackInfo Class Reference

The TrackInfo is shown to the side of a track It has the menus, pan and gain controls displayed in it. So "Info" is somewhat a misnomer. Should possibly be "TrackControls". More...

#include <TrackPanel.h>

Classes

struct  TCPLine
 

Public Member Functions

 TrackInfo (TrackPanel *pParentIn)
 
 ~TrackInfo ()
 
void ReCreateSliders ()
 
int GetTrackInfoWidth () const
 
void DrawBackground (wxDC *dc, const wxRect &rect, bool bSelected, bool bHasMuteSolo, const int labelw, const int vrul) const
 
void DrawBordersWithin (wxDC *dc, const wxRect &rect, const Track &track) const
 

Static Public Member Functions

static unsigned MinimumTrackHeight ()
 
static void DrawItems (TrackPanelDrawingContext &context, const wxRect &rect, const Track &track)
 
static void DrawItems (TrackPanelDrawingContext &context, const wxRect &rect, const Track *pTrack, const std::vector< TCPLine > &topLines, const std::vector< TCPLine > &bottomLines)
 
static void CloseTitleDrawFunction (TrackPanelDrawingContext &context, const wxRect &rect, const Track *pTrack)
 
static void MinimizeSyncLockDrawFunction (TrackPanelDrawingContext &context, const wxRect &rect, const Track *pTrack)
 
static void MidiControlsDrawFunction (TrackPanelDrawingContext &context, const wxRect &rect, const Track *pTrack)
 
template<typename TrackClass >
static void SliderDrawFunction (LWSlider *(*Selector)(const wxRect &sliderRect, const TrackClass *t, bool captured, wxWindow *), wxDC *dc, const wxRect &rect, const Track *pTrack, bool captured, bool highlight)
 
static void PanSliderDrawFunction (TrackPanelDrawingContext &context, const wxRect &rect, const Track *pTrack)
 
static void GainSliderDrawFunction (TrackPanelDrawingContext &context, const wxRect &rect, const Track *pTrack)
 
static void MuteOrSoloDrawFunction (wxDC *dc, const wxRect &rect, const Track *pTrack, bool down, bool captured, bool solo, bool hit)
 
static void WideMuteDrawFunction (TrackPanelDrawingContext &context, const wxRect &rect, const Track *pTrack)
 
static void WideSoloDrawFunction (TrackPanelDrawingContext &context, const wxRect &rect, const Track *pTrack)
 
static void MuteAndSoloDrawFunction (TrackPanelDrawingContext &context, const wxRect &rect, const Track *pTrack)
 
static void StatusDrawFunction (const wxString &string, wxDC *dc, const wxRect &rect)
 
static void Status1DrawFunction (TrackPanelDrawingContext &context, const wxRect &rect, const Track *pTrack)
 
static void Status2DrawFunction (TrackPanelDrawingContext &context, const wxRect &rect, const Track *pTrack)
 
static void SetTrackInfoFont (wxDC *dc)
 
static void GetCloseBoxHorizontalBounds (const wxRect &rect, wxRect &dest)
 
static void GetCloseBoxRect (const wxRect &rect, wxRect &dest)
 
static void GetTitleBarHorizontalBounds (const wxRect &rect, wxRect &dest)
 
static void GetTitleBarRect (const wxRect &rect, wxRect &dest)
 
static void GetNarrowMuteHorizontalBounds (const wxRect &rect, wxRect &dest)
 
static void GetNarrowSoloHorizontalBounds (const wxRect &rect, wxRect &dest)
 
static void GetWideMuteSoloHorizontalBounds (const wxRect &rect, wxRect &dest)
 
static void GetMuteSoloRect (const wxRect &rect, wxRect &dest, bool solo, bool bHasSoloButton, const Track *pTrack)
 
static void GetSliderHorizontalBounds (const wxPoint &topleft, wxRect &dest)
 
static void GetGainRect (const wxPoint &topLeft, wxRect &dest)
 
static void GetPanRect (const wxPoint &topLeft, wxRect &dest)
 
static void GetMinimizeHorizontalBounds (const wxRect &rect, wxRect &dest)
 
static void GetMinimizeRect (const wxRect &rect, wxRect &dest)
 
static void GetSyncLockHorizontalBounds (const wxRect &rect, wxRect &dest)
 
static void GetSyncLockIconRect (const wxRect &rect, wxRect &dest)
 
static bool HideTopItem (const wxRect &rect, const wxRect &subRect, int allowance=0)
 
static unsigned DefaultNoteTrackHeight ()
 
static unsigned DefaultWaveTrackHeight ()
 
static LWSliderGainSlider (const wxRect &sliderRect, const WaveTrack *t, bool captured, wxWindow *pParent)
 
static LWSliderPanSlider (const wxRect &sliderRect, const WaveTrack *t, bool captured, wxWindow *pParent)
 

Private Member Functions

void UpdatePrefs ()
 

Private Attributes

TrackPanelpParent
 

Static Private Attributes

static wxFont gFont
 
static std::unique_ptr< LWSlidergGainCaptured
 
static std::unique_ptr< LWSlidergPanCaptured
 
static std::unique_ptr< LWSlidergGain
 
static std::unique_ptr< LWSlidergPan
 

Friends

class TrackPanel
 

Detailed Description

The TrackInfo is shown to the side of a track It has the menus, pan and gain controls displayed in it. So "Info" is somewhat a misnomer. Should possibly be "TrackControls".

TrackPanel and not TrackInfo takes care of the functionality for each of the buttons in that panel.

In its current implementation TrackInfo is not derived from a wxWindow. Following the original coding style, it has been coded as a 'flyweight' class, which is passed state as needed, except for the array of gains and pans.

If we'd instead coded it as a wxWindow, we would have an instance of this class for each instance displayed.

Constructor & Destructor Documentation

TrackInfo::TrackInfo ( TrackPanel pParentIn)
TrackInfo::~TrackInfo ( )

Member Function Documentation

unsigned TrackInfo::DefaultNoteTrackHeight ( )
static
unsigned TrackInfo::DefaultWaveTrackHeight ( )
static

Referenced by WaveTrack::WaveTrack().

void TrackInfo::DrawBackground ( wxDC *  dc,
const wxRect &  rect,
bool  bSelected,
bool  bHasMuteSolo,
const int  labelw,
const int  vrul 
) const
void TrackInfo::DrawBordersWithin ( wxDC *  dc,
const wxRect &  rect,
const Track track 
) const
void TrackInfo::DrawItems ( TrackPanelDrawingContext context,
const wxRect &  rect,
const Track track 
)
static

Referenced by TrackPanel::DrawOutside().

void TrackInfo::DrawItems ( TrackPanelDrawingContext context,
const wxRect &  rect,
const Track pTrack,
const std::vector< TCPLine > &  topLines,
const std::vector< TCPLine > &  bottomLines 
)
static
LWSlider * TrackInfo::GainSlider ( const wxRect &  sliderRect,
const WaveTrack t,
bool  captured,
wxWindow *  pParent 
)
static
void TrackInfo::GainSliderDrawFunction ( TrackPanelDrawingContext context,
const wxRect &  rect,
const Track pTrack 
)
static
void TrackInfo::GetCloseBoxHorizontalBounds ( const wxRect &  rect,
wxRect &  dest 
)
static
void TrackInfo::GetCloseBoxRect ( const wxRect &  rect,
wxRect &  dest 
)
static
void TrackInfo::GetGainRect ( const wxPoint &  topLeft,
wxRect &  dest 
)
static
void TrackInfo::GetMinimizeHorizontalBounds ( const wxRect &  rect,
wxRect &  dest 
)
static
void TrackInfo::GetMinimizeRect ( const wxRect &  rect,
wxRect &  dest 
)
static
void TrackInfo::GetMuteSoloRect ( const wxRect &  rect,
wxRect &  dest,
bool  solo,
bool  bHasSoloButton,
const Track pTrack 
)
static
void TrackInfo::GetNarrowMuteHorizontalBounds ( const wxRect &  rect,
wxRect &  dest 
)
static
void TrackInfo::GetNarrowSoloHorizontalBounds ( const wxRect &  rect,
wxRect &  dest 
)
static
void TrackInfo::GetPanRect ( const wxPoint &  topLeft,
wxRect &  dest 
)
static
void TrackInfo::GetSliderHorizontalBounds ( const wxPoint &  topleft,
wxRect &  dest 
)
static

References kTrackInfoSliderWidth.

Referenced by GetGainRect(), and SliderDrawFunction().

void TrackInfo::GetSyncLockHorizontalBounds ( const wxRect &  rect,
wxRect &  dest 
)
static
void TrackInfo::GetSyncLockIconRect ( const wxRect &  rect,
wxRect &  dest 
)
static
void TrackInfo::GetTitleBarHorizontalBounds ( const wxRect &  rect,
wxRect &  dest 
)
static
void TrackInfo::GetTitleBarRect ( const wxRect &  rect,
wxRect &  dest 
)
static
int TrackInfo::GetTrackInfoWidth ( ) const

References kTrackInfoWidth.

Referenced by UpdatePrefs().

void TrackInfo::GetWideMuteSoloHorizontalBounds ( const wxRect &  rect,
wxRect &  dest 
)
static

References kTrackInfoBtnSize.

bool TrackInfo::HideTopItem ( const wxRect &  rect,
const wxRect &  subRect,
int  allowance = 0 
)
static
void TrackInfo::MidiControlsDrawFunction ( TrackPanelDrawingContext context,
const wxRect &  rect,
const Track pTrack 
)
static
unsigned TrackInfo::MinimumTrackHeight ( )
static
void TrackInfo::MuteAndSoloDrawFunction ( TrackPanelDrawingContext context,
const wxRect &  rect,
const Track pTrack 
)
static
void TrackInfo::MuteOrSoloDrawFunction ( wxDC *  dc,
const wxRect &  rect,
const Track pTrack,
bool  down,
bool  captured,
bool  solo,
bool  hit 
)
static
LWSlider * TrackInfo::PanSlider ( const wxRect &  sliderRect,
const WaveTrack t,
bool  captured,
wxWindow *  pParent 
)
static
void TrackInfo::PanSliderDrawFunction ( TrackPanelDrawingContext context,
const wxRect &  rect,
const Track pTrack 
)
static
void TrackInfo::ReCreateSliders ( )
void TrackInfo::SetTrackInfoFont ( wxDC *  dc)
static
Todo:
Probably should move to 'Utils.cpp'.

References gFont.

Referenced by DrawItems().

template<typename TrackClass >
void TrackInfo::SliderDrawFunction ( LWSlider *(*)(const wxRect &sliderRect, const TrackClass *t, bool captured, wxWindow *)  Selector,
wxDC *  dc,
const wxRect &  rect,
const Track pTrack,
bool  captured,
bool  highlight 
)
static
void TrackInfo::Status1DrawFunction ( TrackPanelDrawingContext context,
const wxRect &  rect,
const Track pTrack 
)
static

Returns the string to be displayed in the track label indicating whether the track is mono, left, right, or stereo and what sample rate it's using.

References _(), TrackPanelDrawingContext::dc, WaveTrack::GetRate(), Track::LeftChannel, Track::MonoChannel, and Track::RightChannel.

void TrackInfo::Status2DrawFunction ( TrackPanelDrawingContext context,
const wxRect &  rect,
const Track pTrack 
)
static
void TrackInfo::StatusDrawFunction ( const wxString &  string,
wxDC *  dc,
const wxRect &  rect 
)
static
void TrackInfo::UpdatePrefs ( )
private

References _(), GetTrackInfoWidth(), and gFont.

Referenced by TrackInfo(), and TrackPanel::UpdatePrefs().

void TrackInfo::WideMuteDrawFunction ( TrackPanelDrawingContext context,
const wxRect &  rect,
const Track pTrack 
)
static
void TrackInfo::WideSoloDrawFunction ( TrackPanelDrawingContext context,
const wxRect &  rect,
const Track pTrack 
)
static

Friends And Related Function Documentation

friend class TrackPanel
friend

Member Data Documentation

wxFont TrackInfo::gFont
staticprivate

Referenced by SetTrackInfoFont(), and UpdatePrefs().

std::unique_ptr< LWSlider > TrackInfo::gGain
staticprivate

Referenced by ReCreateSliders().

std::unique_ptr< LWSlider > TrackInfo::gGainCaptured
staticprivate

Referenced by ReCreateSliders().

std::unique_ptr< LWSlider > TrackInfo::gPan
staticprivate

Referenced by ReCreateSliders().

std::unique_ptr< LWSlider > TrackInfo::gPanCaptured
staticprivate

Referenced by ReCreateSliders().

TrackPanel* TrackInfo::pParent
private

Referenced by ReCreateSliders(), and TrackInfo().


The documentation for this class was generated from the following files: