16#include "../../ProjectAudioManager.h"
18#include "../../SelectUtilities.h"
19#include "../../RefreshCode.h"
21#include "../../TrackPanelAx.h"
22#include "../../TrackInfo.h"
23#include "../../TrackPanel.h"
24#include "../../TrackUtilities.h"
25#include "../../commands/CommandManager.h"
26#include "../../tracks/ui/TrackView.h"
29(
const std::shared_ptr<Track> &pTrack,
const wxRect &rect )
47 for (
auto channel : channels)
65 ?
XO(
"Expand") :
XO(
"Collapse");
69(std::weak_ptr<MinimizeButtonHandle> &holder,
70 const wxMouseState &state,
const wxRect &rect,
TrackPanelCell *pCell)
75 if (buttonRect.Contains(state.m_x, state.m_y)) {
77 auto result = std::make_shared<MinimizeButtonHandle>( pTrack, buttonRect );
87(
const std::shared_ptr<Track> &pTrack,
const wxRect &rect )
105 pTrack.get(), event.ShiftDown(), event.ControlDown(), !unsafe);
116#if defined(__WXMAC__)
117 return pTrack->GetSelected() ?
XO(
"Command+Click to deselect") :
XO(
"Select track");
119 return pTrack->GetSelected() ?
XO(
"Ctrl+Click to deselect") :
XO(
"Select track");
124(std::weak_ptr<SelectButtonHandle> &holder,
125 const wxMouseState &state,
const wxRect &rect,
TrackPanelCell *pCell)
130 if (buttonRect.Contains(state.m_x, state.m_y)) {
132 auto result = std::make_shared<SelectButtonHandle>( pTrack, buttonRect );
143(
const std::shared_ptr<Track> &pTrack,
const wxRect &rect )
160 auto toRemove = pTrack->SubstitutePendingChangedTrack();
186 return commandManager.DescribeCommandsAndShortcuts( &command, 1u );
190(std::weak_ptr<CloseButtonHandle> &holder,
191 const wxMouseState &state,
const wxRect &rect,
TrackPanelCell *pCell)
196 if (buttonRect.Contains(state.m_x, state.m_y)) {
198 auto result = std::make_shared<CloseButtonHandle>( pTrack, buttonRect );
209(
const std::shared_ptr<TrackPanelCell> &pCell,
210 const std::shared_ptr<Track> &pTrack,
const wxRect &rect )
220(
const wxMouseEvent &,
AudacityProject *pProject, wxWindow *WXUNUSED(pParent))
223 auto pCell =
mpCell.lock();
230 trackPanel.CallAfter(
231 [&trackPanel,pTrack]{ trackPanel.OnTrackMenu( pTrack.get() ); } );
238 auto name =
XO(
"Open menu...");
246 return commandManager.DescribeCommandsAndShortcuts( &command, 1u );
250(std::weak_ptr<MenuButtonHandle> &holder,
251 const wxMouseState &state,
const wxRect &rect,
252 const std::shared_ptr<TrackPanelCell> &pCell)
257 if (buttonRect.Contains(state.m_x, state.m_y)) {
259 auto result = std::make_shared<MenuButtonHandle>( pCell, pTrack, buttonRect );
std::shared_ptr< UIHandle > UIHandlePtr
const TranslatableString name
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...
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,...
bool IsAudioActive() const
static ProjectAudioIO & Get(AudacityProject &project)
static ProjectAudioManager & Get(AudacityProject &project)
void ModifyState(bool bWantsAutoSave)
static ProjectHistory & Get(AudacityProject &project)
static auto Channels(TrackType *pTrack) -> TrackIterRange< TrackType >
static TrackPanel & Get(AudacityProject &project)
void SetMinimized(bool minimized)
bool GetMinimized() const
static TrackView & Get(Track &)
Holds a msgid for the translation catalog; may also bind format arguments.
Namespace containing an enum 'what to do on a refresh?'.
void DoListSelection(AudacityProject &project, Track *t, bool shift, bool ctrl, bool modifyState)
AUDACITY_DLL_API void GetCloseBoxRect(const wxRect &rect, wxRect &dest)
AUDACITY_DLL_API void GetTitleBarRect(const wxRect &rect, wxRect &dest)
AUDACITY_DLL_API void GetMinimizeRect(const wxRect &rect, wxRect &dest)
AUDACITY_DLL_API void GetSelectButtonRect(const wxRect &rect, wxRect &dest)
void DoRemoveTrack(AudacityProject &project, Track *toRemove)
std::shared_ptr< Track > FindTrack(TrackPanelCell *pCell)