summaryrefslogtreecommitdiff
path: root/libs/surfaces
diff options
context:
space:
mode:
Diffstat (limited to 'libs/surfaces')
-rw-r--r--libs/surfaces/cc121/cc121.cc6
-rw-r--r--libs/surfaces/control_protocol/basic_ui.cc36
-rw-r--r--libs/surfaces/control_protocol/control_protocol/basic_ui.h14
-rw-r--r--libs/surfaces/faderport/faderport.cc4
-rw-r--r--libs/surfaces/faderport8/actions.cc16
-rw-r--r--libs/surfaces/faderport8/faderport8.cc6
-rw-r--r--libs/surfaces/faderport8/fp8_strip.cc12
-rw-r--r--libs/surfaces/frontier/tranzport/tranzport_control_protocol.cc10
-rw-r--r--libs/surfaces/frontier/tranzport/tranzport_control_protocol.h8
-rw-r--r--libs/surfaces/generic_midi/generic_midi_control_protocol.cc2
-rw-r--r--libs/surfaces/mackie/mackie_control_protocol.cc32
-rw-r--r--libs/surfaces/mackie/mackie_control_protocol.h8
-rw-r--r--libs/surfaces/mackie/mcp_buttons.cc8
-rw-r--r--libs/surfaces/mackie/strip.cc8
-rw-r--r--libs/surfaces/osc/osc.cc32
-rw-r--r--libs/surfaces/osc/osc.h4
-rw-r--r--libs/surfaces/osc/osc_global_observer.cc32
-rw-r--r--libs/surfaces/osc/osc_global_observer.h2
-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
-rw-r--r--libs/surfaces/tranzport/button_events.cc2
-rw-r--r--libs/surfaces/tranzport/general.cc6
-rw-r--r--libs/surfaces/tranzport/init.cc2
-rw-r--r--libs/surfaces/tranzport/show.cc6
-rw-r--r--libs/surfaces/tranzport/tranzport_control_protocol.h8
28 files changed, 178 insertions, 178 deletions
diff --git a/libs/surfaces/cc121/cc121.cc b/libs/surfaces/cc121/cc121.cc
index 8a8cfb6597..ac4acf3439 100644
--- a/libs/surfaces/cc121/cc121.cc
+++ b/libs/surfaces/cc121/cc121.cc
@@ -309,7 +309,7 @@ CC121::button_press_handler (MIDI::Parser &, MIDI::EventTwoBytes* tb)
if (_current_stripable) {
boost::shared_ptr<AutomationControl> gain = _current_stripable->gain_control ();
if (gain) {
- framepos_t now = session->engine().sample_time();
+ samplepos_t now = session->engine().sample_time();
gain->start_touch (now);
}
}
@@ -356,7 +356,7 @@ CC121::button_release_handler (MIDI::Parser &, MIDI::EventTwoBytes* tb)
if (_current_stripable) {
boost::shared_ptr<AutomationControl> gain = _current_stripable->gain_control ();
if (gain) {
- framepos_t now = session->engine().sample_time();
+ samplepos_t now = session->engine().sample_time();
gain->stop_touch (now);
}
}
@@ -694,7 +694,7 @@ CC121::midi_input_handler (Glib::IOCondition ioc, boost::shared_ptr<ARDOUR::Asyn
port->clear ();
DEBUG_TRACE (DEBUG::CC121, string_compose ("data available on %1\n", boost::shared_ptr<MIDI::Port>(port)->name()));
- framepos_t now = session->engine().sample_time();
+ samplepos_t now = session->engine().sample_time();
port->parse (now);
}
diff --git a/libs/surfaces/control_protocol/basic_ui.cc b/libs/surfaces/control_protocol/basic_ui.cc
index df8a18b855..7836eef319 100644
--- a/libs/surfaces/control_protocol/basic_ui.cc
+++ b/libs/surfaces/control_protocol/basic_ui.cc
@@ -107,7 +107,7 @@ BasicUI::loop_toggle ()
}
void
-BasicUI::loop_location (framepos_t start, framepos_t end)
+BasicUI::loop_location (samplepos_t start, samplepos_t end)
{
Location* tll;
if ((tll = session->locations()->auto_loop_location()) == 0) {
@@ -141,7 +141,7 @@ BasicUI::goto_end ()
void
BasicUI::add_marker (const std::string& markername)
{
- framepos_t where = session->audible_frame();
+ samplepos_t where = session->audible_sample();
Location *location = new Location (*session, where, where, markername, Location::IsMark);
session->begin_reversible_command (_("add marker"));
XMLNode &before = session->locations()->get_state();
@@ -161,7 +161,7 @@ BasicUI::remove_marker_at_playhead ()
//find location(s) at this time
Locations::LocationList locs;
- session->locations()->find_all_between (session->audible_frame(), session->audible_frame()+1, locs, Location::Flags(0));
+ session->locations()->find_all_between (session->audible_sample(), session->audible_sample()+1, locs, Location::Flags(0));
for (Locations::LocationList::iterator i = locs.begin(); i != locs.end(); ++i) {
if ((*i)->is_mark()) {
session->locations()->remove (*i);
@@ -292,7 +292,7 @@ BasicUI::save_state ()
void
BasicUI::prev_marker ()
{
- framepos_t pos = session->locations()->first_mark_before (session->transport_frame());
+ samplepos_t pos = session->locations()->first_mark_before (session->transport_sample());
if (pos >= 0) {
session->request_locate (pos, session->transport_rolling());
@@ -304,7 +304,7 @@ BasicUI::prev_marker ()
void
BasicUI::next_marker ()
{
- framepos_t pos = session->locations()->first_mark_after (session->transport_frame());
+ samplepos_t pos = session->locations()->first_mark_after (session->transport_sample());
if (pos >= 0) {
session->request_locate (pos, session->transport_rolling());
@@ -375,14 +375,14 @@ BasicUI::set_record_enable (bool yn)
}
}
-framepos_t
-BasicUI::transport_frame ()
+samplepos_t
+BasicUI::transport_sample ()
{
- return session->transport_frame();
+ return session->transport_sample();
}
void
-BasicUI::locate (framepos_t where, bool roll_after_locate)
+BasicUI::locate (samplepos_t where, bool roll_after_locate)
{
session->request_locate (where, roll_after_locate);
}
@@ -390,14 +390,14 @@ BasicUI::locate (framepos_t where, bool roll_after_locate)
void
BasicUI::jump_by_seconds (double secs)
{
- framepos_t current = session->transport_frame();
- double s = (double) current / (double) session->nominal_frame_rate();
+ samplepos_t current = session->transport_sample();
+ double s = (double) current / (double) session->nominal_sample_rate();
s+= secs;
if (s < 0) {
s = 0;
}
- s = s * session->nominal_frame_rate();
+ s = s * session->nominal_sample_rate();
session->request_locate ( floor(s) );
}
@@ -406,7 +406,7 @@ void
BasicUI::jump_by_bars (double bars)
{
TempoMap& tmap (session->tempo_map());
- Timecode::BBT_Time bbt (tmap.bbt_at_frame (session->transport_frame()));
+ Timecode::BBT_Time bbt (tmap.bbt_at_sample (session->transport_sample()));
bars += bbt.bars;
if (bars < 0) {
@@ -417,7 +417,7 @@ BasicUI::jump_by_bars (double bars)
any.type = AnyTime::BBT;
any.bbt.bars = bars;
- session->request_locate ( session->convert_to_frames (any) );
+ session->request_locate ( session->convert_to_samples (any) );
}
void
@@ -535,26 +535,26 @@ BasicUI::locked ()
return session->transport_locked ();
}
-ARDOUR::framecnt_t
+ARDOUR::samplecnt_t
BasicUI::timecode_frames_per_hour ()
{
return session->timecode_frames_per_hour ();
}
void
-BasicUI::timecode_time (framepos_t where, Timecode::Time& timecode)
+BasicUI::timecode_time (samplepos_t where, Timecode::Time& timecode)
{
session->timecode_time (where, *((Timecode::Time *) &timecode));
}
void
-BasicUI::timecode_to_sample (Timecode::Time& timecode, framepos_t & sample, bool use_offset, bool use_subframes) const
+BasicUI::timecode_to_sample (Timecode::Time& timecode, samplepos_t & sample, bool use_offset, bool use_subframes) const
{
session->timecode_to_sample (*((Timecode::Time*)&timecode), sample, use_offset, use_subframes);
}
void
-BasicUI::sample_to_timecode (framepos_t sample, Timecode::Time& timecode, bool use_offset, bool use_subframes) const
+BasicUI::sample_to_timecode (samplepos_t sample, Timecode::Time& timecode, bool use_offset, bool use_subframes) const
{
session->sample_to_timecode (sample, *((Timecode::Time*)&timecode), use_offset, use_subframes);
}
diff --git a/libs/surfaces/control_protocol/control_protocol/basic_ui.h b/libs/surfaces/control_protocol/control_protocol/basic_ui.h
index ebf864405e..6626564711 100644
--- a/libs/surfaces/control_protocol/control_protocol/basic_ui.h
+++ b/libs/surfaces/control_protocol/control_protocol/basic_ui.h
@@ -55,7 +55,7 @@ class LIBCONTROLCP_API BasicUI {
/* transport control */
void loop_toggle ();
- void loop_location (framepos_t start, framepos_t end);
+ void loop_location (samplepos_t start, samplepos_t end);
void access_action ( std::string action_path );
static PBD::Signal2<void,std::string,std::string> AccessAction;
void goto_zero ();
@@ -71,8 +71,8 @@ class LIBCONTROLCP_API BasicUI {
void jump_by_seconds( double sec );
void jump_by_bars(double bars);
- ARDOUR::framepos_t transport_frame ();
- void locate (ARDOUR::framepos_t frame, bool play = false);
+ ARDOUR::samplepos_t transport_sample ();
+ void locate (ARDOUR::samplepos_t sample, bool play = false);
bool locating ();
bool locked ();
@@ -142,11 +142,11 @@ class LIBCONTROLCP_API BasicUI {
void goto_nth_marker (int n);
- ARDOUR::framecnt_t timecode_frames_per_hour ();
+ ARDOUR::samplecnt_t timecode_frames_per_hour ();
- void timecode_time (framepos_t where, Timecode::Time&);
- void timecode_to_sample (Timecode::Time& timecode, framepos_t & sample, bool use_offset, bool use_subframes) const;
- void sample_to_timecode (framepos_t sample, Timecode::Time& timecode, bool use_offset, bool use_subframes) const;
+ void timecode_time (samplepos_t where, Timecode::Time&);
+ void timecode_to_sample (Timecode::Time& timecode, samplepos_t & sample, bool use_offset, bool use_subframes) const;
+ void sample_to_timecode (samplepos_t sample, Timecode::Time& timecode, bool use_offset, bool use_subframes) const;
protected:
BasicUI ();
diff --git a/libs/surfaces/faderport/faderport.cc b/libs/surfaces/faderport/faderport.cc
index 72190c1e8a..962678735e 100644
--- a/libs/surfaces/faderport/faderport.cc
+++ b/libs/surfaces/faderport/faderport.cc
@@ -370,7 +370,7 @@ FaderPort::button_handler (MIDI::Parser &, MIDI::EventTwoBytes* tb)
if (_current_stripable) {
boost::shared_ptr<AutomationControl> gain = _current_stripable->gain_control ();
if (gain) {
- framepos_t now = session->engine().sample_time();
+ samplepos_t now = session->engine().sample_time();
if (tb->value) {
gain->start_touch (now);
} else {
@@ -761,7 +761,7 @@ FaderPort::midi_input_handler (Glib::IOCondition ioc, boost::weak_ptr<ARDOUR::As
port->clear ();
DEBUG_TRACE (DEBUG::FaderPort, string_compose ("data available on %1\n", boost::shared_ptr<MIDI::Port>(port)->name()));
- framepos_t now = session->engine().sample_time();
+ samplepos_t now = session->engine().sample_time();
port->parse (now);
}
diff --git a/libs/surfaces/faderport8/actions.cc b/libs/surfaces/faderport8/actions.cc
index d17059d92d..07496e9912 100644
--- a/libs/surfaces/faderport8/actions.cc
+++ b/libs/surfaces/faderport8/actions.cc
@@ -332,7 +332,7 @@ FaderPort8::button_solo_clear ()
if (!ac) {
continue;
}
- ac->start_touch (ac->session().transport_frame());
+ ac->start_touch (ac->session().transport_sample());
cl->push_back (ac);
}
if (!cl->empty()) {
@@ -357,7 +357,7 @@ FaderPort8::button_mute_clear ()
continue;
}
cl->push_back (ac);
- ac->start_touch (ac->session().transport_frame());
+ ac->start_touch (ac->session().transport_sample());
}
if (!cl->empty()) {
session->set_controls (cl, 1.0, PBD::Controllable::NoGroup);
@@ -397,7 +397,7 @@ FaderPort8::handle_encoder_pan (int steps)
ac = s->pan_azimuth_control ();
}
if (ac) {
- ac->start_touch (ac->session().transport_frame());
+ ac->start_touch (ac->session().transport_sample());
if (steps == 0) {
ac->set_value (ac->normal(), PBD::Controllable::UseGroup);
} else {
@@ -421,7 +421,7 @@ FaderPort8::handle_encoder_link (int steps)
}
double v = ac->internal_to_interface (ac->get_value());
- ac->start_touch (ac->session().transport_frame());
+ ac->start_touch (ac->session().transport_sample());
if (steps == 0) {
ac->set_value (ac->normal(), PBD::Controllable::UseGroup);
@@ -528,7 +528,7 @@ FaderPort8::button_encoder ()
ac = session->master_out()->gain_control ();
}
if (ac) {
- ac->start_touch (ac->session().transport_frame());
+ ac->start_touch (ac->session().transport_sample());
ac->set_value (ac->normal(), PBD::Controllable::NoGroup);
}
}
@@ -542,8 +542,8 @@ FaderPort8::button_encoder ()
/* Don't add another mark if one exists within 1/100th of a second of
* the current position and we're not rolling.
*/
- framepos_t where = session->audible_frame();
- if (session->transport_stopped() && session->locations()->mark_at (where, session->frame_rate() / 100.0)) {
+ samplepos_t where = session->audible_sample();
+ if (session->transport_stopped() && session->locations()->mark_at (where, session->sample_rate() / 100.0)) {
return;
}
@@ -608,7 +608,7 @@ FaderPort8::encoder_navigate (bool neg, int steps)
if (ac) {
double v = ac->internal_to_interface (ac->get_value());
v = std::max (0.0, std::min (1.0, v + steps * (neg ? -.01 : .01)));
- ac->start_touch (ac->session().transport_frame());
+ ac->start_touch (ac->session().transport_sample());
ac->set_value (ac->interface_to_internal(v), PBD::Controllable::NoGroup);
}
}
diff --git a/libs/surfaces/faderport8/faderport8.cc b/libs/surfaces/faderport8/faderport8.cc
index 2603a12e34..c3e4a20a9a 100644
--- a/libs/surfaces/faderport8/faderport8.cc
+++ b/libs/surfaces/faderport8/faderport8.cc
@@ -230,7 +230,7 @@ FaderPort8::periodic ()
_timecode = Timecode::timecode_format_time(TC);
char buf[16];
- Timecode::BBT_Time BBT = session->tempo_map ().bbt_at_frame (session->transport_frame ());
+ Timecode::BBT_Time BBT = session->tempo_map ().bbt_at_sample (session->transport_sample ());
snprintf (buf, sizeof (buf),
" %02" PRIu32 "|%02" PRIu32 "|%02" PRIu32 "|%02" PRIu32,
BBT.bars % 100, BBT.beats %100,
@@ -479,7 +479,7 @@ FaderPort8::midi_input_handler (Glib::IOCondition ioc, boost::weak_ptr<ARDOUR::A
#ifdef VERBOSE_DEBUG
DEBUG_TRACE (DEBUG::FaderPort8, string_compose ("data available on %1\n", boost::shared_ptr<MIDI::Port>(port)->name()));
#endif
- framepos_t now = session->engine().sample_time();
+ samplepos_t now = session->engine().sample_time();
port->parse (now);
}
@@ -1638,7 +1638,7 @@ FaderPort8::select_strip (boost::weak_ptr<Stripable> ws)
if (s == first_selected_stripable () && !shift_mod ()) {
if (_ctrls.fader_mode () == ModeTrack) {
boost::shared_ptr<AutomationControl> ac = s->gain_control ();
- ac->start_touch (ac->session().transport_frame());
+ ac->start_touch (ac->session().transport_sample());
ac->set_value (ac->normal (), PBD::Controllable::UseGroup);
}
return;
diff --git a/libs/surfaces/faderport8/fp8_strip.cc b/libs/surfaces/faderport8/fp8_strip.cc
index eb6ec244b9..5de996a294 100644
--- a/libs/surfaces/faderport8/fp8_strip.cc
+++ b/libs/surfaces/faderport8/fp8_strip.cc
@@ -297,9 +297,9 @@ FP8Strip::midi_touch (bool t)
return false;
}
if (t) {
- ac->start_touch (ac->session().transport_frame());
+ ac->start_touch (ac->session().transport_sample());
} else {
- ac->stop_touch (ac->session().transport_frame());
+ ac->stop_touch (ac->session().transport_sample());
}
return true;
}
@@ -315,7 +315,7 @@ FP8Strip::midi_fader (float val)
if (!ac) {
return false;
}
- ac->start_touch (ac->session().transport_frame());
+ ac->start_touch (ac->session().transport_sample());
ac->set_value (ac->interface_to_internal (val), group_mode ());
return true;
}
@@ -340,7 +340,7 @@ FP8Strip::set_mute (bool on)
if (!_mute_ctrl) {
return;
}
- _mute_ctrl->start_touch (_mute_ctrl->session().transport_frame());
+ _mute_ctrl->start_touch (_mute_ctrl->session().transport_sample());
_mute_ctrl->set_value (on ? 1.0 : 0.0, group_mode ());
}
@@ -350,7 +350,7 @@ FP8Strip::set_solo (bool on)
if (!_solo_ctrl) {
return;
}
- _solo_ctrl->start_touch (_solo_ctrl->session().transport_frame());
+ _solo_ctrl->start_touch (_solo_ctrl->session().transport_sample());
_solo_ctrl->set_value (on ? 1.0 : 0.0, group_mode ());
}
@@ -371,7 +371,7 @@ FP8Strip::set_select ()
assert (!_x_select_ctrl);
_select_plugin_functor ();
} else if (_x_select_ctrl) {
- _x_select_ctrl->start_touch (_x_select_ctrl->session().transport_frame());
+ _x_select_ctrl->start_touch (_x_select_ctrl->session().transport_sample());
const bool on = !select_button ().is_active();
_x_select_ctrl->set_value (on ? 1.0 : 0.0, group_mode ());
}
diff --git a/libs/surfaces/frontier/tranzport/tranzport_control_protocol.cc b/libs/surfaces/frontier/tranzport/tranzport_control_protocol.cc
index 5799ab682a..f41703c3de 100644
--- a/libs/surfaces/frontier/tranzport/tranzport_control_protocol.cc
+++ b/libs/surfaces/frontier/tranzport/tranzport_control_protocol.cc
@@ -110,7 +110,7 @@ TranzportControlProtocol::TranzportControlProtocol (Session& s)
_device_status = STATUS_OFFLINE;
udev = 0;
current_track_id = 0;
- last_where = max_frames;
+ last_where = max_samples;
wheel_mode = WheelTimeline;
wheel_shift_mode = WheelShiftGain;
wheel_increment = WheelIncrScreen;
@@ -555,7 +555,7 @@ TranzportControlProtocol::show_meter ()
}
void
-TranzportControlProtocol::show_bbt (framepos_t where)
+TranzportControlProtocol::show_bbt (samplepos_t where)
{
if ((where != last_where) || lcd_isdamaged(1,9,8)) {
char buf[16];
@@ -591,11 +591,11 @@ TranzportControlProtocol::show_bbt (framepos_t where)
void
TranzportControlProtocol::show_transport_time ()
{
- show_bbt (session->transport_frame ());
+ show_bbt (session->transport_sample ());
}
void
-TranzportControlProtocol::show_smpte (framepos_t where)
+TranzportControlProtocol::show_smpte (samplepos_t where)
{
if ((where != last_where) || lcd_isdamaged(1,9,10)) {
@@ -617,7 +617,7 @@ TranzportControlProtocol::show_smpte (framepos_t where)
sprintf (buf, "%02" PRIu32 ":", smpte.seconds);
print (1, 15, buf);
- sprintf (buf, "%02" PRIu32, smpte.frames);
+ sprintf (buf, "%02" PRIu32, smpte.samples);
print_noretry (1, 18, buf);
last_where = where;
diff --git a/libs/surfaces/frontier/tranzport/tranzport_control_protocol.h b/libs/surfaces/frontier/tranzport/tranzport_control_protocol.h
index 13df6915a2..e132361397 100644
--- a/libs/surfaces/frontier/tranzport/tranzport_control_protocol.h
+++ b/libs/surfaces/frontier/tranzport/tranzport_control_protocol.h
@@ -150,8 +150,8 @@ class TranzportControlProtocol : public ARDOUR::ControlProtocol
uint32_t last_hrs;
uint32_t last_mins;
uint32_t last_secs;
- uint32_t last_frames;
- framepos_t last_where;
+ uint32_t last_samples;
+ samplepos_t last_where;
ARDOUR::gain_t last_track_gain;
uint32_t last_meter_fill;
uint64_t last_wheel_motion;
@@ -246,8 +246,8 @@ class TranzportControlProtocol : public ARDOUR::ControlProtocol
void show_current_track ();
void show_track_gain ();
void show_transport_time ();
- void show_bbt (framepos_t where);
- void show_smpte (framepos_t where);
+ void show_bbt (samplepos_t where);
+ void show_smpte (samplepos_t where);
void show_wheel_mode ();
void show_gain ();
void show_pan ();
diff --git a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc
index 36047d262d..4d394e5082 100644
--- a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc
+++ b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc
@@ -1240,7 +1240,7 @@ GenericMidiControlProtocol::maybe_start_touch (Controllable* controllable)
{
AutomationControl *actl = dynamic_cast<AutomationControl*> (controllable);
if (actl) {
- actl->start_touch (session->audible_frame ());
+ actl->start_touch (session->audible_sample ());
}
}
diff --git a/libs/surfaces/mackie/mackie_control_protocol.cc b/libs/surfaces/mackie/mackie_control_protocol.cc
index 064d763d1e..5b2109de34 100644
--- a/libs/surfaces/mackie/mackie_control_protocol.cc
+++ b/libs/surfaces/mackie/mackie_control_protocol.cc
@@ -111,7 +111,7 @@ MackieControlProtocol::MackieControlProtocol (Session& session)
: ControlProtocol (session, X_("Mackie"))
, AbstractUI<MackieControlUIRequest> (name())
, _current_initial_bank (0)
- , _frame_last (0)
+ , _sample_last (0)
, _timecode_type (ARDOUR::AnyTime::BBT)
, _gui (0)
, _scrub_mode (false)
@@ -1098,11 +1098,11 @@ MackieControlProtocol::set_state (const XMLNode & node, int version)
}
string
-MackieControlProtocol::format_bbt_timecode (framepos_t now_frame)
+MackieControlProtocol::format_bbt_timecode (samplepos_t now_sample)
{
Timecode::BBT_Time bbt_time;
- session->bbt_time (now_frame, bbt_time);
+ session->bbt_time (now_sample, bbt_time);
// The Mackie protocol spec is built around a BBT time display of
//
@@ -1125,14 +1125,14 @@ MackieControlProtocol::format_bbt_timecode (framepos_t now_frame)
}
string
-MackieControlProtocol::format_timecode_timecode (framepos_t now_frame)
+MackieControlProtocol::format_timecode_timecode (samplepos_t now_sample)
{
Timecode::Time timecode;
- session->timecode_time (now_frame, timecode);
+ session->timecode_time (now_sample, timecode);
// According to the Logic docs
// digits: 888/88/88/888
- // Timecode mode: Hours/Minutes/Seconds/Frames
+ // Timecode mode: Hours/Minutes/Seconds/Samples
ostringstream os;
os << setw(2) << setfill('0') << timecode.hours;
os << ' ';
@@ -1159,23 +1159,23 @@ MackieControlProtocol::update_timecode_display()
return;
}
- // do assignment here so current_frame is fixed
- framepos_t current_frame = session->transport_frame();
+ // do assignment here so current_sample is fixed
+ samplepos_t current_sample = session->transport_sample();
string timecode;
// For large jumps in play head possition do full reset
- int moved = (current_frame - _frame_last) / session->frame_rate ();
+ int moved = (current_sample - _sample_last) / session->sample_rate ();
if (moved) {
DEBUG_TRACE (DEBUG::MackieControl, "Timecode reset\n");
_timecode_last = string (10, ' ');
}
- _frame_last = current_frame;
+ _sample_last = current_sample;
switch (_timecode_type) {
case ARDOUR::AnyTime::BBT:
- timecode = format_bbt_timecode (current_frame);
+ timecode = format_bbt_timecode (current_sample);
break;
case ARDOUR::AnyTime::Timecode:
- timecode = format_timecode_timecode (current_frame);
+ timecode = format_timecode_timecode (current_sample);
break;
default:
return;
@@ -1641,7 +1641,7 @@ MackieControlProtocol::midi_input_handler (IOCondition ioc, MIDI::Port* port)
}
// DEBUG_TRACE (DEBUG::MackieControl, string_compose ("data available on %1\n", port->name()));
- framepos_t now = session->engine().sample_time();
+ samplepos_t now = session->engine().sample_time();
port->parse (now);
}
@@ -1994,10 +1994,10 @@ MackieControlProtocol::update_fader_automation_state ()
}
}
-framepos_t
-MackieControlProtocol::transport_frame() const
+samplepos_t
+MackieControlProtocol::transport_sample() const
{
- return session->transport_frame();
+ return session->transport_sample();
}
void
diff --git a/libs/surfaces/mackie/mackie_control_protocol.h b/libs/surfaces/mackie/mackie_control_protocol.h
index 9172716fe2..68e918d0e9 100644
--- a/libs/surfaces/mackie/mackie_control_protocol.h
+++ b/libs/surfaces/mackie/mackie_control_protocol.h
@@ -219,7 +219,7 @@ class MackieControlProtocol
void update_global_led (int id, Mackie::LedState);
ARDOUR::Session & get_session() { return *session; }
- framepos_t transport_frame() const;
+ samplepos_t transport_sample() const;
int modifier_state() const { return _modifier_state; }
int main_modifier_state() const { return _modifier_state & MAIN_MODIFIER_MASK; }
@@ -269,8 +269,8 @@ class MackieControlProtocol
// also called from poll_automation to update timecode display
void update_timecode_display();
- std::string format_bbt_timecode (ARDOUR::framepos_t now_frame);
- std::string format_timecode_timecode (ARDOUR::framepos_t now_frame);
+ std::string format_bbt_timecode (ARDOUR::samplepos_t now_sample);
+ std::string format_timecode_timecode (ARDOUR::samplepos_t now_sample);
void do_request (MackieControlUIRequest*);
int stop ();
@@ -313,7 +313,7 @@ class MackieControlProtocol
Mackie::Timer _frm_left_last;
// last written timecode string
std::string _timecode_last;
- framepos_t _frame_last;
+ samplepos_t _sample_last;
// Which timecode are we displaying? BBT or Timecode
ARDOUR::AnyTime::Type _timecode_type;
// Bundle to represent our input ports
diff --git a/libs/surfaces/mackie/mcp_buttons.cc b/libs/surfaces/mackie/mcp_buttons.cc
index a8998f960d..a4ab7d9099 100644
--- a/libs/surfaces/mackie/mcp_buttons.cc
+++ b/libs/surfaces/mackie/mcp_buttons.cc
@@ -457,9 +457,9 @@ MackieControlProtocol::marker_release (Button &)
* the current position and we're not rolling.
*/
- framepos_t where = session->audible_frame();
+ samplepos_t where = session->audible_sample();
- if (session->transport_stopped() && session->locations()->mark_at (where, session->frame_rate() / 100.0)) {
+ if (session->transport_stopped() && session->locations()->mark_at (where, session->sample_rate() / 100.0)) {
return off;
}
@@ -840,7 +840,7 @@ MackieControlProtocol::master_fader_touch_press (Mackie::Button &)
boost::shared_ptr<AutomationControl> ac = master_fader->control ();
master_fader->set_in_use (true);
- master_fader->start_touch (transport_frame());
+ master_fader->start_touch (transport_sample());
return none;
}
@@ -852,7 +852,7 @@ MackieControlProtocol::master_fader_touch_release (Mackie::Button &)
Fader* master_fader = _master_surface->master_fader();
master_fader->set_in_use (false);
- master_fader->stop_touch (transport_frame());
+ master_fader->stop_touch (transport_sample());
return none;
}
diff --git a/libs/surfaces/mackie/strip.cc b/libs/surfaces/mackie/strip.cc
index 28a2fa22bb..64b60d4eea 100644
--- a/libs/surfaces/mackie/strip.cc
+++ b/libs/surfaces/mackie/strip.cc
@@ -790,7 +790,7 @@ Strip::fader_touch_event (Button&, ButtonState bs)
boost::shared_ptr<AutomationControl> ac = _fader->control ();
_fader->set_in_use (true);
- _fader->start_touch (_surface->mcp().transport_frame());
+ _fader->start_touch (_surface->mcp().transport_sample());
if (ac) {
do_parameter_display (ac->desc(), ac->get_value());
@@ -799,7 +799,7 @@ Strip::fader_touch_event (Button&, ButtonState bs)
} else {
_fader->set_in_use (false);
- _fader->stop_touch (_surface->mcp().transport_frame());
+ _fader->stop_touch (_surface->mcp().transport_sample());
}
}
@@ -947,9 +947,9 @@ void
Strip::handle_fader_touch (Fader& fader, bool touch_on)
{
if (touch_on) {
- fader.start_touch (_surface->mcp().transport_frame());
+ fader.start_touch (_surface->mcp().transport_sample());
} else {
- fader.stop_touch (_surface->mcp().transport_frame());
+ fader.stop_touch (_surface->mcp().transport_sample());
}
}
diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc
index 335bfcc6ad..1ca0dff146 100644
--- a/libs/surfaces/osc/osc.cc
+++ b/libs/surfaces/osc/osc.cc
@@ -432,7 +432,7 @@ OSC::register_callbacks()
REGISTER_CALLBACK (serv, "/transport_stop", "f", transport_stop);
REGISTER_CALLBACK (serv, "/transport_play", "", transport_play);
REGISTER_CALLBACK (serv, "/transport_play", "f", transport_play);
- REGISTER_CALLBACK (serv, "/transport_frame", "", transport_frame);
+ REGISTER_CALLBACK (serv, "/transport_frame", "", transport_sample);
REGISTER_CALLBACK (serv, "/transport_speed", "", transport_speed);
REGISTER_CALLBACK (serv, "/record_enabled", "", record_enabled);
REGISTER_CALLBACK (serv, "/set_transport_speed", "f", set_transport_speed);
@@ -1187,37 +1187,37 @@ OSC::current_value (const char */*path*/, const char */*types*/, lo_arg **/*argv
if (strcmp (argv[0]->s, "transport_frame") == 0) {
if (session) {
- lo_send (addr, retpath, "i", session->transport_frame());
+ lo_send (addr, retpath, "i", session->transport_sample());
}
} else if (strcmp (argv[0]->s, "transport_speed") == 0) {
if (session) {
- lo_send (addr, retpath, "i", session->transport_frame());
+ lo_send (addr, retpath, "i", session->transport_sample());
}
} else if (strcmp (argv[0]->s, "transport_locked") == 0) {
if (session) {
- lo_send (addr, retpath, "i", session->transport_frame());
+ lo_send (addr, retpath, "i", session->transport_sample());
}
} else if (strcmp (argv[0]->s, "punch_in") == 0) {
if (session) {
- lo_send (addr, retpath, "i", session->transport_frame());
+ lo_send (addr, retpath, "i", session->transport_sample());
}
} else if (strcmp (argv[0]->s, "punch_out") == 0) {
if (session) {
- lo_send (addr, retpath, "i", session->transport_frame());
+ lo_send (addr, retpath, "i", session->transport_sample());
}
} else if (strcmp (argv[0]->s, "rec_enable") == 0) {
if (session) {
- lo_send (addr, retpath, "i", session->transport_frame());
+ lo_send (addr, retpath, "i", session->transport_sample());
}
} else {
@@ -1313,8 +1313,8 @@ OSC::routes_list (lo_message msg)
lo_message reply = lo_message_new ();
lo_message_add_string (reply, "end_route_list");
- lo_message_add_int64 (reply, session->frame_rate());
- lo_message_add_int64 (reply, session->current_end_frame());
+ lo_message_add_int64 (reply, session->sample_rate());
+ lo_message_add_int64 (reply, session->current_end_sample());
if (session->monitor_out()) {
// this session has a monitor section
lo_message_add_int32 (reply, 1);
@@ -2168,13 +2168,13 @@ OSC::_sel_plugin (int id, lo_address addr)
}
void
-OSC::transport_frame (lo_message msg)
+OSC::transport_sample (lo_message msg)
{
if (!session) {
return;
}
check_surface (msg);
- framepos_t pos = session->transport_frame ();
+ samplepos_t pos = session->transport_sample ();
lo_message reply = lo_message_new ();
lo_message_add_int64 (reply, pos);
@@ -2224,7 +2224,7 @@ OSC::scrub (float delta, lo_message msg)
if (!session) return -1;
check_surface (msg);
- scrub_place = session->transport_frame ();
+ scrub_place = session->transport_sample ();
float speed;
@@ -2871,11 +2871,11 @@ OSC::touch_detect (const char *path, const char* types, lo_arg **argv, int argc,
if (control) {
if (touch) {
//start touch
- control->start_touch (control->session().transport_frame());
+ control->start_touch (control->session().transport_sample());
ret = 0;
} else {
// end touch
- control->stop_touch (control->session().transport_frame());
+ control->stop_touch (control->session().transport_sample());
ret = 0;
}
// just in case some crazy surface starts sending control values before touch
@@ -2895,7 +2895,7 @@ OSC::fake_touch (boost::shared_ptr<ARDOUR::AutomationControl> ctrl)
if (ctrl) {
//start touch
if (ctrl->automation_state() == Touch && !ctrl->touching ()) {
- ctrl->start_touch (ctrl->session().transport_frame());
+ ctrl->start_touch (ctrl->session().transport_sample());
_touch_timeout[ctrl] = 10;
}
}
@@ -4892,7 +4892,7 @@ OSC::periodic (void)
if (!(*x).second) {
boost::shared_ptr<ARDOUR::AutomationControl> ctrl = (*x).first;
// turn touch off
- ctrl->stop_touch (ctrl->session().transport_frame());
+ ctrl->stop_touch (ctrl->session().transport_sample());
_touch_timeout.erase (x++);
} else {
x++;
diff --git a/libs/surfaces/osc/osc.h b/libs/surfaces/osc/osc.h
index 79392a0008..0c19cea7b6 100644
--- a/libs/surfaces/osc/osc.h
+++ b/libs/surfaces/osc/osc.h
@@ -257,7 +257,7 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
int route_get_sends (lo_message msg);
int route_get_receives(lo_message msg);
void routes_list (lo_message msg);
- void transport_frame (lo_message msg);
+ void transport_sample (lo_message msg);
void transport_speed (lo_message msg);
void record_enabled (lo_message msg);
@@ -300,7 +300,7 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
PATH_CALLBACK_MSG(route_get_sends);
PATH_CALLBACK_MSG(route_get_receives);
PATH_CALLBACK_MSG(routes_list);
- PATH_CALLBACK_MSG(transport_frame);
+ PATH_CALLBACK_MSG(transport_sample);
PATH_CALLBACK_MSG(transport_speed);
PATH_CALLBACK_MSG(record_enabled);
PATH_CALLBACK_MSG(refresh_surface);
diff --git a/libs/surfaces/osc/osc_global_observer.cc b/libs/surfaces/osc/osc_global_observer.cc
index 0649626271..00f1b26a30 100644
--- a/libs/surfaces/osc/osc_global_observer.cc
+++ b/libs/surfaces/osc/osc_global_observer.cc
@@ -48,7 +48,7 @@ OSCGlobalObserver::OSCGlobalObserver (Session& s, ArdourSurface::OSC::OSCSurface
session = &s;
gainmode = sur->gainmode;
feedback = sur->feedback;
- _last_frame = -1;
+ _last_sample = -1;
if (feedback[4]) {
// connect to all the things we want to send feed back from
@@ -143,13 +143,13 @@ OSCGlobalObserver::tick ()
if (_init) {
return;
}
- framepos_t now_frame = session->transport_frame();
- if (now_frame != _last_frame) {
+ samplepos_t now_sample = session->transport_sample();
+ if (now_sample != _last_sample) {
if (feedback[6]) { // timecode enabled
Timecode::Time timecode;
- session->timecode_time (now_frame, timecode);
+ session->timecode_time (now_sample, timecode);
- // Timecode mode: Hours/Minutes/Seconds/Frames
+ // Timecode mode: Hours/Minutes/Seconds/Samples
ostringstream os;
os << setw(2) << setfill('0') << timecode.hours;
os << ':';
@@ -164,7 +164,7 @@ OSCGlobalObserver::tick ()
if (feedback[5]) { // Bar beat enabled
Timecode::BBT_Time bbt_time;
- session->bbt_time (now_frame, bbt_time);
+ session->bbt_time (now_sample, bbt_time);
// semantics: BBB/bb/tttt
ostringstream os;
@@ -178,14 +178,14 @@ OSCGlobalObserver::tick ()
text_message ("/position/bbt", os.str());
}
if (feedback[11]) { // minutes/seconds enabled
- framepos_t left = now_frame;
- int hrs = (int) floor (left / (session->frame_rate() * 60.0f * 60.0f));
- left -= (framecnt_t) floor (hrs * session->frame_rate() * 60.0f * 60.0f);
- int mins = (int) floor (left / (session->frame_rate() * 60.0f));
- left -= (framecnt_t) floor (mins * session->frame_rate() * 60.0f);
- int secs = (int) floor (left / (float) session->frame_rate());
- left -= (framecnt_t) floor ((double)(secs * session->frame_rate()));
- int millisecs = floor (left * 1000.0 / (float) session->frame_rate());
+ samplepos_t left = now_sample;
+ int hrs = (int) floor (left / (session->sample_rate() * 60.0f * 60.0f));
+ left -= (samplecnt_t) floor (hrs * session->sample_rate() * 60.0f * 60.0f);
+ int mins = (int) floor (left / (session->sample_rate() * 60.0f));
+ left -= (samplecnt_t) floor (mins * session->sample_rate() * 60.0f);
+ int secs = (int) floor (left / (float) session->sample_rate());
+ left -= (samplecnt_t) floor ((double)(secs * session->sample_rate()));
+ int millisecs = floor (left * 1000.0 / (float) session->sample_rate());
// Min/sec mode: Hours/Minutes/Seconds/msec
ostringstream os;
@@ -201,10 +201,10 @@ OSCGlobalObserver::tick ()
}
if (feedback[10]) { // samples
ostringstream os;
- os << now_frame;
+ os << now_sample;
text_message ("/position/samples", os.str());
}
- _last_frame = now_frame;
+ _last_sample = now_sample;
}
if (feedback[3]) { //heart beat enabled
if (_heartbeat == 10) {
diff --git a/libs/surfaces/osc/osc_global_observer.h b/libs/surfaces/osc/osc_global_observer.h
index ea5a0702a5..86832a54e8 100644
--- a/libs/surfaces/osc/osc_global_observer.h
+++ b/libs/surfaces/osc/osc_global_observer.h
@@ -59,7 +59,7 @@ class OSCGlobalObserver
uint32_t gainmode;
std::bitset<32> feedback;
ARDOUR::Session* session;
- framepos_t _last_frame;
+ samplepos_t _last_sample;
uint32_t _heartbeat;
float _last_meter;
uint32_t master_timeout;
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);
diff --git a/libs/surfaces/tranzport/button_events.cc b/libs/surfaces/tranzport/button_events.cc
index ebc00f95be..bac2a218e5 100644
--- a/libs/surfaces/tranzport/button_events.cc
+++ b/libs/surfaces/tranzport/button_events.cc
@@ -243,7 +243,7 @@ TranzportControlProtocol::button_event_prev_release (bool shifted)
}
// Note - add_marker should adhere to the snap to setting
-// maybe session->audible_frame does that
+// maybe session->audible_sample does that
void
TranzportControlProtocol::button_event_add_press (bool shifted)
diff --git a/libs/surfaces/tranzport/general.cc b/libs/surfaces/tranzport/general.cc
index 2b39aaa2d7..f92d6997be 100644
--- a/libs/surfaces/tranzport/general.cc
+++ b/libs/surfaces/tranzport/general.cc
@@ -181,7 +181,7 @@ TranzportControlProtocol::update_state ()
void
TranzportControlProtocol::prev_marker ()
{
- Location *location = session->locations()->first_location_before (session->transport_frame());
+ Location *location = session->locations()->first_location_before (session->transport_sample());
if (location) {
session->request_locate (location->start(), session->transport_rolling());
@@ -196,13 +196,13 @@ TranzportControlProtocol::prev_marker ()
void
TranzportControlProtocol::next_marker ()
{
- Location *location = session->locations()->first_location_after (session->transport_frame());
+ Location *location = session->locations()->first_location_after (session->transport_sample());
if (location) {
session->request_locate (location->start(), session->transport_rolling());
notify(location->name().c_str());
} else {
- session->request_locate (session->current_end_frame());
+ session->request_locate (session->current_end_sample());
notify("END ");
}
}
diff --git a/libs/surfaces/tranzport/init.cc b/libs/surfaces/tranzport/init.cc
index 96ff493c0e..56501b2c2c 100644
--- a/libs/surfaces/tranzport/init.cc
+++ b/libs/surfaces/tranzport/init.cc
@@ -123,7 +123,7 @@ TranzportControlProtocol::TranzportControlProtocol (Session& s)
_device_status = STATUS_OFFLINE;
udev = 0;
current_track_id = 0;
- last_where = max_frames;
+ last_where = max_samples;
wheel_mode = WheelTimeline;
wheel_shift_mode = WheelShiftGain;
wheel_increment = WheelIncrScreen;
diff --git a/libs/surfaces/tranzport/show.cc b/libs/surfaces/tranzport/show.cc
index 027665ef4a..027485b944 100644
--- a/libs/surfaces/tranzport/show.cc
+++ b/libs/surfaces/tranzport/show.cc
@@ -284,7 +284,7 @@ TranzportControlProtocol::show_meter ()
}
void
-TranzportControlProtocol::show_bbt (framepos_t where)
+TranzportControlProtocol::show_bbt (samplepos_t where)
{
if (where != last_where) {
char buf[16];
@@ -348,11 +348,11 @@ TranzportControlProtocol::show_bbt (framepos_t where)
void
TranzportControlProtocol::show_transport_time ()
{
- show_bbt (session->transport_frame ());
+ show_bbt (session->transport_sample ());
}
void
-TranzportControlProtocol::show_timecode (framepos_t where)
+TranzportControlProtocol::show_timecode (samplepos_t where)
{
if ((where != last_where) || lcd_isdamaged(1,9,10)) {
diff --git a/libs/surfaces/tranzport/tranzport_control_protocol.h b/libs/surfaces/tranzport/tranzport_control_protocol.h
index 32d88aaf5e..95def2bc6e 100644
--- a/libs/surfaces/tranzport/tranzport_control_protocol.h
+++ b/libs/surfaces/tranzport/tranzport_control_protocol.h
@@ -192,8 +192,8 @@ private:
uint32_t last_hrs;
uint32_t last_mins;
uint32_t last_secs;
- uint32_t last_frames;
- framepos_t last_where;
+ uint32_t last_samples;
+ samplepos_t last_where;
ARDOUR::gain_t last_track_gain;
uint32_t last_meter_fill;
struct timeval last_wheel_motion;
@@ -301,8 +301,8 @@ private:
void show_current_track ();
void show_track_gain ();
void show_transport_time ();
- void show_bbt (framepos_t where);
- void show_timecode (framepos_t where);
+ void show_bbt (samplepos_t where);
+ void show_timecode (samplepos_t where);
void show_wheel_mode ();
void show_gain ();
void show_pan ();