Audacity  3.0.3
SampleHandle.cpp
Go to the documentation of this file.
1 /**********************************************************************
2 
3 Audacity: A Digital Audio Editor
4 
5 SampleHandle.cpp
6 
7 Paul Licameli split from TrackPanel.cpp
8 
9 **********************************************************************/
10 
11 
12 #include "SampleHandle.h"
13 
14 #include <algorithm>
15 #include <wx/gdicmn.h>
16 
17 #include "../../../../Envelope.h"
18 #include "../../../../HitTestResult.h"
19 #include "../../../../prefs/WaveformSettings.h"
20 #include "../../../../ProjectAudioIO.h"
21 #include "../../../../ProjectHistory.h"
22 #include "../../../../RefreshCode.h"
23 #include "../../../../TrackArtist.h"
24 #include "../../../../TrackPanelMouseEvent.h"
25 #include "../../../../UndoManager.h"
26 #include "../../../../ViewInfo.h"
27 #include "../../../../WaveTrack.h"
28 #include "../../../../../images/Cursors.h"
29 #include "../../../../widgets/AudacityMessageBox.h"
30 
31 
32 static const int SMOOTHING_KERNEL_RADIUS = 3;
33 static const int SMOOTHING_BRUSH_RADIUS = 5;
34 static const double SMOOTHING_PROPORTION_MAX = 0.7;
35 static const double SMOOTHING_PROPORTION_MIN = 0.0;
36 
37 SampleHandle::SampleHandle( const std::shared_ptr<WaveTrack> &pTrack )
38  : mClickedTrack{ pTrack }
39 {
40 }
41 
43 {
44 #ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
46 #endif
47 }
48 
50 (const wxMouseState &state, const AudacityProject *WXUNUSED(pProject), bool unsafe)
51 {
52  static auto disabledCursor =
53  ::MakeCursor(wxCURSOR_NO_ENTRY, DisabledCursorXpm, 16, 16);
54  static wxCursor smoothCursor{ wxCURSOR_SPRAYCAN };
55  static auto pencilCursor =
56  ::MakeCursor(wxCURSOR_PENCIL, DrawCursorXpm, 12, 22);
57 
58  // TODO: message should also mention the brush. Describing the modifier key
59  // (alt, or other) varies with operating system.
60  auto message = XO("Click and drag to edit the samples");
61 
62  return {
63  message,
64  (unsafe
65  ? &*disabledCursor
66  : (state.AltDown()
67  ? &smoothCursor
68  : &*pencilCursor))
69  };
70 }
71 
73 (std::weak_ptr<SampleHandle> &holder,
74  const wxMouseState &WXUNUSED(state), const std::shared_ptr<WaveTrack> &pTrack)
75 {
76  auto result = std::make_shared<SampleHandle>( pTrack );
77  result = AssignUIHandlePtr(holder, result);
78  return result;
79 }
80 
81 namespace {
82  inline double adjustTime(const WaveTrack *wt, double time)
83  {
84  // Round to an exact sample time
85  return wt->LongSamplesToTime(wt->TimeToLongSamples(time));
86  }
87 
88  // Is the sample horizontally nearest to the cursor sufficiently separated
89  // from its neighbors that the pencil tool should be allowed to drag it?
91  ( const ViewInfo &viewInfo, const WaveTrack *wt, double time, int width )
92  {
93  // Require more than 3 pixels per sample
94  const wxInt64 xx = std::max(wxInt64(0), viewInfo.TimeToPosition(time));
95  ZoomInfo::Intervals intervals;
96  const double rate = wt->GetRate();
97  viewInfo.FindIntervals(rate, intervals, width);
98  ZoomInfo::Intervals::const_iterator it = intervals.begin(),
99  end = intervals.end(), prev;
100  wxASSERT(it != end && it->position == 0);
101  do
102  prev = it++;
103  while (it != end && it->position <= xx);
104  const double threshold = 3 * rate;
105  // three times as many pixels per second, as samples
106  return prev->averageZoom > threshold;
107  }
108 }
109 
111 (std::weak_ptr<SampleHandle> &holder,
112  const wxMouseState &state, const wxRect &rect,
113  const AudacityProject *pProject, const std::shared_ptr<WaveTrack> &pTrack)
114 {
115  const auto &viewInfo = ViewInfo::Get( *pProject );
116 
119  const auto wavetrack = pTrack.get();
120  const auto time = viewInfo.PositionToTime(state.m_x, rect.x);
121 
122  const double tt = adjustTime(wavetrack, time);
123  if (!SampleResolutionTest(viewInfo, wavetrack, tt, rect.width))
124  return {};
125 
126  // Just get one sample.
127  float oneSample;
128  const double rate = wavetrack->GetRate();
129  const auto s0 = (sampleCount)(tt * rate + 0.5);
130  if (! wavetrack->GetFloats(&oneSample, s0, 1, fillZero,
131  // Do not propagate exception but return a failure value
132  false) )
133  return {};
134 
135  // Get y distance of envelope point from center line (in pixels).
136  float zoomMin, zoomMax;
137 
138  wavetrack->GetDisplayBounds(&zoomMin, &zoomMax);
139 
140  double envValue = 1.0;
141  Envelope* env = wavetrack->GetEnvelopeAtTime(time);
142  if (env)
143  // Calculate sample as it would be rendered, so quantize time
144  envValue = env->GetValue( tt, 1.0 / wavetrack->GetRate() );
145 
146  const bool dB = !wavetrack->GetWaveformSettings().isLinear();
147  int yValue = GetWaveYPos(oneSample * envValue,
148  zoomMin, zoomMax,
149  rect.height, dB, true,
150  wavetrack->GetWaveformSettings().dBRange, false) + rect.y;
151 
152  // Get y position of mouse (in pixels)
153  int yMouse = state.m_y;
154 
155  // Perhaps yTolerance should be put into preferences?
156  const int yTolerance = 10; // More tolerance on samples than on envelope.
157  if (abs(yValue - yMouse) >= yTolerance)
158  return {};
159 
160  return HitAnywhere(holder, state, pTrack);
161 }
162 
164 {
165 }
166 
167 namespace {
172  (const wxMouseEvent &event,
173  const wxRect &rect, const ViewInfo &viewInfo, WaveTrack *wt, int width)
174  {
175  //If we aren't zoomed in far enough, show a message dialog.
176  const double time = adjustTime(wt, viewInfo.PositionToTime(event.m_x, rect.x));
177  if (!SampleResolutionTest(viewInfo, wt, time, width))
178  {
180  XO(
181 "To use Draw, zoom in further until you can see the individual samples."),
182  XO("Draw Tool"));
183  return false;
184  }
185  return true;
186  }
187 }
188 
190 (const TrackPanelMouseEvent &evt, AudacityProject *pProject)
191 {
192  using namespace RefreshCode;
193  const bool unsafe = ProjectAudioIO::Get( *pProject ).IsAudioActive();
194  if ( unsafe )
195  return Cancelled;
196 
197  const wxMouseEvent &event = evt.event;
198  const wxRect &rect = evt.rect;
199  const auto &viewInfo = ViewInfo::Get( *pProject );
200  const auto pTrack = mClickedTrack.get();
201 
204  event, rect, viewInfo, pTrack, rect.width))
205  return Cancelled;
206 
208  mRect = rect;
209 
210  //If we are still around, we are drawing in earnest. Set some member data structures up:
211  //First, calculate the starting sample. To get this, we need the time
212  const double t0 =
213  adjustTime(mClickedTrack.get(), viewInfo.PositionToTime(event.m_x, rect.x));
214 
215  //convert t0 to samples
216  mClickedStartSample = mClickedTrack->TimeToLongSamples(t0);
217 
218  //Determine how drawing should occur. If alt is down,
219  //do a smoothing, instead of redrawing.
220  if (event.m_altDown)
221  {
222  mAltKey = true;
223  //*************************************************
224  //*** ALT-DOWN-CLICK (SAMPLE SMOOTHING) ***
225  //*************************************************
226  //
227  // Smoothing works like this: There is a smoothing kernel radius constant that
228  // determines how wide the averaging window is. Plus, there is a smoothing brush radius,
229  // which determines how many pixels wide around the selected pixel this smoothing is applied.
230  //
231  // Samples will be replaced by a mixture of the original points and the smoothed points,
232  // with a triangular mixing probability whose value at the center point is
233  // SMOOTHING_PROPORTION_MAX and at the far bounds is SMOOTHING_PROPORTION_MIN
234 
235  //Get the region of samples around the selected point
236  size_t sampleRegionSize = 1 + 2 * (SMOOTHING_KERNEL_RADIUS + SMOOTHING_BRUSH_RADIUS);
237  Floats sampleRegion{ sampleRegionSize };
238  Floats newSampleRegion{ 1 + 2 * (size_t)SMOOTHING_BRUSH_RADIUS };
239 
240  //Get a sample from the track to do some tricks on.
241  mClickedTrack->GetFloats(sampleRegion.get(),
243  sampleRegionSize);
244 
245  //Go through each point of the smoothing brush and apply a smoothing operation.
246  for (auto jj = -SMOOTHING_BRUSH_RADIUS; jj <= SMOOTHING_BRUSH_RADIUS; ++jj) {
247  float sumOfSamples = 0;
248  for (auto ii = -SMOOTHING_KERNEL_RADIUS; ii <= SMOOTHING_KERNEL_RADIUS; ++ii) {
249  //Go through each point of the smoothing kernel and find the average
250 
251  //The average is a weighted average, scaled by a weighting kernel that is simply triangular
252  // A triangular kernel across N items, with a radius of R ( 2 R + 1 points), if the farthest:
253  // points have a probability of a, the entire triangle has total probability of (R + 1)^2.
254  // For sample number ii and middle brush sample M, (R + 1 - abs(M-ii))/ ((R+1)^2) gives a
255  // legal distribution whose total probability is 1.
256  //
257  //
258  // weighting factor value
259  sumOfSamples +=
260  (SMOOTHING_KERNEL_RADIUS + 1 - abs(ii)) *
261  sampleRegion[ii + jj + SMOOTHING_KERNEL_RADIUS + SMOOTHING_BRUSH_RADIUS];
262 
263  }
264  newSampleRegion[jj + SMOOTHING_BRUSH_RADIUS] =
265  sumOfSamples /
267  }
268 
269 
270  // Now that the NEW sample levels are determined, go through each and mix it appropriately
271  // with the original point, according to a 2-part linear function whose center has probability
272  // SMOOTHING_PROPORTION_MAX and extends out SMOOTHING_BRUSH_RADIUS, at which the probability is
273  // SMOOTHING_PROPORTION_MIN. _MIN and _MAX specify how much of the smoothed curve make it through.
274 
275  float prob;
276 
277  for (auto jj = -SMOOTHING_BRUSH_RADIUS; jj <= SMOOTHING_BRUSH_RADIUS; ++jj) {
278 
279  prob =
281  (float)abs(jj) / SMOOTHING_BRUSH_RADIUS *
283 
284  newSampleRegion[jj + SMOOTHING_BRUSH_RADIUS] =
285  newSampleRegion[jj + SMOOTHING_BRUSH_RADIUS] * prob +
286  sampleRegion[SMOOTHING_BRUSH_RADIUS + SMOOTHING_KERNEL_RADIUS + jj] *
287  (1 - prob);
288  }
289  //Set the sample to the point of the mouse event
290  mClickedTrack->Set((samplePtr)newSampleRegion.get(), floatSample,
292 
293  // mLastDragSampleValue will not be used
294  }
295  else
296  {
297  mAltKey = false;
298  //*************************************************
299  //*** PLAIN DOWN-CLICK (NORMAL DRAWING) ***
300  //*************************************************
301 
302  //Otherwise (e.g., the alt button is not down) do normal redrawing, based on the mouse position.
303  const float newLevel = FindSampleEditingLevel(event, viewInfo, t0);
304 
305  //Set the sample to the point of the mouse event
307 
308  mLastDragSampleValue = newLevel;
309  }
310 
311  //Set the member data structures for drawing
313 
314  // Sample data changed on either branch, so refresh the track display.
315  return RefreshCell;
316 }
317 
319 (const TrackPanelMouseEvent &evt, AudacityProject *pProject)
320 {
321  using namespace RefreshCode;
322  const wxMouseEvent &event = evt.event;
323  const auto &viewInfo = ViewInfo::Get( *pProject );
324 
325  const bool unsafe = ProjectAudioIO::Get( *pProject ).IsAudioActive();
326  if (unsafe) {
327  this->Cancel(pProject);
328  return RefreshCell | Cancelled;
329  }
330 
331  //*************************************************
332  //*** DRAG-DRAWING ***
333  //*************************************************
334 
335  //No dragging effects if the alt key is down--
336  //Don't allow left-right dragging for smoothing operation
337  if (mAltKey)
338  return RefreshNone;
339 
340  sampleCount s0; //declare this for use below. It designates which sample number to draw.
341 
342  // Figure out what time the click was at
343  //Find the point that we want to redraw at. If the control button is down,
344  //adjust only the originally clicked-on sample
345 
346  if (event.m_controlDown) {
347  //*************************************************
348  //*** CTRL-DOWN (Hold Initial Sample Constant ***
349  //*************************************************
350 
351  s0 = mClickedStartSample;
352  }
353  else {
354  //*************************************************
355  //*** Normal CLICK-drag (Normal drawing) ***
356  //*************************************************
357 
358  //Otherwise, adjust the sample you are dragging over right now.
359  //convert this to samples
360  const double tt = viewInfo.PositionToTime(event.m_x, mRect.x);
361  s0 = mClickedTrack->TimeToLongSamples(tt);
362  }
363 
364  const double t0 = mClickedTrack->LongSamplesToTime(s0);
365 
366  // Do redrawing, based on the mouse position.
367  // Calculate where the mouse is located vertically (between +/- 1)
368 
369  const float newLevel = FindSampleEditingLevel(event, viewInfo, t0);
370 
371  //Now, redraw all samples between current and last redrawn sample, inclusive
372  //Go from the smaller to larger sample.
373  const auto start = std::min(s0, mLastDragSample);
374  const auto end = std::max(s0, mLastDragSample);
375  // Few enough samples to be drawn individually on screen will not
376  // overflow size_t:
377  const auto size = ( end - start + 1 ).as_size_t();
378  if (size == 1) {
379  mClickedTrack->Set((samplePtr)&newLevel, floatSample, start, size);
380  }
381  else {
382  std::vector<float> values(size);
383  for (auto ii = start; ii <= end; ++ii) {
384  //This interpolates each sample linearly:
385  // i - start will not overflow size_t either:
386  values[( ii - start ).as_size_t()] =
388  (ii - mLastDragSample).as_float() /
389  (s0 - mLastDragSample).as_float();
390  }
391  mClickedTrack->Set((samplePtr)&values[0], floatSample, start, size);
392  }
393 
394  //Update the member data structures.
395  mLastDragSample = s0;
396  mLastDragSampleValue = newLevel;
397 
398  return RefreshCell;
399 }
400 
402 (const TrackPanelMouseState &st, AudacityProject *pProject)
403 {
404  const bool unsafe = ProjectAudioIO::Get( *pProject ).IsAudioActive();
405  return HitPreview(st.state, pProject, unsafe);
406 }
407 
409 (const TrackPanelMouseEvent &, AudacityProject *pProject,
410  wxWindow *)
411 {
412  const bool unsafe = ProjectAudioIO::Get( *pProject ).IsAudioActive();
413  if (unsafe)
414  return this->Cancel(pProject);
415 
416  //*************************************************
417  //*** UP-CLICK (Finish drawing) ***
418  //*************************************************
419  //On up-click, send the state to the undo stack
420  mClickedTrack.reset(); //Set this to NULL so it will catch improper drag events.
421  ProjectHistory::Get( *pProject ).PushState(XO("Moved Samples"),
422  XO("Sample Edit"),
424 
425  // No change to draw since last drag
427 }
428 
430 {
431  mClickedTrack.reset();
432  ProjectHistory::Get( *pProject ).RollbackState();
434 }
435 
437  (const wxMouseEvent &event, const ViewInfo &viewInfo, double t0)
438 {
439  // Calculate where the mouse is located vertically (between +/- 1)
440  float zoomMin, zoomMax;
441  mClickedTrack->GetDisplayBounds(&zoomMin, &zoomMax);
442 
443  const int yy = event.m_y - mRect.y;
444  const int height = mRect.GetHeight();
445  const bool dB = !mClickedTrack->GetWaveformSettings().isLinear();
446  float newLevel =
447  ::ValueOfPixel(yy, height, false, dB,
448  mClickedTrack->GetWaveformSettings().dBRange, zoomMin, zoomMax);
449 
450  //Take the envelope into account
451  const auto time = viewInfo.PositionToTime(event.m_x, mRect.x);
452  Envelope *const env = mClickedTrack->GetEnvelopeAtTime(time);
453  if (env)
454  {
455  // Calculate sample as it would be rendered, so quantize time
456  double envValue = env->GetValue( t0, 1.0 / mClickedTrack->GetRate());
457  if (envValue > 0)
458  newLevel /= envValue;
459  else
460  newLevel = 0;
461 
462  //Make sure the NEW level is between +/-1
463  newLevel = std::max(-1.0f, std::min(1.0f, newLevel));
464  }
465 
466  return newLevel;
467 }
SampleHandle.h
ViewInfo::Get
static ViewInfo & Get(AudacityProject &project)
Definition: ViewInfo.cpp:156
anonymous_namespace{SampleHandle.cpp}::IsSampleEditingPossible
bool IsSampleEditingPossible(const wxMouseEvent &event, const wxRect &rect, const ViewInfo &viewInfo, WaveTrack *wt, int width)
Definition: SampleHandle.cpp:172
SampleHandle::Cancel
Result Cancel(AudacityProject *pProject) override
Definition: SampleHandle.cpp:429
WaveTrack
A Track that contains audio waveform data.
Definition: WaveTrack.h:69
AudacityMessageBox
int AudacityMessageBox(const TranslatableString &message, const TranslatableString &caption=XO("Message"), long style=wxOK|wxCENTRE, wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord)
Definition: AudacityMessageBox.h:20
SampleHandle::Enter
void Enter(bool forward, AudacityProject *) override
Definition: SampleHandle.cpp:42
TrackPanelMouseEvent::rect
const wxRect & rect
Definition: TrackPanelMouseEvent.h:59
RefreshCode::RefreshNone
@ RefreshNone
Definition: RefreshCode.h:21
SampleHandle::mLastDragSampleValue
float mLastDragSampleValue
Definition: SampleHandle.h:76
SampleHandle::mClickedStartSample
sampleCount mClickedStartSample
Definition: SampleHandle.h:74
MakeCursor
std::unique_ptr< wxCursor > MakeCursor(int WXUNUSED(CursorId), const char *const pXpm[36], int HotX, int HotY)
Definition: TrackPanel.cpp:176
SampleHandle::HitAnywhere
static UIHandlePtr HitAnywhere(std::weak_ptr< SampleHandle > &holder, const wxMouseState &state, const std::shared_ptr< WaveTrack > &pTrack)
Definition: SampleHandle.cpp:73
ViewInfo
Definition: ViewInfo.h:173
Envelope
Piecewise linear or piecewise exponential function from double to double.
Definition: Envelope.h:71
RefreshCode::Cancelled
@ Cancelled
Definition: RefreshCode.h:23
XO
#define XO(s)
Definition: Internat.h:31
anonymous_namespace{SampleHandle.cpp}::adjustTime
double adjustTime(const WaveTrack *wt, double time)
Definition: SampleHandle.cpp:82
SampleHandle::FindSampleEditingLevel
float FindSampleEditingLevel(const wxMouseEvent &event, const ViewInfo &viewInfo, double t0)
Definition: SampleHandle.cpp:437
SampleHandle::~SampleHandle
virtual ~SampleHandle()
Definition: SampleHandle.cpp:163
SampleHandle::HitPreview
static HitTestPreview HitPreview(const wxMouseState &state, const AudacityProject *pProject, bool unsafe)
Definition: SampleHandle.cpp:50
ProjectAudioIO::Get
static ProjectAudioIO & Get(AudacityProject &project)
Definition: ProjectAudioIO.cpp:23
fillZero
@ fillZero
Definition: SampleFormat.h:54
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:53
ProjectAudioIO::IsAudioActive
bool IsAudioActive() const
Definition: ProjectAudioIO.cpp:52
SampleHandle::Preview
HitTestPreview Preview(const TrackPanelMouseState &state, AudacityProject *pProject) override
Definition: SampleHandle.cpp:402
floatSample
@ floatSample
Definition: SampleFormat.h:34
UIHandle::mChangeHighlight
Result mChangeHighlight
Definition: UIHandle.h:133
WaveTrack::LongSamplesToTime
double LongSamplesToTime(sampleCount pos) const
Convert correctly between a number of samples and an (absolute) time in seconds.
Definition: WaveTrack.cpp:1775
SMOOTHING_PROPORTION_MAX
static const double SMOOTHING_PROPORTION_MAX
Definition: SampleHandle.cpp:34
UIHandle::Result
unsigned Result
Definition: UIHandle.h:37
SampleHandle::Drag
Result Drag(const TrackPanelMouseEvent &event, AudacityProject *pProject) override
Definition: SampleHandle.cpp:319
UIHandlePtr
std::shared_ptr< UIHandle > UIHandlePtr
Definition: CellularPanel.h:28
HitTestPreview
Definition: HitTestResult.h:20
SampleHandle::SampleHandle
SampleHandle(const SampleHandle &)=delete
SampleHandle::mLastDragSample
sampleCount mLastDragSample
Definition: SampleHandle.h:75
RefreshCode::RefreshCell
@ RefreshCell
Definition: RefreshCode.h:24
SMOOTHING_PROPORTION_MIN
static const double SMOOTHING_PROPORTION_MIN
Definition: SampleHandle.cpp:35
ZoomInfo::FindIntervals
void FindIntervals(double rate, Intervals &results, wxInt64 width, wxInt64 origin=0) const
Definition: ZoomInfo.cpp:112
samplePtr
char * samplePtr
Definition: SampleFormat.h:49
min
int min(int a, int b)
Definition: CompareAudioCommand.cpp:106
Envelope::GetValue
double GetValue(double t, double sampleDur=0) const
Get envelope value at time t.
Definition: Envelope.cpp:827
ProjectHistory::PushState
void PushState(const TranslatableString &desc, const TranslatableString &shortDesc)
Definition: ProjectHistory.cpp:90
SampleHandle::mClickedTrack
std::shared_ptr< WaveTrack > mClickedTrack
Definition: SampleHandle.h:71
SMOOTHING_KERNEL_RADIUS
static const int SMOOTHING_KERNEL_RADIUS
Definition: SampleHandle.cpp:32
SMOOTHING_BRUSH_RADIUS
static const int SMOOTHING_BRUSH_RADIUS
Definition: SampleHandle.cpp:33
anonymous_namespace{SampleHandle.cpp}::SampleResolutionTest
bool SampleResolutionTest(const ViewInfo &viewInfo, const WaveTrack *wt, double time, int width)
Definition: SampleHandle.cpp:91
SampleHandle::mRect
wxRect mRect
Definition: SampleHandle.h:72
WaveTrack::TimeToLongSamples
sampleCount TimeToLongSamples(double t0) const
Convert correctly between an (absolute) time in seconds and a number of samples.
Definition: WaveTrack.cpp:1770
ProjectHistory::RollbackState
void RollbackState()
Definition: ProjectHistory.cpp:117
sampleCount
Positions or offsets within audio files need a wide type.
Definition: SampleCount.h:18
AudacityProject
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:113
TrackPanelMouseEvent
Definition: TrackPanelMouseEvent.h:46
TrackPanelMouseState
Definition: TrackPanelMouseEvent.h:28
GetWaveYPos
int GetWaveYPos(float value, float min, float max, int height, bool dB, bool outer, float dBr, bool clip)
Definition: TrackArtist.cpp:135
UndoPush::CONSOLIDATE
@ CONSOLIDATE
ValueOfPixel
float ValueOfPixel(int yy, int height, bool offset, bool dB, double dBRange, float zoomMin, float zoomMax)
Definition: TrackArtist.cpp:191
AssignUIHandlePtr
std::shared_ptr< Subclass > AssignUIHandlePtr(std::weak_ptr< Subclass > &holder, const std::shared_ptr< Subclass > &pNew)
Definition: UIHandle.h:145
SampleHandle::Click
Result Click(const TrackPanelMouseEvent &event, AudacityProject *pProject) override
Definition: SampleHandle.cpp:190
RefreshCode
Namespace containing an enum 'what to do on a refresh?'.
Definition: RefreshCode.h:16
SampleHandle::mAltKey
bool mAltKey
Definition: SampleHandle.h:77
ZoomInfo::Intervals
std::vector< Interval > Intervals
Definition: ZoomInfo.h:144
values
const wxChar * values
Definition: Equalization.cpp:472
ArrayOf< float >
TrackPanelMouseEvent::event
wxMouseEvent & event
Definition: TrackPanelMouseEvent.h:58
TrackPanelMouseState::state
wxMouseState & state
Definition: TrackPanelMouseEvent.h:38
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:43
SampleHandle::Release
Result Release(const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *pParent) override
Definition: SampleHandle.cpp:409
SampleHandle::HitTest
static UIHandlePtr HitTest(std::weak_ptr< SampleHandle > &holder, const wxMouseState &state, const wxRect &rect, const AudacityProject *pProject, const std::shared_ptr< WaveTrack > &pTrack)
Definition: SampleHandle.cpp:111
WaveTrack::GetRate
double GetRate() const
Definition: WaveTrack.cpp:358