![]() |
Audacity 3.2.0
|
Functions for drawing the track control panel, which 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...
Classes | |
struct | TCPLine |
Typedefs | |
using | TCPLines = std::vector< TCPLine > |
Functions | |
AUDACITY_DLL_API unsigned | MinimumTrackHeight () |
AUDACITY_DLL_API std::pair< int, int > | CalcItemY (const TCPLines &lines, unsigned iItem) |
AUDACITY_DLL_API unsigned | DefaultTrackHeight (const TCPLines &topLines) |
AUDACITY_DLL_API void | DrawItems (TrackPanelDrawingContext &context, const wxRect &rect, const Track &track) |
AUDACITY_DLL_API void | DrawItems (TrackPanelDrawingContext &context, const wxRect &rect, const Track *pTrack, const std::vector< TCPLine > &topLines, const std::vector< TCPLine > &bottomLines) |
AUDACITY_DLL_API void | DrawCloseButton (TrackPanelDrawingContext &context, const wxRect &bev, const Track *pTrack, ButtonHandle *target) |
AUDACITY_DLL_API void | CloseTitleDrawFunction (TrackPanelDrawingContext &context, const wxRect &rect, const Track *pTrack) |
AUDACITY_DLL_API void | MinimizeSyncLockDrawFunction (TrackPanelDrawingContext &context, const wxRect &rect, const Track *pTrack) |
AUDACITY_DLL_API void | SetTrackInfoFont (wxDC *dc) |
AUDACITY_DLL_API void | GetCloseBoxHorizontalBounds (const wxRect &rect, wxRect &dest) |
AUDACITY_DLL_API void | GetCloseBoxRect (const wxRect &rect, wxRect &dest) |
AUDACITY_DLL_API void | GetTitleBarHorizontalBounds (const wxRect &rect, wxRect &dest) |
AUDACITY_DLL_API void | GetTitleBarRect (const wxRect &rect, wxRect &dest) |
AUDACITY_DLL_API void | GetSliderHorizontalBounds (const wxPoint &topleft, wxRect &dest) |
AUDACITY_DLL_API void | GetMinimizeHorizontalBounds (const wxRect &rect, wxRect &dest) |
AUDACITY_DLL_API void | GetMinimizeRect (const wxRect &rect, wxRect &dest) |
AUDACITY_DLL_API void | GetSelectButtonHorizontalBounds (const wxRect &rect, wxRect &dest) |
AUDACITY_DLL_API void | GetSelectButtonRect (const wxRect &rect, wxRect &dest) |
AUDACITY_DLL_API void | GetSyncLockHorizontalBounds (const wxRect &rect, wxRect &dest) |
AUDACITY_DLL_API void | GetSyncLockIconRect (const wxRect &rect, wxRect &dest) |
AUDACITY_DLL_API bool | HideTopItem (const wxRect &rect, const wxRect &subRect, int allowance=0) |
AUDACITY_DLL_API void | UpdatePrefs (wxWindow *pParent) |
AUDACITY_DLL_API bool | HasSoloButton () |
Functions for drawing the track control panel, which 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".
It maintains global slider widget instances that are reparented and repositioned as needed for drawing and interaction with the user, interoperating with the custom panel subdivision implemented in CellularPanel and avoiding wxWidgets sizers
If we'd instead coded it as a wxWindow, we would have an instance of this class for each track displayed.
using TrackInfo::TCPLines = typedef std::vector< TCPLine > |
Definition at line 67 of file TrackInfo.h.
std::pair< int, int > TrackInfo::CalcItemY | ( | const TCPLines & | lines, |
unsigned | iItem | ||
) |
Definition at line 146 of file TrackInfo.cpp.
Referenced by GetCloseBoxRect(), PlayableTrackControls::GetEffectsRect(), WaveTrackControls::GetGainRect(), NoteTrackControls::GetMidiControlsRect(), PlayableTrackControls::GetMuteSoloRect(), WaveTrackControls::GetPanRect(), GetTitleBarRect(), and NoteTrackControls::GetVelocityRect().
void TrackInfo::CloseTitleDrawFunction | ( | TrackPanelDrawingContext & | context, |
const wxRect & | rect, | ||
const Track * | pTrack | ||
) |
Definition at line 300 of file TrackInfo.cpp.
References _, AColor::Arrow(), AColor::Bevel2(), ThemeBase::Colour(), TrackPanelDrawingContext::dc, DrawCloseButton(), GetCloseBoxHorizontalBounds(), Track::GetName(), Track::GetSelected(), GetTitleBarHorizontalBounds(), ButtonHandle::GetTrack(), TrackPanelDrawingContext::lastState, SetTrackInfoFont(), TrackPanelDrawingContext::target, and theTheme.
Referenced by commonTrackTCPLines().
unsigned TrackInfo::DefaultTrackHeight | ( | const TCPLines & | topLines | ) |
Definition at line 566 of file TrackInfo.cpp.
References anonymous_namespace{TrackInfo.cpp}::commonTrackTCPBottomLines, TrackView::DefaultHeight, kVerticalPadding, and anonymous_namespace{TrackInfo.cpp}::totalTCPLines().
Referenced by NoteTrackControls::DefaultNoteTrackHeight(), and WaveTrackControls::DefaultWaveTrackHeight().
void TrackInfo::DrawCloseButton | ( | TrackPanelDrawingContext & | context, |
const wxRect & | bev, | ||
const Track * | pTrack, | ||
ButtonHandle * | target | ||
) |
Definition at line 267 of file TrackInfo.cpp.
References AColor::Bevel2(), ThemeBase::Colour(), TrackPanelDrawingContext::dc, Track::GetSelected(), ButtonHandle::GetTrack(), ButtonHandle::IsClicked(), TrackPanelDrawingContext::lastState, AColor::Line(), and theTheme.
Referenced by CloseTitleDrawFunction(), and SubViewCloseHandle::Draw().
void TrackInfo::DrawItems | ( | TrackPanelDrawingContext & | context, |
const wxRect & | rect, | ||
const Track & | track | ||
) |
Definition at line 217 of file TrackInfo.cpp.
References anonymous_namespace{TrackInfo.cpp}::commonTrackTCPBottomLines, DrawItems(), TrackControls::Get(), and CommonTrackControls::GetTCPLines().
Referenced by CommonTrackControls::Draw(), and DrawItems().
void TrackInfo::DrawItems | ( | TrackPanelDrawingContext & | context, |
const wxRect & | rect, | ||
const Track * | pTrack, | ||
const std::vector< TCPLine > & | topLines, | ||
const std::vector< TCPLine > & | bottomLines | ||
) |
Definition at line 229 of file TrackInfo.cpp.
References ThemeBase::Colour(), TrackPanelDrawingContext::dc, HideTopItem(), SetTrackInfoFont(), and theTheme.
void TrackInfo::GetCloseBoxHorizontalBounds | ( | const wxRect & | rect, |
wxRect & | dest | ||
) |
Definition at line 457 of file TrackInfo.cpp.
References kTrackInfoBtnSize.
Referenced by CloseTitleDrawFunction(), GetCloseBoxRect(), and GetTitleBarHorizontalBounds().
void TrackInfo::GetCloseBoxRect | ( | const wxRect & | rect, |
wxRect & | dest | ||
) |
Definition at line 463 of file TrackInfo.cpp.
References CalcItemY(), commonTrackTCPLines(), GetCloseBoxHorizontalBounds(), and TrackInfo::TCPLine::kItemBarButtons.
Referenced by CloseButtonHandle::HitTest().
void TrackInfo::GetMinimizeHorizontalBounds | ( | const wxRect & | rect, |
wxRect & | dest | ||
) |
Definition at line 494 of file TrackInfo.cpp.
References GetSyncLockHorizontalBounds(), and kTrackInfoBtnSize.
Referenced by GetMinimizeRect(), GetSelectButtonHorizontalBounds(), and MinimizeSyncLockDrawFunction().
void TrackInfo::GetMinimizeRect | ( | const wxRect & | rect, |
wxRect & | dest | ||
) |
Definition at line 508 of file TrackInfo.cpp.
References anonymous_namespace{TrackInfo.cpp}::CalcBottomItemY(), anonymous_namespace{TrackInfo.cpp}::commonTrackTCPBottomLines, GetMinimizeHorizontalBounds(), and TrackInfo::TCPLine::kItemMinimize.
Referenced by MinimizeButtonHandle::HitTest().
void TrackInfo::GetSelectButtonHorizontalBounds | ( | const wxRect & | rect, |
wxRect & | dest | ||
) |
Definition at line 517 of file TrackInfo.cpp.
References GetMinimizeHorizontalBounds(), and GetSyncLockHorizontalBounds().
Referenced by GetSelectButtonRect(), and MinimizeSyncLockDrawFunction().
void TrackInfo::GetSelectButtonRect | ( | const wxRect & | rect, |
wxRect & | dest | ||
) |
Definition at line 534 of file TrackInfo.cpp.
References anonymous_namespace{TrackInfo.cpp}::CalcBottomItemY(), anonymous_namespace{TrackInfo.cpp}::commonTrackTCPBottomLines, GetSelectButtonHorizontalBounds(), and TrackInfo::TCPLine::kItemMinimize.
Referenced by SelectButtonHandle::HitTest().
void TrackInfo::GetSliderHorizontalBounds | ( | const wxPoint & | topleft, |
wxRect & | dest | ||
) |
Definition at line 488 of file TrackInfo.cpp.
References kTrackInfoSliderWidth.
Referenced by WaveTrackControls::GetGainRect(), NoteTrackControls::GetVelocityRect(), anonymous_namespace{NoteTrackControls.cpp}::SliderDrawFunction(), and anonymous_namespace{WaveTrackControls.cpp}::SliderDrawFunction().
void TrackInfo::GetSyncLockHorizontalBounds | ( | const wxRect & | rect, |
wxRect & | dest | ||
) |
Definition at line 543 of file TrackInfo.cpp.
References kTrackInfoBtnSize.
Referenced by GetMinimizeHorizontalBounds(), GetSelectButtonHorizontalBounds(), GetSyncLockIconRect(), and MinimizeSyncLockDrawFunction().
void TrackInfo::GetSyncLockIconRect | ( | const wxRect & | rect, |
wxRect & | dest | ||
) |
Definition at line 549 of file TrackInfo.cpp.
References anonymous_namespace{TrackInfo.cpp}::CalcBottomItemY(), anonymous_namespace{TrackInfo.cpp}::commonTrackTCPBottomLines, GetSyncLockHorizontalBounds(), and TrackInfo::TCPLine::kItemSyncLock.
void TrackInfo::GetTitleBarHorizontalBounds | ( | const wxRect & | rect, |
wxRect & | dest | ||
) |
Definition at line 471 of file TrackInfo.cpp.
References GetCloseBoxHorizontalBounds(), and TitleSoloBorderOverlap.
Referenced by CloseTitleDrawFunction(), and GetTitleBarRect().
void TrackInfo::GetTitleBarRect | ( | const wxRect & | rect, |
wxRect & | dest | ||
) |
Definition at line 480 of file TrackInfo.cpp.
References CalcItemY(), commonTrackTCPLines(), GetTitleBarHorizontalBounds(), and TrackInfo::TCPLine::kItemBarButtons.
Referenced by CommonTrackControls::DoContextMenu(), and MenuButtonHandle::HitTest().
bool TrackInfo::HasSoloButton | ( | ) |
Definition at line 95 of file TrackInfo.cpp.
References Settings::gSoloPref, settings(), and wxT().
Referenced by anonymous_namespace{PlayableTrackControls.cpp}::MuteAndSoloDrawFunction().
bool TrackInfo::HideTopItem | ( | const wxRect & | rect, |
const wxRect & | subRect, | ||
int | allowance = 0 |
||
) |
Definition at line 208 of file TrackInfo.cpp.
References anonymous_namespace{TrackInfo.cpp}::CalcBottomItemY(), anonymous_namespace{TrackInfo.cpp}::commonTrackTCPBottomLines, and TrackInfo::TCPLine::kHighestBottomItem.
Referenced by DrawItems(), EffectsButtonHandle::HitTest(), GainSliderHandle::HitTest(), MuteButtonHandle::HitTest(), NoteTrackButtonHandle::HitTest(), PanSliderHandle::HitTest(), and SoloButtonHandle::HitTest().
void TrackInfo::MinimizeSyncLockDrawFunction | ( | TrackPanelDrawingContext & | context, |
const wxRect & | rect, | ||
const Track * | pTrack | ||
) |
Definition at line 374 of file TrackInfo.cpp.
References _, AColor::Arrow(), AColor::Bevel2(), ThemeBase::Colour(), AColor::Dark(), TrackPanelDrawingContext::dc, TrackView::Get(), TrackView::GetMinimized(), GetMinimizeHorizontalBounds(), GetSelectButtonHorizontalBounds(), Track::GetSelected(), GetSyncLockHorizontalBounds(), ButtonHandle::GetTrack(), ThemeBase::Image(), SyncLock::IsSyncLockSelected(), TrackPanelDrawingContext::lastState, SetTrackInfoFont(), str, TrackPanelDrawingContext::target, and theTheme.
unsigned TrackInfo::MinimumTrackHeight | ( | ) |
Definition at line 196 of file TrackInfo.cpp.
References anonymous_namespace{TrackInfo.cpp}::commonTrackTCPBottomLines, commonTrackTCPLines(), and kVerticalPadding.
Referenced by anonymous_namespace{ViewMenus.cpp}::DoZoomFitV(), and CommonTrackView::GetMinimizedHeight().
void TrackInfo::SetTrackInfoFont | ( | wxDC * | dc | ) |
Definition at line 559 of file TrackInfo.cpp.
References settings().
Referenced by CloseTitleDrawFunction(), DrawItems(), anonymous_namespace{PlayableTrackControls.cpp}::EffectsDrawFunction(), MinimizeSyncLockDrawFunction(), and anonymous_namespace{PlayableTrackControls.cpp}::MuteOrSoloDrawFunction().
AUDACITY_DLL_API void TrackInfo::UpdatePrefs | ( | wxWindow * | pParent | ) |
Referenced by anonymous_namespace{NumericConverter.cpp}::anonymous_namespace{NumericConverter.cpp}::BeatsUpdater::BeatsUpdater(), and ThemedWindowWrapper< WindowBase >::UpdatePrefs().