Audacity  3.0.3
WaveTrackAffordanceControls.cpp
Go to the documentation of this file.
1 /*!********************************************************************
2 *
3  Audacity: A Digital Audio Editor
4 
5  WaveTrackAffordanceControls.cpp
6 
7  Vitaly Sverchinsky
8 
9  **********************************************************************/
10 
12 
13 #include <wx/dc.h>
14 #include <wx/frame.h>
15 
16 #include "../../../../AllThemeResources.h"
17 #include "../../../../TrackPanelMouseEvent.h"
18 #include "../../../../TrackArtist.h"
19 #include "../../../../TrackPanelDrawingContext.h"
20 #include "../../../../TrackPanelResizeHandle.h"
21 #include "ViewInfo.h"
22 #include "../../../../WaveTrack.h"
23 #include "../../../../WaveClip.h"
24 #include "../../../../UndoManager.h"
25 #include "../../../../ShuttleGui.h"
26 #include "../../../../ProjectWindows.h"
27 #include "../../../../commands/AudacityCommand.h"
28 #include "../../../ui/AffordanceHandle.h"
29 #include "../../../ui/TextEditHelper.h"
30 #include "WaveTrackView.h"//need only ClipParameters
31 
32 #include "../../../../ProjectHistory.h"
33 #include "../../../../SelectionState.h"
34 #include "../../../../RefreshCode.h"
35 #include "../../../../Theme.h"
36 #include "../../../../../images/Cursors.h"
37 #include "../../../../HitTestResult.h"
38 
40 {
41  std::shared_ptr<WaveClip> mTarget;
42 public:
43  WaveTrackAffordanceHandle(const std::shared_ptr<Track>& track, const std::shared_ptr<WaveClip>& target)
44  : AffordanceHandle(track), mTarget(target)
45  { }
46 
47  Result Click(const TrackPanelMouseEvent& event, AudacityProject* project) override
48  {
49  if (event.event.LeftDClick())
50  {
51  auto& viewInfo = ViewInfo::Get(*project);
52  auto affordanceRect = ClipParameters::GetClipRect(*mTarget.get(), viewInfo, event.rect);
53  if (affordanceRect.Contains(event.event.GetPosition()))
54  {
55  if (auto affordanceControl = std::dynamic_pointer_cast<WaveTrackAffordanceControls>(event.pCell))
56  {
57  return affordanceControl->StartEditClipName(project) ?
59  }
60  }
62  }
63  else
64  return AffordanceHandle::Click(event, project);
65  }
66 
68  {
69  auto& viewInfo = ViewInfo::Get(*project);
70  viewInfo.selectedRegion.setTimes(mTarget->GetOffset(), mTarget->GetEndTime());
71 
72  ProjectHistory::Get(*project).ModifyState(false);
73 
75  }
76 };
77 
79 {
80 public:
82 
84  {
85  return Symbol;
86  }
87  void PopulateOrExchange(ShuttleGui& S) override
88  {
89  S.AddSpace(0, 5);
90 
91  S.StartMultiColumn(2, wxALIGN_CENTER);
92  {
93  S.TieTextBox(XXO("Name:"), mName, 60);
94  }
95  S.EndMultiColumn();
96  }
97 public:
98  wxString mName;
99 };
100 
102 { XO("Set Wave Clip Name") };
103 
104 //Handle which is used to send mouse events to TextEditHelper
105 class WaveClipTitleEditHandle final : public UIHandle
106 {
107  std::shared_ptr<TextEditHelper> mHelper;
108 public:
109 
110  WaveClipTitleEditHandle(const std::shared_ptr<TextEditHelper>& helper)
111  : mHelper(helper)
112  { }
113 
114  Result Click(const TrackPanelMouseEvent& event, AudacityProject* project) override
115  {
116  if (mHelper->OnClick(event.event, project))
119  }
120 
121  Result Drag(const TrackPanelMouseEvent& event, AudacityProject* project) override
122  {
123  if (mHelper->OnDrag(event.event, project))
126  }
127 
128  HitTestPreview Preview(const TrackPanelMouseState& state, AudacityProject* pProject) override
129  {
130  static auto ibeamCursor =
131  ::MakeCursor(wxCURSOR_IBEAM, IBeamCursorXpm, 17, 16);
132  return {
133  XO("Click and drag to select text"),
134  ibeamCursor.get()
135  };
136  }
137 
138  Result Release(const TrackPanelMouseEvent& event, AudacityProject* project, wxWindow*) override
139  {
140  if (mHelper->OnRelease(event.event, project))
143  }
144 
145  Result Cancel(AudacityProject* project) override
146  {
147  if (mHelper)
148  {
149  mHelper->Cancel(project);
150  mHelper.reset();
151  }
153  }
154 };
155 
156 WaveTrackAffordanceControls::WaveTrackAffordanceControls(const std::shared_ptr<Track>& pTrack)
157  : CommonTrackCell(pTrack), mClipNameFont(wxFont(wxFontInfo()))
158 {
159  if (auto trackList = pTrack->GetOwner())
160  {
161  trackList->Bind(EVT_TRACKLIST_SELECTION_CHANGE,
163  this);
164  }
165 }
166 
167 std::vector<UIHandlePtr> WaveTrackAffordanceControls::HitTest(const TrackPanelMouseState& state, const AudacityProject* pProject)
168 {
169  std::vector<UIHandlePtr> results;
170 
171  auto px = state.state.m_x;
172  auto py = state.state.m_y;
173 
174  const auto rect = state.rect;
175 
176  const auto track = FindTrack();
177 
178  auto trackList = track->GetOwner();
179  if ((std::abs(rect.GetTop() - py) <= WaveTrackView::kChannelSeparatorThickness / 2)
180  && trackList
181  && !track->IsLeader())
182  {
183  //given that track is not a leader there always should be
184  //another track before this one
185  auto prev = --trackList->Find(track.get());
186  results.push_back(
188  mResizeHandle,
189  std::make_shared<TrackPanelResizeHandle>((*prev)->shared_from_this(), py)
190  )
191  );
192  }
193 
194  if (mTextEditHelper)
195  {
196  if(mTextEditHelper->GetBBox().Contains(px, py))
197  results.push_back(
200  std::make_shared<WaveClipTitleEditHandle>(mTextEditHelper)
201  )
202  );
203  }
204  else
205  {
206  const auto waveTrack = std::static_pointer_cast<WaveTrack>(track->SubstitutePendingChangedTrack());
207  std::shared_ptr<WaveClip> focusClip;
208  auto& zoomInfo = ViewInfo::Get(*pProject);
209  for (const auto& clip : waveTrack->GetClips())
210  {
211  auto affordanceRect = ClipParameters::GetClipRect(*clip.get(), zoomInfo, state.rect);
212  if (affordanceRect.Contains(px, py))
213  {
214  results.push_back(
217  std::make_shared<WaveTrackAffordanceHandle>(track, clip)
218  )
219  );
220  focusClip = clip;
221  break;
222  }
223  }
224  mFocusClip = focusClip;
225  }
226 
227  return results;
228 }
229 
230 void WaveTrackAffordanceControls::Draw(TrackPanelDrawingContext& context, const wxRect& rect, unsigned iPass)
231 {
232  if (iPass == TrackArtist::PassBackground) {
233  auto track = FindTrack();
234  const auto artist = TrackArtist::Get(context);
235 
236  TrackArt::DrawBackgroundWithSelection(context, rect, track.get(), artist->blankSelectedBrush, artist->blankBrush);
237 
238  const auto waveTrack = std::static_pointer_cast<WaveTrack>(track->SubstitutePendingChangedTrack());
239  const auto& zoomInfo = *artist->pZoomInfo;
240 
241  context.dc.SetClippingRegion(rect);
242 
243  context.dc.SetTextBackground(wxTransparentColor);
244  context.dc.SetTextForeground(theTheme.Colour(clrClipNameText));
245  context.dc.SetFont(mClipNameFont);
246 
247  auto px = context.lastState.m_x;
248  auto py = context.lastState.m_y;
249 
250  for (const auto& clip : waveTrack->GetClips())
251  {
252  auto affordanceRect
253  = ClipParameters::GetClipRect(*clip.get(), zoomInfo, rect);
254  if (affordanceRect.IsEmpty())
255  continue;
256 
257  auto selected = GetSelectedClip().lock() == clip;
258  auto highlight = selected || affordanceRect.Contains(px, py);
259  if (mTextEditHelper && mFocusClip.lock() == clip)
260  {
261  TrackArt::DrawClipAffordance(context.dc, affordanceRect, wxEmptyString, highlight, selected);
262  mTextEditHelper->Draw(context.dc, TrackArt::GetAffordanceTitleRect(affordanceRect));
263  }
264  else
265  TrackArt::DrawClipAffordance(context.dc, affordanceRect, clip->GetName(), highlight, selected);
266 
267  }
268  context.dc.DestroyClippingRegion();
269  }
270 }
271 
273 {
274  if (auto lock = mFocusClip.lock())
275  {
276  auto clip = lock.get();
277 
278  bool useDialog{ false };
279  gPrefs->Read(wxT("/GUI/DialogForNameNewLabel"), &useDialog, false);
280 
281  if (useDialog)
282  {
284  auto oldName = clip->GetName();
285  Command.mName = oldName;
286  auto result = Command.PromptUser(&GetProjectFrame(*project));
287  if (result && Command.mName != oldName)
288  {
289  clip->SetName(Command.mName);
290  ProjectHistory::Get(*project).PushState(XO("Modified Clip Name"),
291  XO("Clip Name Edit"), UndoPush::CONSOLIDATE);
292 
293  return true;
294  }
295  }
296  else
297  {
298  mTextEditHelper = MakeTextEditHelper(clip->GetName());
299  return true;
300  }
301  }
302  return false;
303 }
304 
305 std::weak_ptr<WaveClip> WaveTrackAffordanceControls::GetSelectedClip() const
306 {
307  if (auto handle = mAffordanceHandle.lock())
308  {
309  return handle->Clicked() ? mFocusClip : std::weak_ptr<WaveClip>();
310  }
311  return {};
312 }
313 
314 unsigned WaveTrackAffordanceControls::CaptureKey(wxKeyEvent& event, ViewInfo& viewInfo, wxWindow* pParent, AudacityProject* project)
315 {
316  const auto keyCode = event.GetKeyCode();
317  if (!mTextEditHelper && !(keyCode == WXK_RETURN || keyCode == WXK_NUMPAD_ENTER || keyCode == WXK_TAB))
318  event.Skip();
320 }
321 
322 
323 unsigned WaveTrackAffordanceControls::KeyDown(wxKeyEvent& event, ViewInfo& viewInfo, wxWindow*, AudacityProject* project)
324 {
325  auto keyCode = event.GetKeyCode();
326 
327  if (mTextEditHelper)
328  {
329  mTextEditHelper->OnKeyDown(keyCode, event.GetModifiers(), project);
330  if (!TextEditHelper::IsGoodEditKeyCode(keyCode))
331  event.Skip();
332  }
333  else
334  {
335  switch (keyCode)
336  {
337  case WXK_TAB: {
338  SelectNextClip(viewInfo, project, event.GetModifiers() != wxMOD_SHIFT);
339  } break;
340  case WXK_NUMPAD_ENTER:
341  case WXK_RETURN: {
342  const auto pred = [&viewInfo](const WaveClip& clip) {
343  return clip.GetStartTime() == viewInfo.selectedRegion.t0() &&
344  clip.GetEndTime() == viewInfo.selectedRegion.t1();
345  };
346  if (project)
347  StartEditNameOfMatchingClip(*project, pred);
348  break;
349  }
350  }
351  }
353 }
354 
355 unsigned WaveTrackAffordanceControls::Char(wxKeyEvent& event, ViewInfo& viewInfo, wxWindow* pParent, AudacityProject* project)
356 {
357  if (mTextEditHelper && mTextEditHelper->OnChar(event.GetUnicodeKey(), project))
360 }
361 
363 {
364  if (auto lock = mFocusClip.lock())
365  {
366  if (text != lock->GetName()) {
367  lock->SetName(text);
368 
369  ProjectHistory::Get(*project).PushState(XO("Modified Clip Name"),
370  XO("Clip Name Edit"), UndoPush::CONSOLIDATE);
371  }
372  }
373  mTextEditHelper.reset();
374 }
375 
377 {
378  mTextEditHelper.reset();
379 }
380 
382 {
383  //Nothing to do
384 }
385 
387 {
388 }
389 
391 {
392  if (mTextEditHelper)
393  {
394  auto trackList = FindTrack()->GetOwner();
395  if (trackList)
396  {
397  mTextEditHelper->Finish(trackList->GetOwner());
398  }
399  mTextEditHelper.reset();
400  }
401 }
402 
403 
404 
405 namespace {
406  template<typename Iter, typename Comp>
407  WaveClip* NextClipLooped(ViewInfo& viewInfo, Iter begin, Iter end, Comp comp)
408  {
409  auto it = std::find_if(begin, end, [&](WaveClip* clip) {
410  return clip->GetStartTime() == viewInfo.selectedRegion.t0() &&
411  clip->GetEndTime() == viewInfo.selectedRegion.t1();
412  });
413  if (it == end)
414  it = std::find_if(begin, end, comp);
415  else
416  it = std::next(it);
417 
418  if (it == end)
419  return *begin;
420  return *it;
421  }
422 }
423 
424 
426 {
427  //Iterates through clips in a looped manner
428  auto waveTrack = std::dynamic_pointer_cast<WaveTrack>(FindTrack());
429  if (!waveTrack)
430  return false;
431  auto clips = waveTrack->SortedClipArray();
432  if (clips.empty())
433  return false;
434 
435  WaveClip* clip{ };
436  if (forward)
437  {
438  clip = NextClipLooped(viewInfo, clips.begin(), clips.end(), [&](const WaveClip* other) {
439  return other->GetStartTime() >= viewInfo.selectedRegion.t1();
440  });
441  }
442  else
443  {
444  clip = NextClipLooped(viewInfo, clips.rbegin(), clips.rend(), [&](const WaveClip* other) {
445  return other->GetStartTime() <= viewInfo.selectedRegion.t0();
446  });
447  }
448 
449  viewInfo.selectedRegion.setTimes(clip->GetOffset(), clip->GetEndTime());
450  ProjectHistory::Get(*project).ModifyState(false);
451  return true;
452 }
453 
455  AudacityProject &project, std::function<bool(WaveClip&)> test )
456 {
457  //Attempts to invoke name editing if there is a selected clip
458  auto waveTrack = std::dynamic_pointer_cast<WaveTrack>(FindTrack());
459  if (!waveTrack)
460  return false;
461  auto clips = waveTrack->GetClips();
462 
463  auto it = std::find_if(clips.begin(), clips.end(),
464  [&](auto pClip){ return pClip && test && test(*pClip); });
465  if (it != clips.end())
466  {
467  mFocusClip = *it;
468  return StartEditClipName(&project);
469  }
470  return false;
471 }
472 
473 std::shared_ptr<TextEditHelper> WaveTrackAffordanceControls::MakeTextEditHelper(const wxString& text)
474 {
475  auto helper = std::make_shared<TextEditHelper>(shared_from_this(), text, mClipNameFont);
476  helper->SetTextColor(theTheme.Colour(clrClipNameText));
477  helper->SetTextSelectionColor(theTheme.Colour(clrClipNameTextSelection));
478  return helper;
479 }
480 
SetWaveClipNameCommand
Definition: WaveTrackAffordanceControls.cpp:79
TrackPanelMouseEvent::pCell
std::shared_ptr< TrackPanelCell > pCell
Definition: TrackPanelMouseEvent.h:61
ProjectHistory::ModifyState
void ModifyState(bool bWantsAutoSave)
Definition: ProjectHistory.cpp:124
ViewInfo::Get
static ViewInfo & Get(AudacityProject &project)
Definition: ViewInfo.cpp:161
SetWaveClipNameCommand::mName
wxString mName
Definition: WaveTrackAffordanceControls.cpp:98
WaveTrackView::kChannelSeparatorThickness
static constexpr int kChannelSeparatorThickness
Definition: WaveTrackView.h:91
WaveTrackAffordanceControls::mClipNameFont
wxFont mClipNameFont
Definition: WaveTrackAffordanceControls.h:44
TrackPanelMouseEvent::rect
const wxRect & rect
Definition: TrackPanelMouseEvent.h:59
RefreshCode::RefreshAll
@ RefreshAll
Definition: RefreshCode.h:26
RefreshCode::RefreshNone
@ RefreshNone
Definition: RefreshCode.h:21
WaveClipTitleEditHandle::Cancel
Result Cancel(AudacityProject *project) override
Definition: WaveTrackAffordanceControls.cpp:145
gPrefs
FileConfig * gPrefs
Definition: Prefs.cpp:70
WaveTrackAffordanceControls::KeyDown
unsigned KeyDown(wxKeyEvent &event, ViewInfo &viewInfo, wxWindow *pParent, AudacityProject *project) override
Definition: WaveTrackAffordanceControls.cpp:323
WaveClipTitleEditHandle::Drag
Result Drag(const TrackPanelMouseEvent &event, AudacityProject *project) override
Definition: WaveTrackAffordanceControls.cpp:121
WaveClipTitleEditHandle
Definition: WaveTrackAffordanceControls.cpp:106
WaveTrackAffordanceControls::OnTextEditFinished
void OnTextEditFinished(AudacityProject *project, const wxString &text) override
Definition: WaveTrackAffordanceControls.cpp:362
CommonTrackPanelCell::FindTrack
std::shared_ptr< Track > FindTrack()
Definition: CommonTrackPanelCell.h:46
TrackPanelDrawingContext
Definition: TrackPanelDrawingContext.h:22
WaveTrackAffordanceControls::mAffordanceHandle
std::weak_ptr< WaveTrackAffordanceHandle > mAffordanceHandle
Definition: WaveTrackAffordanceControls.h:38
MakeCursor
std::unique_ptr< wxCursor > MakeCursor(int WXUNUSED(CursorId), const char *const pXpm[36], int HotX, int HotY)
Definition: TrackPanel.cpp:182
ViewInfo
Definition: ViewInfo.h:169
ShuttleGui::AddSpace
wxSizerItem * AddSpace(int width, int height, int prop=0)
Definition: ShuttleGui.cpp:2459
WaveClip::GetEndTime
double GetEndTime() const
Definition: WaveClip.cpp:255
RefreshCode::Cancelled
@ Cancelled
Definition: RefreshCode.h:23
XO
#define XO(s)
Definition: Internat.h:31
WaveTrackAffordanceControls::StartEditNameOfMatchingClip
bool StartEditNameOfMatchingClip(AudacityProject &project, std::function< bool(WaveClip &)> test)
Definition: WaveTrackAffordanceControls.cpp:454
Track::GetOwner
std::shared_ptr< TrackList > GetOwner() const
Definition: Track.h:379
TrackPanelDrawingContext::dc
wxDC & dc
Definition: TrackPanelDrawingContext.h:23
ShuttleGuiBase::EndMultiColumn
void EndMultiColumn()
Definition: ShuttleGui.cpp:1238
WaveTrackAffordanceControls::mFocusClip
std::weak_ptr< WaveClip > mFocusClip
Definition: WaveTrackAffordanceControls.h:37
anonymous_namespace{WaveTrackAffordanceControls.cpp}::NextClipLooped
WaveClip * NextClipLooped(ViewInfo &viewInfo, Iter begin, Iter end, Comp comp)
Definition: WaveTrackAffordanceControls.cpp:407
WaveTrackAffordanceHandle::Click
Result Click(const TrackPanelMouseEvent &event, AudacityProject *project) override
Definition: WaveTrackAffordanceControls.cpp:47
TrackPanelMouseState::rect
const wxRect & rect
Definition: TrackPanelMouseEvent.h:39
ComponentInterfaceSymbol
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
Definition: ComponentInterfaceSymbol.h:27
NotifyingSelectedRegion::t1
double t1() const
Definition: ViewInfo.h:48
anonymous_namespace{Registry.cpp}::Comp
bool Comp(const CollectedItems::NewItem &a, const CollectedItems::NewItem &b)
Definition: Registry.cpp:484
ShuttleGuiBase::TieTextBox
wxTextCtrl * TieTextBox(const TranslatableString &Caption, wxString &Value, const int nChars=0)
Definition: ShuttleGui.cpp:1652
TrackArt::GetAffordanceTitleRect
AUDACITY_DLL_API wxRect GetAffordanceTitleRect(const wxRect &affordanceRect)
Definition: TrackArtist.cpp:332
UIHandle
Short-lived drawing and event-handling object associated with a TrackPanelCell.
Definition: UIHandle.h:35
WaveTrackView.h
WaveClip::GetStartTime
double GetStartTime() const
Definition: WaveClip.cpp:249
NotifyingSelectedRegion::setTimes
bool setTimes(double t0, double t1)
Definition: ViewInfo.cpp:62
ClipParameters::GetClipRect
static wxRect GetClipRect(const WaveClip &clip, const ZoomInfo &zoomInfo, const wxRect &viewRect)
Definition: WaveTrackView.cpp:1428
WaveTrackAffordanceControls.h
AffordanceHandle
Definition: AffordanceHandle.h:16
WaveClip
This allows multiple clips to be a part of one WaveTrack.
Definition: WaveClip.h:173
SetWaveClipNameCommand::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S) override
Definition: WaveTrackAffordanceControls.cpp:87
TrackArt::DrawClipAffordance
AUDACITY_DLL_API void DrawClipAffordance(wxDC &dc, const wxRect &affordanceRect, const wxString &title, bool highlight=false, bool selected=false)
Definition: TrackArtist.cpp:302
WaveClipTitleEditHandle::Preview
HitTestPreview Preview(const TrackPanelMouseState &state, AudacityProject *pProject) override
Definition: WaveTrackAffordanceControls.cpp:128
ViewInfo::selectedRegion
NotifyingSelectedRegion selectedRegion
Definition: ViewInfo.h:196
TrackArtist::Get
static TrackArtist * Get(TrackPanelDrawingContext &)
Definition: TrackArtist.cpp:79
XXO
#define XXO(s)
Definition: Internat.h:44
TrackListEvent
Notification of changes in individual tracks of TrackList, or of TrackList's composition.
Definition: Track.h:1222
SetWaveClipNameCommand::GetSymbol
ComponentInterfaceSymbol GetSymbol() override
Definition: WaveTrackAffordanceControls.cpp:83
WaveTrackAffordanceHandle
Definition: WaveTrackAffordanceControls.cpp:40
ShuttleGuiBase::StartMultiColumn
void StartMultiColumn(int nCols, int PositionFlags=wxALIGN_LEFT)
Definition: ShuttleGui.cpp:1229
UIHandle::Result
unsigned Result
Definition: UIHandle.h:38
TrackPanelDrawingContext::lastState
wxMouseState lastState
Definition: TrackPanelDrawingContext.h:25
WaveTrackAffordanceControls::mResizeHandle
std::weak_ptr< TrackPanelResizeHandle > mResizeHandle
Definition: WaveTrackAffordanceControls.h:39
WaveTrackAffordanceControls::GetSelectedClip
std::weak_ptr< WaveClip > GetSelectedClip() const
Definition: WaveTrackAffordanceControls.cpp:305
AudacityCommand
Base class for command in Audacity.
Definition: AudacityCommand.h:41
WaveTrackAffordanceControls::OnTextEditCancelled
void OnTextEditCancelled(AudacityProject *project) override
Definition: WaveTrackAffordanceControls.cpp:376
WaveTrackAffordanceControls::mTitleEditHandle
std::weak_ptr< WaveClipTitleEditHandle > mTitleEditHandle
Definition: WaveTrackAffordanceControls.h:40
AffordanceHandle::Click
Result Click(const TrackPanelMouseEvent &evt, AudacityProject *pProject) override
Definition: AffordanceHandle.cpp:63
WaveClipTitleEditHandle::mHelper
std::shared_ptr< TextEditHelper > mHelper
Definition: WaveTrackAffordanceControls.cpp:107
HitTestPreview
Definition: HitTestResult.h:20
WaveClipTitleEditHandle::Release
Result Release(const TrackPanelMouseEvent &event, AudacityProject *project, wxWindow *) override
Definition: WaveTrackAffordanceControls.cpp:138
WaveClipTitleEditHandle::Click
Result Click(const TrackPanelMouseEvent &event, AudacityProject *project) override
Definition: WaveTrackAffordanceControls.cpp:114
RefreshCode::RefreshCell
@ RefreshCell
Definition: RefreshCode.h:24
WaveTrackAffordanceHandle::SelectAt
UIHandle::Result SelectAt(const TrackPanelMouseEvent &event, AudacityProject *project) override
Definition: WaveTrackAffordanceControls.cpp:67
WaveTrackAffordanceControls::OnTextContextMenu
void OnTextContextMenu(AudacityProject *project, const wxPoint &position) override
Definition: WaveTrackAffordanceControls.cpp:386
ViewInfo.h
WaveTrackAffordanceControls::WaveTrackAffordanceControls
WaveTrackAffordanceControls(const std::shared_ptr< Track > &pTrack)
Definition: WaveTrackAffordanceControls.cpp:156
WaveTrackAffordanceControls::OnTrackChanged
void OnTrackChanged(TrackListEvent &evt)
Definition: WaveTrackAffordanceControls.cpp:390
ProjectHistory::PushState
void PushState(const TranslatableString &desc, const TranslatableString &shortDesc)
Definition: ProjectHistory.cpp:90
TrackArt::DrawBackgroundWithSelection
AUDACITY_DLL_API void DrawBackgroundWithSelection(TrackPanelDrawingContext &context, const wxRect &rect, const Track *track, const wxBrush &selBrush, const wxBrush &unselBrush, bool useSelection=true)
Definition: TrackArtist.cpp:502
WaveTrackAffordanceControls::Draw
void Draw(TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass) override
Definition: WaveTrackAffordanceControls.cpp:230
MenuTable::Command
std::unique_ptr< CommandItem > Command(const CommandID &name, const TranslatableString &label_in, void(Handler::*pmf)(const CommandContext &), CommandFlag flags, const CommandManager::Options &options={}, CommandHandlerFinder finder=FinderScope::DefaultFinder())
Definition: CommandManager.h:675
WaveTrackAffordanceControls::Char
unsigned Char(wxKeyEvent &event, ViewInfo &viewInfo, wxWindow *pParent, AudacityProject *project) override
Definition: WaveTrackAffordanceControls.cpp:355
AudacityProject
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:92
WaveClipTitleEditHandle::WaveClipTitleEditHandle
WaveClipTitleEditHandle(const std::shared_ptr< TextEditHelper > &helper)
Definition: WaveTrackAffordanceControls.cpp:110
WaveTrackAffordanceControls::StartEditClipName
bool StartEditClipName(AudacityProject *project)
Definition: WaveTrackAffordanceControls.cpp:272
WaveTrackAffordanceControls::OnTextModified
void OnTextModified(AudacityProject *project, const wxString &text) override
Definition: WaveTrackAffordanceControls.cpp:381
GetProjectFrame
AUDACITY_DLL_API wxFrame & GetProjectFrame(AudacityProject &project)
Get the top-level window associated with the project (as a wxFrame only, when you do not need to use ...
Definition: ProjectWindows.cpp:72
TrackPanelMouseEvent
Definition: TrackPanelMouseEvent.h:46
TrackPanelMouseState
Definition: TrackPanelMouseEvent.h:28
WaveTrackAffordanceHandle::WaveTrackAffordanceHandle
WaveTrackAffordanceHandle(const std::shared_ptr< Track > &track, const std::shared_ptr< WaveClip > &target)
Definition: WaveTrackAffordanceControls.cpp:43
WaveTrackAffordanceControls::SelectNextClip
bool SelectNextClip(ViewInfo &viewInfo, AudacityProject *project, bool forward)
Definition: WaveTrackAffordanceControls.cpp:425
WaveTrackAffordanceControls::MakeTextEditHelper
std::shared_ptr< TextEditHelper > MakeTextEditHelper(const wxString &text)
Definition: WaveTrackAffordanceControls.cpp:473
UndoPush::CONSOLIDATE
@ CONSOLIDATE
WaveTrackAffordanceControls::HitTest
std::vector< UIHandlePtr > HitTest(const TrackPanelMouseState &state, const AudacityProject *pProject) override
Definition: WaveTrackAffordanceControls.cpp:167
ThemeBase::Colour
wxColour & Colour(int iIndex)
Definition: Theme.cpp:1197
TextEditHelper::IsGoodEditKeyCode
static bool IsGoodEditKeyCode(int keyCode)
Definition: TextEditHelper.cpp:26
SetWaveClipNameCommand::Symbol
static const ComponentInterfaceSymbol Symbol
Definition: WaveTrackAffordanceControls.cpp:81
theTheme
AUDACITY_DLL_API Theme theTheme
Definition: Theme.cpp:203
NotifyingSelectedRegion::t0
double t0() const
Definition: ViewInfo.h:47
AssignUIHandlePtr
std::shared_ptr< Subclass > AssignUIHandlePtr(std::weak_ptr< Subclass > &holder, const std::shared_ptr< Subclass > &pNew)
Definition: UIHandle.h:151
WaveTrackAffordanceControls::mTextEditHelper
std::shared_ptr< TextEditHelper > mTextEditHelper
Definition: WaveTrackAffordanceControls.h:42
TrackArtist::PassBackground
@ PassBackground
Definition: TrackArtist.h:86
WaveTrackAffordanceControls::CaptureKey
unsigned CaptureKey(wxKeyEvent &event, ViewInfo &viewInfo, wxWindow *pParent, AudacityProject *project) override
Definition: WaveTrackAffordanceControls.cpp:314
TrackPanelMouseEvent::event
wxMouseEvent & event
Definition: TrackPanelMouseEvent.h:58
WaveTrackAffordanceHandle::mTarget
std::shared_ptr< WaveClip > mTarget
Definition: WaveTrackAffordanceControls.cpp:41
TrackPanelMouseState::state
wxMouseState & state
Definition: TrackPanelMouseEvent.h:38
ProjectHistory::Get
static ProjectHistory & Get(AudacityProject &project)
Definition: ProjectHistory.cpp:26
ShuttleGui
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:631
CommonTrackCell
Definition: CommonTrackPanelCell.h:99