summaryrefslogtreecommitdiff
path: root/libs/surfaces/push2
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/surfaces/push2
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/surfaces/push2')
-rw-r--r--libs/surfaces/push2/canvas.cc46
-rw-r--r--libs/surfaces/push2/canvas.h8
-rw-r--r--libs/surfaces/push2/mix.cc4
-rw-r--r--libs/surfaces/push2/push2.cc8
-rw-r--r--libs/surfaces/push2/track_mix.cc26
5 files changed, 46 insertions, 46 deletions
diff --git a/libs/surfaces/push2/canvas.cc b/libs/surfaces/push2/canvas.cc
index 6a8d046aa9..761c9d5880 100644
--- a/libs/surfaces/push2/canvas.cc
+++ b/libs/surfaces/push2/canvas.cc
@@ -47,26 +47,26 @@ Push2Canvas::Push2Canvas (Push2& pr, int c, int r)
: p2 (pr)
, _cols (c)
, _rows (r)
- , frame_buffer (Cairo::ImageSurface::create (Cairo::FORMAT_ARGB32, _cols, _rows))
+ , sample_buffer (Cairo::ImageSurface::create (Cairo::FORMAT_ARGB32, _cols, _rows))
{
- context = Cairo::Context::create (frame_buffer);
+ context = Cairo::Context::create (sample_buffer);
expose_region = Cairo::Region::create ();
- device_frame_buffer = new uint16_t[pixel_area()];
- memset (device_frame_buffer, 0, sizeof (uint16_t) * pixel_area());
+ device_sample_buffer = new uint16_t[pixel_area()];
+ memset (device_sample_buffer, 0, sizeof (uint16_t) * pixel_area());
- frame_header[0] = 0xef;
- frame_header[1] = 0xcd;
- frame_header[2] = 0xab;
- frame_header[3] = 0x89;
+ sample_header[0] = 0xef;
+ sample_header[1] = 0xcd;
+ sample_header[2] = 0xab;
+ sample_header[3] = 0x89;
- memset (&frame_header[4], 0, 12);
+ memset (&sample_header[4], 0, 12);
}
Push2Canvas::~Push2Canvas ()
{
- delete [] device_frame_buffer;
- device_frame_buffer = 0;
+ delete [] device_sample_buffer;
+ device_sample_buffer = 0;
}
bool
@@ -75,15 +75,15 @@ Push2Canvas::vblank ()
/* re-render dirty areas, if any */
if (expose ()) {
- /* something rendered, update device_frame_buffer */
- blit_to_device_frame_buffer ();
+ /* something rendered, update device_sample_buffer */
+ blit_to_device_sample_buffer ();
#undef RENDER_LAYOUTS
#ifdef RENDER_LAYOUTS
if (p2.current_layout()) {
std::string s = p2.current_layout()->name();
s += ".png";
- frame_buffer->write_to_png (s);
+ sample_buffer->write_to_png (s);
}
#endif
}
@@ -94,11 +94,11 @@ Push2Canvas::vblank ()
/* transfer to device */
- if ((err = libusb_bulk_transfer (p2.usb_handle(), 0x01, frame_header, sizeof (frame_header), &transferred, timeout_msecs))) {
+ if ((err = libusb_bulk_transfer (p2.usb_handle(), 0x01, sample_header, sizeof (sample_header), &transferred, timeout_msecs))) {
return false;
}
- if ((err = libusb_bulk_transfer (p2.usb_handle(), 0x01, (uint8_t*) device_frame_buffer, 2 * pixel_area (), &transferred, timeout_msecs))) {
+ if ((err = libusb_bulk_transfer (p2.usb_handle(), 0x01, (uint8_t*) device_sample_buffer, 2 * pixel_area (), &transferred, timeout_msecs))) {
return false;
}
@@ -170,24 +170,24 @@ Push2Canvas::expose ()
return true;
}
-/** render host-side frame buffer (a Cairo ImageSurface) to the current
- * device-side frame buffer. The device frame buffer will be pushed to the
+/** render host-side sample buffer (a Cairo ImageSurface) to the current
+ * device-side sample buffer. The device sample buffer will be pushed to the
* device on the next call to vblank()
*/
int
-Push2Canvas::blit_to_device_frame_buffer ()
+Push2Canvas::blit_to_device_sample_buffer ()
{
/* ensure that all drawing has been done before we fetch pixel data */
- frame_buffer->flush ();
+ sample_buffer->flush ();
const int stride = 3840; /* bytes per row for Cairo::FORMAT_ARGB32 */
- const uint8_t* data = frame_buffer->get_data ();
+ const uint8_t* data = sample_buffer->get_data ();
- /* fill frame buffer (320kB) */
+ /* fill sample buffer (320kB) */
- uint16_t* fb = (uint16_t*) device_frame_buffer;
+ uint16_t* fb = (uint16_t*) device_sample_buffer;
for (int row = 0; row < _rows; ++row) {
diff --git a/libs/surfaces/push2/canvas.h b/libs/surfaces/push2/canvas.h
index fe419f44ba..4250003ede 100644
--- a/libs/surfaces/push2/canvas.h
+++ b/libs/surfaces/push2/canvas.h
@@ -79,16 +79,16 @@ class Push2Canvas : public ArdourCanvas::Canvas
static const int pixels_per_row;
int pixel_area () const { return _rows * pixels_per_row; }
- uint8_t frame_header[16];
- uint16_t* device_frame_buffer;
+ uint8_t sample_header[16];
+ uint16_t* device_sample_buffer;
- Cairo::RefPtr<Cairo::ImageSurface> frame_buffer;
+ Cairo::RefPtr<Cairo::ImageSurface> sample_buffer;
Cairo::RefPtr<Cairo::Context> context;
Cairo::RefPtr<Cairo::Region> expose_region;
Glib::RefPtr<Pango::Context> pango_context;
bool expose ();
- int blit_to_device_frame_buffer ();
+ int blit_to_device_sample_buffer ();
};
} /* namespace ArdourSurface */
diff --git a/libs/surfaces/push2/mix.cc b/libs/surfaces/push2/mix.cc
index f012e91673..cb6239728d 100644
--- a/libs/surfaces/push2/mix.cc
+++ b/libs/surfaces/push2/mix.cc
@@ -435,9 +435,9 @@ MixLayout::strip_vpot_touch (int n, bool touching)
boost::shared_ptr<AutomationControl> ac = stripable[n]->gain_control();
if (ac) {
if (touching) {
- ac->start_touch (session.audible_frame());
+ ac->start_touch (session.audible_sample());
} else {
- ac->stop_touch (session.audible_frame());
+ ac->stop_touch (session.audible_sample());
}
}
}
diff --git a/libs/surfaces/push2/push2.cc b/libs/surfaces/push2/push2.cc
index b7f721ff91..763a136270 100644
--- a/libs/surfaces/push2/push2.cc
+++ b/libs/surfaces/push2/push2.cc
@@ -181,7 +181,7 @@ Push2::begin_using_device ()
{
DEBUG_TRACE (DEBUG::Push2, "begin using device\n");
- /* set up periodic task used to push a frame buffer to the
+ /* set up periodic task used to push a sample buffer to the
* device (25fps). The device can handle 60fps, but we don't
* need that frame rate.
*/
@@ -560,7 +560,7 @@ Push2::midi_input_handler (IOCondition ioc, MIDI::Port* port)
DEBUG_TRACE (DEBUG::Push2, string_compose ("data available on %1\n", port->name()));
if (in_use) {
- framepos_t now = AudioEngine::instance()->sample_time();
+ samplepos_t now = AudioEngine::instance()->sample_time();
port->parse (now);
}
}
@@ -1076,9 +1076,9 @@ Push2::other_vpot_touch (int n, bool touching)
boost::shared_ptr<AutomationControl> ac = master->gain_control();
if (ac) {
if (touching) {
- ac->start_touch (session->audible_frame());
+ ac->start_touch (session->audible_sample());
} else {
- ac->stop_touch (session->audible_frame());
+ ac->stop_touch (session->audible_sample());
}
}
}
diff --git a/libs/surfaces/push2/track_mix.cc b/libs/surfaces/push2/track_mix.cc
index a12ca84cf0..a213e204ea 100644
--- a/libs/surfaces/push2/track_mix.cc
+++ b/libs/surfaces/push2/track_mix.cc
@@ -570,9 +570,9 @@ TrackMixLayout::strip_vpot_touch (int n, bool touching)
boost::shared_ptr<AutomationControl> ac = knobs[n]->controllable();
if (ac) {
if (touching) {
- ac->start_touch (session.audible_frame());
+ ac->start_touch (session.audible_sample());
} else {
- ac->stop_touch (session.audible_frame());
+ ac->stop_touch (session.audible_sample());
}
}
}
@@ -590,7 +590,7 @@ TrackMixLayout::update_meters ()
void
TrackMixLayout::update_clocks ()
{
- framepos_t pos = session.audible_frame();
+ samplepos_t pos = session.audible_sample();
bool negative = false;
if (pos < 0) {
@@ -599,7 +599,7 @@ TrackMixLayout::update_clocks ()
}
char buf[16];
- Timecode::BBT_Time BBT = session.tempo_map().bbt_at_frame (pos);
+ Timecode::BBT_Time BBT = session.tempo_map().bbt_at_sample (pos);
#define BBT_BAR_CHAR "|"
@@ -613,22 +613,22 @@ TrackMixLayout::update_clocks ()
bbt_text->set (buf);
- framecnt_t left;
+ samplecnt_t left;
int hrs;
int mins;
int secs;
int millisecs;
- const double frame_rate = session.frame_rate ();
+ const double sample_rate = session.sample_rate ();
left = pos;
- hrs = (int) floor (left / (frame_rate * 60.0f * 60.0f));
- left -= (framecnt_t) floor (hrs * frame_rate * 60.0f * 60.0f);
- mins = (int) floor (left / (frame_rate * 60.0f));
- left -= (framecnt_t) floor (mins * frame_rate * 60.0f);
- secs = (int) floor (left / (float) frame_rate);
- left -= (framecnt_t) floor ((double)(secs * frame_rate));
- millisecs = floor (left * 1000.0 / (float) frame_rate);
+ hrs = (int) floor (left / (sample_rate * 60.0f * 60.0f));
+ left -= (samplecnt_t) floor (hrs * sample_rate * 60.0f * 60.0f);
+ mins = (int) floor (left / (sample_rate * 60.0f));
+ left -= (samplecnt_t) floor (mins * sample_rate * 60.0f);
+ secs = (int) floor (left / (float) sample_rate);
+ left -= (samplecnt_t) floor ((double)(secs * sample_rate));
+ millisecs = floor (left * 1000.0 / (float) sample_rate);
if (negative) {
snprintf (buf, sizeof (buf), "-%02" PRId32 ":%02" PRId32 ":%02" PRId32 ".%03" PRId32, hrs, mins, secs, millisecs);