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...
Typedefs | |
using | TCPLine = TrackInfo::TCPLine |
using | TCPLines = TrackInfo::TCPLines |
Functions | |
AUDACITY_DLL_API unsigned | MinimumTrackHeight () |
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 Channel *pChannel, UIHandle *target) |
AUDACITY_DLL_API void | CloseTitleDrawFunction (TrackPanelDrawingContext &context, const wxRect &rect, const Track *pTrack) |
AUDACITY_DLL_API void | SyncLockDrawFunction (TrackPanelDrawingContext &context, const wxRect &rect, const Track *pTrack) |
AUDACITY_DLL_API void | GetCloseBoxHorizontalBounds (const wxRect &rect, wxRect &dest) |
AUDACITY_DLL_API void | GetCloseBoxRect (const wxRect &rect, wxRect &dest) |
AUDACITY_DLL_API void | GetTrackTitleHorizontalBounds (const wxRect &rect, wxRect &dest) |
AUDACITY_DLL_API void | GetTrackTitleRect (const wxRect &rect, wxRect &dest) |
AUDACITY_DLL_API void | GetSliderHorizontalBounds (const wxRect &rect, wxRect &dest) |
AUDACITY_DLL_API void | GetTrackMenuButtonBounds (const wxRect &rect, wxRect &dest) |
AUDACITY_DLL_API void | GetTrackMenuButtonRect (const wxRect &rect, 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 | 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 const TCPLines & | StaticTCPLines () |
Variables | |
static constexpr auto | Margin = 4 |
static constexpr auto | ToolButtonSize = 16 |
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 CommonTrackInfo::TCPLine = typedef TrackInfo::TCPLine |
Definition at line 20 of file CommonTrackInfo.h.
using CommonTrackInfo::TCPLines = typedef TrackInfo::TCPLines |
Definition at line 21 of file CommonTrackInfo.h.
void CommonTrackInfo::CloseTitleDrawFunction | ( | TrackPanelDrawingContext & | context, |
const wxRect & | rect, | ||
const Track * | pTrack | ||
) |
Definition at line 219 of file CommonTrackInfo.cpp.
References _, ThemeBase::Bitmap(), ThemeBase::Colour(), TrackPanelDrawingContext::dc, anonymous_namespace{CommonTrackInfo.cpp}::DrawToolButtonBackground(), ChannelView::Get(), ChannelGroup::GetChannel(), GetCloseBoxHorizontalBounds(), ChannelView::GetMinimized(), GetMinimizeHorizontalBounds(), Track::GetName(), GetTrackMenuButtonBounds(), GetTrackTitleHorizontalBounds(), TrackInfo::SetTrackInfoFont(), TrackPanelDrawingContext::target, theTheme, and TrackArt::TruncateText().
Referenced by commonTrackTCPLines().
unsigned CommonTrackInfo::DefaultTrackHeight | ( | const TCPLines & | topLines | ) |
Definition at line 393 of file CommonTrackInfo.cpp.
References anonymous_namespace{CommonTrackInfo.cpp}::commonTrackTCPBottomLines, ChannelView::DefaultHeight, kVerticalPadding, Margin, and anonymous_namespace{CommonTrackInfo.cpp}::totalTCPLines().
Referenced by NoteTrackControls::DefaultNoteTrackHeight(), and WaveTrackControls::DefaultWaveTrackHeight().
void CommonTrackInfo::DrawCloseButton | ( | TrackPanelDrawingContext & | context, |
const wxRect & | bev, | ||
const Channel * | pChannel, | ||
UIHandle * | target | ||
) |
Definition at line 180 of file CommonTrackInfo.cpp.
References AColor::Bevel2(), ThemeBase::Bitmap(), TrackPanelDrawingContext::dc, UIHandle::FindTrack(), Channel::GetChannelGroup(), Track::GetSelected(), UIHandle::IsDragging(), TrackPanelDrawingContext::lastState, and theTheme.
Referenced by SubViewCloseHandle::Draw().
void CommonTrackInfo::DrawItems | ( | TrackPanelDrawingContext & | context, |
const wxRect & | rect, | ||
const Track & | track | ||
) |
Definition at line 131 of file CommonTrackInfo.cpp.
References anonymous_namespace{CommonTrackInfo.cpp}::commonTrackTCPBottomLines, DrawItems(), and TrackControls::Get().
Referenced by CommonTrackControls::Draw(), and DrawItems().
void CommonTrackInfo::DrawItems | ( | TrackPanelDrawingContext & | context, |
const wxRect & | rect, | ||
const Track * | pTrack, | ||
const std::vector< TCPLine > & | topLines, | ||
const std::vector< TCPLine > & | bottomLines | ||
) |
Definition at line 142 of file CommonTrackInfo.cpp.
References ThemeBase::Colour(), TrackPanelDrawingContext::dc, HideTopItem(), Margin, TrackInfo::SetTrackInfoFont(), and theTheme.
void CommonTrackInfo::GetCloseBoxHorizontalBounds | ( | const wxRect & | rect, |
wxRect & | dest | ||
) |
Definition at line 304 of file CommonTrackInfo.cpp.
References ToolButtonSize.
Referenced by CloseTitleDrawFunction(), GetCloseBoxRect(), and GetTrackTitleHorizontalBounds().
void CommonTrackInfo::GetCloseBoxRect | ( | const wxRect & | rect, |
wxRect & | dest | ||
) |
Definition at line 310 of file CommonTrackInfo.cpp.
References TrackInfo::CalcItemY(), commonTrackTCPLines(), GetCloseBoxHorizontalBounds(), TrackInfo::TCPLine::kItemBarButtons, and Margin.
Referenced by CloseButtonHandle::HitTest().
void CommonTrackInfo::GetMinimizeHorizontalBounds | ( | const wxRect & | rect, |
wxRect & | dest | ||
) |
Definition at line 360 of file CommonTrackInfo.cpp.
References GetTrackMenuButtonBounds(), anonymous_namespace{CommonTrackInfo.cpp}::Padding, and ToolButtonSize.
Referenced by CloseTitleDrawFunction(), GetMinimizeRect(), and GetTrackTitleHorizontalBounds().
void CommonTrackInfo::GetMinimizeRect | ( | const wxRect & | rect, |
wxRect & | dest | ||
) |
Definition at line 366 of file CommonTrackInfo.cpp.
References TrackInfo::CalcItemY(), commonTrackTCPLines(), GetMinimizeHorizontalBounds(), TrackInfo::TCPLine::kItemBarButtons, and Margin.
Referenced by MinimizeButtonHandle::HitTest().
void CommonTrackInfo::GetSliderHorizontalBounds | ( | const wxRect & | rect, |
wxRect & | dest | ||
) |
Definition at line 339 of file CommonTrackInfo.cpp.
References kTrackInfoSliderWidth.
Referenced by WaveTrackControls::GetPanRect(), NoteTrackControls::GetVelocityRect(), WaveTrackControls::GetVolumeRect(), anonymous_namespace{NoteTrackControls.cpp}::SliderDrawFunction(), and anonymous_namespace{WaveTrackControls.cpp}::SliderDrawFunction().
void CommonTrackInfo::GetSyncLockHorizontalBounds | ( | const wxRect & | rect, |
wxRect & | dest | ||
) |
Definition at line 377 of file CommonTrackInfo.cpp.
References kTrackInfoBtnSize.
Referenced by GetSyncLockIconRect(), and SyncLockDrawFunction().
void CommonTrackInfo::GetSyncLockIconRect | ( | const wxRect & | rect, |
wxRect & | dest | ||
) |
Definition at line 383 of file CommonTrackInfo.cpp.
References anonymous_namespace{CommonTrackInfo.cpp}::CalcBottomItemY(), anonymous_namespace{CommonTrackInfo.cpp}::commonTrackTCPBottomLines, GetSyncLockHorizontalBounds(), TrackInfo::TCPLine::kItemSyncLock, and Margin.
void CommonTrackInfo::GetTrackMenuButtonBounds | ( | const wxRect & | rect, |
wxRect & | dest | ||
) |
Definition at line 345 of file CommonTrackInfo.cpp.
References ToolButtonSize.
Referenced by CloseTitleDrawFunction(), GetMinimizeHorizontalBounds(), and GetTrackMenuButtonRect().
void CommonTrackInfo::GetTrackMenuButtonRect | ( | const wxRect & | rect, |
wxRect & | dest | ||
) |
Definition at line 351 of file CommonTrackInfo.cpp.
References TrackInfo::CalcItemY(), commonTrackTCPLines(), GetTrackMenuButtonBounds(), TrackInfo::TCPLine::kItemBarButtons, Margin, and ToolButtonSize.
Referenced by CommonTrackControls::DoContextMenu(), and MenuButtonHandle::HitTest().
void CommonTrackInfo::GetTrackTitleHorizontalBounds | ( | const wxRect & | rect, |
wxRect & | dest | ||
) |
Definition at line 319 of file CommonTrackInfo.cpp.
References GetCloseBoxHorizontalBounds(), GetMinimizeHorizontalBounds(), and anonymous_namespace{CommonTrackInfo.cpp}::Padding.
Referenced by CloseTitleDrawFunction(), and GetTrackTitleRect().
void CommonTrackInfo::GetTrackTitleRect | ( | const wxRect & | rect, |
wxRect & | dest | ||
) |
Definition at line 330 of file CommonTrackInfo.cpp.
References TrackInfo::CalcItemY(), commonTrackTCPLines(), GetTrackTitleHorizontalBounds(), TrackInfo::TCPLine::kItemBarButtons, and Margin.
bool CommonTrackInfo::HideTopItem | ( | const wxRect & | rect, |
const wxRect & | subRect, | ||
int | allowance = 0 |
||
) |
Definition at line 122 of file CommonTrackInfo.cpp.
References anonymous_namespace{CommonTrackInfo.cpp}::CalcBottomItemY(), anonymous_namespace{CommonTrackInfo.cpp}::commonTrackTCPBottomLines, and TrackInfo::TCPLine::kHighestBottomItem.
Referenced by DrawItems(), EffectsButtonHandle::HitTest(), MuteButtonHandle::HitTest(), NoteTrackButtonHandle::HitTest(), PanSliderHandle::HitTest(), SoloButtonHandle::HitTest(), VelocitySliderHandle::HitTest(), and VolumeSliderHandle::HitTest().
unsigned CommonTrackInfo::MinimumTrackHeight | ( | ) |
Definition at line 110 of file CommonTrackInfo.cpp.
References anonymous_namespace{CommonTrackInfo.cpp}::commonTrackTCPBottomLines, commonTrackTCPLines(), kVerticalPadding, and Margin.
Referenced by CommonChannelView::GetMinimizedHeight(), and ProjectWindow::MinimumTrackHeight().
const TCPLines & CommonTrackInfo::StaticTCPLines | ( | ) |
Definition at line 57 of file CommonTrackInfo.cpp.
References commonTrackTCPLines().
Referenced by CommonTrackControls::GetTCPLines(), PlayableTrackControls::StaticNoteTCPLines(), and PlayableTrackControls::StaticWaveTCPLines().
void CommonTrackInfo::SyncLockDrawFunction | ( | TrackPanelDrawingContext & | context, |
const wxRect & | rect, | ||
const Track * | pTrack | ||
) |
Definition at line 281 of file CommonTrackInfo.cpp.
References TrackPanelDrawingContext::dc, GetSyncLockHorizontalBounds(), ThemeBase::Image(), SyncLock::IsSyncLockSelected(), and theTheme.
|
staticconstexpr |
Definition at line 23 of file CommonTrackInfo.h.
Referenced by DefaultTrackHeight(), DrawItems(), GetCloseBoxRect(), PlayableTrackControls::GetEffectsButtonRect(), NoteTrackControls::GetMidiControlsRect(), GetMinimizeRect(), PlayableTrackControls::GetMuteSoloRect(), anonymous_namespace{PlayableTrackControls.cpp}::GetNarrowMuteHorizontalBounds(), anonymous_namespace{PlayableTrackControls.cpp}::GetNarrowSoloHorizontalBounds(), WaveTrackControls::GetPanRect(), GetSyncLockIconRect(), GetTrackMenuButtonRect(), GetTrackTitleRect(), NoteTrackControls::GetVelocityRect(), WaveTrackControls::GetVolumeRect(), MinimumTrackHeight(), PluginRegistrationDialog::PopulateOrExchange(), and WaveTrackControls::VolumeSlider().
|
staticconstexpr |
Definition at line 24 of file CommonTrackInfo.h.
Referenced by GetCloseBoxHorizontalBounds(), GetMinimizeHorizontalBounds(), GetTrackMenuButtonBounds(), and GetTrackMenuButtonRect().