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

#include <SampleHandle.h>

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

Public Member Functions

 SampleHandle (const std::shared_ptr< WaveTrack > &pTrack)
 
SampleHandleoperator= (const SampleHandle &)=default
 
virtual ~SampleHandle ()
 
std::shared_ptr< WaveTrackGetTrack () const
 
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 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 HitAnywhere (std::weak_ptr< SampleHandle > &holder, const wxMouseState &state, const std::shared_ptr< WaveTrack > &pTrack)
 
static UIHandlePtr HitTest (std::weak_ptr< SampleHandle > &holder, const wxMouseState &state, const wxRect &rect, const AudacityProject *pProject, const std::shared_ptr< WaveTrack > &pTrack)
 
- 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)
 

Private Member Functions

 SampleHandle (const SampleHandle &)=delete
 
float FindSampleEditingLevel (const wxMouseEvent &event, const ViewInfo &viewInfo, double t0)
 

Static Private Member Functions

static HitTestPreview HitPreview (const wxMouseState &state, const AudacityProject *pProject, bool unsafe)
 

Private Attributes

std::shared_ptr< WaveTrackmClickedTrack
 
wxRect mRect {}
 
sampleCount mClickedStartSample {}
 
sampleCount mLastDragSample {}
 
float mLastDragSampleValue {}
 
bool mAltKey {}
 

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 24 of file SampleHandle.h.

Constructor & Destructor Documentation

◆ SampleHandle() [1/2]

SampleHandle::SampleHandle ( const SampleHandle )
privatedelete

◆ SampleHandle() [2/2]

SampleHandle::SampleHandle ( const std::shared_ptr< WaveTrack > &  pTrack)
explicit

Definition at line 37 of file SampleHandle.cpp.

38  : mClickedTrack{ pTrack }
39 {
40 }

◆ ~SampleHandle()

SampleHandle::~SampleHandle ( )
virtual

Definition at line 163 of file SampleHandle.cpp.

164 {
165 }

Member Function Documentation

◆ Cancel()

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

Implements UIHandle.

Definition at line 429 of file SampleHandle.cpp.

430 {
431  mClickedTrack.reset();
432  ProjectHistory::Get( *pProject ).RollbackState();
434 }

References ProjectHistory::Get(), mClickedTrack, RefreshCode::RefreshCell, and ProjectHistory::RollbackState().

Referenced by Drag(), and Release().

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

◆ Click()

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

Someone has just clicked the mouse. What do we do?

We're in a track view and zoomed enough to see the samples.

Implements UIHandle.

Definition at line 189 of file SampleHandle.cpp.

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 }

References anonymous_namespace{SampleHandle.cpp}::adjustTime(), RefreshCode::Cancelled, TrackPanelMouseEvent::event, FindSampleEditingLevel(), floatSample, ViewInfo::Get(), ProjectAudioIO::Get(), ProjectAudioIO::IsAudioActive(), anonymous_namespace{SampleHandle.cpp}::IsSampleEditingPossible(), mAltKey, mClickedStartSample, mClickedTrack, mLastDragSample, mLastDragSampleValue, mRect, TrackPanelMouseEvent::rect, RefreshCode::RefreshCell, SMOOTHING_BRUSH_RADIUS, SMOOTHING_KERNEL_RADIUS, SMOOTHING_PROPORTION_MAX, and SMOOTHING_PROPORTION_MIN.

Here is the call graph for this function:

◆ Drag()

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

Implements UIHandle.

Definition at line 318 of file SampleHandle.cpp.

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 }

References Cancel(), RefreshCode::Cancelled, TrackPanelMouseEvent::event, FindSampleEditingLevel(), floatSample, ViewInfo::Get(), ProjectAudioIO::Get(), ProjectAudioIO::IsAudioActive(), mAltKey, mClickedStartSample, mClickedTrack, min(), mLastDragSample, mLastDragSampleValue, mRect, RefreshCode::RefreshCell, RefreshCode::RefreshNone, size, and values.

Here is the call graph for this function:

◆ Enter()

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

Reimplemented from UIHandle.

Definition at line 42 of file SampleHandle.cpp.

43 {
44 #ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
46 #endif
47 }

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

◆ FindSampleEditingLevel()

float SampleHandle::FindSampleEditingLevel ( const wxMouseEvent &  event,
const ViewInfo viewInfo,
double  t0 
)
private

Definition at line 436 of file SampleHandle.cpp.

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 }

References Envelope::GetValue(), mClickedTrack, min(), mRect, ZoomInfo::PositionToTime(), and ValueOfPixel().

Referenced by Click(), and Drag().

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

◆ GetTrack()

std::shared_ptr<WaveTrack> SampleHandle::GetTrack ( ) const
inline

Definition at line 45 of file SampleHandle.h.

45 { return mClickedTrack; }

References mClickedTrack.

Referenced by anonymous_namespace{WaveformView.cpp}::DrawClipWaveform().

Here is the caller graph for this function:

◆ HitAnywhere()

UIHandlePtr SampleHandle::HitAnywhere ( std::weak_ptr< SampleHandle > &  holder,
const wxMouseState &  state,
const std::shared_ptr< WaveTrack > &  pTrack 
)
static

Definition at line 72 of file SampleHandle.cpp.

75 {
76  auto result = std::make_shared<SampleHandle>( pTrack );
77  result = AssignUIHandlePtr(holder, result);
78  return result;
79 }

References AssignUIHandlePtr().

Referenced by WaveformView::DetailedHitTest(), and HitTest().

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

◆ HitPreview()

HitTestPreview SampleHandle::HitPreview ( const wxMouseState &  state,
const AudacityProject pProject,
bool  unsafe 
)
staticprivate

Definition at line 49 of file SampleHandle.cpp.

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 }

References MakeCursor(), and XO.

Referenced by Preview().

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

◆ HitTest()

UIHandlePtr SampleHandle::HitTest ( std::weak_ptr< SampleHandle > &  holder,
const wxMouseState &  state,
const wxRect &  rect,
const AudacityProject pProject,
const std::shared_ptr< WaveTrack > &  pTrack 
)
static

method that tells us if the mouse event landed on an editable sample

Definition at line 110 of file SampleHandle.cpp.

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 }

References anonymous_namespace{SampleHandle.cpp}::adjustTime(), fillZero, ViewInfo::Get(), Envelope::GetValue(), GetWaveYPos(), HitAnywhere(), and anonymous_namespace{SampleHandle.cpp}::SampleResolutionTest().

Referenced by WaveformView::DetailedHitTest().

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

◆ operator=()

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

◆ Preview()

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

Implements UIHandle.

Definition at line 401 of file SampleHandle.cpp.

403 {
404  const bool unsafe = ProjectAudioIO::Get( *pProject ).IsAudioActive();
405  return HitPreview(st.state, pProject, unsafe);
406 }

References ProjectAudioIO::Get(), HitPreview(), ProjectAudioIO::IsAudioActive(), and TrackPanelMouseState::state.

Here is the call graph for this function:

◆ Release()

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

Implements UIHandle.

Definition at line 408 of file SampleHandle.cpp.

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 }

References Cancel(), CONSOLIDATE, ProjectAudioIO::Get(), ProjectHistory::Get(), ProjectAudioIO::IsAudioActive(), mClickedTrack, ProjectHistory::PushState(), RefreshCode::RefreshNone, and XO.

Here is the call graph for this function:

◆ StopsOnKeystroke()

bool SampleHandle::StopsOnKeystroke ( )
inlineoverridevirtual

Reimplemented from UIHandle.

Definition at line 65 of file SampleHandle.h.

65 { return true; }

Member Data Documentation

◆ mAltKey

bool SampleHandle::mAltKey {}
private

Definition at line 77 of file SampleHandle.h.

Referenced by Click(), and Drag().

◆ mClickedStartSample

sampleCount SampleHandle::mClickedStartSample {}
private

Definition at line 74 of file SampleHandle.h.

Referenced by Click(), and Drag().

◆ mClickedTrack

std::shared_ptr<WaveTrack> SampleHandle::mClickedTrack
private

Definition at line 71 of file SampleHandle.h.

Referenced by Cancel(), Click(), Drag(), FindSampleEditingLevel(), GetTrack(), and Release().

◆ mLastDragSample

sampleCount SampleHandle::mLastDragSample {}
private

Definition at line 75 of file SampleHandle.h.

Referenced by Click(), and Drag().

◆ mLastDragSampleValue

float SampleHandle::mLastDragSampleValue {}
private

Definition at line 76 of file SampleHandle.h.

Referenced by Click(), and Drag().

◆ mRect

wxRect SampleHandle::mRect {}
private

Definition at line 72 of file SampleHandle.h.

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


The documentation for this class was generated from the following files:
size
size_t size
Definition: ffmpeg-2.3.6-single-header.h:412
ViewInfo::Get
static ViewInfo & Get(AudacityProject &project)
Definition: ViewInfo.cpp:241
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
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:182
SampleHandle::HitAnywhere
static UIHandlePtr HitAnywhere(std::weak_ptr< SampleHandle > &holder, const wxMouseState &state, const std::shared_ptr< WaveTrack > &pTrack)
Definition: SampleHandle.cpp:73
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::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:22
fillZero
@ fillZero
Definition: SampleFormat.h:54
ProjectAudioIO::IsAudioActive
bool IsAudioActive() const
Definition: ProjectAudioIO.cpp:51
floatSample
@ floatSample
Definition: SampleFormat.h:34
UIHandle::mChangeHighlight
Result mChangeHighlight
Definition: UIHandle.h:139
SMOOTHING_PROPORTION_MAX
static const double SMOOTHING_PROPORTION_MAX
Definition: SampleHandle.cpp:34
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
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
ProjectHistory::RollbackState
void RollbackState()
Definition: ProjectHistory.cpp:117
sampleCount
Positions or offsets within audio files need a wide type.
Definition: SampleCount.h:18
GetWaveYPos
int GetWaveYPos(float value, float min, float max, int height, bool dB, bool outer, float dBr, bool clip)
Definition: TrackArtist.cpp:136
UndoPush::CONSOLIDATE
@ CONSOLIDATE
ValueOfPixel
float ValueOfPixel(int yy, int height, bool offset, bool dB, double dBRange, float zoomMin, float zoomMax)
Definition: TrackArtist.cpp:192
AssignUIHandlePtr
std::shared_ptr< Subclass > AssignUIHandlePtr(std::weak_ptr< Subclass > &holder, const std::shared_ptr< Subclass > &pNew)
Definition: UIHandle.h:151
RefreshCode
Namespace containing an enum 'what to do on a refresh?'.
Definition: RefreshCode.h:16
SampleHandle::mAltKey
bool mAltKey
Definition: SampleHandle.h:77
values
const wxChar * values
Definition: Equalization.cpp:472
ArrayOf< float >
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