Remove all use of nframes_t.

git-svn-id: svn://localhost/ardour2/branches/3.0@8166 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2010-12-03 22:26:29 +00:00
parent 74b4a3c77b
commit 73192bc1a7
280 changed files with 1615 additions and 1628 deletions

View file

@ -278,9 +278,9 @@ AnalysisWindow::analyze_data (Gtk::Button */*button*/)
int n; int n;
for (int channel = 0; channel < n_inputs; channel++) { for (int channel = 0; channel < n_inputs; channel++) {
nframes_t x = 0; framecnt_t x = 0;
while ( x < (*j).length() ) { while (x < j->length()) {
// TODO: What about stereo+ channels? composite all to one, I guess // TODO: What about stereo+ channels? composite all to one, I guess
n = fft_graph.windowSize(); n = fft_graph.windowSize();
@ -322,11 +322,11 @@ AnalysisWindow::analyze_data (Gtk::Button */*button*/)
int n; int n;
for (int channel = 0; channel < n_inputs; channel++) { for (int channel = 0; channel < n_inputs; channel++) {
nframes_t x = 0; framecnt_t x = 0;
nframes_t length = arv->region()->length(); framecnt_t length = arv->region()->length();
while ( x < length ) { while (x < length) {
// TODO: What about stereo+ channels? composite all to one, I guess // TODO: What about stereo+ channels? composite all to one, I guess
n = fft_graph.windowSize(); n = fft_graph.windowSize();

View file

@ -121,7 +121,7 @@ UIConfiguration *ARDOUR_UI::ui_config = 0;
sigc::signal<void,bool> ARDOUR_UI::Blink; sigc::signal<void,bool> ARDOUR_UI::Blink;
sigc::signal<void> ARDOUR_UI::RapidScreenUpdate; sigc::signal<void> ARDOUR_UI::RapidScreenUpdate;
sigc::signal<void> ARDOUR_UI::SuperRapidScreenUpdate; sigc::signal<void> ARDOUR_UI::SuperRapidScreenUpdate;
sigc::signal<void,nframes_t, bool, nframes_t> ARDOUR_UI::Clock; sigc::signal<void, framepos_t, bool, framepos_t> ARDOUR_UI::Clock;
bool could_be_a_valid_path (const string& path); bool could_be_a_valid_path (const string& path);
@ -952,7 +952,7 @@ ARDOUR_UI::every_point_zero_one_seconds ()
} }
void void
ARDOUR_UI::update_sample_rate (nframes_t) ARDOUR_UI::update_sample_rate (framecnt_t)
{ {
char buf[32]; char buf[32];
@ -964,7 +964,7 @@ ARDOUR_UI::update_sample_rate (nframes_t)
} else { } else {
nframes_t rate = engine->frame_rate(); framecnt_t rate = engine->frame_rate();
if (fmod (rate, 1000.0) != 0.0) { if (fmod (rate, 1000.0) != 0.0) {
snprintf (buf, sizeof (buf), _("%.1f kHz / %4.1f ms"), snprintf (buf, sizeof (buf), _("%.1f kHz / %4.1f ms"),
@ -1024,7 +1024,7 @@ ARDOUR_UI::update_disk_space()
framecnt_t frames = _session->available_capture_duration(); framecnt_t frames = _session->available_capture_duration();
char buf[64]; char buf[64];
nframes_t fr = _session->frame_rate(); framecnt_t fr = _session->frame_rate();
if (frames == max_framecnt) { if (frames == max_framecnt) {
strcpy (buf, _("Disk: 24hrs+")); strcpy (buf, _("Disk: 24hrs+"));
@ -1415,9 +1415,9 @@ restart JACK with more ports."), PROGRAM_NAME));
} }
void void
ARDOUR_UI::do_transport_locate (nframes_t new_position, bool with_roll) ARDOUR_UI::do_transport_locate (framepos_t new_position, bool with_roll)
{ {
nframes_t _preroll = 0; framecnt_t _preroll = 0;
if (_session) { if (_session) {
// XXX CONFIG_CHANGE FIX - requires AnyTime handling // XXX CONFIG_CHANGE FIX - requires AnyTime handling
@ -1497,7 +1497,7 @@ void
ARDOUR_UI::transport_goto_end () ARDOUR_UI::transport_goto_end ()
{ {
if (_session) { if (_session) {
nframes_t const frame = _session->current_end_frame(); framepos_t const frame = _session->current_end_frame();
_session->request_locate (frame); _session->request_locate (frame);
/* force displayed area in editor to start no matter /* force displayed area in editor to start no matter
@ -3257,7 +3257,7 @@ ARDOUR_UI::keyboard_settings () const
} }
void void
ARDOUR_UI::create_xrun_marker(nframes_t where) ARDOUR_UI::create_xrun_marker (framepos_t where)
{ {
editor->mouse_add_new_marker (where, false, true); editor->mouse_add_new_marker (where, false, true);
} }
@ -3271,7 +3271,7 @@ ARDOUR_UI::halt_on_xrun_message ()
} }
void void
ARDOUR_UI::xrun_handler(nframes_t where) ARDOUR_UI::xrun_handler (framepos_t where)
{ {
if (!_session) { if (!_session) {
return; return;
@ -3384,7 +3384,7 @@ what you would like to do.\n"));
} }
int int
ARDOUR_UI::sr_mismatch_dialog (nframes_t desired, nframes_t actual) ARDOUR_UI::sr_mismatch_dialog (framecnt_t desired, framecnt_t actual)
{ {
HBox* hbox = new HBox(); HBox* hbox = new HBox();
Image* image = new Image (Stock::DIALOG_QUESTION, ICON_SIZE_DIALOG); Image* image = new Image (Stock::DIALOG_QUESTION, ICON_SIZE_DIALOG);
@ -3451,7 +3451,7 @@ ARDOUR_UI::use_config ()
} }
void void
ARDOUR_UI::update_transport_clocks (nframes_t pos) ARDOUR_UI::update_transport_clocks (framepos_t pos)
{ {
if (Config->get_primary_clock_delta_edit_cursor()) { if (Config->get_primary_clock_delta_edit_cursor()) {
primary_clock.set (pos, false, editor->get_preferred_edit_position(), 1); primary_clock.set (pos, false, editor->get_preferred_edit_position(), 1);

View file

@ -174,7 +174,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
static sigc::signal<void,bool> Blink; static sigc::signal<void,bool> Blink;
static sigc::signal<void> RapidScreenUpdate; static sigc::signal<void> RapidScreenUpdate;
static sigc::signal<void> SuperRapidScreenUpdate; static sigc::signal<void> SuperRapidScreenUpdate;
static sigc::signal<void,nframes_t, bool, nframes_t> Clock; static sigc::signal<void, framepos_t, bool, framepos_t> Clock;
XMLNode* editor_settings() const; XMLNode* editor_settings() const;
XMLNode* mixer_settings () const; XMLNode* mixer_settings () const;
@ -184,10 +184,10 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
void save_ardour_state (); void save_ardour_state ();
gboolean configure_handler (GdkEventConfigure* conf); gboolean configure_handler (GdkEventConfigure* conf);
void do_transport_locate (nframes_t, bool); void do_transport_locate (framepos_t, bool);
void halt_on_xrun_message (); void halt_on_xrun_message ();
void xrun_handler (nframes_t); void xrun_handler (framepos_t);
void create_xrun_marker (nframes_t); void create_xrun_marker (framepos_t);
AudioClock primary_clock; AudioClock primary_clock;
AudioClock secondary_clock; AudioClock secondary_clock;
@ -328,7 +328,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
void float_big_clock (Gtk::Window* parent); void float_big_clock (Gtk::Window* parent);
bool main_window_state_event_handler (GdkEventWindowState*, bool window_was_editor); bool main_window_state_event_handler (GdkEventWindowState*, bool window_was_editor);
void update_transport_clocks (nframes_t pos); void update_transport_clocks (framepos_t pos);
void record_state_changed (); void record_state_changed ();
std::list<MidiTracer*> _midi_tracer_windows; std::list<MidiTracer*> _midi_tracer_windows;
@ -523,7 +523,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
Gtk::Label sample_rate_label; Gtk::Label sample_rate_label;
Gtk::EventBox sample_rate_box; Gtk::EventBox sample_rate_box;
void update_sample_rate (nframes_t); void update_sample_rate (ARDOUR::framecnt_t);
gint every_second (); gint every_second ();
gint every_point_one_seconds (); gint every_point_one_seconds ();
@ -659,11 +659,11 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
void session_dialog (std::string); void session_dialog (std::string);
int pending_state_dialog (); int pending_state_dialog ();
int sr_mismatch_dialog (nframes_t, nframes_t); int sr_mismatch_dialog (ARDOUR::framecnt_t, ARDOUR::framecnt_t);
void disconnect_from_jack (); void disconnect_from_jack ();
void reconnect_to_jack (); void reconnect_to_jack ();
void set_jack_buffer_size (nframes_t); void set_jack_buffer_size (ARDOUR::pframes_t);
Gtk::MenuItem* jack_disconnect_item; Gtk::MenuItem* jack_disconnect_item;
Gtk::MenuItem* jack_reconnect_item; Gtk::MenuItem* jack_reconnect_item;

View file

@ -187,23 +187,23 @@ ARDOUR_UI::install_actions ()
RadioAction::Group jack_latency_group; RadioAction::Group jack_latency_group;
act = ActionManager::register_radio_action (jack_actions, jack_latency_group, X_("JACKLatency32"), X_("32"), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::set_jack_buffer_size), (nframes_t) 32)); act = ActionManager::register_radio_action (jack_actions, jack_latency_group, X_("JACKLatency32"), X_("32"), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::set_jack_buffer_size), (pframes_t) 32));
ActionManager::jack_sensitive_actions.push_back (act); ActionManager::jack_sensitive_actions.push_back (act);
act = ActionManager::register_radio_action (jack_actions, jack_latency_group, X_("JACKLatency64"), X_("64"), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::set_jack_buffer_size), (nframes_t) 64)); act = ActionManager::register_radio_action (jack_actions, jack_latency_group, X_("JACKLatency64"), X_("64"), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::set_jack_buffer_size), (pframes_t) 64));
ActionManager::jack_sensitive_actions.push_back (act); ActionManager::jack_sensitive_actions.push_back (act);
act = ActionManager::register_radio_action (jack_actions, jack_latency_group, X_("JACKLatency128"), X_("128"), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::set_jack_buffer_size), (nframes_t) 128)); act = ActionManager::register_radio_action (jack_actions, jack_latency_group, X_("JACKLatency128"), X_("128"), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::set_jack_buffer_size), (pframes_t) 128));
ActionManager::jack_sensitive_actions.push_back (act); ActionManager::jack_sensitive_actions.push_back (act);
act = ActionManager::register_radio_action (jack_actions, jack_latency_group, X_("JACKLatency256"), X_("256"), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::set_jack_buffer_size), (nframes_t) 256)); act = ActionManager::register_radio_action (jack_actions, jack_latency_group, X_("JACKLatency256"), X_("256"), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::set_jack_buffer_size), (pframes_t) 256));
ActionManager::jack_sensitive_actions.push_back (act); ActionManager::jack_sensitive_actions.push_back (act);
act = ActionManager::register_radio_action (jack_actions, jack_latency_group, X_("JACKLatency512"), X_("512"), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::set_jack_buffer_size), (nframes_t) 512)); act = ActionManager::register_radio_action (jack_actions, jack_latency_group, X_("JACKLatency512"), X_("512"), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::set_jack_buffer_size), (pframes_t) 512));
ActionManager::jack_sensitive_actions.push_back (act); ActionManager::jack_sensitive_actions.push_back (act);
act = ActionManager::register_radio_action (jack_actions, jack_latency_group, X_("JACKLatency1024"), X_("1024"), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::set_jack_buffer_size), (nframes_t) 1024)); act = ActionManager::register_radio_action (jack_actions, jack_latency_group, X_("JACKLatency1024"), X_("1024"), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::set_jack_buffer_size), (pframes_t) 1024));
ActionManager::jack_sensitive_actions.push_back (act); ActionManager::jack_sensitive_actions.push_back (act);
act = ActionManager::register_radio_action (jack_actions, jack_latency_group, X_("JACKLatency2048"), X_("2048"), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::set_jack_buffer_size), (nframes_t) 2048)); act = ActionManager::register_radio_action (jack_actions, jack_latency_group, X_("JACKLatency2048"), X_("2048"), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::set_jack_buffer_size), (pframes_t) 2048));
ActionManager::jack_sensitive_actions.push_back (act); ActionManager::jack_sensitive_actions.push_back (act);
act = ActionManager::register_radio_action (jack_actions, jack_latency_group, X_("JACKLatency4096"), X_("4096"), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::set_jack_buffer_size), (nframes_t) 4096)); act = ActionManager::register_radio_action (jack_actions, jack_latency_group, X_("JACKLatency4096"), X_("4096"), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::set_jack_buffer_size), (pframes_t) 4096));
ActionManager::jack_sensitive_actions.push_back (act); ActionManager::jack_sensitive_actions.push_back (act);
act = ActionManager::register_radio_action (jack_actions, jack_latency_group, X_("JACKLatency8192"), X_("8192"), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::set_jack_buffer_size), (nframes_t) 8192)); act = ActionManager::register_radio_action (jack_actions, jack_latency_group, X_("JACKLatency8192"), X_("8192"), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::set_jack_buffer_size), (pframes_t) 8192));
ActionManager::jack_sensitive_actions.push_back (act); ActionManager::jack_sensitive_actions.push_back (act);
/* these actions are intended to be shared across all windows */ /* these actions are intended to be shared across all windows */
@ -441,7 +441,7 @@ ARDOUR_UI::install_actions ()
} }
void void
ARDOUR_UI::set_jack_buffer_size (nframes_t nframes) ARDOUR_UI::set_jack_buffer_size (pframes_t nframes)
{ {
Glib::RefPtr<Action> action; Glib::RefPtr<Action> action;
const char* action_name = 0; const char* action_name = 0;

View file

@ -414,7 +414,7 @@ AudioClock::on_realize ()
} }
void void
AudioClock::set (nframes_t when, bool force, nframes_t offset, char which) AudioClock::set (framepos_t when, bool force, framecnt_t offset, char which)
{ {
if ((!force && !is_visible()) || _session == 0) { if ((!force && !is_visible()) || _session == 0) {
@ -479,12 +479,12 @@ AudioClock::session_configuration_changed (std::string p)
return; return;
} }
nframes_t current; framecnt_t current;
switch (_mode) { switch (_mode) {
case Timecode: case Timecode:
if (is_duration) { if (is_duration) {
current = current_duration(); current = current_duration ();
} else { } else {
current = current_time (); current = current_time ();
} }
@ -496,17 +496,17 @@ AudioClock::session_configuration_changed (std::string p)
} }
void void
AudioClock::set_frames (nframes_t when, bool /*force*/) AudioClock::set_frames (framepos_t when, bool /*force*/)
{ {
char buf[32]; char buf[32];
snprintf (buf, sizeof (buf), "%u", when); snprintf (buf, sizeof (buf), "%" PRId64, when);
audio_frames_label.set_text (buf); audio_frames_label.set_text (buf);
if (frames_upper_info_label) { if (frames_upper_info_label) {
nframes_t rate = _session->frame_rate(); framecnt_t rate = _session->frame_rate();
if (fmod (rate, 1000.0) == 0.000) { if (fmod (rate, 1000.0) == 0.000) {
sprintf (buf, "%uK", rate/1000); sprintf (buf, "%" PRId64 "K", rate/1000);
} else { } else {
sprintf (buf, "%.3fK", rate/1000.0f); sprintf (buf, "%.3fK", rate/1000.0f);
} }
@ -531,19 +531,19 @@ AudioClock::set_frames (nframes_t when, bool /*force*/)
} }
void void
AudioClock::set_minsec (nframes_t when, bool force) AudioClock::set_minsec (framepos_t when, bool force)
{ {
char buf[32]; char buf[32];
nframes_t left; framecnt_t left;
int hrs; int hrs;
int mins; int mins;
float secs; float secs;
left = when; left = when;
hrs = (int) floor (left / (_session->frame_rate() * 60.0f * 60.0f)); hrs = (int) floor (left / (_session->frame_rate() * 60.0f * 60.0f));
left -= (nframes_t) floor (hrs * _session->frame_rate() * 60.0f * 60.0f); left -= (framecnt_t) floor (hrs * _session->frame_rate() * 60.0f * 60.0f);
mins = (int) floor (left / (_session->frame_rate() * 60.0f)); mins = (int) floor (left / (_session->frame_rate() * 60.0f));
left -= (nframes_t) floor (mins * _session->frame_rate() * 60.0f); left -= (framecnt_t) floor (mins * _session->frame_rate() * 60.0f);
secs = left / (float) _session->frame_rate(); secs = left / (float) _session->frame_rate();
if (force || hrs != ms_last_hrs) { if (force || hrs != ms_last_hrs) {
@ -566,7 +566,7 @@ AudioClock::set_minsec (nframes_t when, bool force)
} }
void void
AudioClock::set_timecode (nframes_t when, bool force) AudioClock::set_timecode (framepos_t when, bool force)
{ {
char buf[32]; char buf[32];
Timecode::Time timecode; Timecode::Time timecode;
@ -637,7 +637,7 @@ AudioClock::set_timecode (nframes_t when, bool force)
} }
void void
AudioClock::set_bbt (nframes_t when, bool force) AudioClock::set_bbt (framepos_t when, bool force)
{ {
char buf[16]; char buf[16];
BBT_Time bbt; BBT_Time bbt;
@ -1198,7 +1198,7 @@ AudioClock::field_button_press_event (GdkEventButton *ev, Field /*field*/)
return false; return false;
} }
nframes_t frames = 0; framepos_t frames = 0;
switch (ev->button) { switch (ev->button) {
case 1: case 1:
@ -1244,7 +1244,7 @@ AudioClock::field_button_scroll_event (GdkEventScroll *ev, Field field)
return false; return false;
} }
nframes_t frames = 0; framepos_t frames = 0;
switch (ev->direction) { switch (ev->direction) {
@ -1313,8 +1313,8 @@ AudioClock::field_motion_notify_event (GdkEventMotion *ev, Field field)
if (trunc(drag_accum) != 0) { if (trunc(drag_accum) != 0) {
nframes_t frames; framepos_t frames;
nframes_t pos ; framepos_t pos;
int dir; int dir;
dir = (drag_accum < 0 ? 1:-1); dir = (drag_accum < 0 ? 1:-1);
pos = current_time(); pos = current_time();
@ -1322,7 +1322,7 @@ AudioClock::field_motion_notify_event (GdkEventMotion *ev, Field field)
if (frames != 0 && frames * drag_accum < current_time()) { if (frames != 0 && frames * drag_accum < current_time()) {
set ((nframes_t) floor (pos - drag_accum * frames), false); // minus because up is negative in computer-land set ((framepos_t) floor (pos - drag_accum * frames), false); // minus because up is negative in computer-land
} else { } else {
set (0 , false); set (0 , false);
@ -1338,24 +1338,23 @@ AudioClock::field_motion_notify_event (GdkEventMotion *ev, Field field)
return true; return true;
} }
nframes_t framepos_t
AudioClock::get_frames (Field field,nframes_t pos,int dir) AudioClock::get_frames (Field field, framepos_t pos, int dir)
{ {
framecnt_t frames = 0;
nframes_t frames = 0;
BBT_Time bbt; BBT_Time bbt;
switch (field) { switch (field) {
case Timecode_Hours: case Timecode_Hours:
frames = (nframes_t) floor (3600.0 * _session->frame_rate()); frames = (framecnt_t) floor (3600.0 * _session->frame_rate());
break; break;
case Timecode_Minutes: case Timecode_Minutes:
frames = (nframes_t) floor (60.0 * _session->frame_rate()); frames = (framecnt_t) floor (60.0 * _session->frame_rate());
break; break;
case Timecode_Seconds: case Timecode_Seconds:
frames = _session->frame_rate(); frames = _session->frame_rate();
break; break;
case Timecode_Frames: case Timecode_Frames:
frames = (nframes_t) floor (_session->frame_rate() / _session->timecode_frames_per_second()); frames = (framecnt_t) floor (_session->frame_rate() / _session->timecode_frames_per_second());
break; break;
case AudioFrames: case AudioFrames:
@ -1363,10 +1362,10 @@ AudioClock::get_frames (Field field,nframes_t pos,int dir)
break; break;
case MS_Hours: case MS_Hours:
frames = (nframes_t) floor (3600.0 * _session->frame_rate()); frames = (framecnt_t) floor (3600.0 * _session->frame_rate());
break; break;
case MS_Minutes: case MS_Minutes:
frames = (nframes_t) floor (60.0 * _session->frame_rate()); frames = (framecnt_t) floor (60.0 * _session->frame_rate());
break; break;
case MS_Seconds: case MS_Seconds:
frames = _session->frame_rate(); frames = _session->frame_rate();
@ -1395,10 +1394,10 @@ AudioClock::get_frames (Field field,nframes_t pos,int dir)
return frames; return frames;
} }
nframes_t framepos_t
AudioClock::current_time (nframes_t pos) const AudioClock::current_time (framepos_t pos) const
{ {
nframes_t ret = 0; framepos_t ret = 0;
switch (_mode) { switch (_mode) {
case Timecode: case Timecode:
@ -1423,10 +1422,10 @@ AudioClock::current_time (nframes_t pos) const
return ret; return ret;
} }
nframes_t framepos_t
AudioClock::current_duration (nframes_t pos) const AudioClock::current_duration (framepos_t pos) const
{ {
nframes_t ret = 0; framepos_t ret = 0;
switch (_mode) { switch (_mode) {
case Timecode: case Timecode:
@ -1490,7 +1489,7 @@ AudioClock::timecode_sanitize_display()
} }
} }
nframes_t framepos_t
AudioClock::timecode_frame_from_display () const AudioClock::timecode_frame_from_display () const
{ {
if (_session == 0) { if (_session == 0) {
@ -1883,7 +1882,7 @@ AudioClock::timecode_frame_from_display () const
return sample; return sample;
} }
nframes_t framepos_t
AudioClock::minsec_frame_from_display () const AudioClock::minsec_frame_from_display () const
{ {
if (_session == 0) { if (_session == 0) {
@ -1894,13 +1893,13 @@ AudioClock::minsec_frame_from_display () const
int mins = atoi (ms_minutes_label.get_text()); int mins = atoi (ms_minutes_label.get_text());
float secs = atof (ms_seconds_label.get_text()); float secs = atof (ms_seconds_label.get_text());
nframes_t sr = _session->frame_rate(); framecnt_t sr = _session->frame_rate();
return (nframes_t) floor ((hrs * 60.0f * 60.0f * sr) + (mins * 60.0f * sr) + (secs * sr)); return (framepos_t) floor ((hrs * 60.0f * 60.0f * sr) + (mins * 60.0f * sr) + (secs * sr));
} }
nframes_t framepos_t
AudioClock::bbt_frame_from_display (nframes_t pos) const AudioClock::bbt_frame_from_display (framepos_t pos) const
{ {
if (_session == 0) { if (_session == 0) {
error << "AudioClock::current_time() called with BBT mode but without session!" << endmsg; error << "AudioClock::current_time() called with BBT mode but without session!" << endmsg;
@ -1919,14 +1918,12 @@ AudioClock::bbt_frame_from_display (nframes_t pos) const
any.bbt.beats++; any.bbt.beats++;
} }
nframes_t ret = _session->convert_to_frames_at (pos, any); return _session->convert_to_frames_at (pos, any);
return ret;
} }
nframes_t framepos_t
AudioClock::bbt_frame_duration_from_display (nframes_t pos) const AudioClock::bbt_frame_duration_from_display (framepos_t pos) const
{ {
if (_session == 0) { if (_session == 0) {
error << "AudioClock::current_time() called with BBT mode but without session!" << endmsg; error << "AudioClock::current_time() called with BBT mode but without session!" << endmsg;
@ -1943,10 +1940,10 @@ AudioClock::bbt_frame_duration_from_display (nframes_t pos) const
return _session->tempo_map().bbt_duration_at(pos,bbt,1); return _session->tempo_map().bbt_duration_at(pos,bbt,1);
} }
nframes_t framepos_t
AudioClock::audio_frame_from_display () const AudioClock::audio_frame_from_display () const
{ {
return (nframes_t) atoi (audio_frames_label.get_text()); return (framepos_t) atoi (audio_frames_label.get_text());
} }
void void

View file

@ -50,7 +50,7 @@ class AudioClock : public Gtk::HBox, public ARDOUR::SessionHandlePtr
void focus (); void focus ();
void set (nframes_t, bool force = false, nframes_t offset = 0, char which = 0); void set (framepos_t, bool force = false, ARDOUR::framecnt_t offset = 0, char which = 0);
void set_from_playhead (); void set_from_playhead ();
void locate (); void locate ();
void set_mode (Mode); void set_mode (Mode);
@ -61,8 +61,8 @@ class AudioClock : public Gtk::HBox, public ARDOUR::SessionHandlePtr
std::string name() const { return _name; } std::string name() const { return _name; }
nframes_t current_time (nframes_t position = 0) const; framepos_t current_time (framepos_t position = 0) const;
nframes_t current_duration (nframes_t position = 0) const; framepos_t current_duration (framepos_t position = 0) const;
void set_session (ARDOUR::Session *s); void set_session (ARDOUR::Session *s);
sigc::signal<void> ValueChanged; sigc::signal<void> ValueChanged;
@ -164,7 +164,7 @@ class AudioClock : public Gtk::HBox, public ARDOUR::SessionHandlePtr
Gtk::Frame clock_frame; Gtk::Frame clock_frame;
framepos_t bbt_reference_time; framepos_t bbt_reference_time;
nframes_t last_when; framepos_t last_when;
bool last_pdelta; bool last_pdelta;
bool last_sdelta; bool last_sdelta;
@ -195,19 +195,19 @@ class AudioClock : public Gtk::HBox, public ARDOUR::SessionHandlePtr
bool field_focus_out_event (GdkEventFocus *, Field); bool field_focus_out_event (GdkEventFocus *, Field);
bool drop_focus_handler (GdkEventFocus*); bool drop_focus_handler (GdkEventFocus*);
void set_timecode (nframes_t, bool); void set_timecode (framepos_t, bool);
void set_bbt (nframes_t, bool); void set_bbt (framepos_t, bool);
void set_minsec (nframes_t, bool); void set_minsec (framepos_t, bool);
void set_frames (nframes_t, bool); void set_frames (framepos_t, bool);
nframes_t get_frames (Field,nframes_t pos = 0,int dir=1); framepos_t get_frames (Field, framepos_t pos = 0, int dir = 1);
void timecode_sanitize_display(); void timecode_sanitize_display();
nframes_t timecode_frame_from_display () const; framepos_t timecode_frame_from_display () const;
nframes_t bbt_frame_from_display (nframes_t) const; framepos_t bbt_frame_from_display (framepos_t) const;
nframes_t bbt_frame_duration_from_display (nframes_t) const; framepos_t bbt_frame_duration_from_display (framepos_t) const;
nframes_t minsec_frame_from_display () const; framepos_t minsec_frame_from_display () const;
nframes_t audio_frame_from_display () const; framepos_t audio_frame_from_display () const;
void build_ops_menu (); void build_ops_menu ();
void setup_events (); void setup_events ();

View file

@ -573,11 +573,11 @@ AudioRegionView::reset_fade_shapes ()
void void
AudioRegionView::reset_fade_in_shape () AudioRegionView::reset_fade_in_shape ()
{ {
reset_fade_in_shape_width ((nframes_t) audio_region()->fade_in()->back()->when); reset_fade_in_shape_width ((framecnt_t) audio_region()->fade_in()->back()->when);
} }
void void
AudioRegionView::reset_fade_in_shape_width (nframes_t width) AudioRegionView::reset_fade_in_shape_width (framecnt_t width)
{ {
if (fade_in_handle == 0) { if (fade_in_handle == 0) {
return; return;
@ -585,7 +585,7 @@ AudioRegionView::reset_fade_in_shape_width (nframes_t width)
/* smallest size for a fade is 64 frames */ /* smallest size for a fade is 64 frames */
width = std::max ((nframes_t) 64, width); width = std::max ((framecnt_t) 64, width);
Points* points; Points* points;
@ -665,11 +665,11 @@ AudioRegionView::reset_fade_in_shape_width (nframes_t width)
void void
AudioRegionView::reset_fade_out_shape () AudioRegionView::reset_fade_out_shape ()
{ {
reset_fade_out_shape_width ((nframes_t) audio_region()->fade_out()->back()->when); reset_fade_out_shape_width ((framecnt_t) audio_region()->fade_out()->back()->when);
} }
void void
AudioRegionView::reset_fade_out_shape_width (nframes_t width) AudioRegionView::reset_fade_out_shape_width (framecnt_t width)
{ {
if (fade_out_handle == 0) { if (fade_out_handle == 0) {
return; return;
@ -677,7 +677,7 @@ AudioRegionView::reset_fade_out_shape_width (nframes_t width)
/* smallest size for a fade is 64 frames */ /* smallest size for a fade is 64 frames */
width = std::max ((nframes_t) 64, width); width = std::max ((framecnt_t) 64, width);
Points* points; Points* points;
double pwidth = width / samples_per_unit; double pwidth = width / samples_per_unit;
@ -1043,7 +1043,7 @@ AudioRegionView::add_gain_point_event (ArdourCanvas::Item *item, GdkEvent *ev)
item->w2i (x, y); item->w2i (x, y);
nframes_t fx = trackview.editor().pixel_to_frame (x); framepos_t fx = trackview.editor().pixel_to_frame (x);
if (fx > _region->length()) { if (fx > _region->length()) {
return; return;

View file

@ -100,8 +100,8 @@ class AudioRegionView : public RegionView
GhostRegion* add_ghost (TimeAxisView&); GhostRegion* add_ghost (TimeAxisView&);
void reset_fade_in_shape_width (nframes_t); void reset_fade_in_shape_width (framecnt_t);
void reset_fade_out_shape_width (nframes_t); void reset_fade_out_shape_width (framecnt_t);
void show_fade_line(framepos_t pos); void show_fade_line(framepos_t pos);
void hide_fade_line(); void hide_fade_line();

View file

@ -471,7 +471,7 @@ AudioStreamView::setup_rec_box ()
// handle multi // handle multi
nframes_t start = 0; framepos_t start = 0;
if (rec_regions.size() > 0) { if (rec_regions.size() > 0) {
start = rec_regions.back().first->start() start = rec_regions.back().first->start()
+ _trackview.track()->get_captured_frames(rec_regions.size()-1); + _trackview.track()->get_captured_frames(rec_regions.size()-1);
@ -600,7 +600,7 @@ AudioStreamView::foreach_crossfadeview (void (CrossfadeView::*pmf)(void))
} }
void void
AudioStreamView::rec_peak_range_ready (nframes_t start, nframes_t cnt, boost::weak_ptr<Source> weak_src) AudioStreamView::rec_peak_range_ready (framepos_t start, framecnt_t cnt, boost::weak_ptr<Source> weak_src)
{ {
ENSURE_GUI_THREAD (*this, &AudioStreamView::rec_peak_range_ready, start, cnt, weak_src) ENSURE_GUI_THREAD (*this, &AudioStreamView::rec_peak_range_ready, start, cnt, weak_src)
@ -653,13 +653,13 @@ AudioStreamView::update_rec_regions (framepos_t start, framecnt_t cnt)
continue; continue;
} }
nframes_t origlen = region->length(); framecnt_t origlen = region->length();
if (region == rec_regions.back().first && rec_active) { if (region == rec_regions.back().first && rec_active) {
if (last_rec_data_frame > region->start()) { if (last_rec_data_frame > region->start()) {
nframes_t nlen = last_rec_data_frame - region->start(); framecnt_t nlen = last_rec_data_frame - region->start();
if (nlen != region->length()) { if (nlen != region->length()) {
@ -684,7 +684,7 @@ AudioStreamView::update_rec_regions (framepos_t start, framecnt_t cnt)
} else { } else {
nframes_t nlen = _trackview.track()->get_captured_frames(n); framecnt_t nlen = _trackview.track()->get_captured_frames(n);
if (nlen != region->length()) { if (nlen != region->length()) {

View file

@ -78,7 +78,7 @@ class AudioStreamView : public StreamView
private: private:
void setup_rec_box (); void setup_rec_box ();
void rec_peak_range_ready (nframes_t start, nframes_t cnt, boost::weak_ptr<ARDOUR::Source> src); void rec_peak_range_ready (framepos_t start, ARDOUR::framecnt_t cnt, boost::weak_ptr<ARDOUR::Source> src);
void update_rec_regions (ARDOUR::framepos_t, ARDOUR::framecnt_t); void update_rec_regions (ARDOUR::framepos_t, ARDOUR::framecnt_t);
RegionView* add_region_view_internal (boost::shared_ptr<ARDOUR::Region>, bool wait_for_waves, bool recording = false); RegionView* add_region_view_internal (boost::shared_ptr<ARDOUR::Region>, bool wait_for_waves, bool recording = false);

View file

@ -126,7 +126,7 @@ AutomationRegionView::canvas_event(GdkEvent* ev)
* @param y y position, relative to our TimeAxisView. * @param y y position, relative to our TimeAxisView.
*/ */
void void
AutomationRegionView::add_automation_event (GdkEvent *, nframes_t when, double y) AutomationRegionView::add_automation_event (GdkEvent *, framepos_t when, double y)
{ {
if (!_line) { if (!_line) {
boost::shared_ptr<Evoral::Control> c = _region->control(_parameter, true); boost::shared_ptr<Evoral::Control> c = _region->control(_parameter, true);

View file

@ -67,7 +67,7 @@ protected:
bool set_position(framepos_t pos, void* src, double* ignored); bool set_position(framepos_t pos, void* src, double* ignored);
void region_resized (const PBD::PropertyChange&); void region_resized (const PBD::PropertyChange&);
bool canvas_event(GdkEvent* ev); bool canvas_event(GdkEvent* ev);
void add_automation_event (GdkEvent* event, nframes_t when, double y); void add_automation_event (GdkEvent* event, framepos_t when, double y);
void entered (bool); void entered (bool);
void exited(); void exited();

View file

@ -587,7 +587,7 @@ AutomationTimeAxisView::build_display_menu ()
} }
void void
AutomationTimeAxisView::add_automation_event (ArdourCanvas::Item* /*item*/, GdkEvent* /*event*/, nframes_t when, double y) AutomationTimeAxisView::add_automation_event (ArdourCanvas::Item* /*item*/, GdkEvent* /*event*/, framepos_t when, double y)
{ {
if (!_line) if (!_line)
return; return;

View file

@ -72,7 +72,7 @@ class AutomationTimeAxisView : public TimeAxisView {
bool set_visibility (bool yn); bool set_visibility (bool yn);
std::string name() const { return _name; } std::string name() const { return _name; }
void add_automation_event (ArdourCanvas::Item *item, GdkEvent *event, nframes_t, double); void add_automation_event (ArdourCanvas::Item *item, GdkEvent *event, framepos_t, double);
void clear_lines (); void clear_lines ();
@ -86,7 +86,7 @@ class AutomationTimeAxisView : public TimeAxisView {
void get_selectables (ARDOUR::framepos_t start, ARDOUR::framepos_t end, double top, double bot, std::list<Selectable *>&); void get_selectables (ARDOUR::framepos_t start, ARDOUR::framepos_t end, double top, double bot, std::list<Selectable *>&);
void get_inverted_selectables (Selection&, std::list<Selectable*>& results); void get_inverted_selectables (Selection&, std::list<Selectable*>& results);
void show_timestretch (nframes_t /*start*/, nframes_t /*end*/) {} void show_timestretch (framepos_t /*start*/, framepos_t /*end*/) {}
void hide_timestretch () {} void hide_timestretch () {}
/* editing operations */ /* editing operations */

View file

@ -656,7 +656,7 @@ CrossfadeEditor::redraw ()
return; return;
} }
nframes_t len = xfade->length (); framecnt_t len = xfade->length ();
fade[current].normative_curve.clear (); fade[current].normative_curve.clear ();
fade[current].gain_curve.clear (); fade[current].gain_curve.clear ();
@ -1215,11 +1215,11 @@ void
CrossfadeEditor::audition (Audition which) CrossfadeEditor::audition (Audition which)
{ {
AudioPlaylist& pl (_session->the_auditioner()->prepare_playlist()); AudioPlaylist& pl (_session->the_auditioner()->prepare_playlist());
nframes_t preroll; framecnt_t preroll;
nframes_t postroll; framecnt_t postroll;
nframes_t left_start_offset; framecnt_t left_start_offset;
nframes_t right_length; framecnt_t right_length;
nframes_t left_length; framecnt_t left_length;
if (which != Right && preroll_button.get_active()) { if (which != Right && preroll_button.get_active()) {
preroll = _session->frame_rate() * 2; //2 second hardcoded preroll for now preroll = _session->frame_rate() * 2; //2 second hardcoded preroll for now

View file

@ -1105,7 +1105,7 @@ Editor::set_session (Session *t)
bbt.bars = 0; bbt.bars = 0;
bbt.beats = 0; bbt.beats = 0;
bbt.ticks = 120; bbt.ticks = 120;
nframes_t pos = _session->tempo_map().bbt_duration_at (0, bbt, 1); framepos_t pos = _session->tempo_map().bbt_duration_at (0, bbt, 1);
nudge_clock.set_mode(AudioClock::BBT); nudge_clock.set_mode(AudioClock::BBT);
nudge_clock.set (pos, true, 0, AudioClock::BBT); nudge_clock.set (pos, true, 0, AudioClock::BBT);

View file

@ -799,7 +799,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
MinsecRulerScale minsec_ruler_scale; MinsecRulerScale minsec_ruler_scale;
nframes_t minsec_mark_interval; framecnt_t minsec_mark_interval;
gint minsec_mark_modulo; gint minsec_mark_modulo;
gint minsec_nmarks; gint minsec_nmarks;
void set_minsec_ruler_scale (gdouble lower, gdouble upper); void set_minsec_ruler_scale (gdouble lower, gdouble upper);
@ -814,7 +814,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
TimecodeRulerScale timecode_ruler_scale; TimecodeRulerScale timecode_ruler_scale;
nframes_t timecode_mark_interval; framecnt_t timecode_mark_interval;
gint timecode_mark_modulo; gint timecode_mark_modulo;
gint timecode_nmarks; gint timecode_nmarks;
void set_timecode_ruler_scale (gdouble lower, gdouble upper); void set_timecode_ruler_scale (gdouble lower, gdouble upper);
@ -1492,7 +1492,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
void remove_metric_marks (); void remove_metric_marks ();
void draw_metric_marks (const ARDOUR::Metrics& metrics); void draw_metric_marks (const ARDOUR::Metrics& metrics);
void compute_current_bbt_points (nframes_t left, nframes_t right); void compute_current_bbt_points (framepos_t left, framepos_t right);
void tempo_map_changed (const PBD::PropertyChange&); void tempo_map_changed (const PBD::PropertyChange&);
void redisplay_tempo (bool immediate_redraw); void redisplay_tempo (bool immediate_redraw);

View file

@ -1752,13 +1752,13 @@ Editor::temporal_zoom_session ()
ENSURE_GUI_THREAD (*this, &Editor::temporal_zoom_session) ENSURE_GUI_THREAD (*this, &Editor::temporal_zoom_session)
if (_session) { if (_session) {
nframes_t const l = _session->current_end_frame() - _session->current_start_frame(); framecnt_t const l = _session->current_end_frame() - _session->current_start_frame();
double s = _session->current_start_frame() - l * 0.01; double s = _session->current_start_frame() - l * 0.01;
if (s < 0) { if (s < 0) {
s = 0; s = 0;
} }
nframes_t const e = _session->current_end_frame() + l * 0.01; framecnt_t const e = _session->current_end_frame() + l * 0.01;
temporal_zoom_by_frame (nframes_t (s), e, "zoom to _session"); temporal_zoom_by_frame (framecnt_t (s), e, "zoom to _session");
} }
} }
@ -2207,7 +2207,7 @@ Editor::insert_route_list_drag (boost::shared_ptr<Route> route, int x, int y)
{ {
double wx, wy; double wx, wy;
double cx, cy; double cx, cy;
nframes_t where; framepos_t where;
RouteTimeAxisView *dest_rtv = 0; RouteTimeAxisView *dest_rtv = 0;
RouteTimeAxisView *source_rtv = 0; RouteTimeAxisView *source_rtv = 0;
@ -4188,8 +4188,8 @@ Editor::duplicate_some_regions (RegionSelection& regions, float times)
RegionSelection sel = regions; // clear (below) may clear the argument list if its the current region selection RegionSelection sel = regions; // clear (below) may clear the argument list if its the current region selection
RegionSelection foo; RegionSelection foo;
nframes_t const start_frame = regions.start (); framepos_t const start_frame = regions.start ();
nframes_t const end_frame = regions.end_frame (); framepos_t const end_frame = regions.end_frame ();
begin_reversible_command (_("duplicate region")); begin_reversible_command (_("duplicate region"));

View file

@ -800,9 +800,9 @@ EditorRegions::format_position (framepos_t pos, char* buf, size_t bufsize)
left = pos; left = pos;
hrs = (int) floor (left / (_session->frame_rate() * 60.0f * 60.0f)); hrs = (int) floor (left / (_session->frame_rate() * 60.0f * 60.0f));
left -= (nframes_t) floor (hrs * _session->frame_rate() * 60.0f * 60.0f); left -= (framecnt_t) floor (hrs * _session->frame_rate() * 60.0f * 60.0f);
mins = (int) floor (left / (_session->frame_rate() * 60.0f)); mins = (int) floor (left / (_session->frame_rate() * 60.0f));
left -= (nframes_t) floor (mins * _session->frame_rate() * 60.0f); left -= (framecnt_t) floor (mins * _session->frame_rate() * 60.0f);
secs = left / (float) _session->frame_rate(); secs = left / (float) _session->frame_rate();
snprintf (buf, bufsize, "%02d:%02d:%06.3f", hrs, mins, secs); snprintf (buf, bufsize, "%02d:%02d:%06.3f", hrs, mins, secs);
break; break;
@ -844,13 +844,13 @@ EditorRegions::populate_row (boost::shared_ptr<Region> region, TreeModel::Row co
#if 0 #if 0
if (audioRegion && fades_in_seconds) { if (audioRegion && fades_in_seconds) {
nframes_t left; framepos_t left;
int mins; int mins;
int millisecs; int millisecs;
left = audioRegion->fade_in()->back()->when; left = audioRegion->fade_in()->back()->when;
mins = (int) floor (left / (_session->frame_rate() * 60.0f)); mins = (int) floor (left / (_session->frame_rate() * 60.0f));
left -= (nframes_t) floor (mins * _session->frame_rate() * 60.0f); left -= (framepos_t) floor (mins * _session->frame_rate() * 60.0f);
millisecs = (int) floor ((left * 1000.0f) / _session->frame_rate()); millisecs = (int) floor ((left * 1000.0f) / _session->frame_rate());
if (audioRegion->fade_in()->back()->when >= _session->frame_rate()) { if (audioRegion->fade_in()->back()->when >= _session->frame_rate()) {
@ -861,7 +861,7 @@ EditorRegions::populate_row (boost::shared_ptr<Region> region, TreeModel::Row co
left = audioRegion->fade_out()->back()->when; left = audioRegion->fade_out()->back()->when;
mins = (int) floor (left / (_session->frame_rate() * 60.0f)); mins = (int) floor (left / (_session->frame_rate() * 60.0f));
left -= (nframes_t) floor (mins * _session->frame_rate() * 60.0f); left -= (framepos_t) floor (mins * _session->frame_rate() * 60.0f);
millisecs = (int) floor ((left * 1000.0f) / _session->frame_rate()); millisecs = (int) floor ((left * 1000.0f) / _session->frame_rate());
if (audioRegion->fade_out()->back()->when >= _session->frame_rate()) { if (audioRegion->fade_out()->back()->when >= _session->frame_rate()) {

View file

@ -1002,7 +1002,7 @@ Editor::metric_get_timecode (GtkCustomRulerMark **marks, gdouble lower, gdouble
lower = 0; lower = 0;
} }
pos = (nframes_t) floor (lower); pos = (framecnt_t) floor (lower);
*marks = (GtkCustomRulerMark *) g_malloc (sizeof(GtkCustomRulerMark) * timecode_nmarks); *marks = (GtkCustomRulerMark *) g_malloc (sizeof(GtkCustomRulerMark) * timecode_nmarks);
switch (timecode_ruler_scale) { switch (timecode_ruler_scale) {
@ -1150,8 +1150,8 @@ Editor::compute_bbt_ruler_scale (framepos_t lower, framepos_t upper)
TempoMap::BBTPointList::iterator i; TempoMap::BBTPointList::iterator i;
BBT_Time lower_beat, upper_beat; // the beats at each end of the ruler BBT_Time lower_beat, upper_beat; // the beats at each end of the ruler
_session->bbt_time((jack_nframes_t) lower, lower_beat); _session->bbt_time (lower, lower_beat);
_session->bbt_time((jack_nframes_t) upper, upper_beat); _session->bbt_time (upper, upper_beat);
uint32_t beats = 0; uint32_t beats = 0;
bbt_accent_modulo = 1; bbt_accent_modulo = 1;

View file

@ -147,7 +147,7 @@ EditorSummary::render (cairo_t* cr)
/* compute start and end points for the summary */ /* compute start and end points for the summary */
nframes_t const session_length = _session->current_end_frame() - _session->current_start_frame (); framecnt_t const session_length = _session->current_end_frame() - _session->current_start_frame ();
double const theoretical_start = _session->current_start_frame() - session_length * _overhang_fraction; double const theoretical_start = _session->current_start_frame() - session_length * _overhang_fraction;
_start = theoretical_start > 0 ? theoretical_start : 0; _start = theoretical_start > 0 ? theoretical_start : 0;
_end = _session->current_end_frame() + session_length * _overhang_fraction; _end = _session->current_end_frame() + session_length * _overhang_fraction;

View file

@ -80,8 +80,8 @@ private:
Position get_position (double, double) const; Position get_position (double, double) const;
void set_cursor (Position); void set_cursor (Position);
nframes_t _start; ///< start frame of the overview framepos_t _start; ///< start frame of the overview
nframes_t _end; ///< end frame of the overview framepos_t _end; ///< end frame of the overview
/** fraction of the session length by which the overview size should extend past the start and end markers */ /** fraction of the session length by which the overview size should extend past the start and end markers */
double _overhang_fraction; double _overhang_fraction;

View file

@ -138,7 +138,7 @@ Editor::redisplay_tempo (bool immediate_redraw)
} }
void void
Editor::compute_current_bbt_points (nframes_t leftmost, nframes_t rightmost) Editor::compute_current_bbt_points (framepos_t leftmost, framepos_t rightmost)
{ {
if (!_session) { if (!_session) {
return; return;

View file

@ -210,7 +210,7 @@ ExportFormatDialog::set_session (ARDOUR::Session* s)
if (sample_rate_view.get_selection()->count_selected_rows() == 0) { if (sample_rate_view.get_selection()->count_selected_rows() == 0) {
Gtk::ListStore::Children::iterator it; Gtk::ListStore::Children::iterator it;
for (it = sample_rate_list->children().begin(); it != sample_rate_list->children().end(); ++it) { for (it = sample_rate_list->children().begin(); it != sample_rate_list->children().end(); ++it) {
if ((nframes_t) (*it)->get_value (sample_rate_cols.ptr)->rate == _session->nominal_frame_rate()) { if ((framecnt_t) (*it)->get_value (sample_rate_cols.ptr)->rate == _session->nominal_frame_rate()) {
sample_rate_view.get_selection()->select (it); sample_rate_view.get_selection()->select (it);
break; break;
} }
@ -761,7 +761,7 @@ ExportFormatDialog::update_time (AnyTime & time, AudioClock const & clock)
return; return;
} }
nframes_t frames = clock.current_duration(); framecnt_t frames = clock.current_duration();
switch (clock.mode()) { switch (clock.mode()) {
case AudioClock::Timecode: case AudioClock::Timecode:

View file

@ -171,7 +171,7 @@ ExportRangeMarkersDialog::init_progress_computing(Locations::LocationList& locat
// flush vector // flush vector
range_markers_durations_aggregated.resize(0); range_markers_durations_aggregated.resize(0);
nframes_t duration_before_current_location = 0; framecnt_t duration_before_current_location = 0;
Locations::LocationList::iterator locationIter; Locations::LocationList::iterator locationIter;
for (locationIter = locations.begin(); locationIter != locations.end(); ++locationIter) { for (locationIter = locations.begin(); locationIter != locations.end(); ++locationIter) {
@ -180,7 +180,7 @@ ExportRangeMarkersDialog::init_progress_computing(Locations::LocationList& locat
if(currentLocation->is_range_marker()){ if(currentLocation->is_range_marker()){
range_markers_durations_aggregated.push_back (duration_before_current_location); range_markers_durations_aggregated.push_back (duration_before_current_location);
nframes_t duration = currentLocation->end() - currentLocation->start(); framecnt_t duration = currentLocation->end() - currentLocation->start();
range_markers_durations.push_back (duration); range_markers_durations.push_back (duration);
duration_before_current_location += duration; duration_before_current_location += duration;

View file

@ -537,7 +537,7 @@ ImageFrameSocketHandler::send_imageframe_time_axis_group_renamed(const string &
* @param item the time axis item whos position has changed * @param item the time axis item whos position has changed
*/ */
void void
ImageFrameSocketHandler::send_imageframe_view_position_change(nframes_t pos, void* src, ImageFrameView* item) ImageFrameSocketHandler::send_imageframe_view_position_change (framepos_t pos, void* src, ImageFrameView* item)
{ {
// ENSURE_GUI_THREAD (*this, &ImageFrameSocketHandler::send_imageframe_view_position_change, pos, src, item) // ENSURE_GUI_THREAD (*this, &ImageFrameSocketHandler::send_imageframe_view_position_change, pos, src, item)
@ -573,7 +573,7 @@ ImageFrameSocketHandler::send_imageframe_view_position_change(nframes_t pos, voi
* @param item the item which has had a duration change * @param item the item which has had a duration change
*/ */
void void
ImageFrameSocketHandler::send_imageframe_view_duration_change(nframes_t dur, void* src, ImageFrameView* item) ImageFrameSocketHandler::send_imageframe_view_duration_change (framecnt_t dur, void* src, ImageFrameView* item)
{ {
// ENSURE_GUI_THREAD (*this, &ImageFrameSocketHandler::send_imageframe_view_duration_change, dur, src, item) // ENSURE_GUI_THREAD (*this, &ImageFrameSocketHandler::send_imageframe_view_duration_change, dur, src, item)
@ -687,7 +687,7 @@ ImageFrameSocketHandler::send_imageframe_view_removed(const string & item_id, vo
* @param item the time axis item whos position has changed * @param item the time axis item whos position has changed
*/ */
void void
ImageFrameSocketHandler::send_marker_view_position_change(nframes_t pos, void* src, MarkerView* item) ImageFrameSocketHandler::send_marker_view_position_change (framepos_t pos, void* src, MarkerView* item)
{ {
if(this == src || src == 0) if(this == src || src == 0)
{ {
@ -721,7 +721,7 @@ ImageFrameSocketHandler::send_marker_view_position_change(nframes_t pos, void* s
* @param item the time axis item whos position has changed * @param item the time axis item whos position has changed
*/ */
void void
ImageFrameSocketHandler::send_marker_view_duration_change(nframes_t dur, void* src, MarkerView* item) ImageFrameSocketHandler::send_marker_view_duration_change (framecnt_t dur, void* src, MarkerView* item)
{ {
if(this == src || src == 0) if(this == src || src == 0)
{ {
@ -1336,11 +1336,11 @@ ImageFrameSocketHandler::handle_insert_imageframe_view(const char* msg)
position += image_id_size ; position += image_id_size ;
// get the start frame value // get the start frame value
nframes_t start = strtoul((get_message_part(position,10,msg).c_str()),0,10) ; framepos_t start = strtoul((get_message_part(position,10,msg).c_str()),0,10) ;
position += 10 ; position += 10 ;
// get the duration value // get the duration value
nframes_t duration = strtoul((get_message_part(position,10,msg).c_str()),0,10) ; framecnt_t duration = strtoul((get_message_part(position,10,msg).c_str()),0,10) ;
position += 10 ; position += 10 ;
//get the named time axis view we about to add an image to //get the named time axis view we about to add an image to
@ -1672,7 +1672,7 @@ ImageFrameSocketHandler::handle_imageframe_view_position_update(const char* msg)
this->decompose_imageframe_item_desc(msg, position, track_id, track_id_size, scene_id, scene_id_size, item_id, item_id_size) ; this->decompose_imageframe_item_desc(msg, position, track_id, track_id_size, scene_id, scene_id_size, item_id, item_id_size) ;
nframes_t start_frame = strtoul(get_message_part(position, ardourvis::TIME_VALUE_CHARS, msg).c_str(), 0, 10) ; framepos_t start_frame = strtoul(get_message_part(position, ardourvis::TIME_VALUE_CHARS, msg).c_str(), 0, 10) ;
position += ardourvis::TIME_VALUE_CHARS ; position += ardourvis::TIME_VALUE_CHARS ;
// get the named time axis // get the named time axis
@ -1724,7 +1724,7 @@ ImageFrameSocketHandler::handle_imageframe_view_duration_update(const char* msg)
this->decompose_imageframe_item_desc(msg, position, track_id, track_id_size, scene_id, scene_id_size, item_id, item_id_size) ; this->decompose_imageframe_item_desc(msg, position, track_id, track_id_size, scene_id, scene_id_size, item_id, item_id_size) ;
nframes_t duration = strtoul(get_message_part(position,ardourvis::TIME_VALUE_CHARS,msg).c_str(),0,10) ; framecnt_t duration = strtoul(get_message_part(position,ardourvis::TIME_VALUE_CHARS,msg).c_str(),0,10) ;
position += ardourvis::TIME_VALUE_CHARS ; position += ardourvis::TIME_VALUE_CHARS ;
// get the named time axis // get the named time axis
@ -1827,7 +1827,7 @@ ImageFrameSocketHandler::handle_imageframe_view_max_duration_update(const char*
this->decompose_imageframe_item_desc(msg, position, track_id, track_id_size, group_id, group_id_size, item_id, item_id_size) ; this->decompose_imageframe_item_desc(msg, position, track_id, track_id_size, group_id, group_id_size, item_id, item_id_size) ;
nframes_t max_duration = strtoul(get_message_part(position,ardourvis::TIME_VALUE_CHARS,msg).c_str(),0,10) ; framecnt_t max_duration = strtoul(get_message_part(position,ardourvis::TIME_VALUE_CHARS,msg).c_str(),0,10) ;
position += ardourvis::TIME_VALUE_CHARS ; position += ardourvis::TIME_VALUE_CHARS ;
int errcode ; int errcode ;
@ -1915,7 +1915,7 @@ ImageFrameSocketHandler::handle_imageframe_view_min_duration_update(const char*
this->decompose_imageframe_item_desc(msg, position, track_id, track_id_size, group_id, group_id_size, item_id, item_id_size) ; this->decompose_imageframe_item_desc(msg, position, track_id, track_id_size, group_id, group_id_size, item_id, item_id_size) ;
nframes_t min_duration = strtoul(get_message_part(position,ardourvis::TIME_VALUE_CHARS,msg).c_str(),0,10) ; framecnt_t min_duration = strtoul(get_message_part(position,ardourvis::TIME_VALUE_CHARS,msg).c_str(),0,10) ;
position += ardourvis::TIME_VALUE_CHARS ; position += ardourvis::TIME_VALUE_CHARS ;
int errcode ; int errcode ;

View file

@ -198,7 +198,7 @@ ImageFrameTimeAxisGroup::apply_item_color(Gdk::Color& color)
* @param src the identity of the object that initiated the change * @param src the identity of the object that initiated the change
*/ */
ImageFrameView* ImageFrameView*
ImageFrameTimeAxisGroup::add_imageframe_item(const string & frame_id, nframes_t start, nframes_t duration, unsigned char* rgb_data, uint32_t width, uint32_t height, uint32_t num_channels, void* src) ImageFrameTimeAxisGroup::add_imageframe_item(const string & frame_id, framepos_t start, framecnt_t duration, unsigned char* rgb_data, uint32_t width, uint32_t height, uint32_t num_channels, void* src)
{ {
ImageFrameView* ifv = 0; ImageFrameView* ifv = 0;

View file

@ -406,9 +406,8 @@ ImageFrameTimeAxisView::get_selected_imageframe_view() const
void void
ImageFrameTimeAxisView::set_imageframe_duration_sec(double sec) ImageFrameTimeAxisView::set_imageframe_duration_sec(double sec)
{ {
if(selected_imageframe_group && selected_imageframe_view) if (selected_imageframe_group && selected_imageframe_view) {
{ selected_imageframe_view->set_duration ((sec * _trackview.editor.session()->frame_rate()), this);
selected_imageframe_view->set_duration((nframes_t) (sec * _trackview.editor.session()->frame_rate()), this) ;
} }
} }

View file

@ -60,8 +60,8 @@ ImageFrameView::ImageFrameView(const string & item_id,
ImageFrameTimeAxisGroup* item_group, ImageFrameTimeAxisGroup* item_group,
double spu, double spu,
Gdk::Color& basic_color, Gdk::Color& basic_color,
nframes_t start, framepos_t start,
nframes_t duration, framecnt_t duration,
unsigned char* rgb_data, unsigned char* rgb_data,
uint32_t width, uint32_t width,
uint32_t height, uint32_t height,

View file

@ -65,8 +65,8 @@ class ImageFrameView : public TimeAxisViewItem
ImageFrameTimeAxisGroup* group, ImageFrameTimeAxisGroup* group,
double spu, double spu,
Gdk::Color& base_color, Gdk::Color& base_color,
nframes_t start, framepos_t start,
nframes_t duration, framecnt_t duration,
unsigned char* rgb_data, unsigned char* rgb_data,
uint32_t width, uint32_t width,
uint32_t height, uint32_t height,

View file

@ -934,7 +934,7 @@ LocationUI::add_new_location()
string markername; string markername;
if (_session) { if (_session) {
nframes_t where = _session->audible_frame(); framepos_t where = _session->audible_frame();
_session->locations()->next_available_name(markername,"mark"); _session->locations()->next_available_name(markername,"mark");
Location *location = new Location (*_session, where, where, markername, Location::IsMark); Location *location = new Location (*_session, where, where, markername, Location::IsMark);
if (Config->get_name_new_markers()) { if (Config->get_name_new_markers()) {
@ -956,7 +956,7 @@ LocationUI::add_new_range()
string rangename; string rangename;
if (_session) { if (_session) {
nframes_t where = _session->audible_frame(); framepos_t where = _session->audible_frame();
_session->locations()->next_available_name(rangename,"unnamed"); _session->locations()->next_available_name(rangename,"unnamed");
Location *location = new Location (*_session, where, where, rangename, Location::IsRangeMarker); Location *location = new Location (*_session, where, where, rangename, Location::IsRangeMarker);
_session->begin_reversible_command (_("add range marker")); _session->begin_reversible_command (_("add range marker"));

View file

@ -46,7 +46,7 @@ using namespace Gtkmm2ext;
PBD::Signal1<void,Marker*> Marker::CatchDeletion; PBD::Signal1<void,Marker*> Marker::CatchDeletion;
Marker::Marker (PublicEditor& ed, ArdourCanvas::Group& parent, ArdourCanvas::Group& line_parent, guint32 rgba, const string& annotation, Marker::Marker (PublicEditor& ed, ArdourCanvas::Group& parent, ArdourCanvas::Group& line_parent, guint32 rgba, const string& annotation,
Type type, nframes_t frame, bool handle_events) Type type, framepos_t frame, bool handle_events)
: editor (ed) : editor (ed)
, _parent (&parent) , _parent (&parent)

View file

@ -57,7 +57,7 @@ class Marker : public sigc::trackable
Marker (PublicEditor& editor, ArdourCanvas::Group &, ArdourCanvas::Group &, guint32 rgba, const std::string& text, Type, Marker (PublicEditor& editor, ArdourCanvas::Group &, ArdourCanvas::Group &, guint32 rgba, const std::string& text, Type,
nframes_t frame = 0, bool handle_events = true); framepos_t frame = 0, bool handle_events = true);
virtual ~Marker (); virtual ~Marker ();

View file

@ -192,7 +192,7 @@ MarkerTimeAxisView::apply_color(Gdk::Color& color)
* @param src the identity of the object that initiated the change * @param src the identity of the object that initiated the change
*/ */
MarkerView* MarkerView*
MarkerTimeAxisView::add_marker_view(ImageFrameView* ifv, std::string mark_type, std::string mark_id, nframes_t start, nframes_t dur, void* src) MarkerTimeAxisView::add_marker_view(ImageFrameView* ifv, std::string mark_type, std::string mark_id, framepos_t start, framecnt_t dur, void* src)
{ {
if(ifv->has_marker_view_item(mark_id)) if(ifv->has_marker_view_item(mark_id))
{ {
@ -335,7 +335,7 @@ MarkerTimeAxisView::set_marker_duration_sec(double sec)
{ {
if(get_selected_time_axis_item() != 0) if(get_selected_time_axis_item() != 0)
{ {
get_selected_time_axis_item()->set_duration((nframes_t) (sec * _trackview.editor.session()->frame_rate()), this) ; get_selected_time_axis_item()->set_duration((sec * _trackview.editor.session()->frame_rate()), this);
} }
} }

View file

@ -52,8 +52,8 @@ MarkerView::MarkerView(ArdourCanvas::Group *parent,
Gdk::Color& basic_color, Gdk::Color& basic_color,
std::string mark_type, std::string mark_type,
std::string mark_id, std::string mark_id,
nframes_t start, framepos_t start,
nframes_t duration) framecnt_t duration)
: TimeAxisViewItem(mark_id, *parent,*tv,spu,basic_color,start,duration) : TimeAxisViewItem(mark_id, *parent,*tv,spu,basic_color,start,duration)
{ {
mark_type_text = mark_type ; mark_type_text = mark_type ;

View file

@ -437,7 +437,7 @@ MidiStreamView::setup_rec_box ()
// handle multi // handle multi
nframes_t start = 0; framepos_t start = 0;
if (rec_regions.size() > 0) { if (rec_regions.size() > 0) {
start = rec_regions.back().first->start() start = rec_regions.back().first->start()
+ _trackview.track()->get_captured_frames(rec_regions.size()-1); + _trackview.track()->get_captured_frames(rec_regions.size()-1);

View file

@ -35,6 +35,8 @@
#include <iostream> #include <iostream>
#include <cmath> #include <cmath>
using namespace ARDOUR;
PluginEqGui::PluginEqGui(boost::shared_ptr<ARDOUR::PluginInsert> pluginInsert) PluginEqGui::PluginEqGui(boost::shared_ptr<ARDOUR::PluginInsert> pluginInsert)
: _min_dB(-12.0), : _min_dB(-12.0),
_max_dB(+12.0), _max_dB(+12.0),
@ -315,8 +317,8 @@ PluginEqGui::run_impulse_analysis()
ARDOUR::ChanMapping in_map(_plugin->get_info()->n_inputs); ARDOUR::ChanMapping in_map(_plugin->get_info()->n_inputs);
ARDOUR::ChanMapping out_map(_plugin->get_info()->n_outputs); ARDOUR::ChanMapping out_map(_plugin->get_info()->n_outputs);
_plugin->connect_and_run(_bufferset, in_map, out_map, _buffer_size, (nframes_t)0); _plugin->connect_and_run(_bufferset, in_map, out_map, _buffer_size, 0);
nframes_t f = _plugin->signal_latency(); framecnt_t f = _plugin->signal_latency ();
// Adding user_latency() could be interesting // Adding user_latency() could be interesting
// Gather all output, taking latency into account. // Gather all output, taking latency into account.
@ -338,8 +340,8 @@ PluginEqGui::run_impulse_analysis()
} else { } else {
//int C = 0; //int C = 0;
//std::cerr << (++C) << ": latency is " << f << " frames, doing split processing.." << std::endl; //std::cerr << (++C) << ": latency is " << f << " frames, doing split processing.." << std::endl;
nframes_t target_offset = 0; framecnt_t target_offset = 0;
nframes_t frames_left = _buffer_size; // refaktoroi framecnt_t frames_left = _buffer_size; // refaktoroi
do { do {
if (f >= _buffer_size) { if (f >= _buffer_size) {
//std::cerr << (++C) << ": f (=" << f << ") is larger than buffer_size, still trying to reach the actual output" << std::endl; //std::cerr << (++C) << ": f (=" << f << ") is larger than buffer_size, still trying to reach the actual output" << std::endl;
@ -351,7 +353,7 @@ PluginEqGui::run_impulse_analysis()
// we start at output offset "f" // we start at output offset "f"
// .. and copy "buffer size" - "f" - "offset" frames // .. and copy "buffer size" - "f" - "offset" frames
nframes_t length = _buffer_size - f - target_offset; framecnt_t length = _buffer_size - f - target_offset;
//std::cerr << (++C) << ": copying " << length << " frames to _collect_bufferset.get_audio(i)+" << target_offset << " from bufferset at offset " << f << std::endl; //std::cerr << (++C) << ": copying " << length << " frames to _collect_bufferset.get_audio(i)+" << target_offset << " from bufferset at offset " << f << std::endl;
for (uint32_t i = 0; i < outputs; ++i) { for (uint32_t i = 0; i < outputs; ++i) {
@ -374,7 +376,7 @@ PluginEqGui::run_impulse_analysis()
in_map = ARDOUR::ChanMapping(_plugin->get_info()->n_inputs); in_map = ARDOUR::ChanMapping(_plugin->get_info()->n_inputs);
out_map = ARDOUR::ChanMapping(_plugin->get_info()->n_outputs); out_map = ARDOUR::ChanMapping(_plugin->get_info()->n_outputs);
_plugin->connect_and_run(_bufferset, in_map, out_map, _buffer_size, (nframes_t)0); _plugin->connect_and_run(_bufferset, in_map, out_map, _buffer_size, 0);
} }
} while ( frames_left > 0); } while ( frames_left > 0);

View file

@ -89,8 +89,8 @@ class PluginEqGui : public Gtk::Table
float _log_coeff; float _log_coeff;
float _log_max; float _log_max;
nframes_t _buffer_size; ARDOUR::framecnt_t _buffer_size;
nframes_t _signal_buffer_size; ARDOUR::framecnt_t _signal_buffer_size;
// buffers // buffers
ARDOUR::BufferSet _bufferset; ARDOUR::BufferSet _bufferset;

View file

@ -471,8 +471,8 @@ void
PlugUIBase::set_latency_label () PlugUIBase::set_latency_label ()
{ {
char buf[64]; char buf[64];
nframes_t l = insert->effective_latency (); framecnt_t const l = insert->effective_latency ();
nframes_t sr = insert->session().frame_rate(); framecnt_t const sr = insert->session().frame_rate ();
if (l < sr / 1000) { if (l < sr / 1000) {
snprintf (buf, sizeof (buf), "latency (%d samples)", l); snprintf (buf, sizeof (buf), "latency (%d samples)", l);

View file

@ -71,7 +71,7 @@ PortInsertUI::PortInsertUI (Gtk::Window* parent, ARDOUR::Session* sess, boost::s
void void
PortInsertUI::update_latency_display () PortInsertUI::update_latency_display ()
{ {
nframes_t sample_rate = input_selector.session()->engine().frame_rate(); framecnt_t const sample_rate = input_selector.session()->engine().frame_rate();
if (sample_rate == 0) { if (sample_rate == 0) {
latency_display.set_text (_("Disconnected from audio engine")); latency_display.set_text (_("Disconnected from audio engine"));
} else { } else {
@ -98,7 +98,7 @@ PortInsertUI::check_latency_measurement ()
} }
char buf[128]; char buf[128];
nframes_t sample_rate = AudioEngine::instance()->frame_rate(); framecnt_t const sample_rate = AudioEngine::instance()->frame_rate();
if (sample_rate == 0) { if (sample_rate == 0) {
latency_display.set_text (_("Disconnected from audio engine")); latency_display.set_text (_("Disconnected from audio engine"));
@ -121,7 +121,7 @@ PortInsertUI::check_latency_measurement ()
} }
if (solid) { if (solid) {
_pi->set_measured_latency ((nframes_t) rint (mtdm->del())); _pi->set_measured_latency (rint (mtdm->del()));
latency_button.set_active (false); latency_button.set_active (false);
strcat (buf, " (set)"); strcat (buf, " (set)");
} }

View file

@ -196,10 +196,6 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible {
virtual void transition_to_rolling (bool fwd) = 0; virtual void transition_to_rolling (bool fwd) = 0;
virtual framepos_t unit_to_frame (double unit) const = 0; virtual framepos_t unit_to_frame (double unit) const = 0;
// XXX remove me when libardour goes framepos_t
double frame_to_unit (nframes_t frame) const {
return frame_to_unit ((framepos_t) frame);
}
virtual double frame_to_unit (framepos_t frame) const = 0; virtual double frame_to_unit (framepos_t frame) const = 0;
virtual double frame_to_unit (double frame) const = 0; virtual double frame_to_unit (double frame) const = 0;
virtual framepos_t pixel_to_frame (double pixel) const = 0; virtual framepos_t pixel_to_frame (double pixel) const = 0;

View file

@ -291,7 +291,7 @@ RegionEditor::end_clock_changed ()
void void
RegionEditor::length_clock_changed () RegionEditor::length_clock_changed ()
{ {
nframes_t frames = length_clock.current_time(); framecnt_t frames = length_clock.current_time();
_session->begin_reversible_command (_("change region length")); _session->begin_reversible_command (_("change region length"));
@ -343,7 +343,7 @@ RegionEditor::bounds_changed (const PropertyChange& what_changed)
if (what_changed.contains (ARDOUR::Properties::sync_position) || what_changed.contains (ARDOUR::Properties::position)) { if (what_changed.contains (ARDOUR::Properties::sync_position) || what_changed.contains (ARDOUR::Properties::position)) {
int dir; int dir;
nframes_t off = _region->sync_offset (dir); frameoffset_t off = _region->sync_offset (dir);
if (dir == -1) { if (dir == -1) {
off = -off; off = -off;
} }

View file

@ -468,7 +468,7 @@ void
RegionView::region_sync_changed () RegionView::region_sync_changed ()
{ {
int sync_dir; int sync_dir;
nframes_t sync_offset; framecnt_t sync_offset;
sync_offset = _region->sync_offset (sync_dir); sync_offset = _region->sync_offset (sync_dir);
@ -595,7 +595,7 @@ RegionView::set_height (double h)
if (sync_line) { if (sync_line) {
Points points; Points points;
int sync_dir; int sync_dir;
nframes_t sync_offset; framecnt_t sync_offset;
sync_offset = _region->sync_offset (sync_dir); sync_offset = _region->sync_offset (sync_dir);
double offset = sync_offset / samples_per_unit; double offset = sync_offset / samples_per_unit;
@ -631,9 +631,9 @@ RegionView::update_coverage_frames (LayerDisplay d)
return; return;
} }
nframes_t const position = _region->first_frame (); framepos_t const position = _region->first_frame ();
nframes_t t = position; framepos_t t = position;
nframes_t const end = _region->last_frame (); framepos_t const end = _region->last_frame ();
ArdourCanvas::SimpleRect* cr = 0; ArdourCanvas::SimpleRect* cr = 0;
bool me = false; bool me = false;

View file

@ -260,7 +260,7 @@ RouteParams_UI::refresh_latency ()
latency_widget->refresh(); latency_widget->refresh();
char buf[128]; char buf[128];
snprintf (buf, sizeof (buf), _("Playback delay: %u samples"), _route->initial_delay()); snprintf (buf, sizeof (buf), _("Playback delay: %" PRId64 " samples"), _route->initial_delay());
delay_label.set_text (buf); delay_label.set_text (buf);
} }
} }
@ -288,7 +288,7 @@ RouteParams_UI::setup_latency_frame ()
latency_widget = new LatencyGUI (*(_route->output()), _session->frame_rate(), _session->engine().frames_per_cycle()); latency_widget = new LatencyGUI (*(_route->output()), _session->frame_rate(), _session->engine().frames_per_cycle());
char buf[128]; char buf[128];
snprintf (buf, sizeof (buf), _("Playback delay: %u samples"), _route->initial_delay()); snprintf (buf, sizeof (buf), _("Playback delay: %" PRId64 " samples"), _route->initial_delay());
delay_label.set_text (buf); delay_label.set_text (buf);
latency_packer.pack_start (*latency_widget, false, false); latency_packer.pack_start (*latency_widget, false, false);

View file

@ -672,7 +672,7 @@ RouteTimeAxisView::track_mode_changed ()
} }
void void
RouteTimeAxisView::show_timestretch (nframes_t start, nframes_t end) RouteTimeAxisView::show_timestretch (framepos_t start, framepos_t end)
{ {
double x1; double x1;
double x2; double x2;
@ -1208,8 +1208,8 @@ RouteTimeAxisView::get_selectables (framepos_t start, framepos_t end, double top
speed = track()->speed(); speed = track()->speed();
} }
nframes_t start_adjusted = session_frame_to_track_frame(start, speed); framepos_t const start_adjusted = session_frame_to_track_frame(start, speed);
nframes_t end_adjusted = session_frame_to_track_frame(end, speed); framepos_t const end_adjusted = session_frame_to_track_frame(end, speed);
if ((_view && ((top < 0.0 && bot < 0.0))) || touched (top, bot)) { if ((_view && ((top < 0.0 && bot < 0.0))) || touched (top, bot)) {
_view->get_selectables (start_adjusted, end_adjusted, top, bot, results); _view->get_selectables (start_adjusted, end_adjusted, top, bot, results);
@ -1295,7 +1295,7 @@ RouteTimeAxisView::name_entry_changed ()
} }
boost::shared_ptr<Region> boost::shared_ptr<Region>
RouteTimeAxisView::find_next_region (nframes_t pos, RegionPoint point, int32_t dir) RouteTimeAxisView::find_next_region (framepos_t pos, RegionPoint point, int32_t dir)
{ {
boost::shared_ptr<Playlist> pl = playlist (); boost::shared_ptr<Playlist> pl = playlist ();

View file

@ -78,7 +78,7 @@ public:
void set_samples_per_unit (double); void set_samples_per_unit (double);
void set_height (uint32_t h); void set_height (uint32_t h);
void show_timestretch (nframes_t start, nframes_t end); void show_timestretch (framepos_t start, framepos_t end);
void hide_timestretch (); void hide_timestretch ();
void selection_click (GdkEventButton*); void selection_click (GdkEventButton*);
void set_selected_points (PointSelection&); void set_selected_points (PointSelection&);
@ -88,7 +88,7 @@ public:
void set_layer_display (LayerDisplay d); void set_layer_display (LayerDisplay d);
LayerDisplay layer_display () const; LayerDisplay layer_display () const;
boost::shared_ptr<ARDOUR::Region> find_next_region (nframes_t pos, ARDOUR::RegionPoint, int32_t dir); boost::shared_ptr<ARDOUR::Region> find_next_region (framepos_t pos, ARDOUR::RegionPoint, int32_t dir);
framepos_t find_next_region_boundary (framepos_t pos, int32_t dir); framepos_t find_next_region_boundary (framepos_t pos, int32_t dir);
/* Editing operations */ /* Editing operations */
@ -232,7 +232,7 @@ protected:
virtual void show_existing_automation (); virtual void show_existing_automation ();
virtual void hide_all_automation (); virtual void hide_all_automation ();
void timestretch (nframes_t start, nframes_t end); void timestretch (framepos_t start, framepos_t end);
void speed_changed (); void speed_changed ();

View file

@ -304,7 +304,7 @@ Selection::toggle (vector<RegionView*>& r)
} }
long long
Selection::toggle (nframes_t start, nframes_t end) Selection::toggle (framepos_t start, framepos_t end)
{ {
AudioRangeComparator cmp; AudioRangeComparator cmp;
@ -462,7 +462,7 @@ Selection::add (MidiRegionView* mrv)
} }
long long
Selection::add (nframes_t start, nframes_t end) Selection::add (framepos_t start, framepos_t end)
{ {
AudioRangeComparator cmp; AudioRangeComparator cmp;
@ -478,7 +478,7 @@ Selection::add (nframes_t start, nframes_t end)
} }
void void
Selection::replace (uint32_t sid, nframes_t start, nframes_t end) Selection::replace (uint32_t sid, framepos_t start, framepos_t end)
{ {
for (list<AudioRange>::iterator i = time.begin(); i != time.end(); ++i) { for (list<AudioRange>::iterator i = time.begin(); i != time.end(); ++i) {
if ((*i).id == sid) { if ((*i).id == sid) {
@ -654,7 +654,7 @@ Selection::remove (uint32_t selection_id)
} }
void void
Selection::remove (nframes_t /*start*/, nframes_t /*end*/) Selection::remove (framepos_t /*start*/, framepos_t /*end*/)
{ {
} }
@ -744,7 +744,7 @@ Selection::set (vector<RegionView*>& v)
* the list of tracks it applies to. * the list of tracks it applies to.
*/ */
long long
Selection::set (nframes_t start, nframes_t end) Selection::set (framepos_t start, framepos_t end)
{ {
if ((start == 0 && end == 0) || end < start) { if ((start == 0 && end == 0) || end < start) {
return 0; return 0;

View file

@ -121,7 +121,7 @@ class Selection : public sigc::trackable, public PBD::ScopedConnectionList
void set (RegionView*, bool also_clear_tracks = true); void set (RegionView*, bool also_clear_tracks = true);
void set (MidiRegionView*); void set (MidiRegionView*);
void set (std::vector<RegionView*>&); void set (std::vector<RegionView*>&);
long set (nframes_t, nframes_t); long set (framepos_t, framepos_t);
void set (boost::shared_ptr<Evoral::ControlList>); void set (boost::shared_ptr<Evoral::ControlList>);
void set (boost::shared_ptr<ARDOUR::Playlist>); void set (boost::shared_ptr<ARDOUR::Playlist>);
void set (const std::list<boost::shared_ptr<ARDOUR::Playlist> >&); void set (const std::list<boost::shared_ptr<ARDOUR::Playlist> >&);
@ -136,7 +136,7 @@ class Selection : public sigc::trackable, public PBD::ScopedConnectionList
void toggle (MidiRegionView*); void toggle (MidiRegionView*);
void toggle (MidiCutBuffer*); void toggle (MidiCutBuffer*);
void toggle (std::vector<RegionView*>&); void toggle (std::vector<RegionView*>&);
long toggle (nframes_t, nframes_t); long toggle (framepos_t, framepos_t);
void toggle (ARDOUR::AutomationList*); void toggle (ARDOUR::AutomationList*);
void toggle (boost::shared_ptr<ARDOUR::Playlist>); void toggle (boost::shared_ptr<ARDOUR::Playlist>);
void toggle (const std::list<boost::shared_ptr<ARDOUR::Playlist> >&); void toggle (const std::list<boost::shared_ptr<ARDOUR::Playlist> >&);
@ -151,7 +151,7 @@ class Selection : public sigc::trackable, public PBD::ScopedConnectionList
void add (MidiRegionView*); void add (MidiRegionView*);
void add (MidiCutBuffer*); void add (MidiCutBuffer*);
void add (std::vector<RegionView*>&); void add (std::vector<RegionView*>&);
long add (nframes_t, nframes_t); long add (framepos_t, framepos_t);
void add (boost::shared_ptr<Evoral::ControlList>); void add (boost::shared_ptr<Evoral::ControlList>);
void add (boost::shared_ptr<ARDOUR::Playlist>); void add (boost::shared_ptr<ARDOUR::Playlist>);
void add (const std::list<boost::shared_ptr<ARDOUR::Playlist> >&); void add (const std::list<boost::shared_ptr<ARDOUR::Playlist> >&);
@ -167,14 +167,14 @@ class Selection : public sigc::trackable, public PBD::ScopedConnectionList
void remove (MidiRegionView*); void remove (MidiRegionView*);
void remove (MidiCutBuffer*); void remove (MidiCutBuffer*);
void remove (uint32_t selection_id); void remove (uint32_t selection_id);
void remove (nframes_t, nframes_t); void remove (framepos_t, framepos_t);
void remove (boost::shared_ptr<ARDOUR::AutomationList>); void remove (boost::shared_ptr<ARDOUR::AutomationList>);
void remove (boost::shared_ptr<ARDOUR::Playlist>); void remove (boost::shared_ptr<ARDOUR::Playlist>);
void remove (const std::list<boost::shared_ptr<ARDOUR::Playlist> >&); void remove (const std::list<boost::shared_ptr<ARDOUR::Playlist> >&);
void remove (const std::list<Selectable*>&); void remove (const std::list<Selectable*>&);
void remove (Marker*); void remove (Marker*);
void replace (uint32_t time_index, nframes_t start, nframes_t end); void replace (uint32_t time_index, framepos_t start, framepos_t end);
void clear_regions(); void clear_regions();
void clear_tracks (); void clear_tracks ();

View file

@ -268,7 +268,7 @@ SoundFileBox::setup_labels (const string& filename)
samplerate.set_name ("NewSessionSR2Label"); samplerate.set_name ("NewSessionSR2Label");
} }
nframes_t const nfr = _session ? _session->nominal_frame_rate() : 25; framecnt_t const nfr = _session ? _session->nominal_frame_rate() : 25;
double src_coef = (double) nfr / sf_info.samplerate; double src_coef = (double) nfr / sf_info.samplerate;
length_clock.set (sf_info.length * src_coef + 0.5, true); length_clock.set (sf_info.length * src_coef + 0.5, true);
@ -1128,7 +1128,7 @@ SoundFileOmega::check_info (const vector<string>& paths, bool& same_size, bool&
} }
} }
if ((nframes_t) info.samplerate != _session->frame_rate()) { if (info.samplerate != _session->frame_rate()) {
src_needed = true; src_needed = true;
} }

View file

@ -158,14 +158,14 @@ StepEditor::stop_step_editing ()
void void
StepEditor::check_step_edit () StepEditor::check_step_edit ()
{ {
MidiRingBuffer<nframes_t>& incoming (_track->step_edit_ring_buffer()); MidiRingBuffer<framepos_t>& incoming (_track->step_edit_ring_buffer());
uint8_t* buf; uint8_t* buf;
uint32_t bufsize = 32; uint32_t bufsize = 32;
buf = new uint8_t[bufsize]; buf = new uint8_t[bufsize];
while (incoming.read_space()) { while (incoming.read_space()) {
nframes_t time; framepos_t time;
Evoral::EventType type; Evoral::EventType type;
uint32_t size; uint32_t size;

View file

@ -43,9 +43,9 @@ namespace ARDOUR {
} }
struct RecBoxInfo { struct RecBoxInfo {
ArdourCanvas::SimpleRect* rectangle; ArdourCanvas::SimpleRect* rectangle;
nframes_t start; framepos_t start;
nframes_t length; ARDOUR::framecnt_t length;
}; };
class Selectable; class Selectable;
@ -171,7 +171,7 @@ protected:
double height; double height;
PBD::ScopedConnectionList rec_data_ready_connections; PBD::ScopedConnectionList rec_data_ready_connections;
nframes_t last_rec_data_frame; framepos_t last_rec_data_frame;
/* When recording, the session time at which a new layer must be created for the region /* When recording, the session time at which a new layer must be created for the region
being recorded, or max_framepos if not applicable. being recorded, or max_framepos if not applicable.

View file

@ -493,13 +493,13 @@ StripSilenceDialog::update_stats (const SilenceResult& res)
} }
} }
nframes_t framecnt_t
StripSilenceDialog::minimum_length () const StripSilenceDialog::minimum_length () const
{ {
return _minimum_length.current_duration (_waves.front()->region->position()); return _minimum_length.current_duration (_waves.front()->region->position());
} }
nframes_t framecnt_t
StripSilenceDialog::fade_length () const StripSilenceDialog::fade_length () const
{ {
return _minimum_length.current_duration (_waves.front()->region->position()); return _minimum_length.current_duration (_waves.front()->region->position());

View file

@ -41,8 +41,8 @@ public:
return _threshold.get_value (); return _threshold.get_value ();
} }
nframes_t minimum_length () const; ARDOUR::framecnt_t minimum_length () const;
nframes_t fade_length () const; ARDOUR::framecnt_t fade_length () const;
private: private:
typedef std::list<std::pair<ARDOUR::frameoffset_t,ARDOUR::framecnt_t> > SilenceResult; typedef std::list<std::pair<ARDOUR::frameoffset_t,ARDOUR::framecnt_t> > SilenceResult;

View file

@ -33,7 +33,7 @@ using namespace Gtkmm2ext;
using namespace ARDOUR; using namespace ARDOUR;
using namespace PBD; using namespace PBD;
TempoDialog::TempoDialog (TempoMap& map, nframes_t frame, const string & action) TempoDialog::TempoDialog (TempoMap& map, framepos_t frame, const string & action)
: ArdourDialog (_("New Tempo")), : ArdourDialog (_("New Tempo")),
bpm_adjustment (60.0, 1.0, 999.9, 0.1, 1.0), bpm_adjustment (60.0, 1.0, 999.9, 0.1, 1.0),
bpm_spinner (bpm_adjustment), bpm_spinner (bpm_adjustment),
@ -239,7 +239,7 @@ TempoDialog::note_types_change ()
} }
MeterDialog::MeterDialog (TempoMap& map, nframes_t frame, const string & action) MeterDialog::MeterDialog (TempoMap& map, framepos_t frame, const string & action)
: ArdourDialog ("New Meter"), : ArdourDialog ("New Meter"),
ok_button (action), ok_button (action),
cancel_button (_("Cancel")) cancel_button (_("Cancel"))

View file

@ -38,7 +38,7 @@
class TempoDialog : public ArdourDialog class TempoDialog : public ArdourDialog
{ {
public: public:
TempoDialog (ARDOUR::TempoMap&, nframes_t, const std::string & action); TempoDialog (ARDOUR::TempoMap&, framepos_t, const std::string & action);
TempoDialog (ARDOUR::TempoSection&, const std::string & action); TempoDialog (ARDOUR::TempoSection&, const std::string & action);
double get_bpm (); double get_bpm ();
@ -70,7 +70,7 @@ class MeterDialog : public ArdourDialog
{ {
public: public:
MeterDialog (ARDOUR::TempoMap&, nframes_t, const std::string & action); MeterDialog (ARDOUR::TempoMap&, framepos_t, const std::string & action);
MeterDialog (ARDOUR::MeterSection&, const std::string & action); MeterDialog (ARDOUR::MeterSection&, const std::string & action);
double get_bpb (); double get_bpb ();

View file

@ -672,7 +672,7 @@ TimeAxisView::set_samples_per_unit (double spu)
} }
void void
TimeAxisView::show_timestretch (nframes_t start, nframes_t end) TimeAxisView::show_timestretch (framepos_t start, framepos_t end)
{ {
for (Children::iterator i = children.begin(); i != children.end(); ++i) { for (Children::iterator i = children.begin(); i != children.end(); ++i) {
(*i)->show_timestretch (start, end); (*i)->show_timestretch (start, end);
@ -714,7 +714,8 @@ TimeAxisView::show_selection (TimeSelection& ts)
selection_group->raise_to_top(); selection_group->raise_to_top();
for (list<AudioRange>::iterator i = ts.begin(); i != ts.end(); ++i) { for (list<AudioRange>::iterator i = ts.begin(); i != ts.end(); ++i) {
nframes_t start, end, cnt; framepos_t start, end;
framecnt_t cnt;
start = (*i).start; start = (*i).start;
end = (*i).end; end = (*i).end;

View file

@ -169,7 +169,7 @@ class TimeAxisView : public virtual AxisView, public PBD::Stateful
virtual void show_selection (TimeSelection&); virtual void show_selection (TimeSelection&);
virtual void hide_selection (); virtual void hide_selection ();
virtual void reshow_selection (TimeSelection&); virtual void reshow_selection (TimeSelection&);
virtual void show_timestretch (nframes_t start, nframes_t end); virtual void show_timestretch (framepos_t start, framepos_t end);
virtual void hide_timestretch (); virtual void hide_timestretch ();
virtual void hide_dependent_views (TimeAxisViewItem&) {} virtual void hide_dependent_views (TimeAxisViewItem&) {}
@ -183,7 +183,7 @@ class TimeAxisView : public virtual AxisView, public PBD::Stateful
virtual void set_selected_regionviews (RegionSelection&) {} virtual void set_selected_regionviews (RegionSelection&) {}
virtual void set_selected_points (PointSelection&) {} virtual void set_selected_points (PointSelection&) {}
virtual boost::shared_ptr<ARDOUR::Region> find_next_region (nframes_t /*pos*/, ARDOUR::RegionPoint, int32_t /*dir*/) { virtual boost::shared_ptr<ARDOUR::Region> find_next_region (framepos_t /*pos*/, ARDOUR::RegionPoint, int32_t /*dir*/) {
return boost::shared_ptr<ARDOUR::Region> (); return boost::shared_ptr<ARDOUR::Region> ();
} }

View file

@ -409,15 +409,15 @@ VisualTimeAxis::name_entry_key_release_handler(GdkEventKey* ev)
// Super class methods not handled by VisualTimeAxis // Super class methods not handled by VisualTimeAxis
void void
VisualTimeAxis::show_timestretch (nframes_t start, nframes_t end) VisualTimeAxis::show_timestretch (framepos_t start, framepos_t end)
{ {
// Not handled by purely visual TimeAxis // Not handled by purely visual TimeAxis
} }
void void
VisualTimeAxis::hide_timestretch() VisualTimeAxis::hide_timestretch()
{ {
// Not handled by purely visual TimeAxis // Not handled by purely visual TimeAxis
} }

View file

@ -71,7 +71,7 @@ Amp::configure_io (ChanCount in, ChanCount out)
} }
void void
Amp::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end_frame*/, nframes_t nframes, bool) Amp::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end_frame*/, pframes_t nframes, bool)
{ {
if (!_active && !_pending_active) { if (!_active && !_pending_active) {
return; return;
@ -85,7 +85,7 @@ Amp::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end_frame*/,
for (BufferSet::audio_iterator i = bufs.audio_begin(); i != bufs.audio_end(); ++i) { for (BufferSet::audio_iterator i = bufs.audio_begin(); i != bufs.audio_end(); ++i) {
Sample* const sp = i->data(); Sample* const sp = i->data();
for (nframes_t nx = 0; nx < nframes; ++nx) { for (pframes_t nx = 0; nx < nframes; ++nx) {
sp[nx] *= gab[nx]; sp[nx] *= gab[nx];
} }
} }
@ -129,7 +129,7 @@ Amp::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end_frame*/,
} }
void void
Amp::apply_gain (BufferSet& bufs, nframes_t nframes, gain_t initial, gain_t target) Amp::apply_gain (BufferSet& bufs, framecnt_t nframes, gain_t initial, gain_t target)
{ {
/** Apply a (potentially) declicked gain to the buffers of @a bufs /** Apply a (potentially) declicked gain to the buffers of @a bufs
*/ */
@ -144,7 +144,7 @@ Amp::apply_gain (BufferSet& bufs, nframes_t nframes, gain_t initial, gain_t targ
return; return;
} }
const nframes_t declick = std::min ((nframes_t)128, nframes); const framecnt_t declick = std::min ((framecnt_t) 128, nframes);
gain_t delta; gain_t delta;
double fractional_shift = -1.0/declick; double fractional_shift = -1.0/declick;
double fractional_pos; double fractional_pos;
@ -180,7 +180,7 @@ Amp::apply_gain (BufferSet& bufs, nframes_t nframes, gain_t initial, gain_t targ
fractional_pos = 1.0; fractional_pos = 1.0;
for (nframes_t nx = 0; nx < declick; ++nx) { for (pframes_t nx = 0; nx < declick; ++nx) {
buffer[nx] *= (initial + (delta * (0.5 + 0.5 * cos (M_PI * fractional_pos)))); buffer[nx] *= (initial + (delta * (0.5 + 0.5 * cos (M_PI * fractional_pos))));
fractional_pos += fractional_shift; fractional_pos += fractional_shift;
} }
@ -199,7 +199,7 @@ Amp::apply_gain (BufferSet& bufs, nframes_t nframes, gain_t initial, gain_t targ
} }
void void
Amp::declick (BufferSet& bufs, nframes_t nframes, int dir) Amp::declick (BufferSet& bufs, framecnt_t nframes, int dir)
{ {
/* Almost exactly like ::apply_gain() but skips MIDI buffers and has fixed initial+target /* Almost exactly like ::apply_gain() but skips MIDI buffers and has fixed initial+target
values. values.
@ -209,7 +209,7 @@ Amp::declick (BufferSet& bufs, nframes_t nframes, int dir)
return; return;
} }
const nframes_t declick = std::min ((nframes_t)128, nframes); const framecnt_t declick = std::min ((framecnt_t) 128, nframes);
gain_t delta, initial, target; gain_t delta, initial, target;
double fractional_shift = -1.0/declick; double fractional_shift = -1.0/declick;
double fractional_pos; double fractional_pos;
@ -233,7 +233,7 @@ Amp::declick (BufferSet& bufs, nframes_t nframes, int dir)
fractional_pos = 1.0; fractional_pos = 1.0;
for (nframes_t nx = 0; nx < declick; ++nx) { for (pframes_t nx = 0; nx < declick; ++nx) {
buffer[nx] *= (initial + (delta * (0.5 + 0.5 * cos (M_PI * fractional_pos)))); buffer[nx] *= (initial + (delta * (0.5 + 0.5 * cos (M_PI * fractional_pos))));
fractional_pos += fractional_shift; fractional_pos += fractional_shift;
} }
@ -252,7 +252,7 @@ Amp::declick (BufferSet& bufs, nframes_t nframes, int dir)
} }
void void
Amp::apply_gain (AudioBuffer& buf, nframes_t nframes, gain_t initial, gain_t target) Amp::apply_gain (AudioBuffer& buf, framecnt_t nframes, gain_t initial, gain_t target)
{ {
/** Apply a (potentially) declicked gain to the contents of @a buf /** Apply a (potentially) declicked gain to the contents of @a buf
*/ */
@ -267,7 +267,7 @@ Amp::apply_gain (AudioBuffer& buf, nframes_t nframes, gain_t initial, gain_t tar
return; return;
} }
const nframes_t declick = std::min ((nframes_t)128, nframes); const framecnt_t declick = std::min ((framecnt_t) 128, nframes);
gain_t delta; gain_t delta;
double fractional_shift = -1.0/declick; double fractional_shift = -1.0/declick;
double fractional_pos; double fractional_pos;
@ -285,7 +285,7 @@ Amp::apply_gain (AudioBuffer& buf, nframes_t nframes, gain_t initial, gain_t tar
fractional_pos = 1.0; fractional_pos = 1.0;
for (nframes_t nx = 0; nx < declick; ++nx) { for (pframes_t nx = 0; nx < declick; ++nx) {
buffer[nx] *= (initial + (delta * (0.5 + 0.5 * cos (M_PI * fractional_pos)))); buffer[nx] *= (initial + (delta * (0.5 + 0.5 * cos (M_PI * fractional_pos))));
fractional_pos += fractional_shift; fractional_pos += fractional_shift;
} }
@ -303,7 +303,7 @@ Amp::apply_gain (AudioBuffer& buf, nframes_t nframes, gain_t initial, gain_t tar
} }
void void
Amp::apply_simple_gain (BufferSet& bufs, nframes_t nframes, gain_t target) Amp::apply_simple_gain (BufferSet& bufs, framecnt_t nframes, gain_t target)
{ {
if (target == 0.0) { if (target == 0.0) {
@ -342,7 +342,7 @@ Amp::apply_simple_gain (BufferSet& bufs, nframes_t nframes, gain_t target)
} }
void void
Amp::apply_simple_gain (AudioBuffer& buf, nframes_t nframes, gain_t target) Amp::apply_simple_gain (AudioBuffer& buf, framecnt_t nframes, gain_t target)
{ {
if (target == 0.0) { if (target == 0.0) {
memset (buf.data(), 0, sizeof (Sample) * nframes); memset (buf.data(), 0, sizeof (Sample) * nframes);
@ -412,8 +412,9 @@ void
Amp::GainControl::set_value (double val) Amp::GainControl::set_value (double val)
{ {
// max gain at about +6dB (10.0 ^ ( 6 dB * 0.05)) // max gain at about +6dB (10.0 ^ ( 6 dB * 0.05))
if (val > 1.99526231f) if (val > 1.99526231f) {
val = 1.99526231f; val = 1.99526231f;
}
_amp->set_gain (val, this); _amp->set_gain (val, this);
@ -427,7 +428,7 @@ Amp::GainControl::get_value (void) const
} }
void void
Amp::setup_gain_automation (framepos_t start_frame, framepos_t end_frame, nframes_t nframes) Amp::setup_gain_automation (framepos_t start_frame, framepos_t end_frame, framecnt_t nframes)
{ {
Glib::Mutex::Lock am (control_lock(), Glib::TRY_LOCK); Glib::Mutex::Lock am (control_lock(), Glib::TRY_LOCK);

View file

@ -43,12 +43,12 @@ public:
bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const; bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
bool configure_io (ChanCount in, ChanCount out); bool configure_io (ChanCount in, ChanCount out);
void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, nframes_t nframes, bool); void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool);
bool apply_gain() const { return _apply_gain; } bool apply_gain () const { return _apply_gain; }
void apply_gain(bool yn) { _apply_gain = yn; } void apply_gain (bool yn) { _apply_gain = yn; }
void setup_gain_automation (framepos_t start_frame, framepos_t end_frame, nframes_t nframes); void setup_gain_automation (framepos_t start_frame, framepos_t end_frame, framecnt_t nframes);
bool apply_gain_automation() const { return _apply_gain_automation; } bool apply_gain_automation() const { return _apply_gain_automation; }
void apply_gain_automation(bool yn) { _apply_gain_automation = yn; } void apply_gain_automation(bool yn) { _apply_gain_automation = yn; }
@ -56,13 +56,13 @@ public:
XMLNode& state (bool full); XMLNode& state (bool full);
int set_state (const XMLNode&, int version); int set_state (const XMLNode&, int version);
static void apply_gain (BufferSet& bufs, nframes_t nframes, gain_t initial, gain_t target); static void apply_gain (BufferSet& bufs, framecnt_t nframes, gain_t initial, gain_t target);
static void apply_simple_gain(BufferSet& bufs, nframes_t nframes, gain_t target); static void apply_simple_gain(BufferSet& bufs, framecnt_t nframes, gain_t target);
static void apply_gain (AudioBuffer& buf, nframes_t nframes, gain_t initial, gain_t target); static void apply_gain (AudioBuffer& buf, framecnt_t nframes, gain_t initial, gain_t target);
static void apply_simple_gain(AudioBuffer& buf, nframes_t nframes, gain_t target); static void apply_simple_gain(AudioBuffer& buf, framecnt_t nframes, gain_t target);
static void declick (BufferSet& bufs, nframes_t nframes, int dir); static void declick (BufferSet& bufs, framecnt_t nframes, int dir);
gain_t gain () const { return _gain_control->user_double(); } gain_t gain () const { return _gain_control->user_double(); }

View file

@ -30,7 +30,7 @@ public:
AudioBuffer(size_t capacity); AudioBuffer(size_t capacity);
~AudioBuffer(); ~AudioBuffer();
void silence (nframes_t len, nframes_t offset = 0) { void silence (framecnt_t len, framecnt_t offset = 0) {
if (!_silent) { if (!_silent) {
assert(_capacity > 0); assert(_capacity > 0);
assert(offset + len <= _capacity); assert(offset + len <= _capacity);
@ -43,7 +43,7 @@ public:
} }
/** Read @a len frames @a src starting at @a src_offset into self starting at @ dst_offset*/ /** Read @a len frames @a src starting at @a src_offset into self starting at @ dst_offset*/
void read_from (const Buffer& src, nframes_t len, nframes_t dst_offset = 0, nframes_t src_offset = 0) { void read_from (const Buffer& src, framecnt_t len, framecnt_t dst_offset = 0, framecnt_t src_offset = 0) {
assert(&src != this); assert(&src != this);
assert(_capacity > 0); assert(_capacity > 0);
assert(src.type() == DataType::AUDIO); assert(src.type() == DataType::AUDIO);
@ -58,14 +58,14 @@ public:
} }
/** Acumulate (add) @a len frames @a src starting at @a src_offset into self starting at @ dst_offset*/ /** Acumulate (add) @a len frames @a src starting at @a src_offset into self starting at @ dst_offset*/
void merge_from (const Buffer& src, nframes_t len, nframes_t dst_offset = 0, nframes_t src_offset = 0) { void merge_from (const Buffer& src, framecnt_t len, framecnt_t dst_offset = 0, framecnt_t src_offset = 0) {
const AudioBuffer* ab = dynamic_cast<const AudioBuffer*>(&src); const AudioBuffer* ab = dynamic_cast<const AudioBuffer*>(&src);
assert (ab); assert (ab);
accumulate_from (*ab, len, dst_offset, src_offset); accumulate_from (*ab, len, dst_offset, src_offset);
} }
/** Acumulate (add) @a len frames @a src starting at @a src_offset into self starting at @ dst_offset*/ /** Acumulate (add) @a len frames @a src starting at @a src_offset into self starting at @ dst_offset*/
void accumulate_from (const AudioBuffer& src, nframes_t len, nframes_t dst_offset = 0, nframes_t src_offset = 0) { void accumulate_from (const AudioBuffer& src, framecnt_t len, framecnt_t dst_offset = 0, framecnt_t src_offset = 0) {
assert(_capacity > 0); assert(_capacity > 0);
assert(len <= _capacity); assert(len <= _capacity);
@ -80,7 +80,7 @@ public:
/** Acumulate (add) @a len frames @a src starting at @a src_offset into self starting at @ dst_offset /** Acumulate (add) @a len frames @a src starting at @a src_offset into self starting at @ dst_offset
* scaling by @a gain_coeff */ * scaling by @a gain_coeff */
void accumulate_with_gain_from (const AudioBuffer& src, nframes_t len, gain_t gain_coeff, nframes_t dst_offset = 0, nframes_t src_offset = 0) { void accumulate_with_gain_from (const AudioBuffer& src, framecnt_t len, gain_t gain_coeff, framecnt_t dst_offset = 0, framecnt_t src_offset = 0) {
assert(_capacity > 0); assert(_capacity > 0);
assert(len <= _capacity); assert(len <= _capacity);
@ -100,7 +100,7 @@ public:
/** Accumulate (add) @a len frames FROM THE START OF @a src into self /** Accumulate (add) @a len frames FROM THE START OF @a src into self
* scaling by @a gain_coeff */ * scaling by @a gain_coeff */
void accumulate_with_gain_from (const Sample* src_raw, nframes_t len, gain_t gain_coeff, nframes_t dst_offset = 0) { void accumulate_with_gain_from (const Sample* src_raw, framecnt_t len, gain_t gain_coeff, framecnt_t dst_offset = 0) {
assert(_capacity > 0); assert(_capacity > 0);
assert(len <= _capacity); assert(len <= _capacity);
@ -113,7 +113,7 @@ public:
_written = true; _written = true;
} }
void apply_gain (gain_t gain, nframes_t len) { void apply_gain (gain_t gain, framecnt_t len) {
apply_gain_to_buffer (_data, len, gain); apply_gain_to_buffer (_data, len, gain);
} }
@ -137,12 +137,12 @@ public:
void resize (size_t nframes); void resize (size_t nframes);
const Sample* data (nframes_t offset = 0) const { const Sample* data (framecnt_t offset = 0) const {
assert(offset <= _capacity); assert(offset <= _capacity);
return _data + offset; return _data + offset;
} }
Sample* data (nframes_t offset = 0) { Sample* data (framecnt_t offset = 0) {
assert(offset <= _capacity); assert(offset <= _capacity);
return _data + offset; return _data + offset;
} }

View file

@ -139,7 +139,7 @@ class AudioDiskstream : public Diskstream
} }
} }
static void swap_by_ptr (Sample *first, Sample *last, nframes_t n) { static void swap_by_ptr (Sample *first, Sample *last, framecnt_t n) {
while (n--) { while (n--) {
Sample tmp = *first; Sample tmp = *first;
*first++ = *last; *first++ = *last;
@ -161,7 +161,7 @@ class AudioDiskstream : public Diskstream
void set_pending_overwrite(bool); void set_pending_overwrite(bool);
int overwrite_existing_buffers (); int overwrite_existing_buffers ();
void set_block_size (nframes_t); void set_block_size (pframes_t);
int internal_playback_seek (framecnt_t distance); int internal_playback_seek (framecnt_t distance);
int can_internal_playback_seek (framecnt_t distance); int can_internal_playback_seek (framecnt_t distance);
int rename_write_sources (); int rename_write_sources ();
@ -177,17 +177,17 @@ class AudioDiskstream : public Diskstream
protected: protected:
friend class AudioTrack; friend class AudioTrack;
int process (framepos_t transport_frame, nframes_t nframes, bool can_record, bool rec_monitors_input, bool& need_butler); int process (framepos_t transport_frame, pframes_t nframes, bool can_record, bool rec_monitors_input, bool& need_butler);
bool commit (nframes_t nframes); bool commit (framecnt_t nframes);
private: private:
struct ChannelInfo : public boost::noncopyable { struct ChannelInfo : public boost::noncopyable {
ChannelInfo (nframes_t playback_buffer_size, ChannelInfo (framecnt_t playback_buffer_size,
nframes_t capture_buffer_size, framecnt_t capture_buffer_size,
nframes_t speed_buffer_size, framecnt_t speed_buffer_size,
nframes_t wrap_buffer_size); framecnt_t wrap_buffer_size);
~ChannelInfo (); ~ChannelInfo ();
Sample *playback_wrap_buffer; Sample *playback_wrap_buffer;
@ -216,15 +216,15 @@ class AudioDiskstream : public Diskstream
RingBufferNPT<CaptureTransition> * capture_transition_buf; RingBufferNPT<CaptureTransition> * capture_transition_buf;
// the following are used in the butler thread only // the following are used in the butler thread only
nframes_t curr_capture_cnt; framecnt_t curr_capture_cnt;
void resize_playback (nframes_t); void resize_playback (framecnt_t);
void resize_capture (nframes_t); void resize_capture (framecnt_t);
}; };
typedef std::vector<ChannelInfo*> ChannelList; typedef std::vector<ChannelInfo*> ChannelList;
void process_varispeed_playback(nframes_t nframes, boost::shared_ptr<ChannelList> c); void process_varispeed_playback (pframes_t nframes, boost::shared_ptr<ChannelList> c);
/* The two central butler operations */ /* The two central butler operations */
int do_flush (RunContext context, bool force = false); int do_flush (RunContext context, bool force = false);
@ -233,7 +233,7 @@ class AudioDiskstream : public Diskstream
int do_refill_with_alloc (); int do_refill_with_alloc ();
int read (Sample* buf, Sample* mixdown_buffer, float* gain_buffer, int read (Sample* buf, Sample* mixdown_buffer, float* gain_buffer,
framepos_t& start, nframes_t cnt, framepos_t& start, framecnt_t cnt,
ChannelInfo* channel_info, int channel, bool reversed); ChannelInfo* channel_info, int channel, bool reversed);
void finish_capture (bool rec_monitors_input, boost::shared_ptr<ChannelList>); void finish_capture (bool rec_monitors_input, boost::shared_ptr<ChannelList>);

View file

@ -35,25 +35,25 @@ class AudioPort : public Port
return DataType::AUDIO; return DataType::AUDIO;
} }
void cycle_start (nframes_t); void cycle_start (pframes_t);
void cycle_end (nframes_t); void cycle_end (pframes_t);
void cycle_split (); void cycle_split ();
size_t raw_buffer_size(jack_nframes_t nframes) const; size_t raw_buffer_size (pframes_t nframes) const;
Buffer& get_buffer (nframes_t nframes, nframes_t offset = 0) { Buffer& get_buffer (framecnt_t nframes, framecnt_t offset = 0) {
return get_audio_buffer (nframes, offset); return get_audio_buffer (nframes, offset);
} }
AudioBuffer& get_audio_buffer (nframes_t nframes, nframes_t offset = 0); AudioBuffer& get_audio_buffer (framecnt_t nframes, framecnt_t offset = 0);
static nframes_t port_offset() { return _port_offset; } static framecnt_t port_offset() { return _port_offset; }
static void set_port_offset (nframes_t off) { static void set_port_offset (framecnt_t off) {
_port_offset = off; _port_offset = off;
} }
static void increment_port_offset (nframes_t n) { static void increment_port_offset (framecnt_t n) {
_port_offset += n; _port_offset += n;
} }
@ -65,7 +65,7 @@ class AudioPort : public Port
private: private:
AudioBuffer* _buffer; AudioBuffer* _buffer;
static nframes_t _port_offset; static framecnt_t _port_offset;
}; };
} // namespace ARDOUR } // namespace ARDOUR

View file

@ -39,7 +39,7 @@ class AudioTrack : public Track
int set_mode (TrackMode m); int set_mode (TrackMode m);
bool can_use_mode (TrackMode m, bool& bounce_required); bool can_use_mode (TrackMode m, bool& bounce_required);
int roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame, int roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
int declick, bool can_record, bool rec_monitors_input, bool& need_butler); int declick, bool can_record, bool rec_monitors_input, bool& need_butler);
void use_new_diskstream (); void use_new_diskstream ();
@ -55,7 +55,7 @@ class AudioTrack : public Track
void unfreeze (); void unfreeze ();
boost::shared_ptr<Region> bounce (InterThreadInfo&); boost::shared_ptr<Region> bounce (InterThreadInfo&);
boost::shared_ptr<Region> bounce_range (nframes_t start, nframes_t end, InterThreadInfo&, bool enable_processing); boost::shared_ptr<Region> bounce_range (framepos_t start, framepos_t end, InterThreadInfo&, bool enable_processing);
int set_state(const XMLNode&, int version); int set_state(const XMLNode&, int version);

View file

@ -71,7 +71,7 @@ class AUPlugin : public ARDOUR::Plugin
const char * maker () const { return _info->creator.c_str(); } const char * maker () const { return _info->creator.c_str(); }
uint32_t parameter_count () const; uint32_t parameter_count () const;
float default_value (uint32_t port); float default_value (uint32_t port);
nframes_t signal_latency() const; framecnt_t signal_latency() const;
void set_parameter (uint32_t which, float val); void set_parameter (uint32_t which, float val);
float get_parameter (uint32_t which) const; float get_parameter (uint32_t which) const;
@ -80,11 +80,11 @@ class AUPlugin : public ARDOUR::Plugin
void activate (); void activate ();
void deactivate (); void deactivate ();
void flush (); void flush ();
int set_block_size (nframes_t nframes); int set_block_size (pframes_t nframes);
int connect_and_run (BufferSet& bufs, int connect_and_run (BufferSet& bufs,
ChanMapping in, ChanMapping out, ChanMapping in, ChanMapping out,
nframes_t nframes, nframes_t offset); pframes_t nframes, framecnt_t offset);
std::set<Evoral::Parameter> automatable() const; std::set<Evoral::Parameter> automatable() const;
std::string describe_parameter (Evoral::Parameter); std::string describe_parameter (Evoral::Parameter);
std::string state_node_name () const { return "audiounit"; } std::string state_node_name () const { return "audiounit"; }
@ -150,8 +150,8 @@ class AUPlugin : public ARDOUR::Plugin
int32_t input_channels; int32_t input_channels;
int32_t output_channels; int32_t output_channels;
std::vector<std::pair<int,int> > io_configs; std::vector<std::pair<int,int> > io_configs;
nframes_t _current_block_size; pframes_t _current_block_size;
nframes_t _last_nframes; framecnt_t _last_nframes;
bool _requires_fixed_size_buffers; bool _requires_fixed_size_buffers;
AudioBufferList* buffers; AudioBufferList* buffers;
bool _has_midi_input; bool _has_midi_input;
@ -181,10 +181,10 @@ class AUPlugin : public ARDOUR::Plugin
std::vector<std::pair<uint32_t, uint32_t> > parameter_map; std::vector<std::pair<uint32_t, uint32_t> > parameter_map;
uint32_t current_maxbuf; uint32_t current_maxbuf;
nframes_t current_offset; framecnt_t current_offset;
nframes_t cb_offset; framecnt_t cb_offset;
BufferSet* current_buffers; BufferSet* current_buffers;
nframes_t frames_processed; framecnt_t frames_processed;
std::vector<AUParameterDescriptor> descriptors; std::vector<AUParameterDescriptor> descriptors;
void init (); void init ();

View file

@ -56,8 +56,8 @@ class AudioAnalyser : public boost::noncopyable {
AnalysisPlugin* plugin; AnalysisPlugin* plugin;
AnalysisPluginKey plugin_key; AnalysisPluginKey plugin_key;
nframes_t bufsize; framecnt_t bufsize;
nframes_t stepsize; framecnt_t stepsize;
int initialize_plugin (AnalysisPluginKey name, float sample_rate); int initialize_plugin (AnalysisPluginKey name, float sample_rate);
int analyse (const std::string& path, Readable*, uint32_t channel); int analyse (const std::string& path, Readable*, uint32_t channel);

View file

@ -91,46 +91,57 @@ class AudioEngine : public SessionHandlePtr
Glib::Mutex& process_lock() { return _process_lock; } Glib::Mutex& process_lock() { return _process_lock; }
nframes_t frame_rate() const; framecnt_t frame_rate () const;
nframes_t frames_per_cycle() const; framecnt_t frames_per_cycle () const;
size_t raw_buffer_size(DataType t); size_t raw_buffer_size(DataType t);
int usecs_per_cycle () const { return _usecs_per_cycle; } int usecs_per_cycle () const { return _usecs_per_cycle; }
bool get_sync_offset (nframes_t& offset) const; bool get_sync_offset (pframes_t & offset) const;
nframes_t frames_since_cycle_start () { pframes_t frames_since_cycle_start () {
jack_client_t* _priv_jack = _jack; jack_client_t* _priv_jack = _jack;
if (!_running || !_priv_jack) return 0; if (!_running || !_priv_jack) {
return 0;
}
return jack_frames_since_cycle_start (_priv_jack); return jack_frames_since_cycle_start (_priv_jack);
} }
nframes_t frame_time () {
pframes_t frame_time () {
jack_client_t* _priv_jack = _jack; jack_client_t* _priv_jack = _jack;
if (!_running || !_priv_jack) return 0; if (!_running || !_priv_jack) {
return 0;
}
return jack_frame_time (_priv_jack); return jack_frame_time (_priv_jack);
} }
nframes_t frame_time_at_cycle_start () { pframes_t frame_time_at_cycle_start () {
jack_client_t* _priv_jack = _jack; jack_client_t* _priv_jack = _jack;
if (!_running || !_priv_jack) return 0; if (!_running || !_priv_jack) {
return 0;
}
return jack_last_frame_time (_priv_jack); return jack_last_frame_time (_priv_jack);
} }
nframes_t transport_frame () const { pframes_t transport_frame () const {
const jack_client_t* _priv_jack = _jack; const jack_client_t* _priv_jack = _jack;
if (!_running || !_priv_jack) return 0; if (!_running || !_priv_jack) {
return 0;
}
return jack_get_current_transport_frame (_priv_jack); return jack_get_current_transport_frame (_priv_jack);
} }
int request_buffer_size (nframes_t); int request_buffer_size (pframes_t);
nframes_t set_monitor_check_interval (nframes_t); framecnt_t set_monitor_check_interval (framecnt_t);
nframes_t processed_frames() const { return _processed_frames; } framecnt_t processed_frames() const { return _processed_frames; }
float get_cpu_load() { float get_cpu_load() {
jack_client_t* _priv_jack = _jack; jack_client_t* _priv_jack = _jack;
if (!_running || !_priv_jack) return 0; if (!_running || !_priv_jack) {
return 0;
}
return jack_cpu_load (_priv_jack); return jack_cpu_load (_priv_jack);
} }
@ -159,7 +170,7 @@ class AudioEngine : public SessionHandlePtr
Port *register_output_port (DataType, const std::string& portname); Port *register_output_port (DataType, const std::string& portname);
int unregister_port (Port &); int unregister_port (Port &);
void split_cycle (nframes_t offset); void split_cycle (pframes_t offset);
int connect (const std::string& source, const std::string& destination); int connect (const std::string& source, const std::string& destination);
int disconnect (const std::string& source, const std::string& destination); int disconnect (const std::string& source, const std::string& destination);
@ -189,7 +200,7 @@ class AudioEngine : public SessionHandlePtr
void transport_start (); void transport_start ();
void transport_stop (); void transport_stop ();
void transport_locate (nframes_t); void transport_locate (framepos_t);
TransportState transport_state (); TransportState transport_state ();
int reset_timebase (); int reset_timebase ();
@ -203,7 +214,7 @@ class AudioEngine : public SessionHandlePtr
_ the regular process() call to session->process() is not made. _ the regular process() call to session->process() is not made.
*/ */
PBD::Signal1<int,nframes_t> Freewheel; PBD::Signal1<int, pframes_t> Freewheel;
PBD::Signal0<void> Xrun; PBD::Signal0<void> Xrun;
@ -218,7 +229,7 @@ _ the regular process() call to session->process() is not made.
/* this signal is emitted if the sample rate changes */ /* this signal is emitted if the sample rate changes */
PBD::Signal1<void,nframes_t> SampleRateChanged; PBD::Signal1<void, framecnt_t> SampleRateChanged;
/* this signal is sent if JACK ever disconnects us */ /* this signal is sent if JACK ever disconnects us */
@ -255,18 +266,18 @@ _ the regular process() call to session->process() is not made.
bool session_remove_pending; bool session_remove_pending;
bool _running; bool _running;
bool _has_run; bool _has_run;
mutable nframes_t _buffer_size; mutable framecnt_t _buffer_size;
std::map<DataType,size_t> _raw_buffer_sizes; std::map<DataType,size_t> _raw_buffer_sizes;
mutable nframes_t _frame_rate; mutable framecnt_t _frame_rate;
/// number of frames between each check for changes in monitor input /// number of frames between each check for changes in monitor input
nframes_t monitor_check_interval; framecnt_t monitor_check_interval;
/// time of the last monitor check in frames /// time of the last monitor check in frames
nframes_t last_monitor_check; framecnt_t last_monitor_check;
/// the number of frames processed since start() was called /// the number of frames processed since start() was called
nframes_t _processed_frames; framecnt_t _processed_frames;
bool _freewheeling; bool _freewheeling;
bool _freewheel_pending; bool _freewheel_pending;
boost::function<int(nframes_t)> freewheel_action; boost::function<int(framecnt_t)> freewheel_action;
bool reconnect_on_halt; bool reconnect_on_halt;
int _usecs_per_cycle; int _usecs_per_cycle;
@ -274,7 +285,7 @@ _ the regular process() call to session->process() is not made.
Port *register_port (DataType type, const std::string& portname, bool input); Port *register_port (DataType type, const std::string& portname, bool input);
int process_callback (nframes_t nframes); int process_callback (pframes_t nframes);
void* process_thread (); void* process_thread ();
void finish_process_cycle (int status); void finish_process_cycle (int status);
void remove_all_ports (); void remove_all_ports ();
@ -289,20 +300,20 @@ _ the regular process() call to session->process() is not made.
static void _session_callback (jack_session_event_t *event, void *arg); static void _session_callback (jack_session_event_t *event, void *arg);
#endif #endif
static int _graph_order_callback (void *arg); static int _graph_order_callback (void *arg);
static int _process_callback (nframes_t nframes, void *arg); static int _process_callback (pframes_t nframes, void *arg);
static void* _process_thread (void *arg); static void* _process_thread (void *arg);
static int _sample_rate_callback (nframes_t nframes, void *arg); static int _sample_rate_callback (pframes_t nframes, void *arg);
static int _bufsize_callback (nframes_t nframes, void *arg); static int _bufsize_callback (pframes_t nframes, void *arg);
static void _jack_timebase_callback (jack_transport_state_t, nframes_t, jack_position_t*, int, void*); static void _jack_timebase_callback (jack_transport_state_t, pframes_t, jack_position_t*, int, void*);
static int _jack_sync_callback (jack_transport_state_t, jack_position_t*, void *arg); static int _jack_sync_callback (jack_transport_state_t, jack_position_t*, void *arg);
static void _freewheel_callback (int , void *arg); static void _freewheel_callback (int , void *arg);
static void _registration_callback (jack_port_id_t, int, void *); static void _registration_callback (jack_port_id_t, int, void *);
static void _connect_callback (jack_port_id_t, jack_port_id_t, int, void *); static void _connect_callback (jack_port_id_t, jack_port_id_t, int, void *);
void jack_timebase_callback (jack_transport_state_t, nframes_t, jack_position_t*, int); void jack_timebase_callback (jack_transport_state_t, pframes_t, jack_position_t*, int);
int jack_sync_callback (jack_transport_state_t, jack_position_t*); int jack_sync_callback (jack_transport_state_t, jack_position_t*);
int jack_bufsize_callback (nframes_t); int jack_bufsize_callback (pframes_t);
int jack_sample_rate_callback (nframes_t); int jack_sample_rate_callback (pframes_t);
int connect_to_jack (std::string client_name, std::string session_uuid); int connect_to_jack (std::string client_name, std::string session_uuid);

View file

@ -82,7 +82,7 @@ public:
static bool is_empty (Session&, std::string path); static bool is_empty (Session&, std::string path);
static void set_bwf_serial_number (int); static void set_bwf_serial_number (int);
static void set_header_position_offset (nframes_t offset ); static void set_header_position_offset (framecnt_t offset);
static PBD::Signal0<void> HeaderPositionOffsetChanged; static PBD::Signal0<void> HeaderPositionOffsetChanged;
@ -104,7 +104,7 @@ protected:
int move_dependents_to_trash(); int move_dependents_to_trash();
static Sample* get_interleave_buffer (nframes_t size); static Sample* get_interleave_buffer (framecnt_t size);
static std::string peak_dir; static std::string peak_dir;

View file

@ -72,7 +72,7 @@ public:
AudioPlaylist (Session&, const XMLNode&, bool hidden = false); AudioPlaylist (Session&, const XMLNode&, bool hidden = false);
AudioPlaylist (Session&, std::string name, bool hidden = false); AudioPlaylist (Session&, std::string name, bool hidden = false);
AudioPlaylist (boost::shared_ptr<const AudioPlaylist>, std::string name, bool hidden = false); AudioPlaylist (boost::shared_ptr<const AudioPlaylist>, std::string name, bool hidden = false);
AudioPlaylist (boost::shared_ptr<const AudioPlaylist>, nframes_t start, nframes_t cnt, std::string name, bool hidden = false); AudioPlaylist (boost::shared_ptr<const AudioPlaylist>, framepos_t start, framecnt_t cnt, std::string name, bool hidden = false);
~AudioPlaylist (); ~AudioPlaylist ();
@ -85,7 +85,7 @@ public:
PBD::Signal1<void,boost::shared_ptr<Crossfade> > NewCrossfade; PBD::Signal1<void,boost::shared_ptr<Crossfade> > NewCrossfade;
void foreach_crossfade (boost::function<void (boost::shared_ptr<Crossfade>)>); void foreach_crossfade (boost::function<void (boost::shared_ptr<Crossfade>)>);
void crossfades_at (nframes_t frame, Crossfades&); void crossfades_at (framepos_t frame, Crossfades&);
bool destroy_region (boost::shared_ptr<Region>); bool destroy_region (boost::shared_ptr<Region>);

View file

@ -93,8 +93,8 @@ class AudioRegion : public Region
boost::shared_ptr<AutomationList> fade_out() { return _fade_out; } boost::shared_ptr<AutomationList> fade_out() { return _fade_out; }
boost::shared_ptr<AutomationList> envelope() { return _envelope; } boost::shared_ptr<AutomationList> envelope() { return _envelope; }
virtual nframes_t read_peaks (PeakData *buf, nframes_t npeaks, virtual framecnt_t read_peaks (PeakData *buf, framecnt_t npeaks,
nframes_t offset, nframes_t cnt, framecnt_t offset, framecnt_t cnt,
uint32_t chan_n=0, double samples_per_unit= 1.0) const; uint32_t chan_n=0, double samples_per_unit= 1.0) const;
/* Readable interface */ /* Readable interface */

View file

@ -69,7 +69,7 @@ class AudioSource : virtual public Source,
uint32_t read_data_count() const { return _read_data_count; } uint32_t read_data_count() const { return _read_data_count; }
uint32_t write_data_count() const { return _write_data_count; } uint32_t write_data_count() const { return _write_data_count; }
void dec_read_data_count(nframes_t); void dec_read_data_count (framecnt_t);
int read_peaks (PeakData *peaks, framecnt_t npeaks, int read_peaks (PeakData *peaks, framecnt_t npeaks,
framepos_t start, framecnt_t cnt, double samples_per_visual_peak) const; framepos_t start, framecnt_t cnt, double samples_per_visual_peak) const;

View file

@ -46,7 +46,7 @@ class Auditioner : public AudioTrack
ARDOUR::AudioPlaylist& prepare_playlist (); ARDOUR::AudioPlaylist& prepare_playlist ();
void audition_current_playlist (); void audition_current_playlist ();
int play_audition (nframes_t nframes); int play_audition (framecnt_t nframes);
void cancel_audition () { void cancel_audition () {
g_atomic_int_set (&_auditioning, 0); g_atomic_int_set (&_auditioning, 0);
@ -57,10 +57,10 @@ class Auditioner : public AudioTrack
private: private:
boost::shared_ptr<AudioRegion> the_region; boost::shared_ptr<AudioRegion> the_region;
nframes_t current_frame; framepos_t current_frame;
mutable gint _auditioning; mutable gint _auditioning;
Glib::Mutex lock; Glib::Mutex lock;
nframes_t length; framecnt_t length;
bool via_monitor; bool via_monitor;
void drop_ports (); void drop_ports ();

View file

@ -60,7 +60,7 @@ public:
virtual void add_control(boost::shared_ptr<Evoral::Control>); virtual void add_control(boost::shared_ptr<Evoral::Control>);
void clear_controls (); void clear_controls ();
virtual void automation_snapshot(nframes_t now, bool force); virtual void automation_snapshot (framepos_t now, bool force);
virtual void transport_stopped (framepos_t now); virtual void transport_stopped (framepos_t now);
virtual std::string describe_parameter(Evoral::Parameter param); virtual std::string describe_parameter(Evoral::Parameter param);
@ -78,16 +78,16 @@ public:
void mark_automation_visible(Evoral::Parameter, bool); void mark_automation_visible(Evoral::Parameter, bool);
inline bool should_snapshot (nframes_t now) { inline bool should_snapshot (framepos_t now) {
return (_last_automation_snapshot > now return (_last_automation_snapshot > now
|| (now - _last_automation_snapshot) > _automation_interval); || (now - _last_automation_snapshot) > _automation_interval);
} }
static void set_automation_interval (jack_nframes_t frames) { static void set_automation_interval (framecnt_t frames) {
_automation_interval = frames; _automation_interval = frames;
} }
static jack_nframes_t automation_interval() { static framecnt_t automation_interval() {
return _automation_interval; return _automation_interval;
} }
@ -109,8 +109,8 @@ public:
std::set<Evoral::Parameter> _visible_controls; std::set<Evoral::Parameter> _visible_controls;
std::set<Evoral::Parameter> _can_automate_list; std::set<Evoral::Parameter> _can_automate_list;
nframes_t _last_automation_snapshot; framepos_t _last_automation_snapshot;
static nframes_t _automation_interval; static framecnt_t _automation_interval;
private: private:
PBD::ScopedConnectionList _control_connections; ///< connections to our controls' signals PBD::ScopedConnectionList _control_connections; ///< connections to our controls' signals

View file

@ -71,13 +71,13 @@ public:
virtual void resize (size_t) = 0; virtual void resize (size_t) = 0;
/** Clear (eg zero, or empty) buffer */ /** Clear (eg zero, or empty) buffer */
virtual void silence (nframes_t len, nframes_t offset = 0) = 0; virtual void silence (framecnt_t len, framecnt_t offset = 0) = 0;
/** Clear the entire buffer */ /** Clear the entire buffer */
virtual void clear() { silence(_capacity, 0); } virtual void clear() { silence(_capacity, 0); }
virtual void read_from (const Buffer& src, nframes_t len, nframes_t dst_offset = 0, nframes_t src_offset = 0) = 0; virtual void read_from (const Buffer& src, framecnt_t len, framecnt_t dst_offset = 0, framecnt_t src_offset = 0) = 0;
virtual void merge_from (const Buffer& src, nframes_t len, nframes_t dst_offset = 0, nframes_t src_offset = 0) = 0; virtual void merge_from (const Buffer& src, framecnt_t len, framecnt_t dst_offset = 0, framecnt_t src_offset = 0) = 0;
protected: protected:
Buffer(DataType type, size_t capacity) Buffer(DataType type, size_t capacity)

View file

@ -66,7 +66,7 @@ public:
void clear(); void clear();
void attach_buffers(PortSet& ports, nframes_t nframes, nframes_t offset = 0); void attach_buffers(PortSet& ports, framecnt_t nframes, framecnt_t offset = 0);
/* the capacity here is a size_t and has a different interpretation depending /* the capacity here is a size_t and has a different interpretation depending
on the DataType of the buffers. for audio, its a frame count. for MIDI on the DataType of the buffers. for audio, its a frame count. for MIDI
@ -83,7 +83,7 @@ public:
ChanCount& count() { return _count; } ChanCount& count() { return _count; }
void is_silent(bool yn); void is_silent(bool yn);
void silence (nframes_t nframes, nframes_t offset); void silence (framecnt_t nframes, framecnt_t offset);
bool is_mirror() const { return _is_mirror; } bool is_mirror() const { return _is_mirror; }
void set_count(const ChanCount& count) { assert(count <= _available); _count = count; } void set_count(const ChanCount& count) { assert(count <= _available); _count = count; }
@ -115,8 +115,8 @@ public:
VstEvents* get_vst_midi (size_t); VstEvents* get_vst_midi (size_t);
#endif #endif
void read_from(const BufferSet& in, nframes_t nframes); void read_from(const BufferSet& in, framecnt_t nframes);
void merge_from(const BufferSet& in, nframes_t nframes); void merge_from(const BufferSet& in, framecnt_t nframes);
template <typename BS, typename B> template <typename BS, typename B>
class iterator_base { class iterator_base {
@ -176,7 +176,7 @@ private:
~VSTBuffer (); ~VSTBuffer ();
void clear (); void clear ();
void push_back (Evoral::MIDIEvent<nframes_t> const &); void push_back (Evoral::MIDIEvent<framepos_t> const &);
VstEvents* events () const { VstEvents* events () const {
return _events; return _events;
} }

View file

@ -54,8 +54,8 @@ class Butler : public SessionHandleRef
float read_data_rate() const; ///< in usec float read_data_rate() const; ///< in usec
float write_data_rate() const; float write_data_rate() const;
nframes_t audio_diskstream_capture_buffer_size() const { return audio_dstream_capture_buffer_size; } framecnt_t audio_diskstream_capture_buffer_size() const { return audio_dstream_capture_buffer_size; }
nframes_t audio_diskstream_playback_buffer_size() const { return audio_dstream_playback_buffer_size; } framecnt_t audio_diskstream_playback_buffer_size() const { return audio_dstream_playback_buffer_size; }
uint32_t midi_diskstream_buffer_size() const { return midi_dstream_buffer_size; } uint32_t midi_diskstream_buffer_size() const { return midi_dstream_buffer_size; }
static void* _thread_work(void *arg); static void* _thread_work(void *arg);
@ -76,8 +76,8 @@ class Butler : public SessionHandleRef
bool should_run; bool should_run;
mutable gint should_do_transport_work; mutable gint should_do_transport_work;
int request_pipe[2]; int request_pipe[2];
nframes_t audio_dstream_capture_buffer_size; framecnt_t audio_dstream_capture_buffer_size;
nframes_t audio_dstream_playback_buffer_size; framecnt_t audio_dstream_playback_buffer_size;
uint32_t midi_dstream_buffer_size; uint32_t midi_dstream_buffer_size;
RingBuffer<CrossThreadPool*> pool_trash; RingBuffer<CrossThreadPool*> pool_trash;

View file

@ -29,34 +29,34 @@
namespace ARDOUR { namespace ARDOUR {
struct Click { struct Click {
nframes_t start; framepos_t start;
nframes_t duration; framecnt_t duration;
nframes_t offset; framecnt_t offset;
const Sample *data; const Sample *data;
Click (nframes_t s, nframes_t d, const Sample *b) : start (s), duration (d), offset (0), data (b) {} Click (framepos_t s, framecnt_t d, const Sample *b) : start (s), duration (d), offset (0), data (b) {}
void *operator new (size_t) { void *operator new (size_t) {
return pool.alloc (); return pool.alloc ();
}; };
void operator delete(void *ptr, size_t /*size*/) { void operator delete(void *ptr, size_t /*size*/) {
pool.release (ptr); pool.release (ptr);
} }
private: private:
static Pool pool; static Pool pool;
}; };
typedef std::list<Click*> Clicks; typedef std::list<Click*> Clicks;
class ClickIO : public IO class ClickIO : public IO
{ {
public: public:
ClickIO (Session& s, const std::string& name) : IO (s, name, IO::Output) {} ClickIO (Session& s, const std::string& name) : IO (s, name, IO::Output) {}
~ClickIO() {} ~ClickIO() {}
protected: protected:
uint32_t pans_required () const { return 1; } uint32_t pans_required () const { return 1; }
}; };

View file

@ -66,21 +66,21 @@ public:
bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const; bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
bool configure_io (ChanCount in, ChanCount out); bool configure_io (ChanCount in, ChanCount out);
void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, nframes_t nframes, bool); void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool);
/* supplemental method used with MIDI */ /* supplemental method used with MIDI */
void flush_buffers (nframes_t nframes, framepos_t time); void flush_buffers (framecnt_t nframes, framepos_t time);
void no_outs_cuz_we_no_monitor(bool); void no_outs_cuz_we_no_monitor(bool);
void cycle_start (nframes_t); void cycle_start (pframes_t);
void increment_output_offset (nframes_t); void increment_output_offset (framecnt_t);
void transport_stopped (framepos_t frame); void transport_stopped (framepos_t frame);
BufferSet& output_buffers() { return *_output_buffers; } BufferSet& output_buffers() { return *_output_buffers; }
PBD::Signal0<void> MuteChange; PBD::Signal0<void> MuteChange;
static PBD::Signal1<void,nframes_t> CycleStart; static PBD::Signal1<void, pframes_t> CycleStart;
XMLNode& state (bool full); XMLNode& state (bool full);
int set_state (const XMLNode&, int version); int set_state (const XMLNode&, int version);
@ -104,7 +104,7 @@ public:
Role _role; Role _role;
BufferSet* _output_buffers; BufferSet* _output_buffers;
gain_t _current_gain; gain_t _current_gain;
nframes_t _output_offset; framecnt_t _output_offset;
bool _no_outs_cuz_we_no_monitor; bool _no_outs_cuz_we_no_monitor;
boost::shared_ptr<MuteMaster> _mute_master; boost::shared_ptr<MuteMaster> _mute_master;
bool no_panner_reset; bool no_panner_reset;

View file

@ -79,8 +79,8 @@ class Diskstream : public SessionObject, public PublicDiskstream
void set_align_style (AlignStyle); void set_align_style (AlignStyle);
void set_persistent_align_style (AlignStyle a) { _persistent_alignment_style = a; } void set_persistent_align_style (AlignStyle a) { _persistent_alignment_style = a; }
nframes_t roll_delay() const { return _roll_delay; } framecnt_t roll_delay() const { return _roll_delay; }
void set_roll_delay (nframes_t); void set_roll_delay (framecnt_t);
bool record_enabled() const { return g_atomic_int_get (&_record_enabled); } bool record_enabled() const { return g_atomic_int_get (&_record_enabled); }
virtual void set_record_enabled (bool yn) = 0; virtual void set_record_enabled (bool yn) = 0;
@ -118,8 +118,8 @@ class Diskstream : public SessionObject, public PublicDiskstream
ChanCount n_channels() { return _n_channels; } ChanCount n_channels() { return _n_channels; }
static nframes_t disk_io_frames() { return disk_io_chunk_frames; } static framecnt_t disk_io_frames() { return disk_io_chunk_frames; }
static void set_disk_io_chunk_frames (uint32_t n) { disk_io_chunk_frames = n; } static void set_disk_io_chunk_frames (framecnt_t n) { disk_io_chunk_frames = n; }
/* Stateful */ /* Stateful */
virtual XMLNode& get_state(void) = 0; virtual XMLNode& get_state(void) = 0;
@ -127,7 +127,7 @@ class Diskstream : public SessionObject, public PublicDiskstream
virtual void monitor_input (bool) {} virtual void monitor_input (bool) {}
nframes_t capture_offset() const { return _capture_offset; } framecnt_t capture_offset() const { return _capture_offset; }
virtual void set_capture_offset (); virtual void set_capture_offset ();
bool slaved() const { return _slaved; } bool slaved() const { return _slaved; }
@ -144,7 +144,7 @@ class Diskstream : public SessionObject, public PublicDiskstream
/** For non-butler contexts (allocates temporary working buffers) */ /** For non-butler contexts (allocates temporary working buffers) */
virtual int do_refill_with_alloc() = 0; virtual int do_refill_with_alloc() = 0;
virtual void set_block_size (nframes_t) = 0; virtual void set_block_size (pframes_t) = 0;
bool pending_overwrite () const { bool pending_overwrite () const {
return _pending_overwrite; return _pending_overwrite;
@ -186,8 +186,8 @@ class Diskstream : public SessionObject, public PublicDiskstream
protected: protected:
friend class Track; friend class Track;
virtual int process (framepos_t transport_frame, nframes_t nframes, bool can_record, bool rec_monitors_input, bool& need_butler) = 0; virtual int process (framepos_t transport_frame, pframes_t nframes, bool can_record, bool rec_monitors_input, bool& need_butler) = 0;
virtual bool commit (nframes_t nframes) = 0; virtual bool commit (framecnt_t nframes) = 0;
//private: //private:
@ -239,9 +239,9 @@ class Diskstream : public SessionObject, public PublicDiskstream
virtual void prepare_to_stop (framepos_t pos); virtual void prepare_to_stop (framepos_t pos);
void calculate_record_range(OverlapType ot, framepos_t transport_frame, framecnt_t nframes, void calculate_record_range(OverlapType ot, framepos_t transport_frame, framecnt_t nframes,
nframes_t& rec_nframes, nframes_t& rec_offset); framecnt_t& rec_nframes, framecnt_t& rec_offset);
static nframes_t disk_io_chunk_frames; static framecnt_t disk_io_chunk_frames;
std::vector<CaptureInfo*> capture_info; std::vector<CaptureInfo*> capture_info;
mutable Glib::Mutex capture_info_lock; mutable Glib::Mutex capture_info_lock;
@ -265,9 +265,9 @@ class Diskstream : public SessionObject, public PublicDiskstream
framepos_t capture_start_frame; framepos_t capture_start_frame;
framecnt_t capture_captured; framecnt_t capture_captured;
bool was_recording; bool was_recording;
nframes_t adjust_capture_position; framecnt_t adjust_capture_position;
nframes_t _capture_offset; framecnt_t _capture_offset;
nframes_t _roll_delay; framecnt_t _roll_delay;
framepos_t first_recordable_frame; framepos_t first_recordable_frame;
framepos_t last_recordable_frame; framepos_t last_recordable_frame;
int last_possibly_recording; int last_possibly_recording;
@ -280,8 +280,8 @@ class Diskstream : public SessionObject, public PublicDiskstream
bool _pending_overwrite; bool _pending_overwrite;
bool overwrite_queued; bool overwrite_queued;
IOChange input_change_pending; IOChange input_change_pending;
nframes_t wrap_buffer_size; framecnt_t wrap_buffer_size;
nframes_t speed_buffer_size; framecnt_t speed_buffer_size;
double _speed; double _speed;
double _target_speed; double _target_speed;
@ -299,10 +299,6 @@ class Diskstream : public SessionObject, public PublicDiskstream
Glib::Mutex state_lock; Glib::Mutex state_lock;
framepos_t scrub_start;
nframes_t scrub_buffer_size;
nframes_t scrub_offset;
PBD::ScopedConnectionList playlist_connections; PBD::ScopedConnectionList playlist_connections;
PBD::ScopedConnection ic_connection; PBD::ScopedConnection ic_connection;

View file

@ -109,13 +109,13 @@ class ElementImporter
std::string name; std::string name;
/// The sample rate of the session from which we are importing /// The sample rate of the session from which we are importing
nframes_t sample_rate; framecnt_t sample_rate;
/// Converts timecode time to a string /// Converts timecode time to a string
std::string timecode_to_string (Timecode::Time & time) const; std::string timecode_to_string (Timecode::Time & time) const;
/// Converts samples so that times match the sessions sample rate /// Converts samples so that times match the sessions sample rate
nframes_t rate_convert_samples (nframes_t samples) const; framecnt_t rate_convert_samples (framecnt_t samples) const;
/// Converts samples so that times match the sessions sample rate (for straight use in XML) /// Converts samples so that times match the sessions sample rate (for straight use in XML)
std::string rate_convert_samples (std::string const & samples) const; std::string rate_convert_samples (std::string const & samples) const;

View file

@ -43,7 +43,7 @@ class ExportChannel : public boost::less_than_comparable<ExportChannel>
virtual ~ExportChannel () {} virtual ~ExportChannel () {}
virtual void read (Sample * data, nframes_t frames) const = 0; virtual void read (Sample * data, framecnt_t frames) const = 0;
virtual bool empty () const = 0; virtual bool empty () const = 0;
/// Adds state to node passed /// Adds state to node passed
@ -75,7 +75,7 @@ class PortExportChannel : public ExportChannel
PortExportChannel () {} PortExportChannel () {}
void read (Sample * data, nframes_t frames) const; void read (Sample * data, framecnt_t frames) const;
bool empty () const { return ports.empty(); } bool empty () const { return ports.empty(); }
void get_state (XMLNode * node) const; void get_state (XMLNode * node) const;
@ -104,23 +104,23 @@ class RegionExportChannelFactory
~RegionExportChannelFactory (); ~RegionExportChannelFactory ();
ExportChannelPtr create (uint32_t channel); ExportChannelPtr create (uint32_t channel);
void read (uint32_t channel, Sample * data, nframes_t frames_to_read); void read (uint32_t channel, Sample * data, framecnt_t frames_to_read);
private: private:
int new_cycle_started (nframes_t) { buffers_up_to_date = false; return 0; } int new_cycle_started (framecnt_t) { buffers_up_to_date = false; return 0; }
void update_buffers (nframes_t frames); void update_buffers (framecnt_t frames);
AudioRegion const & region; AudioRegion const & region;
AudioTrack & track; AudioTrack & track;
Type type; Type type;
nframes_t frames_per_cycle; framecnt_t frames_per_cycle;
size_t n_channels; size_t n_channels;
BufferSet buffers; BufferSet buffers;
bool buffers_up_to_date; bool buffers_up_to_date;
nframes_t region_start; framecnt_t region_start;
nframes_t position; framecnt_t position;
Sample * mixdown_buffer; Sample * mixdown_buffer;
Sample * gain_buffer; Sample * gain_buffer;
@ -134,7 +134,7 @@ class RegionExportChannel : public ExportChannel
friend class RegionExportChannelFactory; friend class RegionExportChannelFactory;
public: public:
void read (Sample * data, nframes_t frames_to_read) const { factory.read (channel, data, frames_to_read); } void read (Sample * data, framecnt_t frames_to_read) const { factory.read (channel, data, frames_to_read); }
void get_state (XMLNode * /*node*/) const {}; void get_state (XMLNode * /*node*/) const {};
void set_state (XMLNode * /*node*/, Session & /*session*/) {}; void set_state (XMLNode * /*node*/, Session & /*session*/) {};
bool empty () const { return false; } bool empty () const { return false; }

View file

@ -47,7 +47,7 @@ class ExportFormatSpecification : public ExportFormatBase {
Time (Session & session) : AnyTime (), session (session) {} Time (Session & session) : AnyTime (), session (session) {}
Time & operator= (AnyTime const & other); Time & operator= (AnyTime const & other);
nframes_t get_frames (nframes_t target_rate) const; framecnt_t get_frames (framecnt_t target_rate) const;
/* Serialization */ /* Serialization */
@ -123,11 +123,11 @@ class ExportFormatSpecification : public ExportFormatBase {
bool tag () const { return _tag && supports_tagging; } bool tag () const { return _tag && supports_tagging; }
nframes_t silence_beginning () const { return _silence_beginning.get_frames (sample_rate()); } framecnt_t silence_beginning () const { return _silence_beginning.get_frames (sample_rate()); }
nframes_t silence_end () const { return _silence_end.get_frames (sample_rate()); } framecnt_t silence_end () const { return _silence_end.get_frames (sample_rate()); }
nframes_t silence_beginning (nframes_t samplerate) const { return _silence_beginning.get_frames (samplerate); } framecnt_t silence_beginning (framecnt_t samplerate) const { return _silence_beginning.get_frames (samplerate); }
nframes_t silence_end (nframes_t samplerate) const { return _silence_end.get_frames (samplerate); } framecnt_t silence_end (framecnt_t samplerate) const { return _silence_end.get_frames (samplerate); }
AnyTime silence_beginning_time () const { return _silence_beginning; } AnyTime silence_beginning_time () const { return _silence_beginning; }
AnyTime silence_end_time () const { return _silence_end; } AnyTime silence_end_time () const { return _silence_end; }

View file

@ -62,7 +62,7 @@ class ExportGraphBuilder
ExportGraphBuilder (Session const & session); ExportGraphBuilder (Session const & session);
~ExportGraphBuilder (); ~ExportGraphBuilder ();
int process (nframes_t frames, bool last_cycle); int process (framecnt_t frames, bool last_cycle);
bool process_normalize (); // returns true when finished bool process_normalize (); // returns true when finished
void reset (); void reset ();
@ -102,7 +102,7 @@ class ExportGraphBuilder
class SFC { class SFC {
public: public:
// This constructor so that this can be constructed like a Normalizer // This constructor so that this can be constructed like a Normalizer
SFC (ExportGraphBuilder &, FileSpec const & new_config, nframes_t max_frames); SFC (ExportGraphBuilder &, FileSpec const & new_config, framecnt_t max_frames);
FloatSinkPtr sink (); FloatSinkPtr sink ();
void add_child (FileSpec const & new_config); void add_child (FileSpec const & new_config);
bool operator== (FileSpec const & other_config) const; bool operator== (FileSpec const & other_config) const;
@ -124,7 +124,7 @@ class ExportGraphBuilder
class Normalizer { class Normalizer {
public: public:
Normalizer (ExportGraphBuilder & parent, FileSpec const & new_config, nframes_t max_frames); Normalizer (ExportGraphBuilder & parent, FileSpec const & new_config, framecnt_t max_frames);
FloatSinkPtr sink (); FloatSinkPtr sink ();
void add_child (FileSpec const & new_config); void add_child (FileSpec const & new_config);
bool operator== (FileSpec const & other_config) const; bool operator== (FileSpec const & other_config) const;
@ -144,7 +144,7 @@ class ExportGraphBuilder
ExportGraphBuilder & parent; ExportGraphBuilder & parent;
FileSpec config; FileSpec config;
nframes_t max_frames_out; framecnt_t max_frames_out;
BufferPtr buffer; BufferPtr buffer;
PeakReaderPtr peak_reader; PeakReaderPtr peak_reader;
@ -159,7 +159,7 @@ class ExportGraphBuilder
// sample rate converter // sample rate converter
class SRC { class SRC {
public: public:
SRC (ExportGraphBuilder & parent, FileSpec const & new_config, nframes_t max_frames); SRC (ExportGraphBuilder & parent, FileSpec const & new_config, framecnt_t max_frames);
FloatSinkPtr sink (); FloatSinkPtr sink ();
void add_child (FileSpec const & new_config); void add_child (FileSpec const & new_config);
bool operator== (FileSpec const & other_config) const; bool operator== (FileSpec const & other_config) const;
@ -175,13 +175,13 @@ class ExportGraphBuilder
boost::ptr_list<SFC> children; boost::ptr_list<SFC> children;
boost::ptr_list<Normalizer> normalized_children; boost::ptr_list<Normalizer> normalized_children;
SRConverterPtr converter; SRConverterPtr converter;
nframes_t max_frames_out; framecnt_t max_frames_out;
}; };
// Silence trimmer + adder // Silence trimmer + adder
class SilenceHandler { class SilenceHandler {
public: public:
SilenceHandler (ExportGraphBuilder & parent, FileSpec const & new_config, nframes_t max_frames); SilenceHandler (ExportGraphBuilder & parent, FileSpec const & new_config, framecnt_t max_frames);
FloatSinkPtr sink (); FloatSinkPtr sink ();
void add_child (FileSpec const & new_config); void add_child (FileSpec const & new_config);
bool operator== (FileSpec const & other_config) const; bool operator== (FileSpec const & other_config) const;
@ -193,7 +193,7 @@ class ExportGraphBuilder
FileSpec config; FileSpec config;
boost::ptr_list<SRC> children; boost::ptr_list<SRC> children;
SilenceTrimmerPtr silence_trimmer; SilenceTrimmerPtr silence_trimmer;
nframes_t max_frames_in; framecnt_t max_frames_in;
}; };
// channel configuration // channel configuration
@ -210,7 +210,7 @@ class ExportGraphBuilder
FileSpec config; FileSpec config;
boost::ptr_list<SilenceHandler> children; boost::ptr_list<SilenceHandler> children;
InterleaverPtr interleaver; InterleaverPtr interleaver;
nframes_t max_frames; framecnt_t max_frames;
}; };
Session const & session; Session const & session;
@ -223,7 +223,7 @@ class ExportGraphBuilder
ChannelMap channels; ChannelMap channels;
Sample * process_buffer; Sample * process_buffer;
nframes_t process_buffer_frames; framecnt_t process_buffer_frames;
std::list<Normalizer *> normalizers; std::list<Normalizer *> normalizers;

View file

@ -119,7 +119,7 @@ class ExportHandler : public ExportElementFactory
private: private:
int process (nframes_t frames); int process (framecnt_t frames);
Session & session; Session & session;
GraphBuilderPtr graph_builder; GraphBuilderPtr graph_builder;
@ -132,7 +132,7 @@ class ExportHandler : public ExportElementFactory
/* Timespan management */ /* Timespan management */
void start_timespan (); void start_timespan ();
int process_timespan (nframes_t frames); int process_timespan (framecnt_t frames);
int process_normalize (); int process_normalize ();
void finish_timespan (); void finish_timespan ();

View file

@ -136,8 +136,8 @@ class ExportProfileManager
typedef boost::shared_ptr<TimespanState> TimespanStatePtr; typedef boost::shared_ptr<TimespanState> TimespanStatePtr;
typedef std::list<TimespanStatePtr> TimespanStateList; typedef std::list<TimespanStatePtr> TimespanStateList;
void set_selection_range (nframes_t start = 0, nframes_t end = 0); void set_selection_range (framepos_t start = 0, framepos_t end = 0);
std::string set_single_range (nframes_t start, nframes_t end, std::string name); std::string set_single_range (framepos_t start, framepos_t end, std::string name);
TimespanStateList const & get_timespans () { return check_list (timespans); } TimespanStateList const & get_timespans () { return check_list (timespans); }
private: private:

View file

@ -42,7 +42,7 @@ class ExportTimespan
private: private:
friend class ExportElementFactory; friend class ExportElementFactory;
ExportTimespan (ExportStatusPtr status, nframes_t frame_rate); ExportTimespan (ExportStatusPtr status, framecnt_t frame_rate);
public: public:
~ExportTimespan (); ~ExportTimespan ();
@ -53,19 +53,19 @@ class ExportTimespan
std::string range_id () const { return _range_id; } std::string range_id () const { return _range_id; }
void set_range_id (std::string range_id) { _range_id = range_id; } void set_range_id (std::string range_id) { _range_id = range_id; }
void set_range (nframes_t start, nframes_t end); void set_range (framepos_t start, framepos_t end);
nframes_t get_length () const { return end_frame - start_frame; } framecnt_t get_length () const { return end_frame - start_frame; }
nframes_t get_start () const { return start_frame; } framepos_t get_start () const { return start_frame; }
nframes_t get_end () const { return end_frame; } framepos_t get_end () const { return end_frame; }
private: private:
ExportStatusPtr status; ExportStatusPtr status;
nframes_t start_frame; framepos_t start_frame;
nframes_t end_frame; framepos_t end_frame;
nframes_t position; framepos_t position;
nframes_t frame_rate; framecnt_t frame_rate;
std::string _name; std::string _name;
std::string _range_id; std::string _range_id;

View file

@ -31,10 +31,10 @@ struct Gain : public AutomationList {
Gain (const Gain&); Gain (const Gain&);
Gain& operator= (const Gain&); Gain& operator= (const Gain&);
static void fill_linear_fade_in (Gain& curve, nframes_t frames); static void fill_linear_fade_in (Gain& curve, framecnt_t frames);
static void fill_linear_volume_fade_in (Gain& curve, nframes_t frames); static void fill_linear_volume_fade_in (Gain& curve, framecnt_t frames);
static void fill_linear_fade_out (Gain& curve, nframes_t frames); static void fill_linear_fade_out (Gain& curve, framecnt_t frames);
static void fill_linear_volume_fade_out (Gain& curve, nframes_t frames); static void fill_linear_volume_fade_out (Gain& curve, framecnt_t frames);
}; };

View file

@ -71,14 +71,14 @@ class Graph : public SessionHandleRef
void helper_thread(); void helper_thread();
void main_thread(); void main_thread();
int silent_process_routes (nframes_t nframes, framepos_t start_frame, framepos_t end_frame, int silent_process_routes (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
bool can_record, bool rec_monitors_input, bool& need_butler); bool can_record, bool rec_monitors_input, bool& need_butler);
int process_routes (nframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick, int process_routes (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick,
bool can_record, bool rec_monitors_input, bool& need_butler); bool can_record, bool rec_monitors_input, bool& need_butler);
int routes_no_roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame, int routes_no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
bool non_rt_pending, bool can_record, int declick); bool non_rt_pending, bool can_record, int declick);
void process_one_route (Route * route); void process_one_route (Route * route);
@ -118,7 +118,7 @@ class Graph : public SessionHandleRef
volatile int _setup_chain; volatile int _setup_chain;
// parameter caches. // parameter caches.
nframes_t _process_nframes; pframes_t _process_nframes;
framepos_t _process_start_frame; framepos_t _process_start_frame;
framepos_t _process_end_frame; framepos_t _process_end_frame;
bool _process_can_record; bool _process_can_record;

View file

@ -30,12 +30,12 @@ public:
ImportableSource () {} ImportableSource () {}
virtual ~ImportableSource() {} virtual ~ImportableSource() {}
virtual nframes_t read (Sample* buffer, nframes_t nframes) = 0; virtual framecnt_t read (Sample* buffer, framecnt_t nframes) = 0;
virtual float ratio() const { return 1.0f; } virtual float ratio() const { return 1.0f; }
virtual uint32_t channels() const = 0; virtual uint32_t channels() const = 0;
virtual framecnt_t length() const = 0; virtual framecnt_t length() const = 0;
virtual nframes_t samplerate() const = 0; virtual framecnt_t samplerate() const = 0;
virtual void seek (nframes_t pos) = 0; virtual void seek (framecnt_t pos) = 0;
virtual framepos_t natural_position() const = 0; virtual framepos_t natural_position() const = 0;
virtual bool clamped_at_unity () const = 0; virtual bool clamped_at_unity () const = 0;

View file

@ -36,21 +36,21 @@ XMLNode& state(bool full);
XMLNode& get_state(void); XMLNode& get_state(void);
int set_state(const XMLNode&, int version); int set_state(const XMLNode&, int version);
void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, nframes_t nframes, bool); void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool);
bool configure_io (ChanCount in, ChanCount out); bool configure_io (ChanCount in, ChanCount out);
bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const; bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
int set_block_size (nframes_t); int set_block_size (pframes_t);
BufferSet* get_buffers(); BufferSet* get_buffers();
void release_buffers(); void release_buffers();
static PBD::Signal1<void,nframes_t> CycleStart; static PBD::Signal1<void, pframes_t> CycleStart;
private: private:
BufferSet buffers; BufferSet buffers;
gint user_count; /* atomic */ gint user_count; /* atomic */
void allocate_buffers (nframes_t); void allocate_buffers (pframes_t);
void cycle_start (nframes_t); void cycle_start (pframes_t);
}; };
} // namespace ARDOUR } // namespace ARDOUR

View file

@ -39,11 +39,11 @@ class InternalSend : public Send
XMLNode& get_state(void); XMLNode& get_state(void);
int set_state(const XMLNode& node, int version); int set_state(const XMLNode& node, int version);
void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, nframes_t nframes, bool); void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool);
bool feeds (boost::shared_ptr<Route> other) const; bool feeds (boost::shared_ptr<Route> other) const;
bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const; bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
bool configure_io (ChanCount in, ChanCount out); bool configure_io (ChanCount in, ChanCount out);
int set_block_size (nframes_t); int set_block_size (pframes_t);
boost::shared_ptr<Route> target_route() const { return _send_to; } boost::shared_ptr<Route> target_route() const { return _send_to; }
const PBD::ID& target_id() const { return _send_to_id; } const PBD::ID& target_id() const { return _send_to_id; }

View file

@ -39,13 +39,13 @@ class Interpolation {
}; };
class LinearInterpolation : public Interpolation { class LinearInterpolation : public Interpolation {
public: public:
nframes_t interpolate (int channel, nframes_t nframes, Sample* input, Sample* output); framecnt_t interpolate (int channel, framecnt_t nframes, Sample* input, Sample* output);
}; };
class CubicInterpolation : public Interpolation { class CubicInterpolation : public Interpolation {
public: public:
nframes_t interpolate (int channel, nframes_t nframes, Sample* input, Sample* output); framecnt_t interpolate (int channel, framecnt_t nframes, Sample* input, Sample* output);
}; };
} // namespace ARDOUR } // namespace ARDOUR

View file

@ -89,7 +89,7 @@ class IO : public SessionObject, public Latent
bool set_name (const std::string& str); bool set_name (const std::string& str);
virtual void silence (nframes_t); virtual void silence (framecnt_t);
int ensure_io (ChanCount cnt, bool clear, void *src); int ensure_io (ChanCount cnt, bool clear, void *src);
@ -109,9 +109,9 @@ class IO : public SessionObject, public Latent
bool connected () const; bool connected () const;
bool physically_connected () const; bool physically_connected () const;
nframes_t signal_latency() const { return _own_latency; } framecnt_t signal_latency () const { return _own_latency; }
nframes_t latency() const; framecnt_t latency () const;
void set_port_latency (nframes_t); void set_port_latency (framecnt_t);
void update_port_total_latencies (); void update_port_total_latencies ();
@ -188,9 +188,9 @@ class IO : public SessionObject, public Latent
/* three utility functions - this just seems to be simplest place to put them */ /* three utility functions - this just seems to be simplest place to put them */
void collect_input (BufferSet& bufs, nframes_t nframes, ChanCount offset); void collect_input (BufferSet& bufs, pframes_t nframes, ChanCount offset);
void process_input (boost::shared_ptr<Processor>, framepos_t start_frame, framepos_t end_frame, nframes_t nframes); void process_input (boost::shared_ptr<Processor>, framepos_t start_frame, framepos_t end_frame, pframes_t nframes);
void copy_to_outputs (BufferSet& bufs, DataType type, nframes_t nframes, nframes_t offset); void copy_to_outputs (BufferSet& bufs, DataType type, pframes_t nframes, framecnt_t offset);
/* AudioTrack::deprecated_use_diskstream_connections() needs these */ /* AudioTrack::deprecated_use_diskstream_connections() needs these */

View file

@ -62,7 +62,7 @@ class IOProcessor : public Processor
void set_input (boost::shared_ptr<IO>); void set_input (boost::shared_ptr<IO>);
void set_output (boost::shared_ptr<IO>); void set_output (boost::shared_ptr<IO>);
void silence (nframes_t nframes); void silence (framecnt_t nframes);
void disconnect (); void disconnect ();
virtual bool feeds (boost::shared_ptr<Route> other) const; virtual bool feeds (boost::shared_ptr<Route> other) const;

View file

@ -39,7 +39,7 @@ class Session;
class LadspaPlugin : public ARDOUR::Plugin class LadspaPlugin : public ARDOUR::Plugin
{ {
public: public:
LadspaPlugin (void *module, ARDOUR::AudioEngine&, ARDOUR::Session&, uint32_t index, nframes_t sample_rate); LadspaPlugin (void *module, ARDOUR::AudioEngine&, ARDOUR::Session&, uint32_t index, framecnt_t sample_rate);
LadspaPlugin (const LadspaPlugin &); LadspaPlugin (const LadspaPlugin &);
~LadspaPlugin (); ~LadspaPlugin ();
@ -51,7 +51,7 @@ class LadspaPlugin : public ARDOUR::Plugin
const char* maker() const { return _descriptor->Maker; } const char* maker() const { return _descriptor->Maker; }
uint32_t parameter_count() const { return _descriptor->PortCount; } uint32_t parameter_count() const { return _descriptor->PortCount; }
float default_value (uint32_t port); float default_value (uint32_t port);
nframes_t signal_latency() const; framecnt_t signal_latency() const;
void set_parameter (uint32_t port, float val); void set_parameter (uint32_t port, float val);
float get_parameter (uint32_t port) const; float get_parameter (uint32_t port) const;
int get_parameter_descriptor (uint32_t which, ParameterDescriptor&) const; int get_parameter_descriptor (uint32_t which, ParameterDescriptor&) const;
@ -81,11 +81,11 @@ class LadspaPlugin : public ARDOUR::Plugin
_descriptor->cleanup (_handle); _descriptor->cleanup (_handle);
} }
int set_block_size (nframes_t /*nframes*/) { return 0; } int set_block_size (pframes_t /*nframes*/) { return 0; }
int connect_and_run (BufferSet& bufs, int connect_and_run (BufferSet& bufs,
ChanMapping in, ChanMapping out, ChanMapping in, ChanMapping out,
nframes_t nframes, nframes_t offset); pframes_t nframes, framecnt_t offset);
std::string describe_parameter (Evoral::Parameter); std::string describe_parameter (Evoral::Parameter);
std::string state_node_name() const { return "ladspa"; } std::string state_node_name() const { return "ladspa"; }
@ -122,15 +122,15 @@ class LadspaPlugin : public ARDOUR::Plugin
void* _module; void* _module;
const LADSPA_Descriptor* _descriptor; const LADSPA_Descriptor* _descriptor;
LADSPA_Handle _handle; LADSPA_Handle _handle;
nframes_t _sample_rate; framecnt_t _sample_rate;
LADSPA_Data* _control_data; LADSPA_Data* _control_data;
LADSPA_Data* _shadow_data; LADSPA_Data* _shadow_data;
LADSPA_Data* _latency_control_port; LADSPA_Data* _latency_control_port;
uint32_t _index; uint32_t _index;
bool _was_activated; bool _was_activated;
void init (void *mod, uint32_t index, nframes_t rate); void init (void *mod, uint32_t index, framecnt_t rate);
void run_in_place (nframes_t nsamples); void run_in_place (pframes_t nsamples);
void latency_compute_run (); void latency_compute_run ();
int set_state_2X (const XMLNode&, int version); int set_state_2X (const XMLNode&, int version);
}; };

View file

@ -10,10 +10,10 @@ class Latent {
Latent() : _own_latency (0), _user_latency (0) {} Latent() : _own_latency (0), _user_latency (0) {}
virtual ~Latent() {} virtual ~Latent() {}
virtual nframes_t signal_latency() const = 0; virtual framecnt_t signal_latency() const = 0;
nframes_t user_latency () const { return _user_latency; } framecnt_t user_latency () const { return _user_latency; }
nframes_t effective_latency() const { framecnt_t effective_latency() const {
if (_user_latency) { if (_user_latency) {
return _user_latency; return _user_latency;
} else { } else {
@ -21,12 +21,12 @@ class Latent {
} }
} }
virtual void set_latency_delay (nframes_t val) { _own_latency = val; } virtual void set_latency_delay (framecnt_t val) { _own_latency = val; }
virtual void set_user_latency (nframes_t val) { _user_latency = val; } virtual void set_user_latency (framecnt_t val) { _user_latency = val; }
protected: protected:
nframes_t _own_latency; framecnt_t _own_latency;
nframes_t _user_latency; framecnt_t _user_latency;
}; };
} }

View file

@ -41,7 +41,7 @@ struct LV2World;
class LV2Plugin : public ARDOUR::Plugin class LV2Plugin : public ARDOUR::Plugin
{ {
public: public:
LV2Plugin (ARDOUR::AudioEngine&, ARDOUR::Session&, ARDOUR::LV2World&, SLV2Plugin plugin, nframes_t sample_rate); LV2Plugin (ARDOUR::AudioEngine&, ARDOUR::Session&, ARDOUR::LV2World&, SLV2Plugin plugin, framecnt_t sample_rate);
LV2Plugin (const LV2Plugin &); LV2Plugin (const LV2Plugin &);
~LV2Plugin (); ~LV2Plugin ();
@ -53,7 +53,7 @@ class LV2Plugin : public ARDOUR::Plugin
const char* maker() const { return _author ? slv2_value_as_string(_author) : "Unknown"; } const char* maker() const { return _author ? slv2_value_as_string(_author) : "Unknown"; }
uint32_t parameter_count() const { return slv2_plugin_get_num_ports(_plugin); } uint32_t parameter_count() const { return slv2_plugin_get_num_ports(_plugin); }
float default_value (uint32_t port); float default_value (uint32_t port);
nframes_t signal_latency() const; framecnt_t signal_latency () const;
void set_parameter (uint32_t port, float val); void set_parameter (uint32_t port, float val);
float get_parameter (uint32_t port) const; float get_parameter (uint32_t port) const;
int get_parameter_descriptor (uint32_t which, ParameterDescriptor&) const; int get_parameter_descriptor (uint32_t which, ParameterDescriptor&) const;
@ -93,11 +93,11 @@ class LV2Plugin : public ARDOUR::Plugin
_instance = NULL; _instance = NULL;
} }
int set_block_size (nframes_t /*nframes*/) { return 0; } int set_block_size (pframes_t /*nframes*/) { return 0; }
int connect_and_run (BufferSet& bufs, int connect_and_run (BufferSet& bufs,
ChanMapping in, ChanMapping out, ChanMapping in, ChanMapping out,
nframes_t nframes, nframes_t offset); pframes_t nframes, framecnt_t offset);
std::string describe_parameter (Evoral::Parameter); std::string describe_parameter (Evoral::Parameter);
std::string state_node_name() const { return "lv2"; } std::string state_node_name() const { return "lv2"; }
@ -129,7 +129,7 @@ class LV2Plugin : public ARDOUR::Plugin
SLV2Value _name; SLV2Value _name;
SLV2Value _author; SLV2Value _author;
SLV2Instance _instance; SLV2Instance _instance;
nframes_t _sample_rate; framecnt_t _sample_rate;
float* _control_data; float* _control_data;
float* _shadow_data; float* _shadow_data;
float* _defaults; float* _defaults;
@ -149,8 +149,8 @@ class LV2Plugin : public ARDOUR::Plugin
static URIMap _uri_map; static URIMap _uri_map;
static uint32_t _midi_event_type; static uint32_t _midi_event_type;
void init (LV2World& world, SLV2Plugin plugin, nframes_t rate); void init (LV2World& world, SLV2Plugin plugin, framecnt_t rate);
void run (nframes_t nsamples); void run (pframes_t nsamples);
void latency_compute_run (); void latency_compute_run ();
}; };

View file

@ -68,7 +68,7 @@ public:
void reflect_inputs (const ChanCount& in); void reflect_inputs (const ChanCount& in);
/** Compute peaks */ /** Compute peaks */
void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, nframes_t nframes, bool); void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool);
ChanCount input_streams () const { return current_meters; } ChanCount input_streams () const { return current_meters; }
ChanCount output_streams () const { return current_meters; } ChanCount output_streams () const { return current_meters; }

View file

@ -32,14 +32,14 @@ namespace ARDOUR {
class MidiBuffer : public Buffer class MidiBuffer : public Buffer
{ {
public: public:
typedef nframes_t TimeType; typedef framepos_t TimeType;
MidiBuffer(size_t capacity); MidiBuffer(size_t capacity);
~MidiBuffer(); ~MidiBuffer();
void silence (nframes_t nframes, nframes_t offset = 0); void silence (framecnt_t nframes, framecnt_t offset = 0);
void read_from (const Buffer& src, nframes_t nframes, nframes_t dst_offset = 0, nframes_t src_offset = 0); void read_from (const Buffer& src, framecnt_t nframes, framecnt_t dst_offset = 0, framecnt_t src_offset = 0);
void merge_from (const Buffer& src, nframes_t nframes, nframes_t dst_offset = 0, nframes_t src_offset = 0); void merge_from (const Buffer& src, framecnt_t nframes, framecnt_t dst_offset = 0, framecnt_t src_offset = 0);
void copy(const MidiBuffer& copy); void copy(const MidiBuffer& copy);
@ -55,7 +55,7 @@ public:
template<typename BufferType, typename EventType> template<typename BufferType, typename EventType>
struct iterator_base { struct iterator_base {
iterator_base<BufferType, EventType>(BufferType& b, nframes_t o) : buffer(b), offset(o) {} iterator_base<BufferType, EventType>(BufferType& b, framecnt_t o) : buffer(b), offset(o) {}
inline EventType operator*() const { inline EventType operator*() const {
uint8_t* ev_start = buffer._data + offset + sizeof(TimeType); uint8_t* ev_start = buffer._data + offset + sizeof(TimeType);
int event_size = Evoral::midi_event_size(ev_start); int event_size = Evoral::midi_event_size(ev_start);

View file

@ -124,7 +124,7 @@ class MidiDiskstream : public Diskstream
void set_pending_overwrite(bool); void set_pending_overwrite(bool);
int overwrite_existing_buffers (); int overwrite_existing_buffers ();
void set_block_size (nframes_t); void set_block_size (pframes_t);
int internal_playback_seek (framecnt_t distance); int internal_playback_seek (framecnt_t distance);
int can_internal_playback_seek (framecnt_t distance); int can_internal_playback_seek (framecnt_t distance);
int rename_write_sources (); int rename_write_sources ();
@ -133,7 +133,7 @@ class MidiDiskstream : public Diskstream
void non_realtime_input_change (); void non_realtime_input_change ();
void non_realtime_locate (framepos_t location); void non_realtime_locate (framepos_t location);
static void set_readahead_frames(nframes_t frames_ahead) { midi_readahead = frames_ahead; } static void set_readahead_frames (framecnt_t frames_ahead) { midi_readahead = frames_ahead; }
protected: protected:
int seek (framepos_t which_sample, bool complete_refill = false); int seek (framepos_t which_sample, bool complete_refill = false);
@ -141,9 +141,9 @@ class MidiDiskstream : public Diskstream
protected: protected:
friend class MidiTrack; friend class MidiTrack;
int process (framepos_t transport_frame, nframes_t nframes, bool can_record, bool rec_monitors_input, bool& need_butler); int process (framepos_t transport_frame, pframes_t nframes, bool can_record, bool rec_monitors_input, bool& need_butler);
bool commit (nframes_t nframes); bool commit (framecnt_t nframes);
static nframes_t midi_readahead; static framecnt_t midi_readahead;
private: private:
@ -153,7 +153,7 @@ class MidiDiskstream : public Diskstream
int do_refill_with_alloc(); int do_refill_with_alloc();
int read (framepos_t& start, nframes_t cnt, bool reversed); int read (framepos_t& start, framecnt_t cnt, bool reversed);
void finish_capture (bool rec_monitors_input); void finish_capture (bool rec_monitors_input);
void transport_stopped_wallclock (struct tm&, time_t, bool abort); void transport_stopped_wallclock (struct tm&, time_t, bool abort);
@ -181,11 +181,11 @@ class MidiDiskstream : public Diskstream
void engage_record_enable (); void engage_record_enable ();
void disengage_record_enable (); void disengage_record_enable ();
MidiRingBuffer<nframes_t>* _playback_buf; MidiRingBuffer<framepos_t>* _playback_buf;
MidiRingBuffer<nframes_t>* _capture_buf; MidiRingBuffer<framepos_t>* _capture_buf;
MidiPort* _source_port; MidiPort* _source_port;
boost::shared_ptr<SMFSource> _write_source; boost::shared_ptr<SMFSource> _write_source;
nframes_t _last_flush_frame; framepos_t _last_flush_frame;
NoteMode _note_mode; NoteMode _note_mode;
volatile gint _frames_written_to_ringbuffer; volatile gint _frames_written_to_ringbuffer;
volatile gint _frames_read_from_ringbuffer; volatile gint _frames_read_from_ringbuffer;

Some files were not shown because too many files have changed in this diff Show more