Audacity  3.0.3
Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
LabelGlyphHandle Class Referencefinal

#include <LabelGlyphHandle.h>

Inheritance diagram for LabelGlyphHandle:
[legend]
Collaboration diagram for LabelGlyphHandle:
[legend]

Public Member Functions

 LabelGlyphHandle (const std::shared_ptr< LabelTrack > &pLT, const wxRect &rect, const std::shared_ptr< LabelTrackHit > &pHit)
 
LabelGlyphHandleoperator= (const LabelGlyphHandle &)=default
 
virtual ~LabelGlyphHandle ()
 
void Enter (bool forward, AudacityProject *) override
 
Result Click (const TrackPanelMouseEvent &event, AudacityProject *pProject) override
 
Result Drag (const TrackPanelMouseEvent &event, AudacityProject *pProject) override
 
HitTestPreview Preview (const TrackPanelMouseState &state, AudacityProject *pProject) override
 
Result Release (const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *pParent) override
 
Result Cancel (AudacityProject *pProject) override
 
bool StopsOnKeystroke () override
 
- Public Member Functions inherited from LabelDefaultClickHandle
 LabelDefaultClickHandle ()
 
virtual ~LabelDefaultClickHandle ()
 
LabelDefaultClickHandleoperator= (const LabelDefaultClickHandle &)=default
 
- Public Member Functions inherited from UIHandle
virtual ~UIHandle ()=0
 
virtual bool HasRotation () const
 
virtual bool Rotate (bool forward)
 
virtual bool HasEscape () const
 
virtual bool Escape (AudacityProject *pProject)
 
virtual bool HandlesRightClick ()
 Whether the handle has any special right-button handling. More...
 
virtual void OnProjectChange (AudacityProject *pProject)
 
Result GetChangeHighlight () const
 
void SetChangeHighlight (Result val)
 
- Public Member Functions inherited from TrackPanelDrawable
virtual ~TrackPanelDrawable ()=0
 
virtual void Draw (TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass)
 
virtual wxRect DrawingArea (TrackPanelDrawingContext &context, const wxRect &rect, const wxRect &panelRect, unsigned iPass)
 

Static Public Member Functions

static UIHandlePtr HitTest (std::weak_ptr< LabelGlyphHandle > &holder, const wxMouseState &state, const std::shared_ptr< LabelTrack > &pLT, const wxRect &rect)
 
static UIHandle::Result NeedChangeHighlight (const LabelGlyphHandle &oldState, const LabelGlyphHandle &newState)
 
- Static Public Member Functions inherited from UIHandle
static UIHandle::Result NeedChangeHighlight (const UIHandle &, const UIHandle &)
 
- Static Public Member Functions inherited from TrackPanelDrawable
static wxRect MaximizeWidth (const wxRect &rect, const wxRect &panelRect)
 
static wxRect MaximizeHeight (const wxRect &rect, const wxRect &panelRect)
 

Public Attributes

std::shared_ptr< LabelTrackHitmpHit {}
 

Private Member Functions

void HandleGlyphClick (LabelTrackHit &hit, const wxMouseEvent &evt, const wxRect &r, const ZoomInfo &zoomInfo, NotifyingSelectedRegion &newSel)
 
bool HandleGlyphDragRelease (AudacityProject &project, LabelTrackHit &hit, const wxMouseEvent &evt, wxRect &r, const ZoomInfo &zoomInfo, NotifyingSelectedRegion &newSel)
 
void MayAdjustLabel (LabelTrackHit &hit, int iLabel, int iEdge, bool bAllowSwapping, double fNewTime)
 
void MayMoveLabel (int iLabel, int iEdge, double fNewTime)
 

Private Attributes

std::shared_ptr< LabelTrackmpLT {}
 
wxRect mRect {}
 
int mxMouseDisplacement
 Displacement of mouse cursor from the centre being dragged. More...
 

Additional Inherited Members

- Public Types inherited from UIHandle
using Result = unsigned
 
using Cell = TrackPanelCell
 
- Protected Attributes inherited from UIHandle
Result mChangeHighlight { 0 }
 

Detailed Description

Definition at line 49 of file LabelGlyphHandle.h.

Constructor & Destructor Documentation

◆ LabelGlyphHandle()

LabelGlyphHandle::LabelGlyphHandle ( const std::shared_ptr< LabelTrack > &  pLT,
const wxRect &  rect,
const std::shared_ptr< LabelTrackHit > &  pHit 
)
explicit

Definition at line 67 of file LabelGlyphHandle.cpp.

70  : mpHit{ pHit }
71  , mpLT{ pLT }
72  , mRect{ rect }
73 {
74 }

◆ ~LabelGlyphHandle()

LabelGlyphHandle::~LabelGlyphHandle ( )
virtual

Definition at line 114 of file LabelGlyphHandle.cpp.

115 {
116 }

Member Function Documentation

◆ Cancel()

UIHandle::Result LabelGlyphHandle::Cancel ( AudacityProject pProject)
overridevirtual

Reimplemented from LabelDefaultClickHandle.

Definition at line 470 of file LabelGlyphHandle.cpp.

471 {
472  ProjectHistory::Get( *pProject ).RollbackState();
473  auto result = LabelDefaultClickHandle::Cancel( pProject );
474  return result | RefreshCode::RefreshAll;
475 }

References LabelDefaultClickHandle::Cancel(), ProjectHistory::Get(), RefreshCode::RefreshAll, and ProjectHistory::RollbackState().

Here is the call graph for this function:

◆ Click()

UIHandle::Result LabelGlyphHandle::Click ( const TrackPanelMouseEvent event,
AudacityProject pProject 
)
overridevirtual

Reimplemented from LabelDefaultClickHandle.

Definition at line 197 of file LabelGlyphHandle.cpp.

199 {
200  auto result = LabelDefaultClickHandle::Click( evt, pProject );
201 
202  const wxMouseEvent &event = evt.event;
203  auto& selectionState = SelectionState::Get(*pProject);
204  auto& tracks = TrackList::Get(*pProject);
205 
206  auto &viewInfo = ViewInfo::Get( *pProject );
208  *mpHit, event, mRect, viewInfo, viewInfo.selectedRegion);
209 
210  if (! mpHit->mIsAdjustingLabel )
211  {
212  // The positive hit test should have ensured otherwise
213  //wxASSERT(false);
214  result |= RefreshCode::Cancelled;
215  }
216  else
217  // redraw the track.
218  result |= RefreshCode::RefreshCell;
219 
220  return result;
221 }

References RefreshCode::Cancelled, LabelDefaultClickHandle::Click(), TrackPanelMouseEvent::event, ViewInfo::Get(), SelectionState::Get(), TrackList::Get(), HandleGlyphClick(), mpHit, mRect, and RefreshCode::RefreshCell.

Here is the call graph for this function:

◆ Drag()

UIHandle::Result LabelGlyphHandle::Drag ( const TrackPanelMouseEvent event,
AudacityProject pProject 
)
overridevirtual

Reimplemented from LabelDefaultClickHandle.

Definition at line 415 of file LabelGlyphHandle.cpp.

417 {
418  auto result = LabelDefaultClickHandle::Drag( evt, pProject );
419 
420  const wxMouseEvent &event = evt.event;
421  auto &viewInfo = ViewInfo::Get( *pProject );
423  *pProject, *mpHit, event, mRect, viewInfo, viewInfo.selectedRegion);
424 
425  // Refresh all so that the change of selection is redrawn in all tracks
427 }

References LabelDefaultClickHandle::Drag(), RefreshCode::DrawOverlays, TrackPanelMouseEvent::event, ViewInfo::Get(), HandleGlyphDragRelease(), mpHit, mRect, and RefreshCode::RefreshAll.

Here is the call graph for this function:

◆ Enter()

void LabelGlyphHandle::Enter ( bool  forward,
AudacityProject  
)
overridevirtual

Reimplemented from UIHandle.

Definition at line 76 of file LabelGlyphHandle.cpp.

References UIHandle::mChangeHighlight, and RefreshCode::RefreshCell.

◆ HandleGlyphClick()

void LabelGlyphHandle::HandleGlyphClick ( LabelTrackHit hit,
const wxMouseEvent &  evt,
const wxRect &  r,
const ZoomInfo zoomInfo,
NotifyingSelectedRegion newSel 
)
private

Definition at line 118 of file LabelGlyphHandle.cpp.

122 {
123  if (evt.ButtonDown())
124  {
125  //OverGlyph sets mMouseOverLabel to be the chosen label.
126  const auto pTrack = mpLT;
127  LabelTrackView::OverGlyph(*pTrack, hit, evt.m_x, evt.m_y);
128 
129  hit.mIsAdjustingLabel = evt.Button(wxMOUSE_BTN_LEFT) &&
130  ( hit.mEdge & 3 ) != 0;
131 
132  if (hit.mIsAdjustingLabel)
133  {
134  auto& view = LabelTrackView::Get(*pTrack);
135  view.ResetTextSelection();
136 
137  double t = 0.0;
138 
139  // When we start dragging the label(s) we don't want them to jump.
140  // so we calculate the displacement of the mouse from the drag center
141  // and use that in subsequent dragging calculations. The mouse stays
142  // at the same relative displacement throughout dragging.
143 
144  // However, if two label's edges are being dragged
145  // then the displacement is relative to the initial average
146  // position of them, and in that case there can be a jump of at most
147  // a few pixels to bring the two label boundaries to exactly the same
148  // position when we start dragging.
149 
150  // Dragging of three label edges at the same time is not supported (yet).
151 
152  const auto &mLabels = pTrack->GetLabels();
153  if( ( hit.mMouseOverLabelRight >= 0 ) &&
154  ( hit.mMouseOverLabelLeft >= 0 )
155  )
156  {
157  t = (mLabels[ hit.mMouseOverLabelRight ].getT1() +
158  mLabels[ hit.mMouseOverLabelLeft ].getT0()) / 2.0f;
159 
160  // If we're moving two edges of same label then it's a move
161  // (label is shrunk to zero and size of zero is preserved)
162  // If we're on a boundary between two different labels,
163  // then it's an adjust.
164  // In both cases the two points coalesce.
165  //
166  // NOTE: seems that it's not neccessary that hitting the both
167  // left and right handles mean that we're dealing with a point,
168  // but the range will be turned into a point on click
169  bool isPointLabel = hit.mMouseOverLabelLeft == hit.mMouseOverLabelRight;
170  // Except! We don't coalesce if both ends are from the same label and
171  // we have deliberately chosen to preserve length, by holding shift down.
172  if (!(isPointLabel && evt.ShiftDown()))
173  {
174  MayAdjustLabel(hit, hit.mMouseOverLabelLeft, -1, false, t);
175  MayAdjustLabel(hit, hit.mMouseOverLabelRight, 1, false, t);
176  wxASSERT(mLabels[hit.mMouseOverLabelRight].getT1() ==
177  mLabels[hit.mMouseOverLabelLeft].getT0());
178  }
179  }
180  else if( hit.mMouseOverLabelRight >=0)
181  {
182  t = mLabels[ hit.mMouseOverLabelRight ].getT1();
183  }
184  else if( hit.mMouseOverLabelLeft >=0)
185  {
186  t = mLabels[ hit.mMouseOverLabelLeft ].getT0();
187  }
188  else if (hit.mMouseOverLabel >= 0)
189  {
190  t = mLabels[hit.mMouseOverLabel].getT0();
191  }
192  mxMouseDisplacement = zoomInfo.TimeToPosition(t, r.x) - evt.m_x;
193  }
194  }
195 }

References LabelTrackView::Get(), MayAdjustLabel(), LabelTrackHit::mEdge, LabelTrackHit::mIsAdjustingLabel, LabelTrackHit::mMouseOverLabel, LabelTrackHit::mMouseOverLabelLeft, LabelTrackHit::mMouseOverLabelRight, mpLT, mxMouseDisplacement, LabelTrackView::OverGlyph(), and ZoomInfo::TimeToPosition().

Referenced by Click().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HandleGlyphDragRelease()

bool LabelGlyphHandle::HandleGlyphDragRelease ( AudacityProject project,
LabelTrackHit hit,
const wxMouseEvent &  evt,
wxRect &  r,
const ZoomInfo zoomInfo,
NotifyingSelectedRegion newSel 
)
private

Definition at line 287 of file LabelGlyphHandle.cpp.

292 {
293  const auto pTrack = mpLT;
294  const auto &mLabels = pTrack->GetLabels();
295  if(evt.LeftUp())
296  {
297  bool updated = false;
298  if( hit.mMouseOverLabelLeft >= 0 ) {
299  auto labelStruct = mLabels[ hit.mMouseOverLabelLeft ];
300  updated |= labelStruct.updated;
301  labelStruct.updated = false;
302  pTrack->SetLabel( hit.mMouseOverLabelLeft, labelStruct );
303  }
304  if( hit.mMouseOverLabelRight >= 0 ) {
305  auto labelStruct = mLabels[ hit.mMouseOverLabelRight ];
306  updated |= labelStruct.updated;
307  labelStruct.updated = false;
308  pTrack->SetLabel( hit.mMouseOverLabelRight, labelStruct );
309  }
310 
311  if (hit.mMouseOverLabel >= 0)
312  {
313  auto labelStruct = mLabels[hit.mMouseOverLabel];
314  if (!labelStruct.updated)
315  {
316  //happens on click over bar between handles (without moving a cursor)
317  newSel = labelStruct.selectedRegion;
318 
319  // IF the user clicked a label, THEN select all other tracks by Label
320  // do nothing if at least one other track is selected
321  auto& selectionState = SelectionState::Get(project);
322  auto& tracks = TrackList::Get(project);
323 
324  bool done = tracks.Selected().any_of(
325  [&](const Track* track) { return track != static_cast<Track*>(pTrack.get()); }
326  );
327 
328  if (!done) {
329  //otherwise, select all tracks
330  for (auto t : tracks.Any())
331  selectionState.SelectTrack(*t, true, true);
332  }
333 
334  // Do this after, for its effect on TrackPanel's memory of last selected
335  // track (which affects shift-click actions)
336  selectionState.SelectTrack(*pTrack.get(), true, true);
337 
338  // PRL: bug1659 -- make selection change undo correctly
339  updated = !ProjectAudioIO::Get(project).IsAudioActive();
340 
341  auto& view = LabelTrackView::Get(*pTrack);
342  view.SetNavigationIndex(hit.mMouseOverLabel);
343  }
344  else
345  {
346  labelStruct.updated = false;
347  pTrack->SetLabel(hit.mMouseOverLabel, labelStruct);
348  updated = true;
349  }
350  }
351 
352  hit.mIsAdjustingLabel = false;
353  hit.mMouseOverLabelLeft = -1;
354  hit.mMouseOverLabelRight = -1;
355  hit.mMouseOverLabel = -1;
356  return updated;
357  }
358 
359  if(evt.Dragging())
360  {
361  //If we are currently adjusting a label,
362  //just reset its value and redraw.
363  // LL: Constrain to inside track rectangle for now. Should be changed
364  // to allow scrolling while dragging labels
365  int x = Constrain( evt.m_x + mxMouseDisplacement - r.x, 0, r.width);
366 
367  double fNewX = zoomInfo.PositionToTime(x, 0);
368  // Moving the whole ranged label(s)
369  if (hit.mMouseOverLabel != -1)
370  {
371  if (evt.ShiftDown())
372  {
373  auto dt = fNewX - mLabels[hit.mMouseOverLabel].getT0();
374  for (auto i = 0, count = static_cast<int>(mLabels.size()); i < count; ++i)
375  MayMoveLabel(i, -1, mLabels[i].getT0() + dt);
376  }
377  else
378  MayMoveLabel(hit.mMouseOverLabel, -1, fNewX);
379  }
380  // If we're on the 'dot' and nowe're moving,
381  // Though shift-down inverts that.
382  // and if both edges the same, then we're always moving the label.
383  else if((hit.mMouseOverLabelLeft == hit.mMouseOverLabelRight) || evt.ShiftDown())
384  {
385  MayMoveLabel( hit.mMouseOverLabelLeft, -1, fNewX );
386  MayMoveLabel( hit.mMouseOverLabelRight, +1, fNewX );
387  }
388  else
389  {
390  // If exactly one edge is selected we allow swapping
391  bool bAllowSwapping =
392  (hit.mMouseOverLabelLeft >= 0) !=
393  (hit.mMouseOverLabelRight >= 0);
394  MayAdjustLabel( hit, hit.mMouseOverLabelLeft, -1, bAllowSwapping, fNewX );
395  MayAdjustLabel( hit, hit.mMouseOverLabelRight, +1, bAllowSwapping, fNewX );
396  }
397 
398  const auto &view = LabelTrackView::Get( *pTrack );
399  auto navigationIndex = view.GetNavigationIndex(project);
400  if(navigationIndex != -1 &&
401  (navigationIndex == hit.mMouseOverLabel ||
402  navigationIndex == hit.mMouseOverLabelLeft ||
403  navigationIndex == hit.mMouseOverLabelRight))
404  {
405  //Set the selection region to be equal to
406  //the NEW size of the label.
407  newSel = mLabels[navigationIndex].selectedRegion;
408  }
409  pTrack->SortLabels();
410  }
411 
412  return false;
413 }

References Constrain(), ProjectAudioIO::Get(), SelectionState::Get(), TrackList::Get(), LabelTrackView::Get(), ProjectAudioIO::IsAudioActive(), MayAdjustLabel(), MayMoveLabel(), LabelTrackHit::mIsAdjustingLabel, LabelTrackHit::mMouseOverLabel, LabelTrackHit::mMouseOverLabelLeft, LabelTrackHit::mMouseOverLabelRight, mpLT, mxMouseDisplacement, and ZoomInfo::PositionToTime().

Referenced by Drag(), and Release().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HitTest()

UIHandlePtr LabelGlyphHandle::HitTest ( std::weak_ptr< LabelGlyphHandle > &  holder,
const wxMouseState &  state,
const std::shared_ptr< LabelTrack > &  pLT,
const wxRect &  rect 
)
static

Definition at line 90 of file LabelGlyphHandle.cpp.

94 {
95  // Allocate on heap because there are pointers to it when it is bound as
96  // an event sink, therefore it's not copyable; make it shared so
97  // LabelGlyphHandle can be copyable:
98  auto pHit = std::make_shared<LabelTrackHit>( pLT );
99 
100  LabelTrackView::OverGlyph(*pLT, *pHit, state.m_x, state.m_y);
101 
102  // IF edge!=0 THEN we've set the cursor and we're done.
103  // signal this by setting the tip.
104  if ( pHit->mEdge & 3 )
105  {
106  auto result = std::make_shared<LabelGlyphHandle>( pLT, rect, pHit );
107  result = AssignUIHandlePtr(holder, result);
108  return result;
109  }
110 
111  return {};
112 }

References AssignUIHandlePtr(), and LabelTrackView::OverGlyph().

Referenced by LabelTrackView::DetailedHitTest().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MayAdjustLabel()

void LabelGlyphHandle::MayAdjustLabel ( LabelTrackHit hit,
int  iLabel,
int  iEdge,
bool  bAllowSwapping,
double  fNewTime 
)
private

If the index is for a real label, adjust its left or right boundary. @iLabel - index of label, -1 for none. @iEdge - which edge is requested to move, -1 for left +1 for right. @bAllowSwapping - if we can switch which edge is being dragged. fNewTime - the NEW time for this edge of the label.

Definition at line 228 of file LabelGlyphHandle.cpp.

230 {
231  if( iLabel < 0 )
232  return;
233 
234  const auto pTrack = mpLT;
235  const auto &mLabels = pTrack->GetLabels();
236  auto labelStruct = mLabels[ iLabel ];
237 
238  // Adjust the requested edge.
239  bool flipped = labelStruct.AdjustEdge( iEdge, fNewTime );
240  // If the edges did not swap, then we are done.
241  if( ! flipped ) {
242  pTrack->SetLabel( iLabel, labelStruct );
243  return;
244  }
245 
246  // If swapping's not allowed we must also move the edge
247  // we didn't move. Then we're done.
248  if( !bAllowSwapping )
249  {
250  labelStruct.AdjustEdge( -iEdge, fNewTime );
251  pTrack->SetLabel( iLabel, labelStruct );
252  return;
253  }
254 
255  pTrack->SetLabel( iLabel, labelStruct );
256 
257  // Swap our record of what we are dragging.
259 }

References LabelTrackHit::mMouseOverLabelLeft, LabelTrackHit::mMouseOverLabelRight, mpLT, and anonymous_namespace{NoteTrack.cpp}::swap().

Referenced by HandleGlyphClick(), and HandleGlyphDragRelease().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MayMoveLabel()

void LabelGlyphHandle::MayMoveLabel ( int  iLabel,
int  iEdge,
double  fNewTime 
)
private

Definition at line 262 of file LabelGlyphHandle.cpp.

263 {
264  if( iLabel < 0 )
265  return;
266 
267  const auto pTrack = mpLT;
268  const auto &mLabels = pTrack->GetLabels();
269  auto labelStruct = mLabels[ iLabel ];
270  labelStruct.MoveLabel( iEdge, fNewTime );
271  pTrack->SetLabel( iLabel, labelStruct );
272 }

References mpLT.

Referenced by HandleGlyphDragRelease().

Here is the caller graph for this function:

◆ NeedChangeHighlight()

UIHandle::Result LabelGlyphHandle::NeedChangeHighlight ( const LabelGlyphHandle oldState,
const LabelGlyphHandle newState 
)
static

Definition at line 81 of file LabelGlyphHandle.cpp.

83 {
84  if (oldState.mpHit->mEdge != newState.mpHit->mEdge)
85  // pointer moves between the circle and the chevron
87  return 0;
88 }

References mpHit, and RefreshCode::RefreshCell.

◆ operator=()

LabelGlyphHandle& LabelGlyphHandle::operator= ( const LabelGlyphHandle )
default

◆ Preview()

HitTestPreview LabelGlyphHandle::Preview ( const TrackPanelMouseState state,
AudacityProject pProject 
)
overridevirtual

Implements UIHandle.

Definition at line 429 of file LabelGlyphHandle.cpp.

431 {
432  static wxCursor arrowCursor{ wxCURSOR_ARROW };
433  static auto handOpenCursor =
434  MakeCursor(wxCURSOR_HAND, RearrangeCursorXpm, 16, 16);
435  static auto handClosedCursor =
436  MakeCursor(wxCURSOR_HAND, RearrangingCursorXpm, 16, 16);
437 
438  if (mpHit->mMouseOverLabel != -1)
439  {
440  return {
441  XO("Drag label. Hold shift and drag to move all labels on the same track."),
442  mpHit->mIsAdjustingLabel ? &*handClosedCursor : &*handOpenCursor
443  };
444  }
445  else if ((mpHit->mEdge & 4) != 0)
446  return { XO("Drag one or more label boundaries."), &arrowCursor };
447  else
448  return { XO("Drag label boundary."), &arrowCursor };
449 }

References MakeCursor(), mpHit, and XO.

Here is the call graph for this function:

◆ Release()

UIHandle::Result LabelGlyphHandle::Release ( const TrackPanelMouseEvent event,
AudacityProject pProject,
wxWindow *  pParent 
)
overridevirtual

Reimplemented from LabelDefaultClickHandle.

Definition at line 451 of file LabelGlyphHandle.cpp.

454 {
455  auto result = LabelDefaultClickHandle::Release( evt, pProject, pParent );
456 
457  const wxMouseEvent &event = evt.event;
458  auto &viewInfo = ViewInfo::Get( *pProject );
460  *pProject, *mpHit, event, mRect, viewInfo, viewInfo.selectedRegion)) {
461  ProjectHistory::Get( *pProject ).PushState(XO("Modified Label"),
462  XO("Label Edit"),
464  }
465 
466  // Refresh all so that the change of selection is redrawn in all tracks
468 }

References CONSOLIDATE, RefreshCode::DrawOverlays, TrackPanelMouseEvent::event, ViewInfo::Get(), ProjectHistory::Get(), HandleGlyphDragRelease(), mpHit, mRect, ProjectHistory::PushState(), RefreshCode::RefreshAll, LabelDefaultClickHandle::Release(), and XO.

Here is the call graph for this function:

◆ StopsOnKeystroke()

bool LabelGlyphHandle::StopsOnKeystroke ( )
inlineoverridevirtual

Reimplemented from UIHandle.

Definition at line 83 of file LabelGlyphHandle.h.

83 { return true; }

Member Data Documentation

◆ mpHit

std::shared_ptr<LabelTrackHit> LabelGlyphHandle::mpHit {}

◆ mpLT

std::shared_ptr<LabelTrack> LabelGlyphHandle::mpLT {}
private

◆ mRect

wxRect LabelGlyphHandle::mRect {}
private

Definition at line 107 of file LabelGlyphHandle.h.

Referenced by Click(), Drag(), and Release().

◆ mxMouseDisplacement

int LabelGlyphHandle::mxMouseDisplacement
private

Displacement of mouse cursor from the centre being dragged.

Definition at line 110 of file LabelGlyphHandle.h.

Referenced by HandleGlyphClick(), and HandleGlyphDragRelease().


The documentation for this class was generated from the following files:
RefreshCode::DrawOverlays
@ DrawOverlays
Definition: RefreshCode.h:32
ViewInfo::Get
static ViewInfo & Get(AudacityProject &project)
Definition: ViewInfo.cpp:241
LabelDefaultClickHandle::Drag
Result Drag(const TrackPanelMouseEvent &event, AudacityProject *pProject) override
Definition: LabelDefaultClickHandle.cpp:83
LabelDefaultClickHandle::Click
Result Click(const TrackPanelMouseEvent &event, AudacityProject *pProject) override
Definition: LabelDefaultClickHandle.cpp:60
RefreshCode::RefreshAll
@ RefreshAll
Definition: RefreshCode.h:26
MakeCursor
std::unique_ptr< wxCursor > MakeCursor(int WXUNUSED(CursorId), const char *const pXpm[36], int HotX, int HotY)
Definition: TrackPanel.cpp:182
RefreshCode::Cancelled
@ Cancelled
Definition: RefreshCode.h:23
XO
#define XO(s)
Definition: Internat.h:31
LabelGlyphHandle::HandleGlyphDragRelease
bool HandleGlyphDragRelease(AudacityProject &project, LabelTrackHit &hit, const wxMouseEvent &evt, wxRect &r, const ZoomInfo &zoomInfo, NotifyingSelectedRegion &newSel)
Definition: LabelGlyphHandle.cpp:288
LabelGlyphHandle::MayAdjustLabel
void MayAdjustLabel(LabelTrackHit &hit, int iLabel, int iEdge, bool bAllowSwapping, double fNewTime)
Definition: LabelGlyphHandle.cpp:229
ProjectAudioIO::Get
static ProjectAudioIO & Get(AudacityProject &project)
Definition: ProjectAudioIO.cpp:22
ZoomInfo::TimeToPosition
wxInt64 TimeToPosition(double time, wxInt64 origin=0, bool ignoreFisheye=false) const
STM: Converts a project time to screen x position.
Definition: ZoomInfo.cpp:49
ProjectAudioIO::IsAudioActive
bool IsAudioActive() const
Definition: ProjectAudioIO.cpp:51
LabelTrackHit::mEdge
int mEdge
Definition: LabelGlyphHandle.h:37
LabelGlyphHandle::mRect
wxRect mRect
Definition: LabelGlyphHandle.h:107
UIHandle::mChangeHighlight
Result mChangeHighlight
Definition: UIHandle.h:139
LabelTrackView::OverGlyph
static void OverGlyph(const LabelTrack &track, LabelTrackHit &hit, int x, int y)
Definition: LabelTrackView.cpp:1209
LabelDefaultClickHandle::Cancel
Result Cancel(AudacityProject *pProject) override
Definition: LabelDefaultClickHandle.cpp:96
Constrain
static int Constrain(int value, int min, int max)
Definition: LabelGlyphHandle.cpp:276
LabelTrackHit::mMouseOverLabelRight
int mMouseOverLabelRight
Keeps track of which left label the mouse is currently over.
Definition: LabelGlyphHandle.h:41
LabelTrackHit::mMouseOverLabel
int mMouseOverLabel
Definition: LabelGlyphHandle.h:39
LabelTrackView::Get
static LabelTrackView & Get(LabelTrack &)
Definition: LabelTrackView.cpp:162
anonymous_namespace{NoteTrack.cpp}::swap
void swap(std::unique_ptr< Alg_seq > &a, std::unique_ptr< Alg_seq > &b)
Definition: NoteTrack.cpp:735
LabelGlyphHandle::HandleGlyphClick
void HandleGlyphClick(LabelTrackHit &hit, const wxMouseEvent &evt, const wxRect &r, const ZoomInfo &zoomInfo, NotifyingSelectedRegion &newSel)
Definition: LabelGlyphHandle.cpp:119
RefreshCode::RefreshCell
@ RefreshCell
Definition: RefreshCode.h:24
LabelGlyphHandle::mxMouseDisplacement
int mxMouseDisplacement
Displacement of mouse cursor from the centre being dragged.
Definition: LabelGlyphHandle.h:110
LabelTrackHit::mIsAdjustingLabel
bool mIsAdjustingLabel
Keeps track of which right label the mouse is currently over.
Definition: LabelGlyphHandle.h:42
LabelDefaultClickHandle::Release
Result Release(const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *pParent) override
Definition: LabelDefaultClickHandle.cpp:89
SelectionState::Get
static SelectionState & Get(AudacityProject &project)
Definition: SelectionState.cpp:20
ProjectHistory::PushState
void PushState(const TranslatableString &desc, const TranslatableString &shortDesc)
Definition: ProjectHistory.cpp:90
TrackList::Get
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:506
LabelGlyphHandle::mpLT
std::shared_ptr< LabelTrack > mpLT
Definition: LabelGlyphHandle.h:106
LabelGlyphHandle::mpHit
std::shared_ptr< LabelTrackHit > mpHit
Definition: LabelGlyphHandle.h:85
Track
Abstract base class for an object holding data associated with points on a time axis.
Definition: Track.h:239
ProjectHistory::RollbackState
void RollbackState()
Definition: ProjectHistory.cpp:117
UndoPush::CONSOLIDATE
@ CONSOLIDATE
AssignUIHandlePtr
std::shared_ptr< Subclass > AssignUIHandlePtr(std::weak_ptr< Subclass > &holder, const std::shared_ptr< Subclass > &pNew)
Definition: UIHandle.h:151
LabelTrackHit::mMouseOverLabelLeft
int mMouseOverLabelLeft
Keeps track of which (ranged) label the mouse is currently over.
Definition: LabelGlyphHandle.h:40
ProjectHistory::Get
static ProjectHistory & Get(AudacityProject &project)
Definition: ProjectHistory.cpp:26
ZoomInfo::PositionToTime
double PositionToTime(wxInt64 position, wxInt64 origin=0, bool ignoreFisheye=false) const
Definition: ZoomInfo.cpp:39
LabelGlyphHandle::MayMoveLabel
void MayMoveLabel(int iLabel, int iEdge, double fNewTime)
Definition: LabelGlyphHandle.cpp:262