17#include "../../ProjectAudioManager.h"
19#include "../../SelectUtilities.h"
20#include "../../RefreshCode.h"
24#include "../../TrackPanel.h"
25#include "../../TrackUtilities.h"
27#include "../../tracks/ui/ChannelView.h"
30(
const std::shared_ptr<Track> &pTrack,
const wxRect &rect )
43 if (
auto pTrack =
mpTrack.lock()) {
44 auto channels = pTrack->Channels();
46 for (
auto pChannel : channels)
64 ?
XO(
"Expand") :
XO(
"Collapse");
68(std::weak_ptr<MinimizeButtonHandle> &holder,
69 const wxMouseState &state,
const wxRect &rect,
TrackPanelCell *pCell)
74 if (buttonRect.Contains(state.m_x, state.m_y)) {
76 auto result = std::make_shared<MinimizeButtonHandle>( pTrack, buttonRect );
87(
const std::shared_ptr<Track> &pTrack,
const wxRect &rect )
122 auto name =
XO(
"Delete Track");
130 return commandManager.DescribeCommandsAndShortcuts( &command, 1u );
134(std::weak_ptr<CloseButtonHandle> &holder,
135 const wxMouseState &state,
const wxRect &rect,
TrackPanelCell *pCell)
140 if (buttonRect.Contains(state.m_x, state.m_y)) {
142 auto result = std::make_shared<CloseButtonHandle>( pTrack, buttonRect );
153(
const std::shared_ptr<TrackPanelCell> &pCell,
154 const std::shared_ptr<Track> &pTrack,
const wxRect &rect )
164(
const wxMouseEvent &,
AudacityProject *pProject, wxWindow *WXUNUSED(pParent))
167 auto pCell =
mpCell.lock();
174 trackPanel.CallAfter(
175 [&trackPanel,pTrack]{ trackPanel.OnTrackMenu( pTrack.get() ); } );
182 auto name =
XO(
"Open menu...");
190 return commandManager.DescribeCommandsAndShortcuts( &command, 1u );
194(std::weak_ptr<MenuButtonHandle> &holder,
195 const wxMouseState &state,
const wxRect &rect,
196 const std::shared_ptr<TrackPanelCell> &pCell)
201 if (buttonRect.Contains(state.m_x, state.m_y)) {
203 auto result = std::make_shared<MenuButtonHandle>( pCell, pTrack, buttonRect );
std::shared_ptr< UIHandle > UIHandlePtr
declares abstract base class Track, TrackList, and iterators over TrackList
std::shared_ptr< Subclass > AssignUIHandlePtr(std::weak_ptr< Subclass > &holder, const std::shared_ptr< Subclass > &pNew)
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
static ChannelView & Get(Channel &channel)
bool GetMinimized() const
void SetMinimized(bool minimized)
Subclass & Get(const RegisteredFactory &key)
Get reference to an attachment, creating on demand if not present, down-cast it to Subclass.
static CommandManager & Get(AudacityProject &project)
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
Track & SubstitutePendingChangedTrack(Track &track) const
static PendingTracks & Get(AudacityProject &project)
bool IsAudioActive() const
static ProjectAudioIO & Get(AudacityProject &project)
static ProjectAudioManager & Get(AudacityProject &project)
void ModifyState(bool bWantsAutoSave)
static ProjectHistory & Get(AudacityProject &project)
static TrackPanel & Get(AudacityProject &project)
Holds a msgid for the translation catalog; may also bind format arguments.
AUDACITY_DLL_API void GetCloseBoxRect(const wxRect &rect, wxRect &dest)
AUDACITY_DLL_API void GetTrackMenuButtonRect(const wxRect &rect, wxRect &dest)
AUDACITY_DLL_API void GetMinimizeRect(const wxRect &rect, wxRect &dest)
Namespace containing an enum 'what to do on a refresh?'.
AUDACITY_DLL_API void DoRemoveTrack(AudacityProject &project, Track &toRemove)