summaryrefslogtreecommitdiff
path: root/libs/waveview
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2017-09-18 12:39:17 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2017-09-18 12:39:17 -0400
commit30b087ab3d28f1585987fa3f6ae006562ae192e3 (patch)
tree620ae0250b5d77f90a18f8c2b83be61e4fe7b0b5 /libs/waveview
parentcb956e3e480716a3efd280a5287bdd7bee1cedc5 (diff)
globally change all use of "frame" to refer to audio into "sample".
Generated by tools/f2s. Some hand-editing will be required in a few places to fix up comments related to timecode and video in order to keep the legible
Diffstat (limited to 'libs/waveview')
-rw-r--r--libs/waveview/wave_view.cc24
-rw-r--r--libs/waveview/waveview/wave_view.h8
-rw-r--r--libs/waveview/waveview/wave_view_private.h32
3 files changed, 32 insertions, 32 deletions
diff --git a/libs/waveview/wave_view.cc b/libs/waveview/wave_view.cc
index e794dd48a3..7b7f7c28eb 100644
--- a/libs/waveview/wave_view.cc
+++ b/libs/waveview/wave_view.cc
@@ -848,7 +848,7 @@ WaveView::draw_image (Cairo::RefPtr<Cairo::ImageSurface>& image, PeakData* peaks
context->fill ();
}
-framecnt_t
+samplecnt_t
WaveView::optimal_image_width_samples () const
{
/* Compute how wide the image should be in samples.
@@ -865,15 +865,15 @@ WaveView::optimal_image_width_samples () const
* the canvas that are the width of the canvas then we don't want to have to
* draw the images for them all at once as it will cause a spike in render
* time, or in threaded rendering mode it will mean all the draw requests will
- * the queued during the same frame/expose event. This issue can be
+ * the queued during the same sample/expose event. This issue can be
* alleviated by using an element of randomness in selecting the image width.
*
* If the value of samples per pixel is less than 1/10th of a second, use
* 1/10th of a second instead.
*/
- framecnt_t canvas_width_samples = _canvas->visible_area().width() * _props->samples_per_pixel;
- const framecnt_t one_tenth_of_second = _region->session().frame_rate() / 10;
+ samplecnt_t canvas_width_samples = _canvas->visible_area().width() * _props->samples_per_pixel;
+ const samplecnt_t one_tenth_of_second = _region->session().sample_rate() / 10;
/* If zoomed in where a canvas item interects with the canvas area but
* stretches for many pages either side, to avoid having draw all images when
@@ -904,11 +904,11 @@ WaveView::optimal_image_width_samples () const
const double cairo_image_limit = 32767.0;
const double max_image_width = cairo_image_limit / max_multiplier;
- framecnt_t max_width_samples = floor (max_image_width / _props->samples_per_pixel);
+ samplecnt_t max_width_samples = floor (max_image_width / _props->samples_per_pixel);
- const framecnt_t one_tenth_of_second_limited = std::min (one_tenth_of_second, max_width_samples);
+ const samplecnt_t one_tenth_of_second_limited = std::min (one_tenth_of_second, max_width_samples);
- framecnt_t new_sample_count = std::max (canvas_width_samples, one_tenth_of_second_limited);
+ samplecnt_t new_sample_count = std::max (canvas_width_samples, one_tenth_of_second_limited);
const double multiplier = g_random_double_range (min_multiplier, max_multiplier);
@@ -948,7 +948,7 @@ WaveView::process_draw_request (boost::shared_ptr<WaveViewDrawRequest> req)
the Region itself.
*/
- framecnt_t peaks_read =
+ samplecnt_t peaks_read =
region->read_peaks (peaks.get (), n_peaks, props.get_sample_start (),
props.get_length_samples (), props.channel, props.samples_per_pixel);
@@ -976,7 +976,7 @@ WaveView::process_draw_request (boost::shared_ptr<WaveViewDrawRequest> req)
const double amplitude_above_axis = props.amplitude_above_axis;
if (amplitude_above_axis != 1.0) {
- for (framecnt_t i = 0; i < n_peaks; ++i) {
+ for (samplecnt_t i = 0; i < n_peaks; ++i) {
peaks[i].max *= amplitude_above_axis;
peaks[i].min *= amplitude_above_axis;
}
@@ -1325,20 +1325,20 @@ WaveView::set_global_logscaled (bool yn)
}
}
-framecnt_t
+samplecnt_t
WaveView::region_length() const
{
return _region->length() - (_props->region_start - _region->start());
}
-framepos_t
+samplepos_t
WaveView::region_end() const
{
return _props->region_start + region_length();
}
void
-WaveView::set_region_start (frameoffset_t start)
+WaveView::set_region_start (sampleoffset_t start)
{
if (!_region) {
return;
diff --git a/libs/waveview/waveview/wave_view.h b/libs/waveview/waveview/wave_view.h
index 4b1c8eb42b..32fc97c85e 100644
--- a/libs/waveview/waveview/wave_view.h
+++ b/libs/waveview/waveview/wave_view.h
@@ -86,7 +86,7 @@ public:
void set_samples_per_pixel (double);
void set_height (ArdourCanvas::Distance);
void set_channel (int);
- void set_region_start (ARDOUR::frameoffset_t);
+ void set_region_start (ARDOUR::sampleoffset_t);
/** Change the first position drawn by @param pixels.
* @param pixels must be positive. This is used by
@@ -177,13 +177,13 @@ private:
* but if region_start has been reset, then we need to use this modified
* computation.
*/
- ARDOUR::framecnt_t region_length () const;
+ ARDOUR::samplecnt_t region_length () const;
/** Under almost conditions, this is going to return _region->start() +
* _region->length(), but if region_start has been reset, then we need to use
* this modified computation.
*/
- ARDOUR::framepos_t region_end () const;
+ ARDOUR::samplepos_t region_end () const;
/**
* _image stays non-null after the first time it is set
@@ -238,7 +238,7 @@ private:
boost::shared_ptr<WaveViewDrawRequest>);
static void draw_absent_image (Cairo::RefPtr<Cairo::ImageSurface>&, ARDOUR::PeakData*, int);
- ARDOUR::framecnt_t optimal_image_width_samples () const;
+ ARDOUR::samplecnt_t optimal_image_width_samples () const;
void set_image (boost::shared_ptr<WaveViewImage> img) const;
diff --git a/libs/waveview/waveview/wave_view_private.h b/libs/waveview/waveview/wave_view_private.h
index b1e5ace844..d3cf88c7e7 100644
--- a/libs/waveview/waveview/wave_view_private.h
+++ b/libs/waveview/waveview/wave_view_private.h
@@ -41,8 +41,8 @@ public: // ctors
public: // member variables
- framepos_t region_start;
- framepos_t region_end;
+ samplepos_t region_start;
+ samplepos_t region_end;
uint16_t channel;
double height;
double samples_per_pixel;
@@ -60,8 +60,8 @@ public: // member variables
private: // member variables
- framepos_t sample_start;
- framepos_t sample_end;
+ samplepos_t sample_start;
+ samplepos_t sample_end;
public: // methods
@@ -70,13 +70,13 @@ public: // methods
return (sample_end != 0 && samples_per_pixel != 0);
}
- void set_width_samples (ARDOUR::framecnt_t const width_samples)
+ void set_width_samples (ARDOUR::samplecnt_t const width_samples)
{
assert (is_valid());
assert (width_samples != 0);
- ARDOUR::framecnt_t half_width = width_samples / 2;
- framepos_t new_sample_start = std::max (region_start, get_center_sample () - half_width);
- framepos_t new_sample_end = std::min (get_center_sample () + half_width, region_end);
+ ARDOUR::samplecnt_t half_width = width_samples / 2;
+ samplepos_t new_sample_start = std::max (region_start, get_center_sample () - half_width);
+ samplepos_t new_sample_end = std::min (get_center_sample () + half_width, region_end);
assert (new_sample_start <= new_sample_end);
sample_start = new_sample_start;
sample_end = new_sample_end;
@@ -88,7 +88,7 @@ public: // methods
}
- void set_sample_offsets (framepos_t const start, framepos_t const end)
+ void set_sample_offsets (samplepos_t const start, samplepos_t const end)
{
assert (start <= end);
@@ -112,12 +112,12 @@ public: // methods
assert (sample_start <= sample_end);
}
- framepos_t get_sample_start () const
+ samplepos_t get_sample_start () const
{
return sample_start;
}
- framepos_t get_sample_end () const
+ samplepos_t get_sample_end () const
{
return sample_end;
}
@@ -129,18 +129,18 @@ public: // methods
* It is possible for the new sample positions to be past the region_end,
* so we have to do bounds checking/adjustment for this in set_sample_offsets.
*/
- framepos_t new_sample_start = region_start + (start_pixel * samples_per_pixel);
- framepos_t new_sample_end = region_start + (end_pixel * samples_per_pixel);
+ samplepos_t new_sample_start = region_start + (start_pixel * samples_per_pixel);
+ samplepos_t new_sample_end = region_start + (end_pixel * samples_per_pixel);
set_sample_offsets (new_sample_start, new_sample_end);
}
- ARDOUR::framecnt_t get_length_samples () const
+ ARDOUR::samplecnt_t get_length_samples () const
{
assert (sample_start <= sample_end);
return sample_end - sample_start;
}
- framepos_t get_center_sample ()
+ samplepos_t get_center_sample ()
{
return sample_start + (get_length_samples() / 2);
}
@@ -158,7 +158,7 @@ public: // methods
// region_start && start_shift??
}
- bool contains (framepos_t start, framepos_t end)
+ bool contains (samplepos_t start, samplepos_t end)
{
return (sample_start <= start && end <= sample_end);
}