![]() |
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 142 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 296 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 562 of file TrackInfo.cpp.
References anonymous_namespace{TrackInfo.cpp}::commonTrackTCPBottomLines, ChannelView::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 263 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 213 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 225 of file TrackInfo.cpp.
References ThemeBase::Colour(), TrackPanelDrawingContext::dc, HideTopItem(), SetTrackInfoFont(), and theTheme.
void TrackInfo::GetCloseBoxHorizontalBounds | ( | const wxRect & | rect, |
wxRect & | dest | ||
) |
Definition at line 453 of file TrackInfo.cpp.
References kTrackInfoBtnSize.
Referenced by CloseTitleDrawFunction(), GetCloseBoxRect(), and GetTitleBarHorizontalBounds().
void TrackInfo::GetCloseBoxRect | ( | const wxRect & | rect, |
wxRect & | dest | ||
) |
Definition at line 459 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 490 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 504 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 513 of file TrackInfo.cpp.
References GetMinimizeHorizontalBounds(), and GetSyncLockHorizontalBounds().
Referenced by GetSelectButtonRect(), and MinimizeSyncLockDrawFunction().
void TrackInfo::GetSelectButtonRect | ( | const wxRect & | rect, |
wxRect & | dest | ||
) |
Definition at line 530 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 484 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 539 of file TrackInfo.cpp.
References kTrackInfoBtnSize.
Referenced by GetMinimizeHorizontalBounds(), GetSelectButtonHorizontalBounds(), GetSyncLockIconRect(), and MinimizeSyncLockDrawFunction().
void TrackInfo::GetSyncLockIconRect | ( | const wxRect & | rect, |
wxRect & | dest | ||
) |
Definition at line 545 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 467 of file TrackInfo.cpp.
References GetCloseBoxHorizontalBounds(), and TitleSoloBorderOverlap.
Referenced by CloseTitleDrawFunction(), and GetTitleBarRect().
void TrackInfo::GetTitleBarRect | ( | const wxRect & | rect, |
wxRect & | dest | ||
) |
Definition at line 476 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 91 of file TrackInfo.cpp.
References SoloBehaviorNone, and TracksBehaviorsSolo.
Referenced by anonymous_namespace{PlayableTrackControls.cpp}::MuteAndSoloDrawFunction().
bool TrackInfo::HideTopItem | ( | const wxRect & | rect, |
const wxRect & | subRect, | ||
int | allowance = 0 |
||
) |
Definition at line 204 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 370 of file TrackInfo.cpp.
References _, AColor::Arrow(), AColor::Bevel2(), ThemeBase::Colour(), AColor::Dark(), TrackPanelDrawingContext::dc, ChannelView::Get(), ChannelGroup::GetChannel(), ChannelView::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 192 of file TrackInfo.cpp.
References anonymous_namespace{TrackInfo.cpp}::commonTrackTCPBottomLines, commonTrackTCPLines(), and kVerticalPadding.
Referenced by anonymous_namespace{ViewMenus.cpp}::DoZoomFitV(), and CommonChannelView::GetMinimizedHeight().
void TrackInfo::SetTrackInfoFont | ( | wxDC * | dc | ) |
Definition at line 555 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 ThemedWindowWrapper< WindowBase >::UpdatePrefs().