Remove all use of nframes_t.
authorCarl Hetherington <carl@carlh.net>
Fri, 3 Dec 2010 22:26:29 +0000 (22:26 +0000)
committerCarl Hetherington <carl@carlh.net>
Fri, 3 Dec 2010 22:26:29 +0000 (22:26 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@8166 d708f5d6-7413-0410-9779-e7cbd77b26cf

280 files changed:
gtk2_ardour/analysis_window.cc
gtk2_ardour/ardour_ui.cc
gtk2_ardour/ardour_ui.h
gtk2_ardour/ardour_ui_ed.cc
gtk2_ardour/audio_clock.cc
gtk2_ardour/audio_clock.h
gtk2_ardour/audio_region_view.cc
gtk2_ardour/audio_region_view.h
gtk2_ardour/audio_streamview.cc
gtk2_ardour/audio_streamview.h
gtk2_ardour/automation_region_view.cc
gtk2_ardour/automation_region_view.h
gtk2_ardour/automation_time_axis.cc
gtk2_ardour/automation_time_axis.h
gtk2_ardour/crossfade_edit.cc
gtk2_ardour/editor.cc
gtk2_ardour/editor.h
gtk2_ardour/editor_ops.cc
gtk2_ardour/editor_regions.cc
gtk2_ardour/editor_rulers.cc
gtk2_ardour/editor_summary.cc
gtk2_ardour/editor_summary.h
gtk2_ardour/editor_tempodisplay.cc
gtk2_ardour/export_format_dialog.cc
gtk2_ardour/export_range_markers_dialog.cc
gtk2_ardour/imageframe_socket_handler.cc
gtk2_ardour/imageframe_time_axis_group.cc
gtk2_ardour/imageframe_time_axis_view.cc
gtk2_ardour/imageframe_view.cc
gtk2_ardour/imageframe_view.h
gtk2_ardour/location_ui.cc
gtk2_ardour/marker.cc
gtk2_ardour/marker.h
gtk2_ardour/marker_time_axis_view.cc
gtk2_ardour/marker_view.cc
gtk2_ardour/midi_streamview.cc
gtk2_ardour/plugin_eq_gui.cc
gtk2_ardour/plugin_eq_gui.h
gtk2_ardour/plugin_ui.cc
gtk2_ardour/port_insert_ui.cc
gtk2_ardour/public_editor.h
gtk2_ardour/region_editor.cc
gtk2_ardour/region_view.cc
gtk2_ardour/route_params_ui.cc
gtk2_ardour/route_time_axis.cc
gtk2_ardour/route_time_axis.h
gtk2_ardour/selection.cc
gtk2_ardour/selection.h
gtk2_ardour/sfdb_ui.cc
gtk2_ardour/step_editor.cc
gtk2_ardour/streamview.h
gtk2_ardour/strip_silence_dialog.cc
gtk2_ardour/strip_silence_dialog.h
gtk2_ardour/tempo_dialog.cc
gtk2_ardour/tempo_dialog.h
gtk2_ardour/time_axis_view.cc
gtk2_ardour/time_axis_view.h
gtk2_ardour/visual_time_axis.cc
libs/ardour/amp.cc
libs/ardour/ardour/amp.h
libs/ardour/ardour/audio_buffer.h
libs/ardour/ardour/audio_diskstream.h
libs/ardour/ardour/audio_port.h
libs/ardour/ardour/audio_track.h
libs/ardour/ardour/audio_unit.h
libs/ardour/ardour/audioanalyser.h
libs/ardour/ardour/audioengine.h
libs/ardour/ardour/audiofilesource.h
libs/ardour/ardour/audioplaylist.h
libs/ardour/ardour/audioregion.h
libs/ardour/ardour/audiosource.h
libs/ardour/ardour/auditioner.h
libs/ardour/ardour/automatable.h
libs/ardour/ardour/buffer.h
libs/ardour/ardour/buffer_set.h
libs/ardour/ardour/butler.h
libs/ardour/ardour/click.h
libs/ardour/ardour/delivery.h
libs/ardour/ardour/diskstream.h
libs/ardour/ardour/element_importer.h
libs/ardour/ardour/export_channel.h
libs/ardour/ardour/export_format_specification.h
libs/ardour/ardour/export_graph_builder.h
libs/ardour/ardour/export_handler.h
libs/ardour/ardour/export_profile_manager.h
libs/ardour/ardour/export_timespan.h
libs/ardour/ardour/gain.h
libs/ardour/ardour/graph.h
libs/ardour/ardour/importable_source.h
libs/ardour/ardour/internal_return.h
libs/ardour/ardour/internal_send.h
libs/ardour/ardour/interpolation.h
libs/ardour/ardour/io.h
libs/ardour/ardour/io_processor.h
libs/ardour/ardour/ladspa_plugin.h
libs/ardour/ardour/latent.h
libs/ardour/ardour/lv2_plugin.h
libs/ardour/ardour/meter.h
libs/ardour/ardour/midi_buffer.h
libs/ardour/ardour/midi_diskstream.h
libs/ardour/ardour/midi_playlist.h
libs/ardour/ardour/midi_port.h
libs/ardour/ardour/midi_region.h
libs/ardour/ardour/midi_ring_buffer.h
libs/ardour/ardour/midi_source.h
libs/ardour/ardour/midi_state_tracker.h
libs/ardour/ardour/midi_track.h
libs/ardour/ardour/mix.h
libs/ardour/ardour/monitor_processor.h
libs/ardour/ardour/panner.h
libs/ardour/ardour/peak.h
libs/ardour/ardour/playlist_factory.h
libs/ardour/ardour/plugin.h
libs/ardour/ardour/plugin_insert.h
libs/ardour/ardour/port.h
libs/ardour/ardour/port_insert.h
libs/ardour/ardour/processor.h
libs/ardour/ardour/rc_configuration_vars.h
libs/ardour/ardour/region.h
libs/ardour/ardour/resampled_source.h
libs/ardour/ardour/return.h
libs/ardour/ardour/route.h
libs/ardour/ardour/runtime_functions.h
libs/ardour/ardour/send.h
libs/ardour/ardour/session.h
libs/ardour/ardour/session_event.h
libs/ardour/ardour/silentfilesource.h
libs/ardour/ardour/slave.h
libs/ardour/ardour/smf_source.h
libs/ardour/ardour/sndfileimportable.h
libs/ardour/ardour/sndfilesource.h
libs/ardour/ardour/source_factory.h
libs/ardour/ardour/strip_silence.h
libs/ardour/ardour/tempo.h
libs/ardour/ardour/thread_buffers.h
libs/ardour/ardour/ticker.h
libs/ardour/ardour/track.h
libs/ardour/ardour/types.h
libs/ardour/ardour/utils.h
libs/ardour/ardour/vbap.h
libs/ardour/audio_diskstream.cc
libs/ardour/audio_playlist.cc
libs/ardour/audio_port.cc
libs/ardour/audio_region_importer.cc
libs/ardour/audio_track.cc
libs/ardour/audio_track_importer.cc
libs/ardour/audio_unit.cc
libs/ardour/audioanalyser.cc
libs/ardour/audioengine.cc
libs/ardour/audiofilesource.cc
libs/ardour/audioregion.cc
libs/ardour/audiosource.cc
libs/ardour/auditioner.cc
libs/ardour/automatable.cc
libs/ardour/automation_list.cc
libs/ardour/buffer_set.cc
libs/ardour/butler.cc
libs/ardour/caimportable.cc
libs/ardour/coreaudiosource.cc
libs/ardour/default_click.cc
libs/ardour/delivery.cc
libs/ardour/diskstream.cc
libs/ardour/element_importer.cc
libs/ardour/export_channel.cc
libs/ardour/export_format_specification.cc
libs/ardour/export_graph_builder.cc
libs/ardour/export_handler.cc
libs/ardour/export_profile_manager.cc
libs/ardour/export_timespan.cc
libs/ardour/gain.cc
libs/ardour/graph.cc
libs/ardour/import.cc
libs/ardour/internal_return.cc
libs/ardour/internal_send.cc
libs/ardour/interpolation.cc
libs/ardour/io.cc
libs/ardour/io_processor.cc
libs/ardour/ladspa_plugin.cc
libs/ardour/location_importer.cc
libs/ardour/lv2_plugin.cc
libs/ardour/meter.cc
libs/ardour/midi_buffer.cc
libs/ardour/midi_clock_slave.cc
libs/ardour/midi_diskstream.cc
libs/ardour/midi_playlist.cc
libs/ardour/midi_port.cc
libs/ardour/midi_region.cc
libs/ardour/midi_ring_buffer.cc
libs/ardour/midi_source.cc
libs/ardour/midi_state_tracker.cc
libs/ardour/midi_stretch.cc
libs/ardour/midi_track.cc
libs/ardour/mix.cc
libs/ardour/monitor_processor.cc
libs/ardour/mtc_slave.cc
libs/ardour/onset_detector.cc
libs/ardour/panner.cc
libs/ardour/playlist_factory.cc
libs/ardour/plugin_insert.cc
libs/ardour/port.cc
libs/ardour/port_insert.cc
libs/ardour/rb_effect.cc
libs/ardour/region.cc
libs/ardour/resampled_source.cc
libs/ardour/return.cc
libs/ardour/reverse.cc
libs/ardour/route.cc
libs/ardour/send.cc
libs/ardour/session.cc
libs/ardour/session_click.cc
libs/ardour/session_export.cc
libs/ardour/session_midi.cc
libs/ardour/session_process.cc
libs/ardour/session_state.cc
libs/ardour/session_time.cc
libs/ardour/session_transport.cc
libs/ardour/slave.cc
libs/ardour/smf_source.cc
libs/ardour/sndfileimportable.cc
libs/ardour/sndfilesource.cc
libs/ardour/source_factory.cc
libs/ardour/sse_functions_xmm.cc
libs/ardour/st_stretch.cc
libs/ardour/strip_silence.cc
libs/ardour/tempo.cc
libs/ardour/test/interpolation_test.cpp
libs/ardour/test/midi_clock_slave_test.h
libs/ardour/thread_buffers.cc
libs/ardour/ticker.cc
libs/ardour/track.cc
libs/ardour/transient_detector.cc
libs/ardour/utils.cc
libs/ardour/vbap.cc
libs/ardour/vst_plugin.cc
libs/audiographer/audiographer/general/chunker.h
libs/audiographer/audiographer/general/deinterleaver.h
libs/audiographer/audiographer/general/interleaver.h
libs/audiographer/audiographer/general/normalizer.h
libs/audiographer/audiographer/general/sample_format_converter.h
libs/audiographer/audiographer/general/silence_trimmer.h
libs/audiographer/audiographer/general/sr_converter.h
libs/audiographer/audiographer/process_context.h
libs/audiographer/audiographer/sndfile/sndfile.h
libs/audiographer/audiographer/sndfile/sndfile_reader.h
libs/audiographer/audiographer/sndfile/sndfile_writer.h
libs/audiographer/audiographer/sndfile/tmp_file.h
libs/audiographer/audiographer/type_utils.h
libs/audiographer/audiographer/types.h
libs/audiographer/src/general/sample_format_converter.cc
libs/audiographer/src/general/sr_converter.cc
libs/audiographer/tests/general/chunker_test.cc
libs/audiographer/tests/general/deinterleaver_test.cc
libs/audiographer/tests/general/interleaver_deinterleaver_test.cc
libs/audiographer/tests/general/interleaver_test.cc
libs/audiographer/tests/general/normalizer_test.cc
libs/audiographer/tests/general/peak_reader_test.cc
libs/audiographer/tests/general/sample_format_converter_test.cc
libs/audiographer/tests/general/silence_trimmer_test.cc
libs/audiographer/tests/general/sr_converter_test.cc
libs/audiographer/tests/general/threader_test.cc
libs/audiographer/tests/sndfile/tmp_file_test.cc
libs/audiographer/tests/utils.h
libs/audiographer/tests/utils/identity_vertex_test.cc
libs/evoral/src/Event.cpp
libs/midi++2/channel.cc
libs/midi++2/manager.cc
libs/midi++2/midi++/channel.h
libs/midi++2/midi++/manager.h
libs/midi++2/midi++/mmc.h
libs/midi++2/midi++/parser.h
libs/midi++2/midi++/port.h
libs/midi++2/midi++/types.h
libs/midi++2/mmc.cc
libs/midi++2/port.cc
libs/surfaces/frontier/tranzport/tranzport_control_protocol.cc
libs/surfaces/frontier/tranzport/tranzport_control_protocol.h
libs/surfaces/mackie/mackie_control_protocol.cc
libs/surfaces/mackie/mackie_control_protocol.h
libs/surfaces/tranzport/show.cc
libs/surfaces/tranzport/tranzport_control_protocol.h

index 6d858732ff91e4574d0bac284a5ee7683f466dbc..afa277e8e44919e8bf96b5686f5af5dcba3aa7b6 100644 (file)
@@ -278,9 +278,9 @@ AnalysisWindow::analyze_data (Gtk::Button */*button*/)
 
                                        int n;
                                        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
 
                                                        n = fft_graph.windowSize();
@@ -322,11 +322,11 @@ AnalysisWindow::analyze_data (Gtk::Button */*button*/)
                                        int n;
                                        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
 
                                                        n = fft_graph.windowSize();
index e969f31cf13a266c14d18221ff2d8721be5c507a..391db4497601157b3ff26ff84059891206b70193 100644 (file)
@@ -121,7 +121,7 @@ UIConfiguration *ARDOUR_UI::ui_config = 0;
 sigc::signal<void,bool> ARDOUR_UI::Blink;
 sigc::signal<void>      ARDOUR_UI::RapidScreenUpdate;
 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);
 
@@ -952,7 +952,7 @@ ARDOUR_UI::every_point_zero_one_seconds ()
 }
 
 void
-ARDOUR_UI::update_sample_rate (nframes_t)
+ARDOUR_UI::update_sample_rate (framecnt_t)
 {
        char buf[32];
 
@@ -964,7 +964,7 @@ ARDOUR_UI::update_sample_rate (nframes_t)
 
        } else {
 
-               nframes_t rate = engine->frame_rate();
+               framecnt_t rate = engine->frame_rate();
 
                if (fmod (rate, 1000.0) != 0.0) {
                        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();
        char buf[64];
-       nframes_t fr = _session->frame_rate();
+       framecnt_t fr = _session->frame_rate();
 
        if (frames == max_framecnt) {
                strcpy (buf, _("Disk: 24hrs+"));
@@ -1415,9 +1415,9 @@ restart JACK with more ports."), PROGRAM_NAME));
 }
 
 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) {
                // XXX CONFIG_CHANGE FIX - requires AnyTime handling
@@ -1497,7 +1497,7 @@ void
 ARDOUR_UI::transport_goto_end ()
 {
        if (_session) {
-               nframes_t const frame = _session->current_end_frame();
+               framepos_t const frame = _session->current_end_frame();
                _session->request_locate (frame);
 
                /* force displayed area in editor to start no matter
@@ -3257,7 +3257,7 @@ ARDOUR_UI::keyboard_settings () const
 }
 
 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);
 }
@@ -3271,7 +3271,7 @@ ARDOUR_UI::halt_on_xrun_message ()
 }
 
 void
-ARDOUR_UI::xrun_handler(nframes_t where)
+ARDOUR_UI::xrun_handler (framepos_t where)
 {
        if (!_session) {
                return;
@@ -3384,7 +3384,7 @@ what you would like to do.\n"));
 }
 
 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();
        Image* image = new Image (Stock::DIALOG_QUESTION, ICON_SIZE_DIALOG);
@@ -3451,7 +3451,7 @@ ARDOUR_UI::use_config ()
 }
 
 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()) {
                primary_clock.set (pos, false, editor->get_preferred_edit_position(), 1);
index c7c38f8d5ad5eb341aeda1e5f7e91ac6844644a9..e2304b85cce2e671fe7edb99f436d3ed6fb6fcbb 100644 (file)
@@ -174,7 +174,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
        static sigc::signal<void,bool> Blink;
        static sigc::signal<void>      RapidScreenUpdate;
        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* mixer_settings () const;
@@ -184,10 +184,10 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
        void save_ardour_state ();
        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 xrun_handler (nframes_t);
-       void create_xrun_marker (nframes_t);
+       void xrun_handler (framepos_t);
+       void create_xrun_marker (framepos_t);
 
        AudioClock primary_clock;
        AudioClock secondary_clock;
@@ -328,7 +328,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
        void float_big_clock (Gtk::Window* parent);
        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 ();
 
        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::EventBox sample_rate_box;
-       void update_sample_rate (nframes_t);
+       void update_sample_rate (ARDOUR::framecnt_t);
 
        gint every_second ();
        gint every_point_one_seconds ();
@@ -659,11 +659,11 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
 
        void session_dialog (std::string);
        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 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_reconnect_item;
index 6eb88ae9401d9dc35cfeef650969d6aa74069028..e3698289f7bb92f6f2d80d95923ca339ec59c0ad 100644 (file)
@@ -187,23 +187,23 @@ ARDOUR_UI::install_actions ()
 
        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);
-       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);
-       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);
-       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);
-       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);
-       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);
-       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);
-       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);
-       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);
 
        /* these actions are intended to be shared across all windows */
@@ -441,7 +441,7 @@ ARDOUR_UI::install_actions ()
 }
 
 void
-ARDOUR_UI::set_jack_buffer_size (nframes_t nframes)
+ARDOUR_UI::set_jack_buffer_size (pframes_t nframes)
 {
        Glib::RefPtr<Action> action;
        const char* action_name = 0;
index 1c36391bb69b369c9066c9766b7810f9b306433c..797d8551e16fd971c535f5223792f3e50e6dd6ff 100644 (file)
@@ -414,7 +414,7 @@ AudioClock::on_realize ()
 }
 
 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) {
@@ -479,12 +479,12 @@ AudioClock::session_configuration_changed (std::string p)
                return;
        }
        
-       nframes_t current;
+       framecnt_t current;
 
        switch (_mode) {
        case Timecode:
                if (is_duration) {
-                       current = current_duration();
+                       current = current_duration ();
                } else {
                        current = current_time ();
                }
@@ -496,17 +496,17 @@ AudioClock::session_configuration_changed (std::string p)
 }
 
 void
-AudioClock::set_frames (nframes_t when, bool /*force*/)
+AudioClock::set_frames (framepos_t when, bool /*force*/)
 {
        char buf[32];
-       snprintf (buf, sizeof (buf), "%u", when);
+       snprintf (buf, sizeof (buf), "%" PRId64, when);
        audio_frames_label.set_text (buf);
 
        if (frames_upper_info_label) {
-               nframes_t rate = _session->frame_rate();
+               framecnt_t rate = _session->frame_rate();
 
                if (fmod (rate, 1000.0) == 0.000) {
-                       sprintf (buf, "%uK", rate/1000);
+                       sprintf (buf, "%" PRId64 "K", rate/1000);
                } else {
                        sprintf (buf, "%.3fK", rate/1000.0f);
                }
@@ -531,19 +531,19 @@ AudioClock::set_frames (nframes_t when, bool /*force*/)
 }
 
 void
-AudioClock::set_minsec (nframes_t when, bool force)
+AudioClock::set_minsec (framepos_t when, bool force)
 {
        char buf[32];
-       nframes_t left;
+       framecnt_t left;
        int hrs;
        int mins;
        float secs;
 
        left = when;
        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));
-       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();
 
        if (force || hrs != ms_last_hrs) {
@@ -566,7 +566,7 @@ AudioClock::set_minsec (nframes_t when, bool force)
 }
 
 void
-AudioClock::set_timecode (nframes_t when, bool force)
+AudioClock::set_timecode (framepos_t when, bool force)
 {
        char buf[32];
        Timecode::Time timecode;
@@ -637,7 +637,7 @@ AudioClock::set_timecode (nframes_t when, bool force)
 }
 
 void
-AudioClock::set_bbt (nframes_t when, bool force)
+AudioClock::set_bbt (framepos_t when, bool force)
 {
        char buf[16];
        BBT_Time bbt;
@@ -1198,7 +1198,7 @@ AudioClock::field_button_press_event (GdkEventButton *ev, Field /*field*/)
                return false;
        }
 
-       nframes_t frames = 0;
+       framepos_t frames = 0;
 
        switch (ev->button) {
        case 1:
@@ -1244,7 +1244,7 @@ AudioClock::field_button_scroll_event (GdkEventScroll *ev, Field field)
                return false;
        }
 
-       nframes_t frames = 0;
+       framepos_t frames = 0;
 
        switch (ev->direction) {
 
@@ -1313,8 +1313,8 @@ AudioClock::field_motion_notify_event (GdkEventMotion *ev, Field field)
 
        if (trunc(drag_accum) != 0) {
 
-               nframes_t frames;
-               nframes_t pos ;
+               framepos_t frames;
+               framepos_t pos;
                int dir;
                dir = (drag_accum < 0 ? 1:-1);
                pos = current_time();
@@ -1322,7 +1322,7 @@ AudioClock::field_motion_notify_event (GdkEventMotion *ev, Field field)
 
                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 {
                        set (0 , false);
@@ -1338,24 +1338,23 @@ AudioClock::field_motion_notify_event (GdkEventMotion *ev, Field field)
        return true;
 }
 
-nframes_t
-AudioClock::get_frames (Field field,nframes_t pos,int dir)
+framepos_t
+AudioClock::get_frames (Field field, framepos_t pos, int dir)
 {
-
-       nframes_t frames = 0;
+       framecnt_t frames = 0;
        BBT_Time bbt;
        switch (field) {
        case Timecode_Hours:
-               frames = (nframes_t) floor (3600.0 * _session->frame_rate());
+               frames = (framecnt_t) floor (3600.0 * _session->frame_rate());
                break;
        case Timecode_Minutes:
-               frames = (nframes_t) floor (60.0 * _session->frame_rate());
+               frames = (framecnt_t) floor (60.0 * _session->frame_rate());
                break;
        case Timecode_Seconds:
                frames = _session->frame_rate();
                break;
        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;
 
        case AudioFrames:
@@ -1363,10 +1362,10 @@ AudioClock::get_frames (Field field,nframes_t pos,int dir)
                break;
 
        case MS_Hours:
-               frames = (nframes_t) floor (3600.0 * _session->frame_rate());
+               frames = (framecnt_t) floor (3600.0 * _session->frame_rate());
                break;
        case MS_Minutes:
-               frames = (nframes_t) floor (60.0 * _session->frame_rate());
+               frames = (framecnt_t) floor (60.0 * _session->frame_rate());
                break;
        case MS_Seconds:
                frames = _session->frame_rate();
@@ -1395,10 +1394,10 @@ AudioClock::get_frames (Field field,nframes_t pos,int dir)
        return frames;
 }
 
-nframes_t
-AudioClock::current_time (nframes_t pos) const
+framepos_t
+AudioClock::current_time (framepos_t pos) const
 {
-       nframes_t ret = 0;
+       framepos_t ret = 0;
 
        switch (_mode) {
        case Timecode:
@@ -1423,10 +1422,10 @@ AudioClock::current_time (nframes_t pos) const
        return ret;
 }
 
-nframes_t
-AudioClock::current_duration (nframes_t pos) const
+framepos_t
+AudioClock::current_duration (framepos_t pos) const
 {
-       nframes_t ret = 0;
+       framepos_t ret = 0;
 
        switch (_mode) {
        case Timecode:
@@ -1490,7 +1489,7 @@ AudioClock::timecode_sanitize_display()
        }
 }
 
-nframes_t
+framepos_t
 AudioClock::timecode_frame_from_display () const
 {
        if (_session == 0) {
@@ -1883,7 +1882,7 @@ AudioClock::timecode_frame_from_display () const
        return sample;
 }
 
-nframes_t
+framepos_t
 AudioClock::minsec_frame_from_display () const
 {
        if (_session == 0) {
@@ -1894,13 +1893,13 @@ AudioClock::minsec_frame_from_display () const
        int mins = atoi (ms_minutes_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
-AudioClock::bbt_frame_from_display (nframes_t pos) const
+framepos_t
+AudioClock::bbt_frame_from_display (framepos_t pos) const
 {
        if (_session == 0) {
                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++;
        }
 
-       nframes_t ret = _session->convert_to_frames_at (pos, any);
-
-       return ret;
+       return _session->convert_to_frames_at (pos, any);
 }
 
 
-nframes_t
-AudioClock::bbt_frame_duration_from_display (nframes_t pos) const
+framepos_t
+AudioClock::bbt_frame_duration_from_display (framepos_t pos) const
 {
        if (_session == 0) {
                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);
 }
 
-nframes_t
+framepos_t
 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
index faab980bcc7854215249a244366dc798e04b271e..f07b12d4c5fe7a4cb0a44b8fd5d2d6d40e6c9f61 100644 (file)
@@ -50,7 +50,7 @@ class AudioClock : public Gtk::HBox, public ARDOUR::SessionHandlePtr
 
        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 locate ();
        void set_mode (Mode);
@@ -61,8 +61,8 @@ class AudioClock : public Gtk::HBox, public ARDOUR::SessionHandlePtr
 
        std::string name() const { return _name; }
 
-       nframes_t current_time (nframes_t position = 0) const;
-       nframes_t current_duration (nframes_t position = 0) const;
+       framepos_t current_time (framepos_t position = 0) const;
+       framepos_t current_duration (framepos_t position = 0) const;
        void set_session (ARDOUR::Session *s);
 
        sigc::signal<void> ValueChanged;
@@ -164,7 +164,7 @@ class AudioClock : public Gtk::HBox, public ARDOUR::SessionHandlePtr
        Gtk::Frame     clock_frame;
 
        framepos_t bbt_reference_time;
-       nframes_t last_when;
+       framepos_t last_when;
        bool last_pdelta;
        bool last_sdelta;
 
@@ -195,19 +195,19 @@ class AudioClock : public Gtk::HBox, public ARDOUR::SessionHandlePtr
        bool field_focus_out_event (GdkEventFocus *, Field);
        bool drop_focus_handler (GdkEventFocus*);
 
-       void set_timecode (nframes_t, bool);
-       void set_bbt (nframes_t, bool);
-       void set_minsec (nframes_t, bool);
-       void set_frames (nframes_t, bool);
+       void set_timecode (framepos_t, bool);
+       void set_bbt (framepos_t, bool);
+       void set_minsec (framepos_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();
-       nframes_t timecode_frame_from_display () const;
-       nframes_t bbt_frame_from_display (nframes_t) const;
-       nframes_t bbt_frame_duration_from_display (nframes_t) const;
-       nframes_t minsec_frame_from_display () const;
-       nframes_t audio_frame_from_display () const;
+       framepos_t timecode_frame_from_display () const;
+       framepos_t bbt_frame_from_display (framepos_t) const;
+       framepos_t bbt_frame_duration_from_display (framepos_t) const;
+       framepos_t minsec_frame_from_display () const;
+       framepos_t audio_frame_from_display () const;
 
        void build_ops_menu ();
        void setup_events ();
index 908027683154ca548235ce715120eef078df1259..3b98e55151b7d6aa408827a351bdf698853ba5a4 100644 (file)
@@ -573,11 +573,11 @@ AudioRegionView::reset_fade_shapes ()
 void
 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
-AudioRegionView::reset_fade_in_shape_width (nframes_t width)
+AudioRegionView::reset_fade_in_shape_width (framecnt_t width)
 {
        if (fade_in_handle == 0) {
                return;
@@ -585,7 +585,7 @@ AudioRegionView::reset_fade_in_shape_width (nframes_t width)
 
        /* smallest size for a fade is 64 frames */
 
-       width = std::max ((nframes_t) 64, width);
+       width = std::max ((framecnt_t) 64, width);
 
        Points* points;
        
@@ -665,11 +665,11 @@ AudioRegionView::reset_fade_in_shape_width (nframes_t width)
 void
 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
-AudioRegionView::reset_fade_out_shape_width (nframes_t width)
+AudioRegionView::reset_fade_out_shape_width (framecnt_t width)
 {
        if (fade_out_handle == 0) {
                return;
@@ -677,7 +677,7 @@ AudioRegionView::reset_fade_out_shape_width (nframes_t width)
 
        /* smallest size for a fade is 64 frames */
 
-       width = std::max ((nframes_t) 64, width);
+       width = std::max ((framecnt_t) 64, width);
 
        Points* points;
        double pwidth = width / samples_per_unit;
@@ -1043,7 +1043,7 @@ AudioRegionView::add_gain_point_event (ArdourCanvas::Item *item, GdkEvent *ev)
 
        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()) {
                return;
index d2593feaabd087c87e946cd8525edf6f02a5f28a..f7b8404d7b7c9bb768ac75a1a7ad7d7493a97cbe 100644 (file)
@@ -100,8 +100,8 @@ class AudioRegionView : public RegionView
 
        GhostRegion* add_ghost (TimeAxisView&);
 
-       void reset_fade_in_shape_width (nframes_t);
-       void reset_fade_out_shape_width (nframes_t);
+       void reset_fade_in_shape_width (framecnt_t);
+       void reset_fade_out_shape_width (framecnt_t);
        
        void show_fade_line(framepos_t pos);
        void hide_fade_line();
index 1f1ee9d82c08ac11e547858c660b357f664104f5..abfa767c9c473dfeec247de7b435e51840d52806 100644 (file)
@@ -471,7 +471,7 @@ AudioStreamView::setup_rec_box ()
 
                                // handle multi
 
-                               nframes_t start = 0;
+                               framepos_t start = 0;
                                if (rec_regions.size() > 0) {
                                        start = rec_regions.back().first->start()
                                                        + _trackview.track()->get_captured_frames(rec_regions.size()-1);
@@ -600,7 +600,7 @@ AudioStreamView::foreach_crossfadeview (void (CrossfadeView::*pmf)(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)
 
@@ -653,13 +653,13 @@ AudioStreamView::update_rec_regions (framepos_t start, framecnt_t cnt)
                        continue;
                }
                
-               nframes_t origlen = region->length();
+               framecnt_t origlen = region->length();
 
                if (region == rec_regions.back().first && rec_active) {
                        
                        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()) {
 
@@ -684,7 +684,7 @@ AudioStreamView::update_rec_regions (framepos_t start, framecnt_t cnt)
 
                        } else {
                                
-                               nframes_t nlen = _trackview.track()->get_captured_frames(n);
+                               framecnt_t nlen = _trackview.track()->get_captured_frames(n);
                                
                                if (nlen != region->length()) {
                                        
index f7b11dcf9720e21a136642e712fa6b2fe863b22f..0c50986f9383fe832a3467255246eb395ce15f59 100644 (file)
@@ -78,7 +78,7 @@ class AudioStreamView : public StreamView
 
   private:
        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);
 
        RegionView* add_region_view_internal (boost::shared_ptr<ARDOUR::Region>, bool wait_for_waves, bool recording = false);
index 1cda2051ddef9c1e47fd7d79cc93ae889871afb6..c556d0184808e672a1bd7fe7d40f4f6b52f068ff 100644 (file)
@@ -126,7 +126,7 @@ AutomationRegionView::canvas_event(GdkEvent* ev)
  *  @param y y position, relative to our TimeAxisView.
  */
 void
-AutomationRegionView::add_automation_event (GdkEvent *, nframes_t when, double y)
+AutomationRegionView::add_automation_event (GdkEvent *, framepos_t when, double y)
 {
        if (!_line) {
                boost::shared_ptr<Evoral::Control> c = _region->control(_parameter, true);
index 04dd308defb3d9809554afe5aec4699e8344e3d8..570b4edbfeeff640f2228aee60fbda0f55f4885d 100644 (file)
@@ -67,7 +67,7 @@ protected:
        bool set_position(framepos_t pos, void* src, double* ignored);
        void region_resized (const PBD::PropertyChange&);
        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 exited();
 
index abfd83184c3dfae83716a080d68561b1a9867415..e0a2cd0970e1f0063ac17f5d11635ebadfc6a71b 100644 (file)
@@ -587,7 +587,7 @@ AutomationTimeAxisView::build_display_menu ()
 }
 
 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)
                return;
index 798a144cabcce87f308d49046390408e24311f1f..76e687da0de7f1a20aaf2f2a108713d8ef1a4eb1 100644 (file)
@@ -72,7 +72,7 @@ class AutomationTimeAxisView : public TimeAxisView {
        bool set_visibility (bool yn);
        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 ();
 
@@ -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_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 () {}
 
        /* editing operations */
index 987a3f2827b54e138a4a03b8666a9f09f7b81403..0c8daafb045995826673acdb50616d103a4c61db 100644 (file)
@@ -656,7 +656,7 @@ CrossfadeEditor::redraw ()
                return;
        }
 
-       nframes_t len = xfade->length ();
+       framecnt_t len = xfade->length ();
 
        fade[current].normative_curve.clear ();
        fade[current].gain_curve.clear ();
@@ -1215,11 +1215,11 @@ void
 CrossfadeEditor::audition (Audition which)
 {
        AudioPlaylist& pl (_session->the_auditioner()->prepare_playlist());
-       nframes_t preroll;
-       nframes_t postroll;
-       nframes_t left_start_offset;
-       nframes_t right_length;
-       nframes_t left_length;
+       framecnt_t preroll;
+       framecnt_t postroll;
+       framecnt_t left_start_offset;
+       framecnt_t right_length;
+       framecnt_t left_length;
 
        if (which != Right && preroll_button.get_active()) {
                preroll = _session->frame_rate() * 2;  //2 second hardcoded preroll for now
index b41282d0df81908a8b95ed7d85c9b6973f98bf4f..84cd70ee67b38dc6d037ebe6f272bc5663cce6e0 100644 (file)
@@ -1105,7 +1105,7 @@ Editor::set_session (Session *t)
                bbt.bars = 0;
                bbt.beats = 0;
                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 (pos, true, 0, AudioClock::BBT);
 
index 3c3f56d2f121ca2084eff107eb2f28068afcb103..0b90c16e0de5171915b7bcc60dec14d64100d70d 100644 (file)
@@ -799,7 +799,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
 
        MinsecRulerScale minsec_ruler_scale;
 
-       nframes_t minsec_mark_interval;
+       framecnt_t minsec_mark_interval;
        gint minsec_mark_modulo;
        gint minsec_nmarks;
        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;
 
-       nframes_t timecode_mark_interval;
+       framecnt_t timecode_mark_interval;
        gint timecode_mark_modulo;
        gint timecode_nmarks;
        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 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 redisplay_tempo (bool immediate_redraw);
 
index 5bddc13891507d8c863d8eb232c862d576d45590..6f2957b3ff35e740cf46b0bdb3a74330852d1175 100644 (file)
@@ -1752,13 +1752,13 @@ Editor::temporal_zoom_session ()
        ENSURE_GUI_THREAD (*this, &Editor::temporal_zoom_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;
                if (s < 0) {
                        s = 0;
                }
-               nframes_t const e = _session->current_end_frame() + l * 0.01;
-               temporal_zoom_by_frame (nframes_t (s), e, "zoom to _session");
+               framecnt_t const e = _session->current_end_frame() + l * 0.01;
+               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 cx, cy;
-       nframes_t where;
+       framepos_t where;
        RouteTimeAxisView *dest_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 foo;
 
-       nframes_t const start_frame = regions.start ();
-       nframes_t const end_frame = regions.end_frame ();
+       framepos_t const start_frame = regions.start ();
+       framepos_t const end_frame = regions.end_frame ();
 
        begin_reversible_command (_("duplicate region"));
 
index 9b56ad0433eef6f934d4c6c6dafe697bac4d9d0f..30fce08a932f5b6e8046ffcfabcef74d19e52660 100644 (file)
@@ -800,9 +800,9 @@ EditorRegions::format_position (framepos_t pos, char* buf, size_t bufsize)
 
                left = pos;
                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));
-               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();
                snprintf (buf, bufsize, "%02d:%02d:%06.3f", hrs, mins, secs);
                break;
@@ -844,13 +844,13 @@ EditorRegions::populate_row (boost::shared_ptr<Region> region, TreeModel::Row co
 #if 0
        if (audioRegion && fades_in_seconds) {
 
-               nframes_t left;
+               framepos_t left;
                int mins;
                int millisecs;
 
                left = audioRegion->fade_in()->back()->when;
                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());
 
                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;
                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());
 
                if (audioRegion->fade_out()->back()->when >= _session->frame_rate()) {
index 068be6d53471da814988901b65cb05c215cab97f..b367a55f2502313cf88c859e5e3236db96355234 100644 (file)
@@ -1002,7 +1002,7 @@ Editor::metric_get_timecode (GtkCustomRulerMark **marks, gdouble lower, gdouble
                lower = 0;
        }
 
-       pos = (nframes_t) floor (lower);
+       pos = (framecnt_t) floor (lower);
 
        *marks = (GtkCustomRulerMark *) g_malloc (sizeof(GtkCustomRulerMark) * timecode_nmarks);
        switch (timecode_ruler_scale) {
@@ -1150,8 +1150,8 @@ Editor::compute_bbt_ruler_scale (framepos_t lower, framepos_t upper)
        TempoMap::BBTPointList::iterator i;
         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((jack_nframes_t) upper, upper_beat);
+        _session->bbt_time (lower, lower_beat);
+        _session->bbt_time (upper, upper_beat);
         uint32_t beats = 0;
 
        bbt_accent_modulo = 1;
index e55b53aeea081149b1617972d03c1d7bfa5d00d9..c097bfe049b939ac8cf1602b04bb1e31b814d2cf 100644 (file)
@@ -147,7 +147,7 @@ EditorSummary::render (cairo_t* cr)
 
        /* 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;
        _start = theoretical_start > 0 ? theoretical_start : 0;
        _end = _session->current_end_frame() + session_length * _overhang_fraction;
index e9258a88fdd0eb7339daa9abd1a85b0662499358..86f2e793900f492870b9c2dc85f0c9f420feabf7 100644 (file)
@@ -80,8 +80,8 @@ private:
        Position get_position (double, double) const;
        void set_cursor (Position);
 
-       nframes_t _start; ///< start frame of the overview
-       nframes_t _end; ///< end frame of the overview
+       framepos_t _start; ///< start 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 */
        double _overhang_fraction;
index 0d0fd4e8417fd5c86ffea2f8574379e5e211ce59..90fd6136cf4e1e17f530e05cc6f59583bd49cb44 100644 (file)
@@ -138,7 +138,7 @@ Editor::redisplay_tempo (bool immediate_redraw)
 }
 
 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) {
                return;
index caf76ac0de66d6b6fc57ebe0fbfd9f63e5844701..f950e6ab18b9e36a91e7dcf4b15b04f3f149f62c 100644 (file)
@@ -210,7 +210,7 @@ ExportFormatDialog::set_session (ARDOUR::Session* s)
        if (sample_rate_view.get_selection()->count_selected_rows() == 0) {
                Gtk::ListStore::Children::iterator 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);
                                break;
                        }
@@ -761,7 +761,7 @@ ExportFormatDialog::update_time (AnyTime & time, AudioClock const & clock)
                return;
        }
 
-       nframes_t frames = clock.current_duration();
+       framecnt_t frames = clock.current_duration();
 
        switch (clock.mode()) {
          case AudioClock::Timecode:
index f5c6c916d1ad2c1b9c6b5eff0a8aefdda820970d..774a956d9ecb3b1b8fb59da79bf26c1446be259b 100644 (file)
@@ -171,7 +171,7 @@ ExportRangeMarkersDialog::init_progress_computing(Locations::LocationList& locat
        // flush vector
        range_markers_durations_aggregated.resize(0);
 
-       nframes_t duration_before_current_location = 0;
+       framecnt_t duration_before_current_location = 0;
        Locations::LocationList::iterator 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()){
                        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);
                        duration_before_current_location += duration;
index dc9188db1b74ed1c1d1ee6f5c483fd99ce831110..da827b72df6d03da9cc3a810f7d7fdd05e26658b 100644 (file)
@@ -537,7 +537,7 @@ ImageFrameSocketHandler::send_imageframe_time_axis_group_renamed(const string &
  * @param item the time axis item whos position has changed
  */
 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)
 
@@ -573,7 +573,7 @@ ImageFrameSocketHandler::send_imageframe_view_position_change(nframes_t pos, voi
  * @param item the item which has had a duration change
  */
 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)
 
@@ -687,7 +687,7 @@ ImageFrameSocketHandler::send_imageframe_view_removed(const string & item_id, vo
  * @param item the time axis item whos position has changed
  */
 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)
        {
@@ -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
  */
 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)
        {
@@ -1336,11 +1336,11 @@ ImageFrameSocketHandler::handle_insert_imageframe_view(const char* msg)
        position += image_id_size ;
 
        // 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 ;
 
        // 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 ;
 
        //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) ;
 
-       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 ;
 
        // 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) ;
 
-       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 ;
 
        // 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) ;
 
-       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 ;
 
        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) ;
 
-       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 ;
 
        int errcode ;
index 1bff9a15729b647ee23e3b571f7a4d56543dc72c..301d0d2fddf6ed1bc2ce8498722825e3c0aeb32c 100644 (file)
@@ -198,7 +198,7 @@ ImageFrameTimeAxisGroup::apply_item_color(Gdk::Color& color)
  * @param src the identity of the object that initiated the change
  */
 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;
 
index b78ce58b084dfe3658b53e7f8f20a0fa2c97029d..bbec156efddb2d12d2d6ba5373857b19d87828b5 100644 (file)
@@ -406,9 +406,8 @@ ImageFrameTimeAxisView::get_selected_imageframe_view() const
 void
 ImageFrameTimeAxisView::set_imageframe_duration_sec(double sec)
 {
-       if(selected_imageframe_group && selected_imageframe_view)
-       {
-               selected_imageframe_view->set_duration((nframes_t) (sec * _trackview.editor.session()->frame_rate()), this) ;
+       if (selected_imageframe_group && selected_imageframe_view) {
+               selected_imageframe_view->set_duration ((sec * _trackview.editor.session()->frame_rate()), this);
        }
 }
 
index 04dde574c6968a9fb6871a45e5b0f943d36e517a..817088124c4bd5aa459d77637461bacae08ce92f 100644 (file)
@@ -60,8 +60,8 @@ ImageFrameView::ImageFrameView(const string & item_id,
        ImageFrameTimeAxisGroup* item_group,
        double spu,
        Gdk::Color& basic_color,
-       nframes_t start,
-       nframes_t duration,
+       framepos_t start,
+       framecnt_t duration,
        unsigned char* rgb_data,
        uint32_t width,
        uint32_t height,
index ac8a3b3bb0cedbf2066a15f6c71fea8fc495771f..49b29038c4739f01ca53650c0909691a45a35254 100644 (file)
@@ -65,8 +65,8 @@ class ImageFrameView : public TimeAxisViewItem
                        ImageFrameTimeAxisGroup* group,
                        double spu,
                        Gdk::Color& base_color,
-                       nframes_t start,
-                       nframes_t duration,
+                       framepos_t start,
+                       framecnt_t duration,
                        unsigned char* rgb_data,
                        uint32_t width,
                        uint32_t height,
index aadbbfc5b7c6445da65e7077d58196c86de67091..0284921ba5f4ffc6eab26db91b7be2d8cb08e25c 100644 (file)
@@ -934,7 +934,7 @@ LocationUI::add_new_location()
        string markername;
 
        if (_session) {
-               nframes_t where = _session->audible_frame();
+               framepos_t where = _session->audible_frame();
                _session->locations()->next_available_name(markername,"mark");
                Location *location = new Location (*_session, where, where, markername, Location::IsMark);
                if (Config->get_name_new_markers()) {
@@ -956,7 +956,7 @@ LocationUI::add_new_range()
        string rangename;
 
        if (_session) {
-               nframes_t where = _session->audible_frame();
+               framepos_t where = _session->audible_frame();
                _session->locations()->next_available_name(rangename,"unnamed");
                Location *location = new Location (*_session, where, where, rangename, Location::IsRangeMarker);
                _session->begin_reversible_command (_("add range marker"));
index ca4cfbf4c5405d1354388e10d7c8662351e986d3..6f0898d5dc0a60d345e0b9cd3674b805ae00969a 100644 (file)
@@ -46,7 +46,7 @@ using namespace Gtkmm2ext;
 PBD::Signal1<void,Marker*> Marker::CatchDeletion;
 
 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)
        , _parent (&parent)
index c17af63134b4126c11a916104fd0cd9aac7cb346..fbc7e18a50d77724a43dea7d8412d9161b4f84f4 100644 (file)
@@ -57,7 +57,7 @@ class Marker : public sigc::trackable
 
 
        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 ();
 
index c901f9ba522391354217cf3b634ddd85c745d44d..124aac0852a73f1529ec28c3ec599dca8f76f28d 100644 (file)
@@ -192,7 +192,7 @@ MarkerTimeAxisView::apply_color(Gdk::Color& color)
  * @param src the identity of the object that initiated the change
  */
 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))
        {
@@ -335,7 +335,7 @@ MarkerTimeAxisView::set_marker_duration_sec(double sec)
 {
   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);
   }
 }
 
index a0e8f2bbf0c95a847c768b852760345f8c653992..4bd842341bc76be7c0d8eaa8169617559ad105da 100644 (file)
@@ -52,8 +52,8 @@ MarkerView::MarkerView(ArdourCanvas::Group *parent,
                       Gdk::Color& basic_color,
                       std::string mark_type,
                       std::string mark_id,
-                      nframes_t start,
-                      nframes_t duration)
+                      framepos_t start,
+                      framecnt_t duration)
   : TimeAxisViewItem(mark_id, *parent,*tv,spu,basic_color,start,duration)
 {
        mark_type_text = mark_type ;
index 293bb6503a7fab4d54ce58a7eda39410dcd33034..723b52220210e0b3e28e972af24e6a5632135a94 100644 (file)
@@ -437,7 +437,7 @@ MidiStreamView::setup_rec_box ()
 
                                // handle multi
 
-                               nframes_t start = 0;
+                               framepos_t start = 0;
                                if (rec_regions.size() > 0) {
                                        start = rec_regions.back().first->start()
                                                        + _trackview.track()->get_captured_frames(rec_regions.size()-1);
index a95c0891d082eb59a4bb28151aa16593cc1e50c0..21ec8379928986f26157eb83053f67e27c39aa75 100644 (file)
@@ -35,6 +35,8 @@
 #include <iostream>
 #include <cmath>
 
+using namespace ARDOUR;
+
 PluginEqGui::PluginEqGui(boost::shared_ptr<ARDOUR::PluginInsert> pluginInsert)
        : _min_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 out_map(_plugin->get_info()->n_outputs);
 
-       _plugin->connect_and_run(_bufferset, in_map, out_map, _buffer_size, (nframes_t)0);
-       nframes_t f = _plugin->signal_latency();
+       _plugin->connect_and_run(_bufferset, in_map, out_map, _buffer_size, 0);
+       framecnt_t f = _plugin->signal_latency ();
        // Adding user_latency() could be interesting
 
        // Gather all output, taking latency into account.
@@ -338,8 +340,8 @@ PluginEqGui::run_impulse_analysis()
        } else {
                //int C = 0;
                //std::cerr << (++C) << ": latency is " << f << " frames, doing split processing.." << std::endl;
-               nframes_t target_offset = 0;
-               nframes_t frames_left = _buffer_size; // refaktoroi
+               framecnt_t target_offset = 0;
+               framecnt_t frames_left = _buffer_size; // refaktoroi
                do {
                        if (f >= _buffer_size) {
                                //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"
                                //             .. 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;
                                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);
                                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);
 
index 26a0777ba345c76c927b5f2cc3a379f822a406b7..24ffd456562a3760401655851f3f1fdb38130140 100644 (file)
@@ -89,8 +89,8 @@ class PluginEqGui : public Gtk::Table
                float _log_coeff;
                float _log_max;
 
-               nframes_t _buffer_size;
-               nframes_t _signal_buffer_size;
+               ARDOUR::framecnt_t _buffer_size;
+               ARDOUR::framecnt_t _signal_buffer_size;
 
                // buffers
                ARDOUR::BufferSet _bufferset;
index b08b5a3a0f34a627cb8226360c7003b06c278468..ce36b8a4145d7ef43f82677300b3268451c3df8e 100644 (file)
@@ -471,8 +471,8 @@ void
 PlugUIBase::set_latency_label ()
 {
        char buf[64];
-       nframes_t l = insert->effective_latency ();
-       nframes_t sr = insert->session().frame_rate();
+       framecnt_t const l = insert->effective_latency ();
+       framecnt_t const sr = insert->session().frame_rate ();
 
        if (l < sr / 1000) {
                snprintf (buf, sizeof (buf), "latency (%d samples)", l);
index 84d2eea1558ff5f4077d1604bfe1bb61c4817268..5546fd533b53223aaba6e619eee1eec40cf5ce48 100644 (file)
@@ -71,7 +71,7 @@ PortInsertUI::PortInsertUI (Gtk::Window* parent, ARDOUR::Session* sess, boost::s
 void
 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) {
                 latency_display.set_text (_("Disconnected from audio engine"));
         } else {
@@ -98,7 +98,7 @@ PortInsertUI::check_latency_measurement ()
         }
 
         char buf[128];
-        nframes_t sample_rate = AudioEngine::instance()->frame_rate();
+        framecnt_t const sample_rate = AudioEngine::instance()->frame_rate();
 
         if (sample_rate == 0) {
                 latency_display.set_text (_("Disconnected from audio engine"));
@@ -121,7 +121,7 @@ PortInsertUI::check_latency_measurement ()
         }
 
         if (solid) {
-                _pi->set_measured_latency ((nframes_t) rint (mtdm->del()));
+                _pi->set_measured_latency (rint (mtdm->del()));
                 latency_button.set_active (false);
                 strcat (buf, " (set)");
         }
index 1be9879cd780a6d7dd9d7801da863060d4fff970..f0c2ca3f9137a743b2cc8ae8dc9e12dc00270185 100644 (file)
@@ -196,10 +196,6 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible {
 
        virtual void transition_to_rolling (bool fwd) = 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 (double frame) const = 0;
        virtual framepos_t pixel_to_frame (double pixel) const = 0;
index 61e2939c099bc4f17671ca746a5f989f81efeb8f..c95d9bbd20a89a20f89fa5eaa35bc8279e0e5178 100755 (executable)
@@ -291,7 +291,7 @@ RegionEditor::end_clock_changed ()
 void
 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"));
 
@@ -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)) {
                int dir;
-               nframes_t off = _region->sync_offset (dir);
+               frameoffset_t off = _region->sync_offset (dir);
                if (dir == -1) {
                        off = -off;
                }
index d7229768613ec924eb46bf828fc77ee16654c960..51ec00293164e563d4efd10756827c068d9965b1 100644 (file)
@@ -468,7 +468,7 @@ void
 RegionView::region_sync_changed ()
 {
        int sync_dir;
-       nframes_t sync_offset;
+       framecnt_t sync_offset;
 
        sync_offset = _region->sync_offset (sync_dir);
 
@@ -595,7 +595,7 @@ RegionView::set_height (double h)
        if (sync_line) {
                Points points;
                int sync_dir;
-               nframes_t sync_offset;
+               framecnt_t sync_offset;
                sync_offset = _region->sync_offset (sync_dir);
                double offset = sync_offset / samples_per_unit;
 
@@ -631,9 +631,9 @@ RegionView::update_coverage_frames (LayerDisplay d)
                return;
        }
 
-       nframes_t const position = _region->first_frame ();
-       nframes_t t = position;
-       nframes_t const end = _region->last_frame ();
+       framepos_t const position = _region->first_frame ();
+       framepos_t t = position;
+       framepos_t const end = _region->last_frame ();
 
        ArdourCanvas::SimpleRect* cr = 0;
        bool me = false;
index d947fbeb1543aa8192e2e77f450bcbe8aaf8112a..1cba72ebda68b09933ba1d7df21afed2b675aa40 100644 (file)
@@ -260,7 +260,7 @@ RouteParams_UI::refresh_latency ()
                latency_widget->refresh();
 
                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);
        }
 }
@@ -288,7 +288,7 @@ RouteParams_UI::setup_latency_frame ()
        latency_widget = new LatencyGUI (*(_route->output()), _session->frame_rate(), _session->engine().frames_per_cycle());
 
        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);
 
        latency_packer.pack_start (*latency_widget, false, false);
index 31966681df2e9cf6d336ab51e3811ea21c08a8af..b6cea2a11afaaf821c255b5254db11c1dd766765 100644 (file)
@@ -672,7 +672,7 @@ RouteTimeAxisView::track_mode_changed ()
 }
 
 void
-RouteTimeAxisView::show_timestretch (nframes_t start, nframes_t end)
+RouteTimeAxisView::show_timestretch (framepos_t start, framepos_t end)
 {
        double x1;
        double x2;
@@ -1208,8 +1208,8 @@ RouteTimeAxisView::get_selectables (framepos_t start, framepos_t end, double top
                speed = track()->speed();
        }
 
-       nframes_t start_adjusted = session_frame_to_track_frame(start, speed);
-       nframes_t end_adjusted   = session_frame_to_track_frame(end, speed);
+       framepos_t const start_adjusted = session_frame_to_track_frame(start, speed);
+       framepos_t const end_adjusted   = session_frame_to_track_frame(end, speed);
 
        if ((_view && ((top < 0.0 && bot < 0.0))) || touched (top, bot)) {
                _view->get_selectables (start_adjusted, end_adjusted, top, bot, results);
@@ -1295,7 +1295,7 @@ RouteTimeAxisView::name_entry_changed ()
 }
 
 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 ();
 
index edc752d630dd3562068fdf136505a5b7bc9475f7..8515f375b932983ec1d3c2a4052086b6c47d4e16 100644 (file)
@@ -78,7 +78,7 @@ public:
 
        void set_samples_per_unit (double);
        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 selection_click (GdkEventButton*);
        void set_selected_points (PointSelection&);
@@ -88,7 +88,7 @@ public:
        void set_layer_display (LayerDisplay d);
        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);
 
        /* Editing operations */
@@ -232,7 +232,7 @@ protected:
        virtual void show_existing_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 ();
 
index 63ece47e6a3f0fb33dfb73d67ac5918a163b4428..b135593a62623860f8cf5547f9d0ff96c95798f5 100644 (file)
@@ -304,7 +304,7 @@ Selection::toggle (vector<RegionView*>& r)
 }
 
 long
-Selection::toggle (nframes_t start, nframes_t end)
+Selection::toggle (framepos_t start, framepos_t end)
 {
        AudioRangeComparator cmp;
 
@@ -462,7 +462,7 @@ Selection::add (MidiRegionView* mrv)
 }
 
 long
-Selection::add (nframes_t start, nframes_t end)
+Selection::add (framepos_t start, framepos_t end)
 {
        AudioRangeComparator cmp;
 
@@ -478,7 +478,7 @@ Selection::add (nframes_t start, nframes_t end)
 }
 
 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) {
                if ((*i).id == sid) {
@@ -654,7 +654,7 @@ Selection::remove (uint32_t selection_id)
 }
 
 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.
  */
 long
-Selection::set (nframes_t start, nframes_t end)
+Selection::set (framepos_t start, framepos_t end)
 {
        if ((start == 0 && end == 0) || end < start) {
                return 0;
index 81bb54b9df156b3f83e811b08c08abaf5851f568..0a73ae275e7f8fb5403746a999196910c4068c75 100644 (file)
@@ -121,7 +121,7 @@ class Selection : public sigc::trackable, public PBD::ScopedConnectionList
        void set (RegionView*, bool also_clear_tracks = true);
        void set (MidiRegionView*);
        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<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 (MidiCutBuffer*);
        void toggle (std::vector<RegionView*>&);
-       long toggle (nframes_t, nframes_t);
+       long toggle (framepos_t, framepos_t);
        void toggle (ARDOUR::AutomationList*);
        void toggle (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 (MidiCutBuffer*);
        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<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 (MidiCutBuffer*);
        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::Playlist>);
        void remove (const std::list<boost::shared_ptr<ARDOUR::Playlist> >&);
        void remove (const std::list<Selectable*>&);
        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_tracks ();
index aed3d5208918bb982067f2fb059af2a3d6609996..bd19db31f04ba275cc413be8ae3799289b7da9d4 100644 (file)
@@ -268,7 +268,7 @@ SoundFileBox::setup_labels (const string& filename)
                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;
 
        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;
                        }
 
index 5e7969bb3a794e608fe4b3521c31223adcdd0176..c4d62def90c7141a20e8bb50604a2d7de3cfe3fb 100644 (file)
@@ -158,14 +158,14 @@ StepEditor::stop_step_editing ()
 void
 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;
        uint32_t bufsize = 32;
 
        buf = new uint8_t[bufsize];
 
        while (incoming.read_space()) {
-               nframes_t time;
+               framepos_t time;
                Evoral::EventType type;
                uint32_t size;
 
index 366bc8d4bf5f20a8323dba67b20ed97f4a5e34d4..769255408a04da844f6cb3d82e9395f3a6274ee5 100644 (file)
@@ -43,9 +43,9 @@ namespace ARDOUR {
 }
 
 struct RecBoxInfo {
-       ArdourCanvas::SimpleRect* rectangle;
-       nframes_t                 start;
-       nframes_t                 length;
+       ArdourCanvas::SimpleRect*  rectangle;
+       framepos_t                 start;
+       ARDOUR::framecnt_t         length;
 };
 
 class Selectable;
@@ -171,7 +171,7 @@ protected:
        double height;
 
        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
           being recorded, or max_framepos if not applicable.
index c43a962e4d81a50b216f940e4a6903d9423b5381..9103f72cbab095f40eccc90b12b22192f22dceab 100644 (file)
@@ -493,13 +493,13 @@ StripSilenceDialog::update_stats (const SilenceResult& res)
         }
 }
 
-nframes_t
+framecnt_t
 StripSilenceDialog::minimum_length () const
 {
         return _minimum_length.current_duration (_waves.front()->region->position());
 }
 
-nframes_t
+framecnt_t
 StripSilenceDialog::fade_length () const
 {
         return _minimum_length.current_duration (_waves.front()->region->position());
index 15e6b206c1c7de084ee22c24048d59effdfef4f6..625e9b65fd592d7af6bca459296faf6b49d0b7c7 100644 (file)
@@ -41,8 +41,8 @@ public:
                return _threshold.get_value ();
        }
 
-        nframes_t minimum_length () const;
-        nframes_t fade_length () const;
+       ARDOUR::framecnt_t minimum_length () const;
+        ARDOUR::framecnt_t fade_length () const;
 
 private:
         typedef std::list<std::pair<ARDOUR::frameoffset_t,ARDOUR::framecnt_t> > SilenceResult;
index 71fd5b40b41ed4cacd00d578b08914da1eb92c56..1190251fa1864dcd5eaa3248ed4d9d9b3de51f5d 100644 (file)
@@ -33,7 +33,7 @@ using namespace Gtkmm2ext;
 using namespace ARDOUR;
 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")),
          bpm_adjustment (60.0, 1.0, 999.9, 0.1, 1.0),
          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"),
          ok_button (action),
          cancel_button (_("Cancel"))
index c1a88367ca2c1a76ed94997296c4042466edf8b8..ebb700e3e97bca23b4ae8f53bf8d89725d2ce501 100644 (file)
@@ -38,7 +38,7 @@
 class TempoDialog : public ArdourDialog
 {
 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);
 
        double get_bpm ();
@@ -70,7 +70,7 @@ class MeterDialog : public ArdourDialog
 {
 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);
 
        double get_bpb ();
index 29cb3e613bef594fc4e4e4e3b013981c0a124bc7..a206b1a2313c5cbc60eb75bc4d30a8d83798051c 100644 (file)
@@ -672,7 +672,7 @@ TimeAxisView::set_samples_per_unit (double spu)
 }
 
 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) {
                (*i)->show_timestretch (start, end);
@@ -714,7 +714,8 @@ TimeAxisView::show_selection (TimeSelection& ts)
        selection_group->raise_to_top();
 
        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;
                end = (*i).end;
index 94d3bb16ce40bc4ab2fcb372c80ec427bc423768..b376ba2aba735619d39256b11e20f6f4f7e1620f 100644 (file)
@@ -169,7 +169,7 @@ class TimeAxisView : public virtual AxisView, public PBD::Stateful
        virtual void show_selection (TimeSelection&);
        virtual void hide_selection ();
        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_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_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> ();
        }
 
index 23daba7f7f05fa4f767e5bb3114600cdb5e1b0bf..10c8513ec8741753c4601e3a4e9f0b15038dd5a5 100644 (file)
@@ -409,15 +409,15 @@ VisualTimeAxis::name_entry_key_release_handler(GdkEventKey* ev)
 // Super class methods not handled by VisualTimeAxis
 
 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
 VisualTimeAxis::hide_timestretch()
 {
-  // Not handled by purely visual TimeAxis
+       // Not handled by purely visual TimeAxis
 }
 
 
index 7f0b397703d8afcbcb0ae613e6e8390d61a19de7..230b9f0d6b13ab7daa2ed893cb0aa17d21da101f 100644 (file)
@@ -71,7 +71,7 @@ Amp::configure_io (ChanCount in, ChanCount out)
 }
 
 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) {
                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) {
                                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];
                                }
                        }
@@ -129,7 +129,7 @@ Amp::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end_frame*/,
 }
 
 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
         */
@@ -144,7 +144,7 @@ Amp::apply_gain (BufferSet& bufs, nframes_t nframes, gain_t initial, gain_t targ
                return;
        }
 
-       const nframes_t declick = std::min ((nframes_t)128, nframes);
+       const framecnt_t declick = std::min ((framecnt_t) 128, nframes);
        gain_t         delta;
        double         fractional_shift = -1.0/declick;
        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;
 
-               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))));
                        fractional_pos += fractional_shift;
                }
@@ -199,7 +199,7 @@ Amp::apply_gain (BufferSet& bufs, nframes_t nframes, gain_t initial, gain_t targ
 }
 
 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
            values.
@@ -209,7 +209,7 @@ Amp::declick (BufferSet& bufs, nframes_t nframes, int dir)
                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;
        double         fractional_shift = -1.0/declick;
        double         fractional_pos;
@@ -233,7 +233,7 @@ Amp::declick (BufferSet& bufs, nframes_t nframes, int dir)
 
                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))));
                        fractional_pos += fractional_shift;
                }
@@ -252,7 +252,7 @@ Amp::declick (BufferSet& bufs, nframes_t nframes, int dir)
 }
 
 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
         */
@@ -267,7 +267,7 @@ Amp::apply_gain (AudioBuffer& buf, nframes_t nframes, gain_t initial, gain_t tar
                return;
        }
 
-       const nframes_t declick = std::min ((nframes_t)128, nframes);
+       const framecnt_t declick = std::min ((framecnt_t) 128, nframes);
        gain_t         delta;
        double         fractional_shift = -1.0/declick;
        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;
         
-        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))));
                 fractional_pos += fractional_shift;
         }
@@ -303,7 +303,7 @@ Amp::apply_gain (AudioBuffer& buf, nframes_t nframes, gain_t initial, gain_t tar
 }
 
 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) {
 
@@ -342,7 +342,7 @@ Amp::apply_simple_gain (BufferSet& bufs, nframes_t nframes, gain_t target)
 }
 
 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) {
                 memset (buf.data(), 0, sizeof (Sample) * nframes);
@@ -412,8 +412,9 @@ void
 Amp::GainControl::set_value (double val)
 {
        // max gain at about +6dB (10.0 ^ ( 6 dB * 0.05))
-       if (val > 1.99526231f)
+       if (val > 1.99526231f) {
                val = 1.99526231f;
+       }
 
        _amp->set_gain (val, this);
 
@@ -427,7 +428,7 @@ Amp::GainControl::get_value (void) const
 }
 
 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);
 
index 0ec493e8ced7be49245640fd7b7cc986af73aa06..711cc5489fb73a7fd37f033a1e5d2b7c0a263a22 100644 (file)
@@ -43,12 +43,12 @@ public:
        bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
        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; }
-       void apply_gain(bool yn) { _apply_gain = yn; }
+       bool apply_gain () const  { return _apply_gain; }
+       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; }
        void apply_gain_automation(bool yn) { _apply_gain_automation = yn; }
@@ -56,13 +56,13 @@ public:
        XMLNode& state (bool full);
        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_simple_gain(BufferSet& bufs, nframes_t nframes, 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, framecnt_t nframes, gain_t target);
         
-        static void apply_gain (AudioBuffer& buf, nframes_t nframes, gain_t initial, gain_t target);
-       static void apply_simple_gain(AudioBuffer& buf, nframes_t nframes, 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, 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(); }
 
index 65eb38d6db396548989eadf798b0fa31761ebcff..6c5a0a0832b2fe2e6aa7b3583691ec787e224da5 100644 (file)
@@ -30,7 +30,7 @@ public:
        AudioBuffer(size_t capacity);
        ~AudioBuffer();
 
-       void silence (nframes_t len, nframes_t offset = 0) {
+       void silence (framecnt_t len, framecnt_t offset = 0) {
                if (!_silent) {
                        assert(_capacity > 0);
                        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*/
-       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(_capacity > 0);
                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*/
-       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);
                assert (ab);
                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*/
-       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(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
         * 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(len <= _capacity);
@@ -100,7 +100,7 @@ public:
 
        /** Accumulate (add) @a len frames FROM THE START OF @a src into self
         * 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(len <= _capacity);
@@ -113,7 +113,7 @@ public:
                _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);
        }
 
@@ -137,12 +137,12 @@ public:
        void resize (size_t nframes);
 
 
-       const Sample* data (nframes_t offset = 0) const {
+       const Sample* data (framecnt_t offset = 0) const {
                assert(offset <= _capacity);
                return _data + offset;
        }
 
-       Sample* data (nframes_t offset = 0) {
+       Sample* data (framecnt_t offset = 0) {
                assert(offset <= _capacity);
                return _data + offset;
        }
index 4106602b63e5e372c7d29e03ec7717e41a4deeae..2bd44d62a6e3f2c6299e539ac3c4ab8d36eb4a3b 100644 (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--) {
                        Sample tmp = *first;
                        *first++ = *last;
@@ -161,7 +161,7 @@ class AudioDiskstream : public Diskstream
 
        void set_pending_overwrite(bool);
        int  overwrite_existing_buffers ();
-       void set_block_size (nframes_t);
+       void set_block_size (pframes_t);
        int  internal_playback_seek (framecnt_t distance);
        int  can_internal_playback_seek (framecnt_t distance);
        int  rename_write_sources ();
@@ -177,17 +177,17 @@ class AudioDiskstream : public Diskstream
   protected:
        friend class AudioTrack;
 
-       int  process (framepos_t transport_frame, nframes_t nframes, bool can_record, bool rec_monitors_input, bool& need_butler);
-       bool commit  (nframes_t nframes);
+       int  process (framepos_t transport_frame, pframes_t nframes, bool can_record, bool rec_monitors_input, bool& need_butler);
+       bool commit  (framecnt_t nframes);
 
   private:
 
        struct ChannelInfo : public boost::noncopyable {
 
-               ChannelInfo (nframes_t playback_buffer_size, 
-                             nframes_t capture_buffer_size,
-                             nframes_t speed_buffer_size, 
-                             nframes_t wrap_buffer_size);
+               ChannelInfo (framecnt_t playback_buffer_size, 
+                             framecnt_t capture_buffer_size,
+                             framecnt_t speed_buffer_size, 
+                             framecnt_t wrap_buffer_size);
                ~ChannelInfo ();
 
                Sample     *playback_wrap_buffer;
@@ -216,15 +216,15 @@ class AudioDiskstream : public Diskstream
 
                RingBufferNPT<CaptureTransition> * capture_transition_buf;
                // 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_capture (nframes_t);
+                void resize_playback (framecnt_t);
+                void resize_capture (framecnt_t);
        };
 
        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 */
        int do_flush (RunContext context, bool force = false);
@@ -233,7 +233,7 @@ class AudioDiskstream : public Diskstream
        int do_refill_with_alloc ();
 
        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);
 
        void finish_capture (bool rec_monitors_input, boost::shared_ptr<ChannelList>);
index 895cae99a645384e44d47290ad8a685713a8df75..748ef8263baf8c3a8c1ad49f84c1cffcc23c5b65 100644 (file)
@@ -35,25 +35,25 @@ class AudioPort : public Port
                return DataType::AUDIO;
        }
 
-       void cycle_start (nframes_t);
-       void cycle_end (nframes_t);
+       void cycle_start (pframes_t);
+       void cycle_end (pframes_t);
        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);
        }
 
-       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;
        }
        
-       static void increment_port_offset (nframes_t n) {
+       static void increment_port_offset (framecnt_t n) {
                _port_offset += n;
        }
        
@@ -65,7 +65,7 @@ class AudioPort : public Port
   private:
        AudioBuffer* _buffer;
 
-       static nframes_t _port_offset;
+       static framecnt_t _port_offset;
 };
 
 } // namespace ARDOUR
index 8e31db34fd33e53cffa60a8784a91429d3a24c85..b9c60d5107a96f82edddb04bcaca846835ac34f2 100644 (file)
@@ -39,7 +39,7 @@ class AudioTrack : public Track
        int set_mode (TrackMode m);
        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);
 
        void use_new_diskstream ();
@@ -55,7 +55,7 @@ class AudioTrack : public Track
        void unfreeze ();
 
        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);
 
index 048e6b978b203914a1091f3f4dab763920e1c594..b00c23b1dc91ae6b82864c8fa6a48a9003520733 100644 (file)
@@ -71,7 +71,7 @@ class AUPlugin : public ARDOUR::Plugin
        const char * maker () const { return _info->creator.c_str(); }
        uint32_t parameter_count () const;
        float default_value (uint32_t port);
-       nframes_t signal_latency() const;
+       framecnt_t signal_latency() const;
        void set_parameter (uint32_t which, float val);
        float get_parameter (uint32_t which) const;
     
@@ -80,11 +80,11 @@ class AUPlugin : public ARDOUR::Plugin
        void activate ();
        void deactivate ();
        void flush ();
-       int set_block_size (nframes_t nframes);
+       int set_block_size (pframes_t nframes);
     
        int connect_and_run (BufferSet& bufs,
                             ChanMapping in, ChanMapping out,
-                            nframes_t nframes, nframes_t offset);
+                            pframes_t nframes, framecnt_t offset);
        std::set<Evoral::Parameter> automatable() const;
        std::string describe_parameter (Evoral::Parameter);
        std::string state_node_name () const { return "audiounit"; }
@@ -150,8 +150,8 @@ class AUPlugin : public ARDOUR::Plugin
        int32_t input_channels;
        int32_t output_channels;
        std::vector<std::pair<int,int> > io_configs;
-       nframes_t _current_block_size;
-       nframes_t _last_nframes;
+       pframes_t _current_block_size;
+       framecnt_t _last_nframes;
        bool _requires_fixed_size_buffers;
        AudioBufferList* buffers;
        bool _has_midi_input;
@@ -181,10 +181,10 @@ class AUPlugin : public ARDOUR::Plugin
 
        std::vector<std::pair<uint32_t, uint32_t> > parameter_map;
        uint32_t current_maxbuf;
-        nframes_t current_offset;
-        nframes_t cb_offset;
+        framecnt_t current_offset;
+        framecnt_t cb_offset;
         BufferSet* current_buffers;
-        nframes_t frames_processed;
+        framecnt_t frames_processed;
        
        std::vector<AUParameterDescriptor> descriptors;
        void init ();
index f16a2b1e49a6cc2f7f26fa24dc82e21300bbb524..27a03ce8052e756d2b300dd8ef36de2306227490 100644 (file)
@@ -56,8 +56,8 @@ class AudioAnalyser : public boost::noncopyable {
        AnalysisPlugin* plugin;
        AnalysisPluginKey plugin_key;
 
-       nframes_t bufsize;
-       nframes_t stepsize;
+       framecnt_t bufsize;
+       framecnt_t stepsize;
 
        int initialize_plugin (AnalysisPluginKey name, float sample_rate);
        int analyse (const std::string& path, Readable*, uint32_t channel);
index 523a05b4c11911c0930aec6492459d6828db0178..f55a7e334e1927908d9a7cb122b2ff82c9df10f9 100644 (file)
@@ -91,46 +91,57 @@ class AudioEngine : public SessionHandlePtr
 
        Glib::Mutex& process_lock() { return _process_lock; }
 
-       nframes_t frame_rate() const;
-       nframes_t frames_per_cycle() const;
+       framecnt_t frame_rate () const;
+       framecnt_t frames_per_cycle () const;
 
        size_t raw_buffer_size(DataType t);
 
        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;
-               if (!_running || !_priv_jack) return 0;
+               if (!_running || !_priv_jack) {
+                       return 0;
+               }
                return jack_frames_since_cycle_start (_priv_jack);
        }
-       nframes_t frame_time () {
+       
+       pframes_t frame_time () {
                jack_client_t* _priv_jack = _jack;
-               if (!_running || !_priv_jack) return 0;
+               if (!_running || !_priv_jack) {
+                       return 0;
+               }
                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;
-               if (!_running || !_priv_jack) return 0;
+               if (!_running || !_priv_jack) {
+                       return 0;
+               }
                return jack_last_frame_time (_priv_jack);
        }
 
-       nframes_t transport_frame () const {
+       pframes_t transport_frame () const {
                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);
        }
 
-       int request_buffer_size (nframes_t);
+       int request_buffer_size (pframes_t);
 
-       nframes_t set_monitor_check_interval (nframes_t);
-       nframes_t processed_frames() const { return _processed_frames; }
+       framecnt_t set_monitor_check_interval (framecnt_t);
+       framecnt_t processed_frames() const { return _processed_frames; }
 
        float get_cpu_load() {
                jack_client_t* _priv_jack = _jack;
-               if (!_running || !_priv_jack) return 0;
+               if (!_running || !_priv_jack) {
+                       return 0;
+               }
                return jack_cpu_load (_priv_jack);
        }
 
@@ -159,7 +170,7 @@ class AudioEngine : public SessionHandlePtr
        Port *register_output_port (DataType, const std::string& portname);
        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 disconnect (const std::string& source, const std::string& destination);
@@ -189,7 +200,7 @@ class AudioEngine : public SessionHandlePtr
 
        void transport_start ();
        void transport_stop ();
-       void transport_locate (nframes_t);
+       void transport_locate (framepos_t);
        TransportState transport_state ();
 
        int  reset_timebase ();
@@ -203,7 +214,7 @@ class AudioEngine : public SessionHandlePtr
 _         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;
 
@@ -218,7 +229,7 @@ _      the regular process() call to session->process() is not made.
 
        /* 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 */
 
@@ -255,18 +266,18 @@ _    the regular process() call to session->process() is not made.
        bool                       session_remove_pending;
        bool                      _running;
        bool                      _has_run;
-       mutable nframes_t         _buffer_size;
+       mutable framecnt_t        _buffer_size;
        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
-       nframes_t                  monitor_check_interval;
+       framecnt_t                 monitor_check_interval;
        /// 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
-       nframes_t                 _processed_frames;
+       framecnt_t                _processed_frames;
        bool                      _freewheeling;
        bool                      _freewheel_pending;
-       boost::function<int(nframes_t)>  freewheel_action;
+       boost::function<int(framecnt_t)>  freewheel_action;
        bool                       reconnect_on_halt;
        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);
 
-       int    process_callback (nframes_t nframes);
+       int    process_callback (pframes_t nframes);
        void*  process_thread ();
         void   finish_process_cycle (int status);
        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);
 #endif
        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 int  _sample_rate_callback (nframes_t nframes, void *arg);
-       static int  _bufsize_callback (nframes_t nframes, void *arg);
-       static void _jack_timebase_callback (jack_transport_state_t, nframes_t, jack_position_t*, int, void*);
+       static int  _sample_rate_callback (pframes_t nframes, void *arg);
+       static int  _bufsize_callback (pframes_t nframes, void *arg);
+       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 void _freewheel_callback (int , void *arg);
        static void _registration_callback (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_bufsize_callback (nframes_t);
-       int  jack_sample_rate_callback (nframes_t);
+       int  jack_bufsize_callback (pframes_t);
+       int  jack_sample_rate_callback (pframes_t);
 
        int connect_to_jack (std::string client_name, std::string session_uuid);
 
index 4f01bf4182b8c858cc4dbb4f606d50301e435374..3bd4bbd34c0b92abb6633e8d34c189f4a033b9af 100644 (file)
@@ -82,7 +82,7 @@ public:
        static bool is_empty (Session&, std::string path);
 
        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;
 
@@ -104,7 +104,7 @@ protected:
 
        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;
 
index 253329b38e7ab79e4a103fb03bc9e07033a0c296..6c3169070faebb25de1a5c7cd621e0c2e78165e1 100644 (file)
@@ -72,7 +72,7 @@ public:
        AudioPlaylist (Session&, const XMLNode&, 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>, 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 ();
 
@@ -85,7 +85,7 @@ public:
        PBD::Signal1<void,boost::shared_ptr<Crossfade> >  NewCrossfade;
        
        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>);
 
index 902e7eb9340fd49735bea295688ce4dae1057958..a5791c8b30d94172be1f640b3e6c07431c514255 100644 (file)
@@ -93,8 +93,8 @@ class AudioRegion : public Region
        boost::shared_ptr<AutomationList> fade_out() { return _fade_out; }
        boost::shared_ptr<AutomationList> envelope() { return _envelope; }
 
-       virtual nframes_t read_peaks (PeakData *buf, nframes_t npeaks,
-                       nframes_t offset, nframes_t cnt,
+       virtual framecnt_t read_peaks (PeakData *buf, framecnt_t npeaks,
+                       framecnt_t offset, framecnt_t cnt,
                        uint32_t chan_n=0, double samples_per_unit= 1.0) const;
 
        /* Readable interface */
index 08c879d92646ee8a60492f26ed845cbfe8a67503..22d5d1a7249c7881b22919a7a3ea8a15540257f9 100644 (file)
@@ -69,7 +69,7 @@ class AudioSource : virtual public Source,
 
        uint32_t read_data_count() const { return _read_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,
                        framepos_t start, framecnt_t cnt, double samples_per_visual_peak) const;
index e7d3347cb66b342e68478cf0f6dd5816f6fd7fd0..25a7b91158cabc119340a3b2dda6f8a1ca059861 100644 (file)
@@ -46,7 +46,7 @@ class Auditioner : public AudioTrack
        ARDOUR::AudioPlaylist& prepare_playlist ();
        void audition_current_playlist ();
 
-       int  play_audition (nframes_t nframes);
+       int play_audition (framecnt_t nframes);
 
        void cancel_audition () {
                g_atomic_int_set (&_auditioning, 0);
@@ -57,10 +57,10 @@ class Auditioner : public AudioTrack
 
   private:
        boost::shared_ptr<AudioRegion> the_region;
-       nframes_t current_frame;
+       framepos_t current_frame;
        mutable gint _auditioning;
        Glib::Mutex lock;
-       nframes_t length;
+       framecnt_t length;
         bool via_monitor;
 
        void drop_ports ();
index f90f1dec4867fd781e9e5a5129118c7aa99b0a96..541e9d562d4abd6357998bfd06b1d35ad089a27e 100644 (file)
@@ -60,7 +60,7 @@ public:
        virtual void add_control(boost::shared_ptr<Evoral::Control>);
        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 std::string describe_parameter(Evoral::Parameter param);
@@ -78,16 +78,16 @@ public:
 
        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
                                || (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;
        }
 
-       static jack_nframes_t automation_interval() {
+       static framecnt_t automation_interval() {
                return _automation_interval;
        }
 
@@ -109,8 +109,8 @@ public:
        std::set<Evoral::Parameter> _visible_controls;
        std::set<Evoral::Parameter> _can_automate_list;
 
-       nframes_t        _last_automation_snapshot;
-       static nframes_t _automation_interval;
+       framepos_t _last_automation_snapshot;
+       static framecnt_t _automation_interval;
 
 private:
        PBD::ScopedConnectionList _control_connections; ///< connections to our controls' signals
index 48fd7f099bc859bdf3f8f3d8c1231368276d1b19..5b76aafca60304ff212e15b555ddd93ba8473d66 100644 (file)
@@ -71,13 +71,13 @@ public:
        virtual void resize (size_t) = 0;
 
        /** 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 */
        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 merge_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, framecnt_t len, framecnt_t dst_offset = 0, framecnt_t src_offset = 0) = 0;
 
   protected:
        Buffer(DataType type, size_t capacity)
index 711e2350fddcc4f6d0286f3534f29b2ddfbe73eb..c3358f44368cefa69c544a711e328b3b8577ac22 100644 (file)
@@ -66,7 +66,7 @@ public:
 
        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
           on the DataType of the buffers. for audio, its a frame count. for MIDI
@@ -83,7 +83,7 @@ public:
        ChanCount&       count()       { return _count; }
 
        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; }
 
        void set_count(const ChanCount& count) { assert(count <= _available); _count = count; }
@@ -115,8 +115,8 @@ public:
        VstEvents* get_vst_midi (size_t);
 #endif 
 
-       void read_from(const BufferSet& in, nframes_t nframes);
-       void merge_from(const BufferSet& in, nframes_t nframes);
+       void read_from(const BufferSet& in, framecnt_t nframes);
+       void merge_from(const BufferSet& in, framecnt_t nframes);
 
        template <typename BS, typename B>
        class iterator_base {
@@ -176,7 +176,7 @@ private:
                ~VSTBuffer ();
 
                void clear ();
-               void push_back (Evoral::MIDIEvent<nframes_t> const &);
+               void push_back (Evoral::MIDIEvent<framepos_t> const &);
                VstEvents* events () const {
                        return _events;
                }
index 6ad96dc70439dedbc9416dd42d03e27bccddad66..6751f3dccaab2817c800f7da7f42e0ff1f44784d 100644 (file)
@@ -54,8 +54,8 @@ class Butler : public SessionHandleRef
        float read_data_rate() const; ///< in usec
        float write_data_rate() const;
 
-       nframes_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_capture_buffer_size() const { return audio_dstream_capture_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; }
 
        static void* _thread_work(void *arg);
@@ -76,8 +76,8 @@ class Butler : public SessionHandleRef
        bool         should_run;
        mutable gint should_do_transport_work;
        int          request_pipe[2];
-       nframes_t    audio_dstream_capture_buffer_size;
-       nframes_t    audio_dstream_playback_buffer_size;
+       framecnt_t   audio_dstream_capture_buffer_size;
+       framecnt_t   audio_dstream_playback_buffer_size;
        uint32_t     midi_dstream_buffer_size;
        RingBuffer<CrossThreadPool*> pool_trash;
 
index 5ee1d5019410ef2e6c99dce77e5d7f71a91a7742..783588c8ab636de8983f0f26a7028912b4e43627 100644 (file)
 namespace ARDOUR {
 
 struct Click {
-    nframes_t start;
-    nframes_t duration;
-    nframes_t offset;
-    const Sample *data;
-
-    Click (nframes_t s, nframes_t d, const Sample *b) : start (s), duration (d), offset (0), data (b) {}
+       framepos_t start;
+       framecnt_t duration;
+       framecnt_t offset;
+       const Sample *data;
+       
+       Click (framepos_t s, framecnt_t d, const Sample *b) : start (s), duration (d), offset (0), data (b) {}
     
-    void *operator new (size_t) {
-           return pool.alloc ();
+       void *operator new (size_t) {
+               return pool.alloc ();
     };
-    
-    void operator delete(void *ptr, size_t /*size*/) {
-           pool.release (ptr);
-    }
-    
+       
+       void operator delete(void *ptr, size_t /*size*/) {
+               pool.release (ptr);
+       }
+       
 private:
-    static Pool pool;
+       static Pool pool;
 };
 
 typedef std::list<Click*> Clicks;
 
 class ClickIO : public IO
 {
-  public:
+public:
        ClickIO (Session& s, const std::string& name) : IO (s, name, IO::Output) {}
        ~ClickIO() {}
        
-  protected:
+protected:
        uint32_t pans_required () const { return 1; }
 };
 
index c920fadc2cf69a90418d18e2186f087e025742c4..e1aa389df7dac724a2135c5a18495f502d47715a 100644 (file)
@@ -66,21 +66,21 @@ public:
        bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
        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 */
 
-       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 cycle_start (nframes_t);
-       void increment_output_offset (nframes_t);
+       void cycle_start (pframes_t);
+       void increment_output_offset (framecnt_t);
        void transport_stopped (framepos_t frame);
 
        BufferSet& output_buffers() { return *_output_buffers; }
 
        PBD::Signal0<void> MuteChange;
 
-       static PBD::Signal1<void,nframes_t> CycleStart;
+       static PBD::Signal1<void, pframes_t> CycleStart;
 
        XMLNode& state (bool full);
        int set_state (const XMLNode&, int version);
@@ -104,7 +104,7 @@ public:
        Role        _role;
        BufferSet*  _output_buffers;
        gain_t      _current_gain;
-       nframes_t   _output_offset;
+       framecnt_t  _output_offset;
        bool        _no_outs_cuz_we_no_monitor;
        boost::shared_ptr<MuteMaster> _mute_master;
        bool         no_panner_reset;
index 4eabe29d8527e585d7736060ae5b3611707a1589..cd5932b3e526de7128e48aed39797817f92da9db 100644 (file)
@@ -79,8 +79,8 @@ class Diskstream : public SessionObject, public PublicDiskstream
        void       set_align_style (AlignStyle);
        void       set_persistent_align_style (AlignStyle a) { _persistent_alignment_style = a; }
 
-       nframes_t roll_delay() const { return _roll_delay; }
-       void      set_roll_delay (nframes_t);
+       framecnt_t roll_delay() const { return _roll_delay; }
+       void       set_roll_delay (framecnt_t);
 
        bool         record_enabled() const { return g_atomic_int_get (&_record_enabled); }
        virtual void set_record_enabled (bool yn) = 0;
@@ -118,8 +118,8 @@ class Diskstream : public SessionObject, public PublicDiskstream
 
        ChanCount n_channels() { return _n_channels; }
 
-       static nframes_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 framecnt_t disk_io_frames() { return disk_io_chunk_frames; }
+       static void set_disk_io_chunk_frames (framecnt_t n) { disk_io_chunk_frames = n; }
 
        /* Stateful */
        virtual XMLNode& get_state(void) = 0;
@@ -127,7 +127,7 @@ class Diskstream : public SessionObject, public PublicDiskstream
 
        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 ();
 
        bool slaved() const      { return _slaved; }
@@ -144,7 +144,7 @@ class Diskstream : public SessionObject, public PublicDiskstream
 
        /** For non-butler contexts (allocates temporary working buffers) */
        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 {
                return _pending_overwrite;
@@ -186,8 +186,8 @@ class Diskstream : public SessionObject, public PublicDiskstream
   protected:
        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 bool commit  (nframes_t nframes) = 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  (framecnt_t nframes) = 0;
 
        //private:
 
@@ -239,9 +239,9 @@ class Diskstream : public SessionObject, public PublicDiskstream
         virtual void prepare_to_stop (framepos_t pos);
 
        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;
        mutable Glib::Mutex capture_info_lock;
 
@@ -265,9 +265,9 @@ class Diskstream : public SessionObject, public PublicDiskstream
        framepos_t    capture_start_frame;
        framecnt_t    capture_captured;
        bool          was_recording;
-       nframes_t     adjust_capture_position;
-       nframes_t    _capture_offset;
-       nframes_t    _roll_delay;
+       framecnt_t    adjust_capture_position;
+       framecnt_t   _capture_offset;
+       framecnt_t   _roll_delay;
        framepos_t    first_recordable_frame;
        framepos_t    last_recordable_frame;
        int           last_possibly_recording;
@@ -280,8 +280,8 @@ class Diskstream : public SessionObject, public PublicDiskstream
        bool          _pending_overwrite;
        bool          overwrite_queued;
        IOChange      input_change_pending;
-       nframes_t     wrap_buffer_size;
-       nframes_t     speed_buffer_size;
+       framecnt_t    wrap_buffer_size;
+       framecnt_t    speed_buffer_size;
 
        double        _speed;
        double        _target_speed;
@@ -299,10 +299,6 @@ class Diskstream : public SessionObject, public PublicDiskstream
 
        Glib::Mutex state_lock;
 
-       framepos_t scrub_start;
-       nframes_t  scrub_buffer_size;
-       nframes_t  scrub_offset;
-
        PBD::ScopedConnectionList playlist_connections;
 
        PBD::ScopedConnection ic_connection;
index 8ffa3b90ba4f3e088b5528434c34066a6057248c..8c25fd380d8f0654d3abc547b75ea2cf6eb02e88 100644 (file)
@@ -109,13 +109,13 @@ class ElementImporter
        std::string  name;
 
        /// 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
        std::string timecode_to_string (Timecode::Time & time) const;
 
        /// 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)
        std::string rate_convert_samples (std::string const & samples) const;
index 51ecabee25c8156e74d3cc2530c0f80d5199c3c4..96b9c1eda2cda6c800182dcf701d892d39ffd4a8 100644 (file)
@@ -43,7 +43,7 @@ class ExportChannel : public boost::less_than_comparable<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;
 
        /// Adds state to node passed
@@ -75,7 +75,7 @@ class PortExportChannel : public ExportChannel
 
        PortExportChannel () {}
 
-       void read (Sample * data, nframes_t frames) const;
+       void read (Sample * data, framecnt_t frames) const;
        bool empty () const { return ports.empty(); }
 
        void get_state (XMLNode * node) const;
@@ -104,23 +104,23 @@ class RegionExportChannelFactory
        ~RegionExportChannelFactory ();
 
        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:
 
-       int new_cycle_started (nframes_t) { buffers_up_to_date = false; return 0; }
-       void update_buffers (nframes_t frames);
+       int new_cycle_started (framecnt_t) { buffers_up_to_date = false; return 0; }
+       void update_buffers (framecnt_t frames);
 
        AudioRegion const & region;
        AudioTrack & track;
        Type type;
 
-       nframes_t frames_per_cycle;
+       framecnt_t frames_per_cycle;
        size_t n_channels;
        BufferSet buffers;
        bool buffers_up_to_date;
-       nframes_t region_start;
-       nframes_t position;
+       framecnt_t region_start;
+       framecnt_t position;
 
        Sample * mixdown_buffer;
        Sample * gain_buffer;
@@ -134,7 +134,7 @@ class RegionExportChannel : public ExportChannel
        friend class RegionExportChannelFactory;
 
   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 set_state (XMLNode * /*node*/, Session & /*session*/) {};
        bool empty () const { return false; }
index 9594485a911c4846e6fd2a47f25dbd336a470865..52ed9769a781cd4e655505297186136f6ec27a1c 100644 (file)
@@ -47,7 +47,7 @@ class ExportFormatSpecification : public ExportFormatBase {
                Time (Session & session) : AnyTime (), session (session) {}
                Time & operator= (AnyTime const & other);
 
-               nframes_t get_frames (nframes_t target_rate) const;
+               framecnt_t get_frames (framecnt_t target_rate) const;
 
                /* Serialization */
 
@@ -123,11 +123,11 @@ class ExportFormatSpecification : public ExportFormatBase {
 
        bool tag () const { return _tag && supports_tagging; }
 
-       nframes_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_beginning () const { return _silence_beginning.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); }
-       nframes_t silence_end (nframes_t samplerate) const { return _silence_end.get_frames (samplerate); }
+       framecnt_t silence_beginning (framecnt_t samplerate) const { return _silence_beginning.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_end_time () const { return _silence_end; }
index 55fa7133fcf2eec476375df22b6035f7b5324e24..1c49eccd9d16f7074d4f6cee5919c5c8b72140e7 100644 (file)
@@ -62,7 +62,7 @@ class ExportGraphBuilder
        ExportGraphBuilder (Session const & session);
        ~ExportGraphBuilder ();
        
-       int process (nframes_t frames, bool last_cycle);
+       int process (framecnt_t frames, bool last_cycle);
        bool process_normalize (); // returns true when finished
        
        void reset ();
@@ -102,7 +102,7 @@ class ExportGraphBuilder
        class SFC {
          public:
                // 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 ();
                void add_child (FileSpec const & new_config);
                bool operator== (FileSpec const & other_config) const;
@@ -124,7 +124,7 @@ class ExportGraphBuilder
        
        class Normalizer {
          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 ();
                void add_child (FileSpec const & new_config);
                bool operator== (FileSpec const & other_config) const;
@@ -144,7 +144,7 @@ class ExportGraphBuilder
                ExportGraphBuilder & parent;
                
                FileSpec        config;
-               nframes_t       max_frames_out;
+               framecnt_t      max_frames_out;
                
                BufferPtr       buffer;
                PeakReaderPtr   peak_reader;
@@ -159,7 +159,7 @@ class ExportGraphBuilder
        // sample rate converter
        class SRC {
          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 ();
                void add_child (FileSpec const & new_config);
                bool operator== (FileSpec const & other_config) const;
@@ -175,13 +175,13 @@ class ExportGraphBuilder
                boost::ptr_list<SFC>  children;
                boost::ptr_list<Normalizer> normalized_children;
                SRConverterPtr        converter;
-               nframes_t             max_frames_out;
+               framecnt_t            max_frames_out;
        };
        
        // Silence trimmer + adder
        class SilenceHandler {
          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 ();
                void add_child (FileSpec const & new_config);
                bool operator== (FileSpec const & other_config) const;
@@ -193,7 +193,7 @@ class ExportGraphBuilder
                FileSpec             config;
                boost::ptr_list<SRC> children;
                SilenceTrimmerPtr    silence_trimmer;
-               nframes_t            max_frames_in;
+               framecnt_t           max_frames_in;
        };
        
        // channel configuration
@@ -210,7 +210,7 @@ class ExportGraphBuilder
                FileSpec                  config;
                boost::ptr_list<SilenceHandler> children;
                InterleaverPtr            interleaver;
-               nframes_t                 max_frames;
+               framecnt_t                max_frames;
        };
 
        Session const & session;
@@ -223,7 +223,7 @@ class ExportGraphBuilder
        ChannelMap channels;
        
        Sample *  process_buffer;
-       nframes_t process_buffer_frames;
+       framecnt_t process_buffer_frames;
        
        std::list<Normalizer *> normalizers;
        
index f826e09bf5f8e48220313e38da8cceea130b900a..dbc8213eed3c134dbf8f988939b8e6c24e26b5d4 100644 (file)
@@ -119,7 +119,7 @@ class ExportHandler : public ExportElementFactory
 
   private:
 
-       int process (nframes_t frames);
+       int process (framecnt_t frames);
        
        Session &          session;
        GraphBuilderPtr    graph_builder;
@@ -132,7 +132,7 @@ class ExportHandler : public ExportElementFactory
        /* Timespan management */
 
        void start_timespan ();
-       int  process_timespan (nframes_t frames);
+       int  process_timespan (framecnt_t frames);
        int  process_normalize ();
        void finish_timespan ();
 
index b8e86d11df85218bd9f557eb7d63f30123591ffd..67ebe2b316328cd76bf878e3f3a27ed2d8c81cf7 100644 (file)
@@ -136,8 +136,8 @@ class ExportProfileManager
        typedef boost::shared_ptr<TimespanState> TimespanStatePtr;
        typedef std::list<TimespanStatePtr> TimespanStateList;
 
-       void set_selection_range (nframes_t start = 0, nframes_t end = 0);
-       std::string set_single_range (nframes_t start, nframes_t end, std::string name);
+       void set_selection_range (framepos_t start = 0, framepos_t end = 0);
+       std::string set_single_range (framepos_t start, framepos_t end, std::string name);
        TimespanStateList const & get_timespans () { return check_list (timespans); }
 
   private:
index 592f36b1a99e1d9b02281d6243b08854f2889351..ba31fd6f6a33b465623da71769def7ae203518db 100644 (file)
@@ -42,7 +42,7 @@ class ExportTimespan
 
   private:
        friend class ExportElementFactory;
-       ExportTimespan (ExportStatusPtr status, nframes_t frame_rate);
+       ExportTimespan (ExportStatusPtr status, framecnt_t frame_rate);
 
   public:
        ~ExportTimespan ();
@@ -53,19 +53,19 @@ class ExportTimespan
        std::string range_id () const { return _range_id; }
        void set_range_id (std::string range_id) { _range_id = range_id; }
 
-       void set_range (nframes_t start, nframes_t end);
-       nframes_t get_length () const { return end_frame - start_frame; }
-       nframes_t get_start () const { return start_frame; }
-       nframes_t get_end () const { return end_frame; }
+       void set_range (framepos_t start, framepos_t end);
+       framecnt_t get_length () const { return end_frame - start_frame; }
+       framepos_t get_start () const { return start_frame; }
+       framepos_t get_end () const { return end_frame; }
 
   private:
 
        ExportStatusPtr status;
 
-       nframes_t      start_frame;
-       nframes_t      end_frame;
-       nframes_t      position;
-       nframes_t      frame_rate;
+       framepos_t      start_frame;
+       framepos_t      end_frame;
+       framepos_t      position;
+       framecnt_t      frame_rate;
 
        std::string _name;
        std::string _range_id;
index 785475444ad1562c29c3f37866f1861a71137593..71706a28370d13c61a0f0085fa3a1aee55ea390b 100644 (file)
@@ -31,10 +31,10 @@ struct Gain : public AutomationList {
     Gain (const Gain&);
     Gain& operator= (const Gain&);
 
-    static void fill_linear_fade_in (Gain& curve, nframes_t frames);
-    static void fill_linear_volume_fade_in (Gain& curve, nframes_t frames);
-    static void fill_linear_fade_out (Gain& curve, nframes_t frames);
-    static void fill_linear_volume_fade_out (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, framecnt_t frames);
+    static void fill_linear_fade_out (Gain& curve, framecnt_t frames);
+    static void fill_linear_volume_fade_out (Gain& curve, framecnt_t frames);
 
 };
 
index bb51c992372ccda528396e7b1cf45678749a3fce..6893c08d9dfd9c30ea5f2874ed65c89a7069fa40 100644 (file)
@@ -71,14 +71,14 @@ class Graph : public SessionHandleRef
        void helper_thread();
        void main_thread();
 
-       int silent_process_routes (nframes_t nframes, framepos_t start_frame, framepos_t end_frame,
-                bool can_record, bool rec_monitors_input, bool& need_butler);
+       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);
 
-       int process_routes (nframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick,
-                bool can_record, bool rec_monitors_input, bool& need_butler);
+       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);
 
-        int routes_no_roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame, 
-                bool non_rt_pending, bool can_record, int declick);
+        int routes_no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, 
+                           bool non_rt_pending, bool can_record, int declick);
 
        void process_one_route (Route * route);
 
@@ -118,7 +118,7 @@ class Graph : public SessionHandleRef
        volatile int _setup_chain;
 
        // parameter caches.
-       nframes_t       _process_nframes;
+       pframes_t       _process_nframes;
        framepos_t      _process_start_frame;
        framepos_t      _process_end_frame;
        bool            _process_can_record;
index c610d546f2574fc55bb4989319b7f6f981fff783..804b0629699acf23e7d4bdb53996eba309610504 100644 (file)
@@ -30,12 +30,12 @@ public:
        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 uint32_t   channels() const = 0;
        virtual framecnt_t length() const = 0;
-       virtual nframes_t  samplerate() const = 0;
-       virtual void       seek (nframes_t pos) = 0;
+       virtual framecnt_t samplerate() const = 0;
+       virtual void       seek (framecnt_t pos) = 0;
        virtual framepos_t natural_position() const = 0;
 
        virtual bool clamped_at_unity () const = 0;
index d05e764592787144cb4118a3d0e13fb5ad6e7b14..41d09b280590f84327b5170201ebe354dbb9781f 100644 (file)
@@ -36,21 +36,21 @@ XMLNode& state(bool full);
        XMLNode& get_state(void);
        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 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();
        void release_buffers();
 
-       static PBD::Signal1<void,nframes_t> CycleStart;
+       static PBD::Signal1<void, pframes_t> CycleStart;
 
   private:
        BufferSet buffers;
        gint user_count; /* atomic */
-       void allocate_buffers (nframes_t);
-       void cycle_start (nframes_t);
+       void allocate_buffers (pframes_t);
+       void cycle_start (pframes_t);
 };
 
 } // namespace ARDOUR
index d2a769982c8ef79d655539036b9c9cb88bdc45a1..903e4673df9a318529bddac890926e6777e220a0 100644 (file)
@@ -39,11 +39,11 @@ class InternalSend : public Send
        XMLNode& get_state(void);
        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 can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
        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; }
        const PBD::ID& target_id() const { return _send_to_id; }
index 21a47cfcdc432f4644bacee5a893189f3905786e..0d79b01d1429bb3539dec0bc04b24268aec14e91 100644 (file)
@@ -39,13 +39,13 @@ class Interpolation {
 };
 
 class LinearInterpolation : public Interpolation {
- public:
-     nframes_t interpolate (int channel, nframes_t nframes, Sample* input, Sample* output);
+public:
+       framecnt_t interpolate (int channel, framecnt_t nframes, Sample* input, Sample* output);
 };
 
 class CubicInterpolation : public Interpolation {
- public:
-     nframes_t interpolate (int channel, nframes_t nframes, Sample* input, Sample* output);
+public:
+       framecnt_t interpolate (int channel, framecnt_t nframes, Sample* input, Sample* output);
 };
 
 } // namespace ARDOUR
index 9d423f55a5aecbf800ef300008325e32efe9e5c7..fd7cb563fd725f1745d4b939ca9cb74b5225abe0 100644 (file)
@@ -89,7 +89,7 @@ class IO : public SessionObject, public Latent
 
        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);
 
@@ -109,9 +109,9 @@ class IO : public SessionObject, public Latent
         bool connected () const;
         bool physically_connected () const;
         
-       nframes_t signal_latency() const { return _own_latency; }
-       nframes_t latency() const;
-       void      set_port_latency (nframes_t);
+       framecnt_t signal_latency () const { return _own_latency; }
+       framecnt_t latency () const;
+       void set_port_latency (framecnt_t);
 
        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 */
 
-       void collect_input (BufferSet& bufs, nframes_t nframes, ChanCount offset);
-       void process_input (boost::shared_ptr<Processor>, framepos_t start_frame, framepos_t end_frame, nframes_t nframes);
-       void copy_to_outputs (BufferSet& bufs, DataType type, nframes_t nframes, nframes_t 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, pframes_t nframes);
+       void copy_to_outputs (BufferSet& bufs, DataType type, pframes_t nframes, framecnt_t offset);
 
        /* AudioTrack::deprecated_use_diskstream_connections() needs these */
 
index 7d1854ced085128a96f44a39039ffb443830bfb9..cb80b74351b60af7ad8f89aa0d6850529ae34b42 100644 (file)
@@ -62,7 +62,7 @@ class IOProcessor : public Processor
        void set_input (boost::shared_ptr<IO>);
        void set_output (boost::shared_ptr<IO>);
 
-       void silence (nframes_t nframes);
+       void silence (framecnt_t nframes);
        void disconnect ();
 
        virtual bool feeds (boost::shared_ptr<Route> other) const;
index f4da2bf0a008989c91b428a0ea01afcadabe0531..968342a909c18f86fabea17ee292561d145f9b14 100644 (file)
@@ -39,7 +39,7 @@ class Session;
 class LadspaPlugin : public ARDOUR::Plugin
 {
   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 ();
 
@@ -51,7 +51,7 @@ class LadspaPlugin : public ARDOUR::Plugin
        const char* maker() const           { return _descriptor->Maker; }
        uint32_t    parameter_count() const { return _descriptor->PortCount; }
        float       default_value (uint32_t port);
-       nframes_t   signal_latency() const;
+       framecnt_t  signal_latency() const;
        void        set_parameter (uint32_t port, float val);
        float       get_parameter (uint32_t port) const;
        int         get_parameter_descriptor (uint32_t which, ParameterDescriptor&) const;
@@ -81,11 +81,11 @@ class LadspaPlugin : public ARDOUR::Plugin
                        _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,
                        ChanMapping in, ChanMapping out,
-                       nframes_t nframes, nframes_t offset);
+                       pframes_t nframes, framecnt_t offset);
 
        std::string describe_parameter (Evoral::Parameter);
        std::string state_node_name() const { return "ladspa"; }
@@ -122,15 +122,15 @@ class LadspaPlugin : public ARDOUR::Plugin
        void*                    _module;
        const LADSPA_Descriptor* _descriptor;
        LADSPA_Handle            _handle;
-       nframes_t                _sample_rate;
+       framecnt_t               _sample_rate;
        LADSPA_Data*             _control_data;
        LADSPA_Data*             _shadow_data;
        LADSPA_Data*             _latency_control_port;
        uint32_t                 _index;
        bool                     _was_activated;
 
-       void init (void *mod, uint32_t index, nframes_t rate);
-       void run_in_place (nframes_t nsamples);
+       void init (void *mod, uint32_t index, framecnt_t rate);
+       void run_in_place (pframes_t nsamples);
        void latency_compute_run ();
        int set_state_2X (const XMLNode&, int version);
 };
index d1e62aaf45149d12ed72a383d088dfbbc9d93580..ba2f91d2a28ec4f7ca7a50eb36b0f424a29c2515 100644 (file)
@@ -10,10 +10,10 @@ class Latent {
        Latent() : _own_latency (0), _user_latency (0) {}
        virtual ~Latent() {}
 
-       virtual nframes_t signal_latency() const = 0;
-       nframes_t user_latency () const { return _user_latency; }
+       virtual framecnt_t signal_latency() const = 0;
+       framecnt_t user_latency () const { return _user_latency; }
 
-       nframes_t effective_latency() const {
+       framecnt_t effective_latency() const {
                if (_user_latency) {
                        return _user_latency;
                } else {
@@ -21,12 +21,12 @@ class Latent {
                }
        }
 
-       virtual void set_latency_delay (nframes_t val) { _own_latency = val; }
-       virtual void set_user_latency (nframes_t val) { _user_latency = val; }
+       virtual void set_latency_delay (framecnt_t val) { _own_latency = val; }
+       virtual void set_user_latency (framecnt_t val) { _user_latency = val; }
 
   protected:
-       nframes_t           _own_latency;
-       nframes_t           _user_latency;
+       framecnt_t           _own_latency;
+       framecnt_t           _user_latency;
 };
 
 }
index 0c8b3e511c6c82249def4acc6a6f11ff702e4541..821922903bc2f7744710678aa2d42dfeabd33927 100644 (file)
@@ -41,7 +41,7 @@ struct LV2World;
 class LV2Plugin : public ARDOUR::Plugin
 {
   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 ();
 
@@ -53,7 +53,7 @@ class LV2Plugin : public ARDOUR::Plugin
        const char* maker() const           { return _author ? slv2_value_as_string(_author) : "Unknown"; }
        uint32_t    parameter_count() const { return slv2_plugin_get_num_ports(_plugin); }
        float       default_value (uint32_t port);
-       nframes_t   signal_latency() const;
+       framecnt_t  signal_latency () const;
        void        set_parameter (uint32_t port, float val);
        float       get_parameter (uint32_t port) const;
        int         get_parameter_descriptor (uint32_t which, ParameterDescriptor&) const;
@@ -93,11 +93,11 @@ class LV2Plugin : public ARDOUR::Plugin
                _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,
                        ChanMapping in, ChanMapping out,
-                       nframes_t nframes, nframes_t offset);
+                       pframes_t nframes, framecnt_t offset);
 
        std::string describe_parameter (Evoral::Parameter);
        std::string state_node_name() const { return "lv2"; }
@@ -129,7 +129,7 @@ class LV2Plugin : public ARDOUR::Plugin
        SLV2Value         _name;
        SLV2Value         _author;
        SLV2Instance      _instance;
-       nframes_t         _sample_rate;
+       framecnt_t        _sample_rate;
        float*            _control_data;
        float*            _shadow_data;
        float*            _defaults;
@@ -149,8 +149,8 @@ class LV2Plugin : public ARDOUR::Plugin
        static URIMap   _uri_map;
        static uint32_t _midi_event_type;
 
-       void init (LV2World& world, SLV2Plugin plugin, nframes_t rate);
-       void run (nframes_t nsamples);
+       void init (LV2World& world, SLV2Plugin plugin, framecnt_t rate);
+       void run (pframes_t nsamples);
        void latency_compute_run ();
 };
 
index dad86d518572d0b2937e678eb8437034ad8857e2..7ff910a91b024b63f5c29d93e70859df2f61f157 100644 (file)
@@ -68,7 +68,7 @@ public:
        void reflect_inputs (const ChanCount& in);
 
        /** 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 output_streams () const { return current_meters; }
index b3ed093df75b592c803b59e6aaff24bd342612dc..18a95e934707f327208af0c008debd29ce697646 100644 (file)
@@ -32,14 +32,14 @@ namespace ARDOUR {
 class MidiBuffer : public Buffer
 {
 public:
-       typedef nframes_t TimeType;
+       typedef framepos_t TimeType;
 
        MidiBuffer(size_t capacity);
        ~MidiBuffer();
 
-       void silence (nframes_t nframes, nframes_t offset = 0);
-       void read_from (const Buffer& src, nframes_t nframes, nframes_t dst_offset = 0, nframes_t src_offset = 0);
-       void merge_from (const Buffer& src, nframes_t nframes, nframes_t dst_offset = 0, nframes_t src_offset = 0);
+       void silence (framecnt_t nframes, framecnt_t 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, framecnt_t nframes, framecnt_t dst_offset = 0, framecnt_t src_offset = 0);
 
        void copy(const MidiBuffer& copy);
 
@@ -55,7 +55,7 @@ public:
 
        template<typename BufferType, typename EventType>
        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 {
                        uint8_t* ev_start = buffer._data + offset + sizeof(TimeType);
                        int event_size = Evoral::midi_event_size(ev_start);
index 126857a858e1d0f67a245059694d68340e278e33..aea60dc3bfdb1857045d7fae30ee962e42be6215 100644 (file)
@@ -124,7 +124,7 @@ class MidiDiskstream : public Diskstream
 
        void set_pending_overwrite(bool);
        int  overwrite_existing_buffers ();
-       void set_block_size (nframes_t);
+       void set_block_size (pframes_t);
        int  internal_playback_seek (framecnt_t distance);
        int  can_internal_playback_seek (framecnt_t distance);
        int  rename_write_sources ();
@@ -133,7 +133,7 @@ class MidiDiskstream : public Diskstream
        void non_realtime_input_change ();
        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:
        int seek (framepos_t which_sample, bool complete_refill = false);
@@ -141,9 +141,9 @@ class MidiDiskstream : public Diskstream
   protected:
        friend class MidiTrack;
 
-       int  process (framepos_t transport_frame, nframes_t nframes, bool can_record, bool rec_monitors_input, bool& need_butler);
-       bool commit  (nframes_t nframes);
-       static nframes_t midi_readahead;
+       int  process (framepos_t transport_frame, pframes_t nframes, bool can_record, bool rec_monitors_input, bool& need_butler);
+       bool commit  (framecnt_t nframes);
+       static framecnt_t midi_readahead;
 
   private:
 
@@ -153,7 +153,7 @@ class MidiDiskstream : public Diskstream
 
        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 transport_stopped_wallclock (struct tm&, time_t, bool abort);
@@ -181,11 +181,11 @@ class MidiDiskstream : public Diskstream
        void engage_record_enable ();
        void disengage_record_enable ();
 
-       MidiRingBuffer<nframes_t>*   _playback_buf;
-       MidiRingBuffer<nframes_t>*   _capture_buf;
+       MidiRingBuffer<framepos_t>*  _playback_buf;
+       MidiRingBuffer<framepos_t>*  _capture_buf;
        MidiPort*                    _source_port;
        boost::shared_ptr<SMFSource> _write_source;
-       nframes_t                    _last_flush_frame;
+       framepos_t                   _last_flush_frame;
        NoteMode                     _note_mode;
        volatile gint                _frames_written_to_ringbuffer;
        volatile gint                _frames_read_from_ringbuffer;
index ccadb39e92ee4c8db6e8813050c2561388807b33..6170e9271f731f3364119c8561a3862793cc08ed 100644 (file)
@@ -43,13 +43,13 @@ public:
        MidiPlaylist (Session&, const XMLNode&, bool hidden = false);
        MidiPlaylist (Session&, std::string name, bool hidden = false);
        MidiPlaylist (boost::shared_ptr<const MidiPlaylist> other, std::string name, bool hidden = false);
-       MidiPlaylist (boost::shared_ptr<const MidiPlaylist> other, nframes_t start, nframes_t cnt,
+       MidiPlaylist (boost::shared_ptr<const MidiPlaylist> other, framepos_t start, framecnt_t cnt,
                      std::string name, bool hidden = false);
 
        ~MidiPlaylist ();
 
-       nframes_t read (MidiRingBuffer<nframes_t>& buf,
-                       nframes_t start, nframes_t cnt, uint32_t chan_n=0);
+       framecnt_t read (MidiRingBuffer<framepos_t>& buf,
+                        framepos_t start, framecnt_t cnt, uint32_t chan_n = 0);
 
        int set_state (const XMLNode&, int version);
 
index 8b6095c47075355849badb5eaf6cbd6e8907d134..7a019e5a203c7af23ffb05e8d5cac51c12b293f2 100644 (file)
@@ -37,20 +37,20 @@ class MidiPort : public Port {
                return DataType::MIDI;
        }
 
-       void cycle_start (nframes_t nframes);
-       void cycle_end (nframes_t nframes);
+       void cycle_start (pframes_t nframes);
+       void cycle_end (pframes_t nframes);
        void cycle_split ();
 
-       void flush_buffers (nframes_t nframes, framepos_t time, nframes_t offset = 0);
+       void flush_buffers (pframes_t nframes, framepos_t time, framecnt_t offset = 0);
        void transport_stopped ();
 
-       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_midi_buffer (nframes, offset);
        }
 
-       MidiBuffer& get_midi_buffer (nframes_t nframes, nframes_t offset = 0);
+       MidiBuffer& get_midi_buffer (framecnt_t nframes, framecnt_t offset = 0);
 
   protected:
        friend class AudioEngine;
index dbbf6d80d19e187f3a95b11725b12d5bdd653a0b..853272d3499c309aa0c31e855377ff1f44e18340 100644 (file)
@@ -70,14 +70,14 @@ class MidiRegion : public Region
        virtual framecnt_t read (Sample*, framepos_t /*pos*/, framecnt_t /*cnt*/, int /*channel*/) const { return 0; }
        virtual framecnt_t readable_length() const { return length(); }
 
-       framecnt_t read_at (Evoral::EventSink<nframes_t>& dst,
+       framecnt_t read_at (Evoral::EventSink<framepos_t>& dst,
                            framepos_t position,
                            framecnt_t dur,
                            uint32_t  chan_n = 0,
                            NoteMode  mode = Sustained,
                            MidiStateTracker* tracker = 0) const;
        
-       framepos_t master_read_at (MidiRingBuffer<nframes_t>& dst,
+       framepos_t master_read_at (MidiRingBuffer<framepos_t>& dst,
                                   framepos_t position,
                                   framecnt_t dur,
                                   uint32_t  chan_n = 0,
@@ -114,7 +114,7 @@ class MidiRegion : public Region
        MidiRegion (boost::shared_ptr<const MidiRegion>, frameoffset_t offset = 0, bool offset_relative = true);
 
   private:
-       framecnt_t _read_at (const SourceList&, Evoral::EventSink<nframes_t>& dst,
+       framecnt_t _read_at (const SourceList&, Evoral::EventSink<framepos_t>& dst,
                             framepos_t position,
                             framecnt_t dur,
                             uint32_t chan_n = 0,
index 2de611f4d636a0fc02d477caa9ad61cc781ae686..a809226a30addd9bebb170ac28c467af588d53b1 100644 (file)
@@ -50,7 +50,7 @@ public:
        inline bool read_prefix(T* time, Evoral::EventType* type, uint32_t* size);
        inline bool read_contents(uint32_t size, uint8_t* buf);
 
-       size_t read(MidiBuffer& dst, nframes_t start, nframes_t end, nframes_t offset=0);
+       size_t read(MidiBuffer& dst, framepos_t start, framepos_t end, framecnt_t offset=0);
        void dump(std::ostream& dst);
 
        /** Set the channel filtering mode.
index 0c2759b96d667222f1d4526faa9ff015dfa67bae..e40ccff291b34aa8438d04e9b4627a60562c5270 100644 (file)
@@ -58,19 +58,19 @@ class MidiSource : virtual public Source
         * \param cnt Length of range to be read (in audio frames)
         * \param tracker an optional pointer to MidiStateTracker object, for note on/off tracking
         */
-       virtual nframes_t midi_read (Evoral::EventSink<nframes_t>& dst,
-                                    framepos_t source_start,
-                                    framepos_t start, nframes_t cnt,
-                                    MidiStateTracker*,
-                                    std::set<Evoral::Parameter> const &) const;
+       virtual framecnt_t midi_read (Evoral::EventSink<framepos_t>& dst,
+                                     framepos_t source_start,
+                                     framepos_t start, framecnt_t cnt,
+                                     MidiStateTracker*,
+                                     std::set<Evoral::Parameter> const &) const;
 
-       virtual nframes_t midi_write (MidiRingBuffer<nframes_t>& src,
-                                     framepos_t source_start,
-                                     nframes_t cnt);
+       virtual framecnt_t midi_write (MidiRingBuffer<framepos_t>& src,
+                                      framepos_t source_start,
+                                      framecnt_t cnt);
 
        virtual void append_event_unlocked_beats(const Evoral::Event<Evoral::MusicalTime>& ev) = 0;
 
-       virtual void append_event_unlocked_frames(const Evoral::Event<nframes_t>& ev,
+       virtual void append_event_unlocked_frames(const Evoral::Event<framepos_t>& ev,
                        framepos_t source_start) = 0;
 
        virtual bool       empty () const;
@@ -130,14 +130,14 @@ class MidiSource : virtual public Source
   protected:
        virtual void flush_midi() = 0;
 
-       virtual nframes_t read_unlocked (Evoral::EventSink<nframes_t>& dst,
-                                        framepos_t position,
-                                        framepos_t start, nframes_t cnt,
-                                        MidiStateTracker* tracker) const = 0;
+       virtual framepos_t read_unlocked (Evoral::EventSink<framepos_t>& dst,
+                                         framepos_t position,
+                                         framepos_t start, framecnt_t cnt,
+                                         MidiStateTracker* tracker) const = 0;
 
-       virtual nframes_t write_unlocked (MidiRingBuffer<nframes_t>& dst,
-                       framepos_t position,
-                       nframes_t cnt) = 0;
+       virtual framepos_t write_unlocked (MidiRingBuffer<framepos_t>& dst,
+                                          framepos_t position,
+                                          framecnt_t cnt) = 0;
 
        std::string      _captured_for;
        mutable uint32_t _read_data_count;  ///< modified in read()
index 9720649a1086c5e5b60a5aceadc3db8daa1d0fd8..f6acb88f238428812849fe13fe904156a8275024 100644 (file)
@@ -42,7 +42,7 @@ public:
        void add (uint8_t note, uint8_t chn);
        void remove (uint8_t note, uint8_t chn);
        void resolve_notes (MidiBuffer& buffer, framepos_t time);
-       void resolve_notes (Evoral::EventSink<nframes_t>& buffer, framepos_t time);
+       void resolve_notes (Evoral::EventSink<framepos_t>& buffer, framepos_t time);
        void resolve_notes (MidiSource& src, Evoral::MusicalTime time);
        void dump (std::ostream&);
        void reset ();
index 91ccc4b1fe0f5f63645679c61e4e690616b01795..554f5b3385ab7d842db89a0e2e2d71de98c2516b 100644 (file)
@@ -39,7 +39,7 @@ public:
        MidiTrack (Session&, string name, Route::Flag f = Route::Flag (0), TrackMode m = Normal);
        ~MidiTrack ();
 
-       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);
 
        void handle_transport_stopped (bool abort, bool did_locate, bool flush_processors);
@@ -52,16 +52,17 @@ public:
                return DataType::MIDI;
        }
 
-       void set_latency_delay (nframes_t);
+       void set_latency_delay (framecnt_t);
 
-       int export_stuff (BufferSet& bufs, nframes_t nframes, framepos_t end_frame);
+       int export_stuff (BufferSet& bufs, framecnt_t nframes, framepos_t end_frame);
 
        void freeze_me (InterThreadInfo&);
        void unfreeze ();
         
        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);
 
@@ -86,7 +87,7 @@ public:
 
        bool step_editing() const { return _step_editing; }
        void set_step_editing (bool yn);
-       MidiRingBuffer<nframes_t>& step_edit_ring_buffer() { return _step_edit_ring_buffer; }
+       MidiRingBuffer<framepos_t>& step_edit_ring_buffer() { return _step_edit_ring_buffer; }
 
         PBD::Signal1<void,bool> StepEditStatusChange;
 
@@ -112,21 +113,21 @@ protected:
 private:
        boost::shared_ptr<MidiDiskstream> midi_diskstream () const;
 
-       void write_out_of_band_data (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, nframes_t nframes);
+       void write_out_of_band_data (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, framecnt_t nframes);
 
        void set_state_part_two ();
        void set_state_part_three ();
 
-       MidiRingBuffer<nframes_t> _immediate_events;
-       MidiRingBuffer<nframes_t> _step_edit_ring_buffer;
+       MidiRingBuffer<framepos_t> _immediate_events;
+       MidiRingBuffer<framepos_t> _step_edit_ring_buffer;
        NoteMode                  _note_mode;
        bool                      _step_editing;
        uint8_t                   _default_channel;
        bool                      _midi_thru;
 
-       int no_roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame,
+       int no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
                        bool state_changing, bool can_record, bool rec_monitors_input);
-       void push_midi_input_to_step_edit_ringbuffer (nframes_t nframes);
+       void push_midi_input_to_step_edit_ringbuffer (framecnt_t nframes);
 
        void diskstream_data_recorded (boost::shared_ptr<MidiBuffer>, boost::weak_ptr<MidiSource>);
        PBD::ScopedConnection _diskstream_data_recorded_connection;
index 72b414d09c34051dd429dd59ab457545140c5f92..2118b819b51ea797d5b1f3a647d67319b36930c2 100644 (file)
 
 extern "C" {
 /* SSE functions */
-    float x86_sse_compute_peak         (const ARDOUR::Sample * buf, ARDOUR::nframes_t nsamples, float current);
-    void  x86_sse_apply_gain_to_buffer (ARDOUR::Sample * buf, ARDOUR::nframes_t nframes, float gain);
-    void  x86_sse_mix_buffers_with_gain(ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::nframes_t nframes, float gain);
-    void  x86_sse_mix_buffers_no_gain  (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::nframes_t nframes);
+    float x86_sse_compute_peak         (const ARDOUR::Sample * buf, ARDOUR::pframes_t nsamples, float current);
+    void  x86_sse_apply_gain_to_buffer (ARDOUR::Sample * buf, ARDOUR::pframes_t nframes, float gain);
+    void  x86_sse_mix_buffers_with_gain(ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::pframes_t nframes, float gain);
+    void  x86_sse_mix_buffers_no_gain  (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::pframes_t nframes);
 }
 
-void  x86_sse_find_peaks               (const ARDOUR::Sample * buf, ARDOUR::nframes_t nsamples, float *min, float *max);
+void  x86_sse_find_peaks               (const ARDOUR::Sample * buf, ARDOUR::pframes_t nsamples, float *min, float *max);
 
 /* debug wrappers for SSE functions */
 
-float debug_compute_peak               (const ARDOUR::Sample * buf, ARDOUR::nframes_t nsamples, float current);
-void  debug_apply_gain_to_buffer       (ARDOUR::Sample * buf, ARDOUR::nframes_t nframes, float gain);
-void  debug_mix_buffers_with_gain      (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::nframes_t nframes, float gain);
-void  debug_mix_buffers_no_gain        (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::nframes_t nframes);
+float debug_compute_peak               (const ARDOUR::Sample * buf, ARDOUR::pframes_t nsamples, float current);
+void  debug_apply_gain_to_buffer       (ARDOUR::Sample * buf, ARDOUR::pframes_t nframes, float gain);
+void  debug_mix_buffers_with_gain      (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::pframes_t nframes, float gain);
+void  debug_mix_buffers_no_gain        (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::pframes_t nframes);
 
 #endif
 
 #if defined (__APPLE__)
 
-float veclib_compute_peak              (const ARDOUR::Sample * buf, ARDOUR::nframes_t nsamples, float current);
-void veclib_find_peaks                 (const ARDOUR::Sample * buf, ARDOUR::nframes_t nsamples, float *min, float *max);
-void  veclib_apply_gain_to_buffer      (ARDOUR::Sample * buf, ARDOUR::nframes_t nframes, float gain);
-void  veclib_mix_buffers_with_gain     (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::nframes_t nframes, float gain);
-void  veclib_mix_buffers_no_gain       (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::nframes_t nframes);
+float veclib_compute_peak              (const ARDOUR::Sample * buf, ARDOUR::pframes_t nsamples, float current);
+void veclib_find_peaks                 (const ARDOUR::Sample * buf, ARDOUR::pframes_t nsamples, float *min, float *max);
+void  veclib_apply_gain_to_buffer      (ARDOUR::Sample * buf, ARDOUR::pframes_t nframes, float gain);
+void  veclib_mix_buffers_with_gain     (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::pframes_t nframes, float gain);
+void  veclib_mix_buffers_no_gain       (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::pframes_t nframes);
 
 #endif
 
 /* non-optimized functions */
 
-float default_compute_peak              (const ARDOUR::Sample * buf, ARDOUR::nframes_t nsamples, float current);
-void  default_find_peaks                (const ARDOUR::Sample * buf, ARDOUR::nframes_t nsamples, float *min, float *max);
-void  default_apply_gain_to_buffer      (ARDOUR::Sample * buf, ARDOUR::nframes_t nframes, float gain);
-void  default_mix_buffers_with_gain     (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::nframes_t nframes, float gain);
-void  default_mix_buffers_no_gain       (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::nframes_t nframes);
+float default_compute_peak              (const ARDOUR::Sample * buf, ARDOUR::pframes_t nsamples, float current);
+void  default_find_peaks                (const ARDOUR::Sample * buf, ARDOUR::pframes_t nsamples, float *min, float *max);
+void  default_apply_gain_to_buffer      (ARDOUR::Sample * buf, ARDOUR::pframes_t nframes, float gain);
+void  default_mix_buffers_with_gain     (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::pframes_t nframes, float gain);
+void  default_mix_buffers_no_gain       (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::pframes_t nframes);
 
 #endif /* __ardour_mix_h__ */
index 0f23d7029fc91c1c5a1fd221f267369bfa6e149b..f8675bde2e521021db900a1b6b9853a0a7311746 100644 (file)
@@ -110,7 +110,7 @@ class MonitorProcessor : public Processor
 
         bool display_to_user() const;
 
-       void run (BufferSet& /*bufs*/, framepos_t /*start_frame*/, framepos_t /*end_frame*/, nframes_t /*nframes*/, bool /*result_required*/);
+       void run (BufferSet& /*bufs*/, framepos_t /*start_frame*/, framepos_t /*end_frame*/, pframes_t /*nframes*/, bool /*result_required*/);
 
         XMLNode& state (bool full);
         int set_state (const XMLNode&, int /* version */);
index 3bfe2cf713a116e3b6bc72556091c11ed31f3bcb..4550aab5a52cc572f2c30de94c1145ed63a37d87 100644 (file)
@@ -56,8 +56,8 @@ class StreamPanner : public PBD::Stateful
        void set_position (const PBD::AngularVector&, bool link_call = false);
        void set_diffusion (double);
 
-       void distribute (AudioBuffer &, BufferSet &, gain_t, nframes_t);
-       void distribute_automated (AudioBuffer &, BufferSet &, nframes_t, nframes_t, nframes_t, pan_t **);
+       void distribute (AudioBuffer &, BufferSet &, gain_t, pframes_t);
+       void distribute_automated (AudioBuffer &, BufferSet &, framepos_t, framepos_t, pframes_t, pan_t **);
 
        /* the basic StreamPanner API */
 
@@ -69,9 +69,9 @@ class StreamPanner : public PBD::Stateful
         *  @param gain_coeff Gain coefficient to apply to output samples.
         *  @param nframes Number of frames in the input.
         */
-       virtual void do_distribute (AudioBuffer& src, BufferSet& obufs, gain_t gain_coeff, nframes_t nframes) = 0;
+       virtual void do_distribute (AudioBuffer& src, BufferSet& obufs, gain_t gain_coeff, pframes_t nframes) = 0;
        virtual void do_distribute_automated (AudioBuffer& src, BufferSet& obufs,
-                                             nframes_t start, nframes_t end, nframes_t nframes,
+                                             framepos_t start, framepos_t end, pframes_t nframes,
                                              pan_t** buffers) = 0;
 
        boost::shared_ptr<AutomationControl> pan_control()  { return _control; }
@@ -135,7 +135,7 @@ class BaseStereoPanner : public StreamPanner
           and a type name. See EqualPowerStereoPanner as an example.
        */
 
-       void do_distribute (AudioBuffer& src, BufferSet& obufs, gain_t gain_coeff, nframes_t nframes);
+       void do_distribute (AudioBuffer& src, BufferSet& obufs, gain_t gain_coeff, pframes_t nframes);
 
        static double azimuth_to_lr_fract (double azi) { 
                /* 180.0 degrees=> left => 0.0 */
@@ -169,7 +169,7 @@ class EqualPowerStereoPanner : public BaseStereoPanner
        ~EqualPowerStereoPanner ();
 
        void do_distribute_automated (AudioBuffer& src, BufferSet& obufs,
-                                     nframes_t start, nframes_t end, nframes_t nframes,
+                                     framepos_t start, framepos_t end, pframes_t nframes,
                                      pan_t** buffers);
 
        void get_current_coefficients (pan_t*) const;
@@ -219,7 +219,7 @@ public:
        bool can_support_io_configuration (const ChanCount& /*in*/, ChanCount& /*out*/) const { return true; };
 
        /// The fundamental Panner function
-       void run (BufferSet& src, BufferSet& dest, framepos_t start_frame, framepos_t end_frames, nframes_t nframes);
+       void run (BufferSet& src, BufferSet& dest, framepos_t start_frame, framepos_t end_frames, pframes_t nframes);
 
        bool bypassed() const { return _bypassed; }
        void set_bypassed (bool yn);
@@ -300,7 +300,7 @@ public:
        /* disallow copy construction */
        Panner (Panner const &);
 
-       void distribute_no_automation(BufferSet& src, BufferSet& dest, nframes_t nframes, gain_t gain_coeff);
+       void distribute_no_automation(BufferSet& src, BufferSet& dest, pframes_t nframes, gain_t gain_coeff);
        std::vector<StreamPanner*> _streampanners; ///< one StreamPanner per input
        std::vector<Output> outputs;
        uint32_t     current_outs;
index 2283f5011899912407f08ca084515260899f9211..ab99889dd3dd0c4cf43fc5de1ec6c88de3c64d27 100644 (file)
@@ -25,9 +25,9 @@
 #include "ardour/utils.h"
 
 static inline float
-default_compute_peak (const ARDOUR::Sample * const buf, ARDOUR::nframes_t nsamples, float current)
+default_compute_peak (const ARDOUR::Sample * const buf, ARDOUR::pframes_t nsamples, float current)
 {
-       for (ARDOUR::nframes_t i = 0; i < nsamples; ++i) {
+       for (ARDOUR::pframes_t i = 0; i < nsamples; ++i) {
                current = f_max (current, fabsf (buf[i]));
        }
        return current;
index 17645ad8a3bbd699a2b174da3079b4e08b434684..8b5d9d6a23f4943a77d187750444778d11552b41 100644 (file)
@@ -36,7 +36,7 @@ class PlaylistFactory {
        static boost::shared_ptr<Playlist> create (Session&, const XMLNode&, bool hidden = false, bool unused = false);
        static boost::shared_ptr<Playlist> create (DataType type, Session&, std::string name, bool hidden = false);
        static boost::shared_ptr<Playlist> create (boost::shared_ptr<const Playlist>, std::string name, bool hidden = false);
-       static boost::shared_ptr<Playlist> create (boost::shared_ptr<const Playlist>, nframes_t start, nframes_t cnt, std::string name, bool hidden = false);
+       static boost::shared_ptr<Playlist> create (boost::shared_ptr<const Playlist>, framepos_t start, framecnt_t cnt, std::string name, bool hidden = false);
 };
 
 }
index 3d7c8d9c335c440da466b2ca7b0cc14677468303..bab2b71f31d67dc8471fcf8785c9af24124ef1cb 100644 (file)
@@ -112,11 +112,11 @@ class Plugin : public PBD::StatefulDestructible, public Latent
        virtual void deactivate () = 0;
         virtual void flush () { deactivate(); activate(); }
 
-       virtual int set_block_size (nframes_t nframes) = 0;
+       virtual int set_block_size (pframes_t nframes) = 0;
 
        virtual int connect_and_run (BufferSet& bufs,
                        ChanMapping in, ChanMapping out,
-                       nframes_t nframes, nframes_t offset) = 0;
+                       pframes_t nframes, framecnt_t offset) = 0;
 
        virtual std::set<Evoral::Parameter> automatable() const = 0;
        virtual std::string describe_parameter (Evoral::Parameter) = 0;
index 9b65ba41f5acab25900729c6ff902fd4bab7faed..e4a42d8165414d207596c5740cf3a66e09b4b555 100644 (file)
@@ -52,14 +52,14 @@ class PluginInsert : public Processor
        XMLNode& get_state(void);
        int set_state(const XMLNode&, int version);
 
-       void run (BufferSet& in, framepos_t start_frame, framepos_t end_frame, nframes_t nframes, bool);
-       void silence (nframes_t nframes);
+       void run (BufferSet& in, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool);
+       void silence (framecnt_t nframes);
 
        void activate ();
        void deactivate ();
         void flush ();
 
-       int set_block_size (nframes_t nframes);
+       int set_block_size (pframes_t nframes);
 
        ChanCount output_streams() const;
        ChanCount input_streams() const;
@@ -101,11 +101,11 @@ class PluginInsert : public Processor
 
        std::string describe_parameter (Evoral::Parameter param);
 
-       nframes_t signal_latency() const;
+       framecnt_t signal_latency () const;
 
        boost::shared_ptr<Plugin> get_impulse_analysis_plugin();
 
-       void collect_signal_for_analysis(nframes_t nframes);
+       void collect_signal_for_analysis (framecnt_t nframes);
 
        PBD::Signal2<void,BufferSet*, BufferSet*> AnalysisDataGathered;
 
@@ -125,14 +125,14 @@ class PluginInsert : public Processor
 
        boost::weak_ptr<Plugin> _impulseAnalysisPlugin;
 
-       nframes_t _signal_analysis_collected_nframes;
-       nframes_t _signal_analysis_collect_nframes_max;
+       framecnt_t _signal_analysis_collected_nframes;
+       framecnt_t _signal_analysis_collect_nframes_max;
 
        BufferSet _signal_analysis_inputs;
        BufferSet _signal_analysis_outputs;
 
-       void automation_run (BufferSet& bufs, nframes_t nframes);
-       void connect_and_run (BufferSet& bufs, nframes_t nframes, nframes_t offset, bool with_auto, nframes_t now = 0);
+       void automation_run (BufferSet& bufs, pframes_t nframes);
+       void connect_and_run (BufferSet& bufs, pframes_t nframes, framecnt_t offset, bool with_auto, framepos_t now = 0);
 
        void set_automatable ();
        void control_list_automation_state_changed (Evoral::Parameter, AutoState);
index 23b42a55eaaa848a0aa51ef611e482ebb513a83e..ffdc1d47217db070d733d4468d8f93e053fbf925 100644 (file)
@@ -45,7 +45,7 @@ public:
 
        virtual ~Port ();
 
-       static void set_buffer_size (nframes_t sz) {
+       static void set_buffer_size (pframes_t sz) {
                _buffer_size = sz;
        }
        static void set_connecting_blocked( bool yn ) { 
@@ -93,24 +93,24 @@ public:
 
        void ensure_monitor_input (bool);
        bool monitoring_input () const;
-       nframes_t total_latency () const;
+       framecnt_t total_latency () const;
        int reestablish ();
        int reconnect ();
        void request_monitor_input (bool);
-       void set_latency (nframes_t);
+       void set_latency (framecnt_t);
 
        virtual void reset ();
 
        /** @return the size of the raw buffer (bytes) for duration @a nframes (audio frames) */
-       virtual size_t raw_buffer_size(jack_nframes_t nframes) const = 0;
+       virtual size_t raw_buffer_size (pframes_t nframes) const = 0;
 
        virtual DataType type () const = 0;
-       virtual void cycle_start (nframes_t) = 0;
-       virtual void cycle_end (nframes_t) = 0;
+       virtual void cycle_start (pframes_t) = 0;
+       virtual void cycle_end (pframes_t) = 0;
        virtual void cycle_split () = 0;
-       virtual Buffer& get_buffer (nframes_t nframes, nframes_t offset = 0) = 0;
-       virtual void flush_buffers (nframes_t nframes, framepos_t /*time*/, nframes_t offset = 0) {
-               assert(offset < nframes);
+       virtual Buffer& get_buffer (framecnt_t nframes, framecnt_t offset = 0) = 0;
+       virtual void flush_buffers (pframes_t nframes, framepos_t /*time*/, framecnt_t offset = 0) {
+               assert (offset < nframes);
        }
        virtual void transport_stopped () {}
 
@@ -126,8 +126,8 @@ protected:
 
        jack_port_t* _jack_port; ///< JACK port
 
-       static nframes_t _buffer_size;
-       static bool      _connecting_blocked;
+       static pframes_t  _buffer_size;
+       static bool       _connecting_blocked;
         
        static AudioEngine* _engine; ///< the AudioEngine
 
index f4e20a8045f687fce39f84824ddbd2e02eb2aa05..d460aa55461d0f2b0024afb47609265a3759a679 100644 (file)
@@ -50,9 +50,9 @@ class PortInsert : public IOProcessor
        XMLNode& get_state(void);
        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);
 
-       nframes_t signal_latency() const;
+       framecnt_t signal_latency () const;
 
        bool set_name (const std::string& name);
 
@@ -68,8 +68,8 @@ class PortInsert : public IOProcessor
         void stop_latency_detection ();
 
         MTDM* mtdm () const { return _mtdm; }
-        void set_measured_latency (nframes_t);
-        nframes_t latency() const;
+        void set_measured_latency (framecnt_t);
+        framecnt_t latency () const;
 
   private:
        /* disallow copy construction */
@@ -77,11 +77,12 @@ class PortInsert : public IOProcessor
 
        boost::shared_ptr<Delivery> _out;
 
-       uint32_t bitslot;
-        MTDM*     _mtdm;
-        bool      _latency_detect;
-        nframes_t _latency_flush_frames;
-        nframes_t _measured_latency;};
+       uint32_t    bitslot;
+        MTDM*      _mtdm;
+        bool       _latency_detect;
+        framecnt_t _latency_flush_frames;
+        framecnt_t _measured_latency;
+};
 
 } // namespace ARDOUR
 
index 09505e3f7245aae7b25efe1e3aaf2eba2dda7ef1..182208e5608cf455bcfbfe145fef1e5727feef76 100644 (file)
@@ -61,16 +61,16 @@ class Processor : public SessionObject, public Automatable, public Latent
        bool get_next_ab_is_active () const { return _next_ab_is_active; }
        void set_next_ab_is_active (bool yn) { _next_ab_is_active = yn; }
 
-       virtual nframes_t signal_latency() const { return 0; }
+       virtual framecnt_t signal_latency() const { return 0; }
 
-       virtual int set_block_size (nframes_t /*nframes*/) { return 0; }
+       virtual int set_block_size (pframes_t /*nframes*/) { return 0; }
         virtual bool requires_fixed_sized_buffers() const { return false; }
 
        /** @param result_required true if, on return from this method, bufs is required to contain valid data;
         *  if false, the method need not bother writing to bufs if it doesn't want to.
         */  
-       virtual void run (BufferSet& /*bufs*/, framepos_t /*start_frame*/, framepos_t /*end_frame*/, nframes_t /*nframes*/, bool /*result_required*/) {}
-       virtual void silence (nframes_t /*nframes*/) {}
+       virtual void run (BufferSet& /*bufs*/, framepos_t /*start_frame*/, framepos_t /*end_frame*/, pframes_t /*nframes*/, bool /*result_required*/) {}
+       virtual void silence (framecnt_t /*nframes*/) {}
 
        virtual void activate ()   { _pending_active = true; ActiveChanged(); }
        virtual void deactivate () { _pending_active = false; ActiveChanged(); }
index 9348544c27588555f88e24bd6d041007a62d0552..d06edac230322ef0c5b6c85280b95abd7cc33b62 100644 (file)
@@ -102,8 +102,8 @@ CONFIG_VARIABLE (bool, stop_recording_on_xrun, "stop-recording-on-xrun", false)
 CONFIG_VARIABLE (bool, create_xrun_marker, "create-xrun-marker", true)
 CONFIG_VARIABLE (bool, stop_at_session_end, "stop-at-session-end", true)
 CONFIG_VARIABLE (bool, seamless_loop, "seamless-loop", false)
-CONFIG_VARIABLE (nframes_t, preroll, "preroll", 0)
-CONFIG_VARIABLE (nframes_t, postroll, "postroll", 0)
+CONFIG_VARIABLE (framecnt_t, preroll, "preroll", 0)
+CONFIG_VARIABLE (framecnt_t, postroll, "postroll", 0)
 CONFIG_VARIABLE (float, rf_speed, "rf-speed", 2.0f)
 CONFIG_VARIABLE (float, shuttle_speed_factor, "shuttle-speed-factor", 1.0f)
 CONFIG_VARIABLE (float, shuttle_speed_threshold, "shuttle-speed-threshold", 5.0f)
index ef86dce4b2c3984d6d9923920f07042c4e107c10..3ad61919b1ee3f46c9ae1f3b6b270d992da1f3ca 100644 (file)
@@ -193,8 +193,8 @@ class Region
        void trim_end (framepos_t new_position, void *src);
        void trim_to (framepos_t position, framecnt_t length, void *src);
 
-        void cut_front (nframes_t new_position, void *src);
-        void cut_end (nframes_t new_position, void *src);
+        void cut_front (framepos_t new_position, void *src);
+        void cut_end (framepos_t new_position, void *src);
 
        void set_layer (layer_t l); /* ONLY Playlist can call this */
        void raise ();
@@ -321,8 +321,8 @@ class Region
 
        void trim_to_internal (framepos_t position, framecnt_t length, void *src);
        virtual void set_position_internal (framepos_t pos, bool allow_bbt_recompute);
-        void modify_front (nframes_t new_position, bool reset_fade, void* src);
-        void modify_end (nframes_t new_position, bool reset_fade, void* src);
+        void modify_front (framepos_t new_position, bool reset_fade, void* src);
+        void modify_end (framepos_t new_position, bool reset_fade, void* src);
 
        void maybe_uncopy ();
        void first_edit ();
index 6d630bc44bf0895547c61255fd161e4675fd57b0..b315430b46ae06d58c60eb1e55d2006bb8f059cf 100644 (file)
@@ -30,16 +30,16 @@ namespace ARDOUR {
 class ResampledImportableSource : public ImportableSource
 {
   public:
-       ResampledImportableSource (boost::shared_ptr<ImportableSource>, nframes_t rate, SrcQuality);
+       ResampledImportableSource (boost::shared_ptr<ImportableSource>, framecnt_t rate, SrcQuality);
 
        ~ResampledImportableSource ();
 
-       nframes_t  read (Sample* buffer, nframes_t nframes);
+       framecnt_t read (Sample* buffer, framecnt_t nframes);
        float      ratio() const { return src_data.src_ratio; }
        uint32_t   channels() const { return source->channels(); }
        framecnt_t length() const { return source->length(); }
-       nframes_t  samplerate() const { return source->samplerate(); }
-       void       seek (nframes_t);
+       framecnt_t samplerate() const { return source->samplerate(); }
+       void       seek (framecnt_t);
        framepos_t natural_position() const;
 
        bool clamped_at_unity () const {
index cf709ed2f2733d385c7f9537d61ef583e54da9db..8ec4c9b8b53c54553c66dcfbe124bdb966734612 100644 (file)
@@ -42,7 +42,7 @@ public:
 
        uint32_t bit_slot() const { return _bitslot; }
 
-       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);
 
        boost::shared_ptr<Amp> amp() const { return _amp; }
        boost::shared_ptr<PeakMeter> meter() const { return _meter; }
@@ -71,10 +71,10 @@ private:
        /* disallow copy construction */
        Return (const Return&);
 
-       uint32_t  _bitslot;
+       uint32_t _bitslot;
 
-       void collect_input  (BufferSet& bufs, nframes_t nframes, ChanCount offset=ChanCount::ZERO);
-       void just_meter_input (framepos_t start_frame, framepos_t end_frame, nframes_t nframes);
+       void collect_input (BufferSet& bufs, pframes_t nframes, ChanCount offset = ChanCount::ZERO);
+       void just_meter_input (framepos_t start_frame, framepos_t end_frame, pframes_t nframes);
 };
 
 } // namespace ARDOUR
index 7702901523bd2bf6d7d712684771a7863f4da79f..afa6c0e527ac553a74161642ea49591ae4e8d252 100644 (file)
@@ -102,13 +102,13 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember,
 
        /* these are the core of the API of a Route. see the protected sections as well */
 
-       virtual int roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame,
+       virtual 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);
 
-       virtual int no_roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame,
+       virtual int no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
                        bool state_changing, bool can_record, bool rec_monitors_input);
 
-       virtual int silent_roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame,
+       virtual int silent_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
                                  bool can_record, bool rec_monitors_input, bool& need_butler);
 
        virtual void toggle_monitor_input ();
@@ -243,10 +243,10 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember,
        void all_processors_flip();
        void all_processors_active (Placement, bool state);
 
-       virtual nframes_t update_total_latency();
-       void set_latency_delay (nframes_t);
-       void set_user_latency (nframes_t);
-       nframes_t initial_delay() const { return _initial_delay; }
+       virtual framecnt_t update_total_latency();
+       void set_latency_delay (framecnt_t);
+       void set_user_latency (framecnt_t);
+       framecnt_t initial_delay() const { return _initial_delay; }
 
        PBD::Signal0<void>       active_changed;
        PBD::Signal0<void>       phase_invert_changed;
@@ -365,7 +365,7 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember,
        boost::shared_ptr<Panner> panner() const;
        boost::shared_ptr<AutomationControl> gain_control() const;
 
-       void automation_snapshot (nframes_t now, bool force=false);
+       void automation_snapshot (framepos_t now, bool force=false);
        void protect_automation ();
 
        void set_remote_control_id (uint32_t id, bool notify_class_listeners = true);
@@ -390,28 +390,28 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember,
        void mod_solo_by_others_downstream (int32_t);
        bool has_external_redirects() const;
        void curve_reallocate ();
-       void just_meter_input (framepos_t start_frame, framepos_t end_frame, nframes_t nframes);
-       virtual void set_block_size (nframes_t nframes);
+       void just_meter_input (framepos_t start_frame, framepos_t end_frame, pframes_t nframes);
+       virtual void set_block_size (pframes_t nframes);
 
   protected:
-       nframes_t check_initial_delay (nframes_t, nframes_t&);
+       framecnt_t check_initial_delay (framecnt_t, framecnt_t&);
 
        void passthru (framepos_t start_frame, framepos_t end_frame,
-                       nframes_t nframes, int declick);
+                       pframes_t nframes, int declick);
 
        virtual void write_out_of_band_data (BufferSet& /* bufs */, framepos_t /* start_frame */, framepos_t /* end_frame */,
-                       nframes_t /* nframes */) {}
+                       framecnt_t /* nframes */) {}
 
        virtual void process_output_buffers (BufferSet& bufs,
                        framepos_t start_frame, framepos_t end_frame,
-                       nframes_t nframes, bool with_processors, int declick);
+                       pframes_t nframes, bool with_processors, int declick);
 
        boost::shared_ptr<IO> _input;
        boost::shared_ptr<IO> _output;
 
        bool           _active;
-       nframes_t      _initial_delay;
-       nframes_t      _roll_delay;
+       framecnt_t     _initial_delay;
+       framecnt_t     _roll_delay;
 
        ProcessorList  _processors;
        mutable Glib::RWLock   _processor_lock;
@@ -453,10 +453,10 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember,
        int configure_processors (ProcessorStreams*);
 
        void passthru_silence (framepos_t start_frame, framepos_t end_frame,
-                              nframes_t nframes, int declick);
+                              pframes_t nframes, int declick);
 
-       void silence (nframes_t);
-       void silence_unlocked (nframes_t);
+       void silence (framecnt_t);
+       void silence_unlocked (framecnt_t);
 
        ChanCount processor_max_streams;
        uint32_t _remote_control_id;
index 147d697fca3beae6f3955f87db1e50ff8e8d85a0..8882d721d74301ff9e47ae4b2f791557cf3121ab 100644 (file)
 
 namespace ARDOUR {
 
-       typedef float (*compute_peak_t)                 (const ARDOUR::Sample *, nframes_t, float);
-       typedef void  (*find_peaks_t)                   (const ARDOUR::Sample *, nframes_t, float *, float*);
-       typedef void  (*apply_gain_to_buffer_t)         (ARDOUR::Sample *, nframes_t, float);
-       typedef void  (*mix_buffers_with_gain_t)        (ARDOUR::Sample *, const ARDOUR::Sample *, nframes_t, float);
-       typedef void  (*mix_buffers_no_gain_t)          (ARDOUR::Sample *, const ARDOUR::Sample *, nframes_t);
+       typedef float (*compute_peak_t)                 (const ARDOUR::Sample *, pframes_t, float);
+       typedef void  (*find_peaks_t)                   (const ARDOUR::Sample *, pframes_t, float *, float*);
+       typedef void  (*apply_gain_to_buffer_t)         (ARDOUR::Sample *, pframes_t, float);
+       typedef void  (*mix_buffers_with_gain_t)        (ARDOUR::Sample *, const ARDOUR::Sample *, pframes_t, float);
+       typedef void  (*mix_buffers_no_gain_t)          (ARDOUR::Sample *, const ARDOUR::Sample *, pframes_t);
 
        extern compute_peak_t           compute_peak;
        extern find_peaks_t             find_peaks;
index e66c72367a33a56d93f3958308cc7e5d7e41d194..bf5c5d73707cb7b229a0b69e04698204af38be48 100644 (file)
@@ -55,7 +55,7 @@ class Send : public Delivery
 
        uint32_t pans_required() const { return _configured_input.n_audio(); }
 
-       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 can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
        bool configure_io (ChanCount in, ChanCount out);
index f1a79ba4f38fb5b7b14796133d4891a801b2ac3a..4966c19b69df21d849b3b345591aaef027c3c4f1 100644 (file)
@@ -190,7 +190,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
        std::string new_source_path_from_name (DataType type, const std::string&, bool as_stub = false);
        RouteList new_route_from_template (uint32_t how_many, const std::string& template_path);
 
-       void process (nframes_t nframes);
+       void process (pframes_t nframes);
 
        BufferSet& get_silent_buffers (ChanCount count = ChanCount::ZERO);
        BufferSet& get_scratch_buffers (ChanCount count = ChanCount::ZERO);
@@ -297,7 +297,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
        void request_play_loop (bool yn, bool leave_rolling = false);
        bool get_play_loop () const { return play_loop; }
 
-       nframes_t  last_transport_start() const { return _last_roll_location; }
+       framepos_t last_transport_start () const { return _last_roll_location; }
        void goto_end ();
        void goto_start ();
        void use_rf_shuttle_speed ();
@@ -317,14 +317,14 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
        std::pair<framepos_t, framepos_t> get_extent () const;
        framepos_t current_end_frame () const;
        framepos_t current_start_frame () const;
-       /// "actual" sample rate of session, set by current audioengine rate, pullup/down etc.
-       nframes_t frame_rate() const   { return _current_frame_rate; }
-       /// "native" sample rate of session, regardless of current audioengine rate, pullup/down etc
-       nframes_t nominal_frame_rate() const   { return _nominal_frame_rate; }
-       nframes_t frames_per_hour() const { return _frames_per_hour; }
+       /** "actual" sample rate of session, set by current audioengine rate, pullup/down etc. */
+       framecnt_t frame_rate () const { return _current_frame_rate; }
+       /** "native" sample rate of session, regardless of current audioengine rate, pullup/down etc */
+       framecnt_t nominal_frame_rate () const { return _nominal_frame_rate; }
+       framecnt_t frames_per_hour () const { return _frames_per_hour; }
 
        double frames_per_timecode_frame() const { return _frames_per_timecode_frame; }
-       nframes_t timecode_frames_per_hour() const { return _timecode_frames_per_hour; }
+       framecnt_t timecode_frames_per_hour() const { return _timecode_frames_per_hour; }
 
        MIDI::byte get_mtc_timecode_bits() const {
                return mtc_timecode_bits;   /* encoding of SMTPE type for MTC */
@@ -347,10 +347,10 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
 
        void reset_input_monitor_state ();
 
-       nframes_t get_block_size()        const { return current_block_size; }
-       nframes_t worst_output_latency () const { return _worst_output_latency; }
-       nframes_t worst_input_latency ()  const { return _worst_input_latency; }
-       nframes_t worst_track_latency ()  const { return _worst_track_latency; }
+       pframes_t get_block_size()        const { return current_block_size; }
+       framecnt_t worst_output_latency () const { return _worst_output_latency; }
+       framecnt_t worst_input_latency ()  const { return _worst_input_latency; }
+       framecnt_t worst_track_latency ()  const { return _worst_track_latency; }
 
 #ifdef HAVE_JACK_SESSION 
        void jack_session_event (jack_session_event_t* event);
@@ -449,17 +449,17 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
 
        void sync_time_vars();
 
-       void bbt_time (nframes_t when, BBT_Time&);
+       void bbt_time (framepos_t when, BBT_Time&);
        void timecode_to_sample(Timecode::Time& timecode, framepos_t& sample, bool use_offset, bool use_subframes) const;
        void sample_to_timecode(framepos_t sample, Timecode::Time& timecode, bool use_offset, bool use_subframes) const;
        void timecode_time (Timecode::Time &);
-       void timecode_time (nframes_t when, Timecode::Time&);
-       void timecode_time_subframes (nframes_t when, Timecode::Time&);
+       void timecode_time (framepos_t when, Timecode::Time&);
+       void timecode_time_subframes (framepos_t when, Timecode::Time&);
 
        void timecode_duration (framecnt_t, Timecode::Time&) const;
        void timecode_duration_string (char *, framecnt_t) const;
 
-       nframes_t convert_to_frames_at (nframes_t position, AnyTime const &);
+       framecnt_t convert_to_frames_at (framepos_t position, AnyTime const &);
 
        static PBD::Signal1<void, framepos_t> StartTimeChanged;
        static PBD::Signal1<void, framepos_t> EndTimeChanged;
@@ -475,12 +475,10 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
        void set_silent (bool yn);
        bool silent () { return _silent; }
 
-       int jack_slave_sync (nframes_t);
-
        TempoMap& tempo_map() { return *_tempo_map; }
 
        /// signals the current transport position in frames, bbt and timecode time (in that order)
-       PBD::Signal3<void,const nframes_t&, const BBT_Time&, const Timecode::Time&> tick;
+       PBD::Signal3<void, const framepos_t &, const BBT_Time&, const Timecode::Time&> tick;
 
        /* region info  */
 
@@ -501,9 +499,9 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
        boost::shared_ptr<ExportHandler> get_export_handler ();
        boost::shared_ptr<ExportStatus> get_export_status ();
 
-       int  start_audio_export (nframes_t position, bool realtime);
+       int start_audio_export (framepos_t position, bool realtime);
 
-       PBD::Signal1<int,nframes_t> ProcessExport;
+       PBD::Signal1<int, framecnt_t> ProcessExport;
        static PBD::Signal2<void,std::string, std::string> Exported;
 
        void add_source (boost::shared_ptr<Source>);
@@ -525,7 +523,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
        /** handlers should return 0 for "ignore the rate mismatch",
            !0 for "do not use this session"
        */
-       static PBD::Signal2<int,nframes_t, nframes_t> AskAboutSampleRateMismatch;
+       static PBD::Signal2<int, framecnt_t, framecnt_t> AskAboutSampleRateMismatch;
 
        /** handlers should return !0 for use pending state, 0 for ignore it.
        */
@@ -641,14 +639,6 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
 
        void midi_panic ();
 
-       /* Scrubbing */
-
-       void start_scrub (nframes_t where);
-       void stop_scrub ();
-       void set_scrub_speed (float);
-       nframes_t scrub_buffer_size() const;
-       PBD::Signal0<void> ScrubReady;
-
        /* History (for editors, mixers, UIs etc.) */
 
        /** Undo some transactions.
@@ -809,8 +799,8 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
 
   protected:
        friend class AudioEngine;
-       void set_block_size (nframes_t nframes);
-       void set_frame_rate (nframes_t nframes);
+       void set_block_size (pframes_t nframes);
+       void set_frame_rate (framecnt_t nframes);
 
   protected:
        friend class Route;
@@ -832,16 +822,16 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
           maximise cache hits
        */
 
-       typedef void (Session::*process_function_type)(nframes_t);
+       typedef void (Session::*process_function_type)(pframes_t);
 
        AudioEngine&            _engine;
        mutable gint             processing_prohibited;
        process_function_type    process_function;
        process_function_type    last_process_function;
        bool                     waiting_for_sync_offset;
-       nframes_t               _base_frame_rate;
-       nframes_t               _current_frame_rate;  //this includes video pullup offset
-       nframes_t               _nominal_frame_rate;  //ignores audioengine setting, "native" SR
+       framecnt_t              _base_frame_rate;
+       framecnt_t              _current_frame_rate;  //this includes video pullup offset
+       framecnt_t              _nominal_frame_rate;  //ignores audioengine setting, "native" SR
        int                      transport_sub_state;
        mutable gint            _record_status;
        framepos_t              _transport_frame;
@@ -857,12 +847,12 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
 
        bool                     auto_play_legal;
        framepos_t              _last_slave_transport_frame;
-       nframes_t                maximum_output_latency;
+       framecnt_t               maximum_output_latency;
        framepos_t              _requested_return_frame;
-       nframes_t                current_block_size;
-       nframes_t               _worst_output_latency;
-       nframes_t               _worst_input_latency;
-       nframes_t               _worst_track_latency;
+       pframes_t                current_block_size;
+       framecnt_t              _worst_output_latency;
+       framecnt_t              _worst_input_latency;
+       framecnt_t              _worst_track_latency;
        bool                    _have_captured;
        float                   _meter_hold;
        float                   _meter_falloff;
@@ -881,12 +871,12 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
 
        void ensure_buffers (ChanCount howmany = ChanCount::ZERO);
 
-       void process_scrub          (nframes_t);
-       void process_without_events (nframes_t);
-       void process_with_events    (nframes_t);
-       void process_audition       (nframes_t);
-       void process_export         (nframes_t);
-       int  process_export_fw      (nframes_t);
+       void process_scrub          (pframes_t);
+       void process_without_events (pframes_t);
+       void process_with_events    (pframes_t);
+       void process_audition       (pframes_t);
+       void process_export         (pframes_t);
+       int  process_export_fw      (pframes_t);
 
        void block_processing() { g_atomic_int_set (&processing_prohibited, 1); }
        void unblock_processing() { g_atomic_int_set (&processing_prohibited, 0); }
@@ -905,20 +895,20 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
        bool have_first_delta_accumulator;
 
        SlaveState _slave_state;
-       nframes_t slave_wait_end;
+       framepos_t slave_wait_end;
 
        void reset_slave_state ();
-       bool follow_slave (nframes_t);
-       void calculate_moving_average_of_slave_delta(int dir, nframes_t this_delta);
-       void track_slave_state(float slave_speed, nframes_t slave_transport_frame, nframes_t this_delta);
-       void follow_slave_silently(nframes_t nframes, float slave_speed);
+       bool follow_slave (pframes_t);
+       void calculate_moving_average_of_slave_delta (int dir, framecnt_t this_delta);
+       void track_slave_state (float slave_speed, framepos_t slave_transport_frame, framecnt_t this_delta);
+       void follow_slave_silently (pframes_t nframes, float slave_speed);
 
        void switch_to_sync_source (SyncSource); /* !RT context */
        void drop_sync_source ();  /* !RT context */
        void use_sync_source (Slave*); /* RT context */
 
        bool post_export_sync;
-       nframes_t post_export_position;
+       framepos_t post_export_position;
 
        bool _exporting;
        bool _export_rolling;
@@ -933,8 +923,8 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
        PBD::ScopedConnection export_freewheel_connection;
 
        void get_track_statistics ();
-       int  process_routes (nframes_t, bool& need_butler);
-       int  silent_process_routes (nframes_t, bool& need_butler);
+       int  process_routes (pframes_t, bool& need_butler);
+       int  silent_process_routes (pframes_t, bool& need_butler);
 
        bool get_rec_monitors_input () {
                if (actively_recording()) {
@@ -959,8 +949,8 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
                }
        }
 
-       bool maybe_stop (nframes_t limit);
-       bool maybe_sync_start (nframes_t&);
+       bool maybe_stop (framepos_t limit);
+       bool maybe_sync_start (pframes_t &);
 
        void check_declick_out ();
 
@@ -971,7 +961,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
        bool                     session_midi_feedback;
        bool                     play_loop;
        bool                     loop_changing;
-       nframes_t                last_loopend;
+       framepos_t               last_loopend;
 
        boost::scoped_ptr<SessionDirectory> _session_dir;
 
@@ -989,12 +979,12 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
        int      load_options (const XMLNode&);
        int      load_state (std::string snapshot_name);
 
-       nframes_t _last_roll_location;
-       nframes_t _last_roll_or_reversal_location;
-       nframes_t _last_record_location;
+       framepos_t _last_roll_location;
+       framepos_t _last_roll_or_reversal_location;
+       framepos_t _last_record_location;
 
        bool              pending_locate_roll;
-       nframes_t         pending_locate_frame;
+       framepos_t        pending_locate_frame;
        bool              pending_locate_flush;
        bool              pending_abort;
        bool              pending_auto_loop;
@@ -1045,7 +1035,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
        uint32_t    rf_scale;
 
        void set_rf_speed (float speed);
-       void reset_rf_scale (nframes_t frames_moved);
+       void reset_rf_scale (framecnt_t frames_moved);
 
        Locations*       _locations;
        void              locations_changed ();
@@ -1099,9 +1089,9 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
 
        /* MIDI Machine Control */
 
-       void spp_start (MIDI::Parser&, nframes_t timestamp);
-       void spp_continue (MIDI::Parser&, nframes_t timestamp);
-       void spp_stop (MIDI::Parser&, nframes_t timestamp);
+       void spp_start (MIDI::Parser&, framepos_t timestamp);
+       void spp_continue (MIDI::Parser&, framepos_t timestamp);
+       void spp_stop (MIDI::Parser&, framepos_t timestamp);
 
        void mmc_deferred_play (MIDI::MachineControl &);
        void mmc_stop (MIDI::MachineControl &);
@@ -1129,30 +1119,28 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
        MIDI::byte mtc_msg[16];
        MIDI::byte mtc_timecode_bits;   /* encoding of SMTPE type for MTC */
        MIDI::byte midi_msg[16];
-       nframes_t  outbound_mtc_timecode_frame;
+       framepos_t outbound_mtc_timecode_frame;
        Timecode::Time transmitting_timecode_time;
        int next_quarter_frame_to_send;
 
        double _frames_per_timecode_frame; /* has to be floating point because of drop frame */
-       nframes_t _frames_per_hour;
-       nframes_t _timecode_frames_per_hour;
+       framecnt_t _frames_per_hour;
+       framecnt_t _timecode_frames_per_hour;
 
        /* cache the most-recently requested time conversions. This helps when we
         * have multiple clocks showing the same time (e.g. the transport frame) */
-       bool           last_timecode_valid;
-       nframes_t last_timecode_when;
-       Timecode::Time    last_timecode;
+       bool last_timecode_valid;
+       framepos_t last_timecode_when;
+       Timecode::Time last_timecode;
 
        bool _send_timecode_update; ///< Flag to send a full frame (Timecode) MTC message this cycle
 
-       int send_midi_time_code_for_cycle(nframes_t nframes);
-
-       nframes_t adjust_apparent_position (nframes_t frames);
+       int send_midi_time_code_for_cycle (pframes_t nframes);
 
        void reset_record_status ();
 
-       int no_roll (nframes_t nframes);
-       int fail_roll (nframes_t nframes);
+       int no_roll (pframes_t nframes);
+       int fail_roll (pframes_t nframes);
 
        bool non_realtime_work_pending() const { return static_cast<bool>(post_transport_work()); }
        bool process_can_proceed() const { return !(post_transport_work() & ProcessCannotProceedMask); }
@@ -1166,7 +1154,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
        void unset_play_loop ();
        void overwrite_some_buffers (Track *);
        void flush_all_inserts ();
-       int  micro_locate (nframes_t distance);
+       int  micro_locate (framecnt_t distance);
        void locate (framepos_t, bool with_roll, bool with_flush, bool with_loop=false, bool force=false, bool with_mmc=true);
        void start_locate (framepos_t, bool with_roll, bool with_flush, bool with_loop=false, bool force=false);
        void force_locate (framepos_t frame, bool with_roll = false);
@@ -1294,7 +1282,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
 
        /* FLATTEN */
 
-       int flatten_one_track (AudioTrack&, nframes_t start, nframes_t cnt);
+       int flatten_one_track (AudioTrack&, framepos_t start, framecnt_t cnt);
 
        /* INSERT AND SEND MANAGEMENT */
 
@@ -1344,7 +1332,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
        UndoHistory                  _history;
        std::stack<UndoTransaction*> _current_trans;
 
-       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*);
        void reset_jack_connection (jack_client_t* jack);
        void process_rtop (SessionEvent*);
@@ -1358,19 +1346,19 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
        boost::shared_ptr<IO> _click_io;
        Sample*                click_data;
        Sample*                click_emphasis_data;
-       nframes_t              click_length;
-       nframes_t              click_emphasis_length;
+       framecnt_t             click_length;
+       framecnt_t             click_emphasis_length;
        mutable Glib::RWLock   click_lock;
 
-       static const Sample    default_click[];
-       static const nframes_t default_click_length;
-       static const Sample    default_click_emphasis[];
-       static const nframes_t default_click_emphasis_length;
+       static const Sample     default_click[];
+       static const framecnt_t default_click_length;
+       static const Sample     default_click_emphasis[];
+       static const framecnt_t default_click_emphasis_length;
 
        Click *get_click();
        void   setup_click_sounds (int which);
        void   clear_clicks ();
-       void   click (nframes_t start, nframes_t nframes);
+       void   click (framepos_t start, framecnt_t nframes);
 
        std::vector<Route*> master_outs;
 
@@ -1448,7 +1436,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
        /** temporary list of Diskstreams used only during load of 2.X sessions */
        std::list<boost::shared_ptr<Diskstream> > _diskstreams_2X;
 
-       void add_session_range_location (nframes_t, nframes_t);
+       void add_session_range_location (framepos_t, framepos_t);
 
        void setup_midi_machine_control ();
        void cleanup_stubfiles ();
index 5c31217045c8fdf4c09ea3a940e84c704c6fe933..738de46a86af100794e1353072c87db02ed39925 100644 (file)
@@ -83,7 +83,7 @@ struct SessionEvent {
     
     boost::shared_ptr<Region> region;
 
-    SessionEvent (Type t, Action a, nframes_t when, nframes_t where, double spd, bool yn = false, bool yn2 = false)
+    SessionEvent (Type t, Action a, framepos_t when, framepos_t where, double spd, bool yn = false, bool yn2 = false)
            : type (t)
            , action (a)
            , action_frame (when)
@@ -112,7 +112,7 @@ struct SessionEvent {
     void* operator new (size_t);
     void  operator delete (void *ptr, size_t /*size*/);
     
-    static const nframes_t Immediate = 0;
+    static const framepos_t Immediate = 0;
     
     static void create_per_thread_pool (const std::string& n, uint32_t nitems);
     static void init_event_pool ();
index d24aa9d13666f598f1c76f4952842db16abcdd6f..46ddda3985cea801daea41f35cd09cea66580035 100644 (file)
@@ -31,7 +31,7 @@ public:
        int flush_header () { return 0; }
        float sample_rate () const { return _sample_rate; }
 
-       void set_length (nframes_t len) { _length = len; }
+       void set_length (framecnt_t len) { _length = len; }
 
        bool destructive() const { return false; }
        bool can_be_analysed() const { return false; }
index 74cf4371b0e801e592512514a22aacfad0e44d76..45ab00a44f6088698e7df58e0a207c2ac9bba459 100644 (file)
@@ -143,7 +143,7 @@ class Slave {
         * @return - the timing resolution of the Slave - If the distance of ARDOURs transport
         * to the slave becomes greater than the resolution, sound will stop
         */
-       virtual nframes_t resolution() const = 0;
+       virtual framecnt_t resolution() const = 0;
 
        /**
         * @return - when returning true, ARDOUR will wait for seekahead_distance() before transport
@@ -174,11 +174,11 @@ class Slave {
 class ISlaveSessionProxy {
   public:
        virtual ~ISlaveSessionProxy() {}
-       virtual TempoMap& tempo_map()                 const   { return *((TempoMap *) 0); }
-       virtual nframes_t   frame_rate()                const   { return 0; }
+       virtual TempoMap&  tempo_map()                 const   { return *((TempoMap *) 0); }
+       virtual framecnt_t frame_rate()                const   { return 0; }
        virtual framepos_t audible_frame ()            const   { return 0; }
        virtual framepos_t transport_frame ()          const   { return 0; }
-       virtual nframes_t   frames_since_cycle_start () const   { return 0; }
+       virtual pframes_t  frames_since_cycle_start () const   { return 0; }
        virtual framepos_t frame_time ()               const   { return 0; }
 
        virtual void request_locate (framepos_t /*frame*/, bool with_roll = false) {
@@ -195,11 +195,11 @@ class SlaveSessionProxy : public ISlaveSessionProxy {
   public:
        SlaveSessionProxy(Session &s) : session(s) {}
 
-       TempoMap&   tempo_map()                 const;
-       nframes_t   frame_rate()                const;
+       TempoMap&  tempo_map()                 const;
+       framecnt_t frame_rate()                const;
        framepos_t audible_frame ()            const;
        framepos_t transport_frame ()          const;
-       nframes_t   frames_since_cycle_start () const;
+       pframes_t  frames_since_cycle_start () const;
        framepos_t frame_time ()               const;
 
        void request_locate (framepos_t frame, bool with_roll = false);
@@ -234,7 +234,7 @@ class MTC_Slave : public Slave {
        bool ok() const;
        void handle_locate (const MIDI::byte*);
 
-       nframes_t resolution() const;
+       framecnt_t resolution () const;
        bool requires_seekahead () const { return true; }
        framepos_t seekahead_distance() const;
        bool give_slave_full_control_over_transport_speed() const;
@@ -271,8 +271,8 @@ class MTC_Slave : public Slave {
        void queue_reset (bool with_pos);
        void maybe_reset ();
 
-       void update_mtc_qtr (MIDI::Parser&, int, nframes_t);
-       void update_mtc_time (const MIDI::byte *, bool, nframes_t);
+       void update_mtc_qtr (MIDI::Parser&, int, framepos_t);
+       void update_mtc_time (const MIDI::byte *, bool, framepos_t);
        void update_mtc_status (MIDI::MTC_Status);
        void read_current (SafeTime *) const;
        void reset_window (framepos_t);
@@ -295,7 +295,7 @@ class MIDIClock_Slave : public Slave {
        bool ok() const;
        bool starting() const;
 
-       nframes_t resolution() const;
+       framecnt_t resolution () const;
        bool requires_seekahead () const { return false; }
        bool give_slave_full_control_over_transport_speed() const { return true; }
 
@@ -313,10 +313,10 @@ class MIDIClock_Slave : public Slave {
        double      one_ppqn_in_frames;
 
        /// the timestamp of the first MIDI clock message
-       nframes_t   first_timestamp;
+       framepos_t  first_timestamp;
 
        /// the time stamp and should-be transport position of the last inbound MIDI clock message
-       nframes_t   last_timestamp;
+       framepos_t  last_timestamp;
        double      should_be_position;
 
        /// the number of midi clock messages received (zero-based)
@@ -375,7 +375,7 @@ class JACK_Slave : public Slave
        bool starting() const { return _starting; }
        bool locked() const;
        bool ok() const;
-       nframes_t resolution() const { return 1; }
+       framecnt_t resolution () const { return 1; }
        bool requires_seekahead () const { return false; }
        void reset_client (jack_client_t* jack);
        bool is_always_synced() const { return true; }
index bd1428a129e3357ac738eb658adefeadebb326d8..32163551a0cfd4293b03b26405c4dff54195d050 100644 (file)
@@ -52,7 +52,7 @@ public:
        bool set_name (const std::string& newname) { return (set_source_name(newname, false) == 0); }
 
        void append_event_unlocked_beats (const Evoral::Event<Evoral::MusicalTime>& ev);
-       void append_event_unlocked_frames (const Evoral::Event<nframes_t>& ev, framepos_t source_start);
+       void append_event_unlocked_frames (const Evoral::Event<framepos_t>& ev, framepos_t source_start);
 
        void mark_streaming_midi_write_started (NoteMode mode, framepos_t start_time);
        void mark_streaming_write_completed ();
@@ -65,7 +65,7 @@ public:
 
        void flush_midi ();
 
-       static void set_header_position_offset (nframes_t offset, bool negative);
+       static void set_header_position_offset (framecnt_t offset, bool negative);
 
        static bool safe_midi_file_extension (const std::string& path);
 
@@ -73,15 +73,15 @@ public:
         void set_path (const std::string& newpath);
         
   private:
-       nframes_t read_unlocked (Evoral::EventSink<nframes_t>& dst,
-                                framepos_t position,
-                                framepos_t start,
-                                nframes_t cnt,
-                                MidiStateTracker* tracker) const;
-
-       nframes_t write_unlocked (MidiRingBuffer<nframes_t>& src,
-                       framepos_t position,
-                       nframes_t cnt);
+       framecnt_t read_unlocked (Evoral::EventSink<framepos_t>& dst,
+                                 framepos_t position,
+                                 framepos_t start,
+                                 framecnt_t cnt,
+                                 MidiStateTracker* tracker) const;
+
+       framecnt_t write_unlocked (MidiRingBuffer<framepos_t>& src,
+                                  framepos_t position,
+                                  framecnt_t cnt);
 
        double    _last_ev_time_beats;
        framepos_t _last_ev_time_frames;
index aab8b6ac5999a3ad74005254a787e0cef9f6383b..2b5535e29f134a84b97218476014e903db0ce33c 100644 (file)
@@ -33,11 +33,11 @@ class SndFileImportableSource : public ImportableSource {
        SndFileImportableSource (const std::string& path);
        virtual ~SndFileImportableSource();
 
-       nframes_t  read (Sample* buffer, nframes_t nframes);
+       framecnt_t read (Sample* buffer, framecnt_t nframes);
        uint32_t   channels() const;
        framecnt_t length() const;
-       nframes_t  samplerate() const;
-       void       seek (nframes_t pos);
+       framecnt_t samplerate() const;
+       void       seek (framecnt_t pos);
        framepos_t natural_position() const;
        bool       clamped_at_unity () const;
 
index ff15608d7057b68ac6305bcbc0faaa8491a83717..f08b0be4c0b272364b1e2d4ce06d834c703bbcf9 100644 (file)
@@ -35,7 +35,7 @@ class SndFileSource : public AudioFileSource {
 
        /* Constructor to be called for new in-session files */
        SndFileSource (Session&, const std::string& path, const std::string& origin,
-                       SampleFormat samp_format, HeaderFormat hdr_format, nframes_t rate,
+                       SampleFormat samp_format, HeaderFormat hdr_format, framecnt_t rate,
                        Flag flags = SndFileSource::default_writable_flags);
 
        /** Constructor to be called for existing in-session files */
@@ -60,7 +60,7 @@ class SndFileSource : public AudioFileSource {
 
        bool clamped_at_unity () const;
 
-       static void setup_standard_crossfades (Session const &, nframes_t sample_rate);
+       static void setup_standard_crossfades (Session const &, framecnt_t sample_rate);
        static const Source::Flag default_writable_flags;
 
        static int get_soundfile_info (const std::string& path, SoundFileInfo& _info, std::string& error_msg);
index c59dab92234625e110f27d1473b5ed0bb9f99266..c5994027cede972167206e64f013f91e8dd232e7 100644 (file)
@@ -49,7 +49,7 @@ class SourceFactory {
 
        static boost::shared_ptr<Source> createWritable (DataType type, Session&,
                         const std::string& path, const std::string& origin,
-                       bool destructive, nframes_t rate, bool announce = true, bool async = false);
+                       bool destructive, framecnt_t rate, bool announce = true, bool async = false);
 
        static Glib::Cond*                               PeaksToBuild;
        static Glib::StaticMutex                         peak_building_lock;
index e77aa7111ce206cd38b2c557c0f0d6153d848aef..91374be88a59370e737c6b73520fdc1932b44fef 100644 (file)
@@ -25,14 +25,14 @@ namespace ARDOUR {
 class StripSilence : public Filter {
 
 public:
-       StripSilence (Session &, double, nframes_t, nframes_t);
+       StripSilence (Session &, double, framecnt_t, framecnt_t);
 
        int run (boost::shared_ptr<ARDOUR::Region>, Progress* progress = 0);
 
 private:
        double _threshold; ///< silence threshold, in dBFS
-       nframes_t _minimum_length; ///< minimum length to be considered silence, in samples
-       nframes_t _fade_length; ///< fade in/out to use on trimmed regions, in samples
+       framecnt_t _minimum_length; ///< minimum length to be considered silence, in samples
+       framecnt_t _fade_length; ///< fade in/out to use on trimmed regions, in samples
 };
 
 }
index e69233423463605037d56f116bd911c43e23ba52..a1ad8d1f3191911b2b6727177e822dc7855e109b 100644 (file)
@@ -44,7 +44,7 @@ class Tempo {
 
        double beats_per_minute () const { return _beats_per_minute;}
        double note_type () const { return _note_type;}
-       double frames_per_beat (nframes_t sr, const Meter& meter) const;
+       double frames_per_beat (framecnt_t sr, const Meter& meter) const;
 
   protected:
        double _beats_per_minute;
@@ -61,7 +61,7 @@ class Meter {
        double beats_per_bar () const { return _beats_per_bar; }
        double note_divisor() const { return _note_type; }
 
-       double frames_per_bar (const Tempo&, nframes_t sr) const;
+       double frames_per_bar (const Tempo&, framecnt_t sr) const;
 
   protected:
        /** The number of beats in a bar.  This is a real value because
@@ -168,7 +168,7 @@ class TempoMetric {
 class TempoMap : public PBD::StatefulDestructible
 {
   public:
-       TempoMap (nframes_t frame_rate);
+       TempoMap (framecnt_t frame_rate);
        ~TempoMap();
 
        /* measure-based stuff */
@@ -258,15 +258,15 @@ class TempoMap : public PBD::StatefulDestructible
        int n_tempos () const;
        int n_meters () const;
 
-       nframes_t frame_rate () const { return _frame_rate; }
+       framecnt_t frame_rate () const { return _frame_rate; }
 
   private:
        static Tempo    _default_tempo;
        static Meter    _default_meter;
 
        Metrics*             metrics;
-       nframes_t           _frame_rate;
-       framepos_t          last_bbt_when;
+       framecnt_t          _frame_rate;
+       framepos_t           last_bbt_when;
        bool                 last_bbt_valid;
        BBT_Time             last_bbt;
        mutable Glib::RWLock lock;
index 3c312176a8945c55c049b62d2ae280199684eae5..8e927471a062eec94298157ebb7fc275aa7d5757 100644 (file)
@@ -25,7 +25,7 @@ class ThreadBuffers {
         uint32_t   npan_buffers;
 
   private:
-        void allocate_pan_automation_buffers (nframes_t nframes, uint32_t howmany, bool force);
+        void allocate_pan_automation_buffers (framecnt_t nframes, uint32_t howmany, bool force);
 };
 
 } // namespace
index f5cda677ede35c4852f9ce8c2e8923888f5ce1d2..0a24070608b654dfbb6002dd50aff20121e77ea0 100644 (file)
@@ -43,8 +43,8 @@ public:
        Ticker() {};
        virtual ~Ticker() {}
 
-       virtual void tick(
-               const nframes_t& transport_frames,
+       virtual void tick (
+               const framepos_t& transport_frames,
                const BBT_Time& transport_bbt,
                const Timecode::Time& transport_timecode) = 0;
 
@@ -68,7 +68,7 @@ public:
        }
 
        void tick(
-               const nframes_t& transport_frames,
+               const framepos_t& transport_frames,
                const BBT_Time& transport_bbt,
                const Timecode::Time& transport_timecode);
 
@@ -82,7 +82,7 @@ public:
        void transport_state_changed();
 
        /// slot for the signal session::PositionChanged
-       void position_changed(nframes_t position);
+       void position_changed (framepos_t position);
 
        /// slot for the signal session::TransportLooped
        void transport_looped();
@@ -95,12 +95,12 @@ private:
        int          _ppqn;
        double       _last_tick;
 
-       double one_ppqn_in_frames(nframes_t transport_position);
+       double one_ppqn_in_frames (framepos_t transport_position);
 
-       void send_midi_clock_event(nframes_t offset);
-       void send_start_event(nframes_t offset);
-       void send_continue_event(nframes_t offset);
-       void send_stop_event(nframes_t offset);
+       void send_midi_clock_event (framecnt_t offset);
+       void send_start_event (framecnt_t offset);
+       void send_continue_event (framecnt_t offset);
+       void send_stop_event (framecnt_t offset);
 };
 
 }
index ff1b57950a4bfbd2662cad59364949b7c0a1932f..5087ddda3af9a1fdd64f7cb9656b7d4ffc8f410e 100644 (file)
@@ -48,13 +48,13 @@ class Track : public Route, public PublicDiskstream
        virtual bool can_use_mode (TrackMode /*m*/, bool& /*bounce_required*/) { return false; }
        PBD::Signal0<void> TrackModeChanged;
 
-       virtual int no_roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame,
+       virtual int no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
                        bool state_changing, bool can_record, bool rec_monitors_input);
 
-       int silent_roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame,
+       int silent_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
                          bool can_record, bool rec_monitors_input, bool& need_butler);
 
-       virtual int roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame,
+       virtual 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) = 0;
 
         bool needs_butler() const { return _needs_butler; }
@@ -67,8 +67,8 @@ class Track : public Route, public PublicDiskstream
         virtual void use_new_diskstream () = 0;
         virtual void set_diskstream (boost::shared_ptr<Diskstream>);
 
-       nframes_t update_total_latency();
-       void           set_latency_delay (nframes_t);
+       framecnt_t update_total_latency();
+       void set_latency_delay (framecnt_t);
 
        enum FreezeState {
                NoFreeze,
@@ -82,7 +82,7 @@ class Track : public Route, public PublicDiskstream
        virtual void unfreeze () = 0;
 
        virtual boost::shared_ptr<Region> bounce (InterThreadInfo&) = 0;
-       virtual boost::shared_ptr<Region> bounce_range (nframes_t start, nframes_t end, InterThreadInfo&, bool enable_processing = true) = 0;
+       virtual boost::shared_ptr<Region> bounce_range (framepos_t start, framepos_t end, InterThreadInfo&, bool enable_processing = true) = 0;
 
        XMLNode&    get_state();
        XMLNode&    get_template();
@@ -97,7 +97,7 @@ class Track : public Route, public PublicDiskstream
        /* XXX: unfortunate that this is exposed */
        PBD::ID const & diskstream_id () const;
 
-       void set_block_size (nframes_t);
+       void set_block_size (pframes_t);
 
        /* PublicDiskstream interface */
        boost::shared_ptr<Playlist> playlist ();
index d452cd6b541e2cc8fcc77a9f3b7d1391fc6e09ad..1f16ce6313e2e50144e4424fe8737bad9be640da 100644 (file)
@@ -52,7 +52,7 @@ namespace ARDOUR {
        typedef float                       gain_t;
        typedef uint32_t                    layer_t;
        typedef uint64_t                    microseconds_t;
-       typedef uint32_t                    nframes_t;
+       typedef jack_nframes_t              pframes_t;
 
         /* Any position measured in audio frames.
            Assumed to be non-negative but not enforced.
@@ -213,7 +213,7 @@ namespace ARDOUR {
                BBT_Time       bbt;
 
                union {
-                       nframes_t      frames;
+                       framecnt_t     frames;
                        double         seconds;
                };
 
@@ -221,13 +221,13 @@ namespace ARDOUR {
        };
 
        struct AudioRange {
-               nframes_t start;
-               nframes_t end;
+               framepos_t start;
+               framepos_t end;
                uint32_t id;
 
-               AudioRange (nframes_t s, nframes_t e, uint32_t i) : start (s), end (e) , id (i) {}
+               AudioRange (framepos_t s, framepos_t e, uint32_t i) : start (s), end (e) , id (i) {}
 
-               nframes_t length() { return end - start + 1; }
+               framecnt_t length() { return end - start + 1; }
 
                bool operator== (const AudioRange& other) const {
                        return start == other.start && end == other.end && id == other.id;
@@ -237,7 +237,7 @@ namespace ARDOUR {
                        return start == other.start && end == other.end;
                }
 
-               OverlapType coverage (nframes_t s, nframes_t e) const {
+               OverlapType coverage (framepos_t s, framepos_t e) const {
                        return ARDOUR::coverage (start, end, s, e);
                }
        };
@@ -560,9 +560,8 @@ track_frame_to_session_frame (ARDOUR::framepos_t track_frame, double speed)
        return (ARDOUR::framepos_t)( (double)track_frame / speed );
 }
 
-/* for now, break the rules and use "using" to make these "global" */
+/* for now, break the rules and use "using" to make this "global" */
 
-using ARDOUR::nframes_t;
 using ARDOUR::framepos_t;
 
 
index 8c3145a28b5ad7224d7a4b0854109c979c01b128..06dc6d6bd9584e789885648e915ad9361cd620cd 100644 (file)
@@ -62,7 +62,7 @@ std::string path_expand (std::string);
 std::string region_name_from_path (std::string path, bool strip_channels, bool add_channel_suffix = false, uint32_t total = 0, uint32_t this_one = 0);
 bool path_is_paired (std::string path, std::string& pair_base);
 
-void compute_equal_power_fades (ARDOUR::nframes_t nframes, float* in, float* out);
+void compute_equal_power_fades (ARDOUR::framecnt_t nframes, float* in, float* out);
 
 const char* sync_source_to_string (ARDOUR::SyncSource src);
 ARDOUR::SyncSource string_to_sync_source (std::string str);
index 4b6b42e73271177138631b7176e48d859f662479..063bcb82d6882017bdf8d13ddafca3e8ea7f8798 100644 (file)
@@ -37,9 +37,9 @@ public:
        static StreamPanner* factory (Panner& parent, Evoral::Parameter param, Speakers& s);
        static std::string name;
 
-       void do_distribute (AudioBuffer&, BufferSet& obufs, gain_t gain_coeff, nframes_t nframes);
+       void do_distribute (AudioBuffer&, BufferSet& obufs, gain_t gain_coeff, pframes_t nframes);
        void do_distribute_automated (AudioBuffer& src, BufferSet& obufs,
-                                     nframes_t start, nframes_t end, nframes_t nframes, pan_t** buffers);
+                                     framepos_t start, framepos_t end, pframes_t nframes, pan_t** buffers);
 
        void set_azimuth_elevation (double azimuth, double elevation);
 
index c6caf4ddc53fe42d7ec636c7f28d123fa95a1cbc..7b271b2e73cdd6be2d95bd92834097785a95c606 100644 (file)
@@ -421,14 +421,14 @@ AudioDiskstream::prepare_record_status(framepos_t capture_start_frame)
 }
 
 int
-AudioDiskstream::process (framepos_t transport_frame, nframes_t nframes, bool can_record, bool rec_monitors_input, bool& need_butler)
+AudioDiskstream::process (framepos_t transport_frame, pframes_t nframes, bool can_record, bool rec_monitors_input, bool& need_butler)
 {
        uint32_t n;
        boost::shared_ptr<ChannelList> c = channels.reader();
        ChannelList::iterator chan;
        int ret = -1;
-       nframes_t rec_offset = 0;
-       nframes_t rec_nframes = 0;
+       framecnt_t rec_offset = 0;
+       framecnt_t rec_nframes = 0;
        bool collect_playback = false;
 
         playback_distance = 0;
@@ -519,7 +519,7 @@ AudioDiskstream::process (framepos_t transport_frame, nframes_t nframes, bool ca
 
                        } else {
 
-                               nframes_t total = chaninfo->capture_vector.len[0] + chaninfo->capture_vector.len[1];
+                               framecnt_t total = chaninfo->capture_vector.len[0] + chaninfo->capture_vector.len[1];
 
                                if (rec_nframes > total) {
                                        DiskOverrun ();
@@ -530,7 +530,7 @@ AudioDiskstream::process (framepos_t transport_frame, nframes_t nframes, bool ca
                                assert(ap);
 
                                Sample* buf = ap->get_audio_buffer(nframes).data();
-                               nframes_t first = chaninfo->capture_vector.len[0];
+                               framecnt_t first = chaninfo->capture_vector.len[0];
 
                                memcpy (chaninfo->capture_wrap_buffer, buf, sizeof (Sample) * first);
                                memcpy (chaninfo->capture_vector.buf[0], buf, sizeof (Sample) * first);
@@ -593,12 +593,12 @@ AudioDiskstream::process (framepos_t transport_frame, nframes_t nframes, bool ca
 
                /* we're doing playback */
 
-               nframes_t necessary_samples;
+               framecnt_t necessary_samples;
 
                /* no varispeed playback if we're recording, because the output .... TBD */
 
                if (rec_nframes == 0 && _actual_speed != 1.0f) {
-                       necessary_samples = (nframes_t) floor ((nframes * fabs (_actual_speed))) + 1;
+                       necessary_samples = (framecnt_t) floor ((nframes * fabs (_actual_speed))) + 1;
                } else {
                        necessary_samples = nframes;
                }
@@ -618,7 +618,7 @@ AudioDiskstream::process (framepos_t transport_frame, nframes_t nframes, bool ca
                                chaninfo->current_playback_buffer = chaninfo->playback_vector.buf[0];
 
                        } else {
-                               nframes_t total = chaninfo->playback_vector.len[0] + chaninfo->playback_vector.len[1];
+                               framecnt_t total = chaninfo->playback_vector.len[0] + chaninfo->playback_vector.len[1];
 
                                if (necessary_samples > total) {
                                        cerr << _name << " Need " << necessary_samples << " total = " << total << endl;
@@ -662,7 +662,7 @@ AudioDiskstream::process (framepos_t transport_frame, nframes_t nframes, bool ca
 }
 
 void
-AudioDiskstream::process_varispeed_playback(nframes_t nframes, boost::shared_ptr<ChannelList> c)
+AudioDiskstream::process_varispeed_playback (pframes_t nframes, boost::shared_ptr<ChannelList> c)
 {
        ChannelList::iterator chan;
 
@@ -680,7 +680,7 @@ AudioDiskstream::process_varispeed_playback(nframes_t nframes, boost::shared_ptr
 }
 
 bool
-AudioDiskstream::commit (nframes_t /* nframes */)
+AudioDiskstream::commit (framecnt_t /* nframes */)
 {
        bool need_butler = false;
 
@@ -750,7 +750,7 @@ AudioDiskstream::overwrite_existing_buffers ()
        overwrite_queued = false;
 
        /* assume all are the same size */
-       nframes_t size = c->front()->playback_buf->bufsize();
+       framecnt_t size = c->front()->playback_buf->bufsize();
 
        mixdown_buffer = new Sample[size];
        gain_buffer = new float[size];
@@ -764,7 +764,7 @@ AudioDiskstream::overwrite_existing_buffers ()
        for (ChannelList::iterator chan = c->begin(); chan != c->end(); ++chan, ++n) {
 
                start = overwrite_frame;
-               nframes_t cnt = size;
+               framecnt_t cnt = size;
 
                /* to fill the buffer without resetting the playback sample, we need to
                   do it one or two chunks (normally two).
@@ -777,7 +777,7 @@ AudioDiskstream::overwrite_existing_buffers ()
 
                */
 
-               nframes_t to_read = size - overwrite_offset;
+               framecnt_t to_read = size - overwrite_offset;
 
                if (read ((*chan)->playback_buf->buffer() + overwrite_offset, mixdown_buffer, gain_buffer, start, to_read, *chan, n, reversed)) {
                        error << string_compose(_("AudioDiskstream %1: when refilling, cannot read %2 from playlist at frame %3"),
@@ -874,14 +874,14 @@ AudioDiskstream::internal_playback_seek (framecnt_t distance)
 
 int
 AudioDiskstream::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)
 {
-       nframes_t this_read = 0;
+       framecnt_t this_read = 0;
        bool reloop = false;
        framepos_t loop_end = 0;
        framepos_t loop_start = 0;
-       nframes_t offset = 0;
+       framecnt_t offset = 0;
        Location *loc = 0;
 
        /* XXX we don't currently play loops in reverse. not sure why */
@@ -988,15 +988,15 @@ int
 AudioDiskstream::_do_refill (Sample* mixdown_buffer, float* gain_buffer)
 {
        int32_t ret = 0;
-       nframes_t to_read;
+       framecnt_t to_read;
        RingBufferNPT<Sample>::rw_vector vector;
        bool reversed = (_visible_speed * _session.transport_speed()) < 0.0f;
-       nframes_t total_space;
-       nframes_t zero_fill;
+       framecnt_t total_space;
+       framecnt_t zero_fill;
        uint32_t chan_n;
        ChannelList::iterator i;
        boost::shared_ptr<ChannelList> c = channels.reader();
-       nframes_t ts;
+       framecnt_t ts;
 
        if (c->empty()) {
                return 0;
@@ -1121,7 +1121,7 @@ AudioDiskstream::_do_refill (Sample* mixdown_buffer, float* gain_buffer)
                ChannelInfo* chan (*i);
                Sample* buf1;
                Sample* buf2;
-               nframes_t len1, len2;
+               framecnt_t len1, len2;
 
                chan->playback_buf->get_write_vector (&vector);
 
@@ -1216,7 +1216,7 @@ AudioDiskstream::do_flush (RunContext /*context*/, bool force_flush)
        int32_t ret = 0;
        RingBufferNPT<Sample>::rw_vector vector;
        RingBufferNPT<CaptureTransition>::rw_vector transvec;
-       nframes_t total;
+       framecnt_t total;
 
        _write_data_count = 0;
 
@@ -1251,7 +1251,7 @@ AudioDiskstream::do_flush (RunContext /*context*/, bool force_flush)
                        ret = 1;
                }
 
-               to_write = min (disk_io_chunk_frames, (nframes_t) vector.len[0]);
+               to_write = min (disk_io_chunk_frames, (framecnt_t) vector.len[0]);
 
                // check the transition buffer when recording destructive
                // important that we get this after the capture buf
@@ -1321,7 +1321,7 @@ AudioDiskstream::do_flush (RunContext /*context*/, bool force_flush)
                           of vector.len[1] to be flushed to disk as well.
                        */
 
-                       to_write = min ((nframes_t)(disk_io_chunk_frames - to_write), (nframes_t) vector.len[1]);
+                       to_write = min ((framecnt_t)(disk_io_chunk_frames - to_write), (framecnt_t) vector.len[1]);
 
                        if ((*chan)->write_source->write (vector.buf[1], to_write) != to_write) {
                                error << string_compose(_("AudioDiskstream %1: cannot write to disk"), _id) << endmsg;
@@ -1346,7 +1346,7 @@ AudioDiskstream::transport_stopped_wallclock (struct tm& when, time_t twhen, boo
        bool more_work = true;
        int err = 0;
        boost::shared_ptr<AudioRegion> region;
-       nframes_t total_capture;
+       framecnt_t total_capture;
        SourceList srcs;
        SourceList::iterator src;
        ChannelList::iterator chan;
@@ -2002,7 +2002,7 @@ AudioDiskstream::rename_write_sources ()
 }
 
 void
-AudioDiskstream::set_block_size (nframes_t /*nframes*/)
+AudioDiskstream::set_block_size (pframes_t /*nframes*/)
 {
        if (_session.get_block_size() > speed_buffer_size) {
                speed_buffer_size = _session.get_block_size();
@@ -2026,7 +2026,7 @@ AudioDiskstream::allocate_temporary_buffers ()
        */
 
        double const sp = max (fabsf (_actual_speed), 1.2f);
-       nframes_t required_wrap_size = (nframes_t) floor (_session.get_block_size() * sp) + 1;
+       framecnt_t required_wrap_size = (framecnt_t) floor (_session.get_block_size() * sp) + 1;
 
        if (required_wrap_size > wrap_buffer_size) {
 
@@ -2350,7 +2350,7 @@ AudioDiskstream::adjust_capture_buffering ()
         }
 }
 
-AudioDiskstream::ChannelInfo::ChannelInfo (nframes_t playback_bufsize, nframes_t capture_bufsize, nframes_t speed_size, nframes_t wrap_size)
+AudioDiskstream::ChannelInfo::ChannelInfo (framecnt_t playback_bufsize, framecnt_t capture_bufsize, framecnt_t speed_size, framecnt_t wrap_size)
 {
        peak_power = 0.0f;
        source = 0;
@@ -2378,7 +2378,7 @@ AudioDiskstream::ChannelInfo::ChannelInfo (nframes_t playback_bufsize, nframes_t
 }
 
 void
-AudioDiskstream::ChannelInfo::resize_playback (nframes_t playback_bufsize)
+AudioDiskstream::ChannelInfo::resize_playback (framecnt_t playback_bufsize)
 {
         delete playback_buf;
        playback_buf = new RingBufferNPT<Sample> (playback_bufsize);
@@ -2386,7 +2386,7 @@ AudioDiskstream::ChannelInfo::resize_playback (nframes_t playback_bufsize)
 }
 
 void
-AudioDiskstream::ChannelInfo::resize_capture (nframes_t capture_bufsize)
+AudioDiskstream::ChannelInfo::resize_capture (framecnt_t capture_bufsize)
 {
         delete capture_buf;
 
index 1fa9c5adc4990659b8bca3de450f85b5b974b076..497667215214ccadc3e287df0d6768920c277fb4 100644 (file)
@@ -164,7 +164,7 @@ AudioPlaylist::AudioPlaylist (boost::shared_ptr<const AudioPlaylist> other, stri
        }
 }
 
-AudioPlaylist::AudioPlaylist (boost::shared_ptr<const AudioPlaylist> other, nframes_t start, nframes_t cnt, string name, bool hidden)
+AudioPlaylist::AudioPlaylist (boost::shared_ptr<const AudioPlaylist> other, framepos_t start, framecnt_t cnt, string name, bool hidden)
        : Playlist (other, start, cnt, name, hidden)
        , _crossfades (*this)
 {
@@ -838,15 +838,13 @@ AudioPlaylist::region_changed (const PropertyChange& what_changed, boost::shared
 }
 
 void
-AudioPlaylist::crossfades_at (nframes_t frame, Crossfades& clist)
+AudioPlaylist::crossfades_at (framepos_t frame, Crossfades& clist)
 {
        RegionLock rlock (this);
 
        for (Crossfades::iterator i = _crossfades.begin(); i != _crossfades.end(); ++i) {
-               nframes_t start, end;
-
-               start = (*i)->position();
-               end = start + (*i)->overlap_length(); // not length(), important difference
+               framepos_t const start = (*i)->position ();
+               framepos_t const end = start + (*i)->overlap_length(); // not length(), important difference
 
                if (frame >= start && frame <= end) {
                        clist.push_back (*i);
index c7e920dfb69663068c07ef4010cb4944330396de..aad56748c319395564a0ffb413e1a13726c60ef4 100644 (file)
@@ -25,7 +25,7 @@
 using namespace ARDOUR;
 using namespace std;
 
-nframes_t AudioPort::_port_offset = 0;
+framecnt_t AudioPort::_port_offset = 0;
 
 AudioPort::AudioPort (const std::string& name, Flags flags)
        : Port (name, DataType::AUDIO, flags)
@@ -40,7 +40,7 @@ AudioPort::~AudioPort ()
 }
 
 void
-AudioPort::cycle_start (nframes_t nframes)
+AudioPort::cycle_start (pframes_t nframes)
 {
        /* caller must hold process lock */
 
@@ -65,7 +65,7 @@ AudioPort::cycle_start (nframes_t nframes)
 }
 
 void
-AudioPort::cycle_end (nframes_t nframes)
+AudioPort::cycle_end (pframes_t nframes)
 {
        if (sends_output() && !_buffer->written()) {
                _buffer->silence (nframes);
@@ -78,7 +78,7 @@ AudioPort::cycle_split ()
 }
 
 AudioBuffer&
-AudioPort::get_audio_buffer (nframes_t nframes, nframes_t offset)
+AudioPort::get_audio_buffer (framecnt_t nframes, framecnt_t offset)
 {
        /* caller must hold process lock */
 
@@ -100,7 +100,7 @@ AudioPort::get_audio_buffer (nframes_t nframes, nframes_t offset)
 }
 
 size_t
-AudioPort::raw_buffer_size (nframes_t nframes) const
+AudioPort::raw_buffer_size (pframes_t nframes) const
 {
        return nframes * sizeof (Sample);
 }
index 2cade745f2d055f81df0a4e3d3d1dc7399d12e75..775bd0119f1eca90009965704a16085d71fdfe51 100644 (file)
@@ -126,7 +126,7 @@ AudioRegionImporter::~AudioRegionImporter ()
 string
 AudioRegionImporter::get_info () const
 {
-       nframes_t length, position;
+       framecnt_t length, position;
        Timecode::Time length_time, position_time;
        std::ostringstream oss;
 
index ca2291902d277a2e179e760e31c8092cdf344e2b..182fdccd26e2c0a647cc2bba057ff7c32716f347 100644 (file)
@@ -354,7 +354,7 @@ AudioTrack::set_state_part_two ()
 }
 
 int
-AudioTrack::roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick,
+AudioTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick,
                  bool can_record, bool rec_monitors_input, bool& need_butler)
 {
        Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK);
@@ -365,7 +365,7 @@ AudioTrack::roll (nframes_t nframes, framepos_t start_frame, framepos_t end_fram
        int dret;
        Sample* b;
        Sample* tmpb;
-       nframes_t transport_frame;
+       framepos_t transport_frame;
        boost::shared_ptr<AudioDiskstream> diskstream = audio_diskstream();
         
        automation_snapshot (start_frame, false);
@@ -453,7 +453,7 @@ AudioTrack::roll (nframes_t nframes, framepos_t start_frame, framepos_t end_fram
 
                                Sample* bb = bufs.get_audio (i).data();
 
-                               for (nframes_t xx = 0; xx < nframes; ++xx) {
+                               for (pframes_t xx = 0; xx < nframes; ++xx) {
                                        bb[xx] = b[xx] * scaling;
                                }
 
@@ -595,7 +595,7 @@ AudioTrack::bounce (InterThreadInfo& itt)
 }
 
 boost::shared_ptr<Region>
-AudioTrack::bounce_range (nframes_t start, nframes_t end, InterThreadInfo& itt, bool enable_processing)
+AudioTrack::bounce_range (framepos_t start, framepos_t end, InterThreadInfo& itt, bool enable_processing)
 {
        vector<boost::shared_ptr<Source> > srcs;
        return _session.write_one_track (*this, start, end, false, srcs, itt, enable_processing);
index b29384b2010cb9e2a4f2974d9a349f7d5815ac3d..a831e480dbceafdf598d02dcd530575ae3eb0e3d 100644 (file)
@@ -357,7 +357,7 @@ AudioTrackImporter::rate_convert_events (XMLNode & node)
        std::stringstream str (content_node->content());
        std::ostringstream new_content;
 
-       nframes_t x;
+       framecnt_t x;
        double y;
        bool ok = true;
 
index 517c5f150cb83ec83e6c8e7aab91effd57ebedfb..daace03de17369858ea9ba4bba79c35c9a350976 100644 (file)
@@ -758,7 +758,7 @@ AUPlugin::default_value (uint32_t port)
        return 0;
 }
 
-nframes_t
+framecnt_t
 AUPlugin::signal_latency () const
 {
        return unit->Latency() * _session.frame_rate();
@@ -858,7 +858,7 @@ AUPlugin::requires_fixed_size_buffers() const
 
 
 int
-AUPlugin::set_block_size (nframes_t nframes)
+AUPlugin::set_block_size (pframes_t nframes)
 {
        bool was_initialized = initialized;
        UInt32 numFrames = nframes;
@@ -1252,7 +1252,7 @@ AUPlugin::render_callback(AudioUnitRenderActionFlags*,
 }
 
 int
-AUPlugin::connect_and_run (BufferSet& bufs, ChanMapping, ChanMapping, nframes_t nframes, nframes_t offset)
+AUPlugin::connect_and_run (BufferSet& bufs, ChanMapping, ChanMapping, pframes_t nframes, framecnt_t offset)
 {
        AudioUnitRenderActionFlags flags = 0;
        AudioTimeStamp ts;
index 7b649aae896266ffb12c309565825ebe119a384c..cb46c45defbe3bbbfb25c3b4becb4e8dbcd7da15 100644 (file)
@@ -111,7 +111,7 @@ AudioAnalyser::analyse (const string& path, Readable* src, uint32_t channel)
 
        while (!done) {
 
-               nframes_t to_read;
+               framecnt_t to_read;
 
                /* read from source */
 
index 32ebe1643edecfe579c0387953d7df058d45092b..cb5374eabbe02bb87a8dec827a25bee46e578bba 100644 (file)
@@ -176,7 +176,7 @@ AudioEngine::start ()
 
        if (!_running) {
 
-               nframes_t blocksize = jack_get_buffer_size (_priv_jack);
+               pframes_t blocksize = jack_get_buffer_size (_priv_jack);
 
                if (_session) {
                        BootMessage (_("Connect session to engine"));
@@ -274,7 +274,7 @@ AudioEngine::stop (bool forever)
 
 
 bool
-AudioEngine::get_sync_offset (nframes_t& offset) const
+AudioEngine::get_sync_offset (pframes_t& offset) const
 {
 
 #ifdef HAVE_JACK_VIDEO_SUPPORT
@@ -300,14 +300,14 @@ AudioEngine::get_sync_offset (nframes_t& offset) const
 }
 
 void
-AudioEngine::_jack_timebase_callback (jack_transport_state_t state, nframes_t nframes,
+AudioEngine::_jack_timebase_callback (jack_transport_state_t state, pframes_t nframes,
                                      jack_position_t* pos, int new_position, void *arg)
 {
        static_cast<AudioEngine*> (arg)->jack_timebase_callback (state, nframes, pos, new_position);
 }
 
 void
-AudioEngine::jack_timebase_callback (jack_transport_state_t state, nframes_t nframes,
+AudioEngine::jack_timebase_callback (jack_transport_state_t state, pframes_t nframes,
                                     jack_position_t* pos, int new_position)
 {
        if (_jack && _session && _session->synced_to_jack()) {
@@ -368,7 +368,7 @@ AudioEngine::_graph_order_callback (void *arg)
  * @param arg User argument passed by JACK, which will be the AudioEngine*.
  */
 int
-AudioEngine::_process_callback (nframes_t nframes, void *arg)
+AudioEngine::_process_callback (pframes_t nframes, void *arg)
 {
        return static_cast<AudioEngine *> (arg)->process_callback (nframes);
 }
@@ -400,7 +400,7 @@ AudioEngine::_connect_callback (jack_port_id_t /*id_a*/, jack_port_id_t /*id_b*/
 }
 
 void
-AudioEngine::split_cycle (nframes_t offset)
+AudioEngine::split_cycle (pframes_t offset)
 {
        /* caller must hold process lock */
 
@@ -434,7 +434,7 @@ AudioEngine::process_thread ()
 
         while (1) {
                 GET_PRIVATE_JACK_POINTER_RET(_jack,0);
-                jack_nframes_t nframes = jack_cycle_wait (_jack);
+                pframes_t nframes = jack_cycle_wait (_jack);
 
                 if (process_callback (nframes)) {
                         cerr << "--- process\n";
@@ -452,14 +452,14 @@ AudioEngine::process_thread ()
  * @param nframes Number of frames to process.
  */
 int
-AudioEngine::process_callback (nframes_t nframes)
+AudioEngine::process_callback (pframes_t nframes)
 {
        GET_PRIVATE_JACK_POINTER_RET(_jack,0);
        // CycleTimer ct ("AudioEngine::process");
        Glib::Mutex::Lock tm (_process_lock, Glib::TRY_LOCK);
 
        /// The number of frames that will have been processed when we've finished
-       nframes_t next_processed_frames;
+       pframes_t next_processed_frames;
 
        /* handle wrap around of total frames counter */
 
@@ -571,13 +571,13 @@ AudioEngine::process_callback (nframes_t nframes)
 }
 
 int
-AudioEngine::_sample_rate_callback (nframes_t nframes, void *arg)
+AudioEngine::_sample_rate_callback (pframes_t nframes, void *arg)
 {
        return static_cast<AudioEngine *> (arg)->jack_sample_rate_callback (nframes);
 }
 
 int
-AudioEngine::jack_sample_rate_callback (nframes_t nframes)
+AudioEngine::jack_sample_rate_callback (pframes_t nframes)
 {
        _frame_rate = nframes;
        _usecs_per_cycle = (int) floor ((((double) frames_per_cycle() / nframes)) * 1000000.0);
@@ -597,13 +597,13 @@ AudioEngine::jack_sample_rate_callback (nframes_t nframes)
 }
 
 int
-AudioEngine::_bufsize_callback (nframes_t nframes, void *arg)
+AudioEngine::_bufsize_callback (pframes_t nframes, void *arg)
 {
        return static_cast<AudioEngine *> (arg)->jack_bufsize_callback (nframes);
 }
 
 int
-AudioEngine::jack_bufsize_callback (nframes_t nframes)
+AudioEngine::jack_bufsize_callback (pframes_t nframes)
 {
         bool need_midi_size = true;
         bool need_audio_size = true;
@@ -694,7 +694,7 @@ AudioEngine::set_session (Session *s)
 
                start_metering_thread ();
                
-               nframes_t blocksize = jack_get_buffer_size (_jack);
+               pframes_t blocksize = jack_get_buffer_size (_jack);
                
                /* page in as much of the session process code as we
                   can before we really start running.
@@ -933,14 +933,14 @@ AudioEngine::disconnect (Port& port)
        return port.disconnect_all ();
 }
 
-ARDOUR::nframes_t
+ARDOUR::framecnt_t
 AudioEngine::frame_rate () const
 {
-       GET_PRIVATE_JACK_POINTER_RET (_jack,0);
+       GET_PRIVATE_JACK_POINTER_RET (_jack, 0);
        if (_frame_rate == 0) {
-         return (_frame_rate = jack_get_sample_rate (_priv_jack));
+               return (_frame_rate = jack_get_sample_rate (_priv_jack));
        } else {
-         return _frame_rate;
+               return _frame_rate;
        }
 }
 
@@ -951,14 +951,14 @@ AudioEngine::raw_buffer_size (DataType t)
        return (s != _raw_buffer_sizes.end()) ? s->second : 0;
 }
 
-ARDOUR::nframes_t
+ARDOUR::framecnt_t
 AudioEngine::frames_per_cycle () const
 {
        GET_PRIVATE_JACK_POINTER_RET (_jack,0);
        if (_buffer_size == 0) {
-         return (_buffer_size = jack_get_buffer_size (_jack));
+               return (_buffer_size = jack_get_buffer_size (_jack));
        } else {
-         return _buffer_size;
+               return _buffer_size;
        }
 }
 
@@ -1196,7 +1196,7 @@ AudioEngine::transport_start ()
 }
 
 void
-AudioEngine::transport_locate (nframes_t where)
+AudioEngine::transport_locate (framepos_t where)
 {
        GET_PRIVATE_JACK_POINTER (_jack);
        // cerr << "tell JACK to locate to " << where << endl;
@@ -1401,7 +1401,7 @@ AudioEngine::reconnect_to_jack ()
 }
 
 int
-AudioEngine::request_buffer_size (nframes_t nframes)
+AudioEngine::request_buffer_size (pframes_t nframes)
 {
        GET_PRIVATE_JACK_POINTER_RET (_jack, -1);
 
index 39701f24cc25550cff57942214ae4148c4f7a3c1..63f7b55016455d7a02a9a862e2b65c81b8c49c16 100644 (file)
@@ -77,16 +77,16 @@ uint64_t           AudioFileSource::header_position_offset = 0;
 char AudioFileSource::bwf_serial_number[13] = "000000000000";
 
 struct SizedSampleBuffer {
-    nframes_t size;
-    Sample* buf;
+       framecnt_t size;
+       Sample* buf;
 
-    SizedSampleBuffer (nframes_t sz) : size (sz) {
-           buf = new Sample[size];
-    }
+       SizedSampleBuffer (framecnt_t sz) : size (sz) {
+               buf = new Sample[size];
+       }
 
-    ~SizedSampleBuffer() {
-           delete [] buf;
-    }
+       ~SizedSampleBuffer() {
+               delete [] buf;
+       }
 };
 
 Glib::StaticPrivate<SizedSampleBuffer> thread_interleave_buffer = GLIBMM_STATIC_PRIVATE_INIT;
@@ -302,7 +302,7 @@ AudioFileSource::move_dependents_to_trash()
 }
 
 void
-AudioFileSource::set_header_position_offset (nframes_t offset)
+AudioFileSource::set_header_position_offset (framecnt_t offset)
 {
        header_position_offset = offset;
        HeaderPositionOffsetChanged ();
@@ -385,7 +385,7 @@ AudioFileSource::safe_audio_file_extension(const string& file)
 }
 
 Sample*
-AudioFileSource::get_interleave_buffer (nframes_t size)
+AudioFileSource::get_interleave_buffer (framecnt_t size)
 {
        SizedSampleBuffer* ssb;
 
index 9d94651eb05f2790775b9cb76708b9d1585d362b..f3ae05f1b1b8710970d9b8707f40fe5dfddaf9dc 100644 (file)
@@ -297,8 +297,8 @@ AudioRegion::set_envelope_active (bool yn)
        }
 }
 
-ARDOUR::nframes_t
-AudioRegion::read_peaks (PeakData *buf, nframes_t npeaks, nframes_t offset, nframes_t cnt, uint32_t chan_n, double samples_per_unit) const
+ARDOUR::framecnt_t
+AudioRegion::read_peaks (PeakData *buf, framecnt_t npeaks, framecnt_t offset, framecnt_t cnt, uint32_t chan_n, double samples_per_unit) const
 {
        if (chan_n >= _sources.size()) {
                return 0;
@@ -308,7 +308,7 @@ AudioRegion::read_peaks (PeakData *buf, nframes_t npeaks, nframes_t offset, nfra
                return 0;
        } else {
                if (_scale_amplitude != 1.0f) {
-                       for (nframes_t n = 0; n < npeaks; ++n) {
+                       for (framecnt_t n = 0; n < npeaks; ++n) {
                                buf[n].max *= _scale_amplitude;
                                buf[n].min *= _scale_amplitude;
                        }
@@ -438,20 +438,19 @@ AudioRegion::_read_at (const SourceList& /*srcs*/, framecnt_t limit,
 
                if (_fade_in_active && _session.config.get_use_region_fades()) {
 
-                       nframes_t fade_in_length = (nframes_t) _fade_in->back()->when;
+                       framecnt_t fade_in_length = (framecnt_t) _fade_in->back()->when;
 
                        /* see if this read is within the fade in */
 
                        if (internal_offset < fade_in_length) {
 
-                               nframes_t fi_limit;
+                               framecnt_t fi_limit;
 
                                fi_limit = min (to_read, fade_in_length - internal_offset);
 
-
                                _fade_in->curve().get_vector (internal_offset, internal_offset+fi_limit, gain_buffer, fi_limit);
 
-                               for (nframes_t n = 0; n < fi_limit; ++n) {
+                               for (framecnt_t n = 0; n < fi_limit; ++n) {
                                        mixdown_buffer[n] *= gain_buffer[n];
                                }
                        }
@@ -480,20 +479,20 @@ AudioRegion::_read_at (const SourceList& /*srcs*/, framecnt_t limit,
                */
 
 
-                       nframes_t fade_out_length = (nframes_t) _fade_out->back()->when;
-                       nframes_t fade_interval_start = max(internal_offset, limit-fade_out_length);
-                       nframes_t fade_interval_end   = min(internal_offset + to_read, limit);
+                       framecnt_t fade_out_length = (framecnt_t) _fade_out->back()->when;
+                       framecnt_t fade_interval_start = max(internal_offset, limit-fade_out_length);
+                       framecnt_t fade_interval_end   = min(internal_offset + to_read, limit);
 
                        if (fade_interval_end > fade_interval_start) {
                                /* (part of the) the fade out is  in this buffer */
 
-                               nframes_t fo_limit = fade_interval_end - fade_interval_start;
-                               nframes_t curve_offset = fade_interval_start - (limit-fade_out_length);
-                               nframes_t fade_offset = fade_interval_start - internal_offset;
+                               framecnt_t fo_limit = fade_interval_end - fade_interval_start;
+                               framecnt_t curve_offset = fade_interval_start - (limit-fade_out_length);
+                               framecnt_t fade_offset = fade_interval_start - internal_offset;
 
                                _fade_out->curve().get_vector (curve_offset, curve_offset+fo_limit, gain_buffer, fo_limit);
 
-                               for (nframes_t n = 0, m = fade_offset; n < fo_limit; ++n, ++m) {
+                               for (framecnt_t n = 0, m = fade_offset; n < fo_limit; ++n, ++m) {
                                        mixdown_buffer[m] *= gain_buffer[n];
                                }
                        }
@@ -507,11 +506,11 @@ AudioRegion::_read_at (const SourceList& /*srcs*/, framecnt_t limit,
                _envelope->curve().get_vector (internal_offset, internal_offset + to_read, gain_buffer, to_read);
 
                if ((rops & ReadOpsOwnScaling) && _scale_amplitude != 1.0f) {
-                       for (nframes_t n = 0; n < to_read; ++n) {
+                       for (framecnt_t n = 0; n < to_read; ++n) {
                                mixdown_buffer[n] *= gain_buffer[n] * _scale_amplitude;
                        }
                } else {
-                       for (nframes_t n = 0; n < to_read; ++n) {
+                       for (framecnt_t n = 0; n < to_read; ++n) {
                                mixdown_buffer[n] *= gain_buffer[n];
                        }
                }
@@ -520,7 +519,7 @@ AudioRegion::_read_at (const SourceList& /*srcs*/, framecnt_t limit,
                // XXX this should be using what in 2.0 would have been:
                // Session::apply_gain_to_buffer (mixdown_buffer, to_read, _scale_amplitude);
 
-               for (nframes_t n = 0; n < to_read; ++n) {
+               for (framecnt_t n = 0; n < to_read; ++n) {
                        mixdown_buffer[n] *= _scale_amplitude;
                }
        }
@@ -532,7 +531,7 @@ AudioRegion::_read_at (const SourceList& /*srcs*/, framecnt_t limit,
 
                buf += buf_offset;
 
-               for (nframes_t n = 0; n < to_read; ++n) {
+               for (framecnt_t n = 0; n < to_read; ++n) {
                        buf[n] += mixdown_buffer[n];
                }
        }
@@ -713,13 +712,13 @@ AudioRegion::set_state (const XMLNode& node, int version)
 void
 AudioRegion::set_fade_in_shape (FadeShape shape)
 {
-       set_fade_in (shape, (nframes_t) _fade_in->back()->when);
+       set_fade_in (shape, (framecnt_t) _fade_in->back()->when);
 }
 
 void
 AudioRegion::set_fade_out_shape (FadeShape shape)
 {
-       set_fade_out (shape, (nframes_t) _fade_out->back()->when);
+       set_fade_out (shape, (framecnt_t) _fade_out->back()->when);
 }
 
 void
@@ -1063,8 +1062,8 @@ int
 AudioRegion::exportme (Session& /*session*/, ARDOUR::ExportSpecification& /*spec*/)
 {
        // TODO EXPORT
-//     const nframes_t blocksize = 4096;
-//     nframes_t to_read;
+//     const framecnt_t blocksize = 4096;
+//     framecnt_t to_read;
 //     int status = -1;
 //
 //     spec.channels = _sources.size();
@@ -1099,7 +1098,7 @@ AudioRegion::exportme (Session& /*session*/, ARDOUR::ExportSpecification& /*spec
 //                                     goto out;
 //                             }
 //
-//                             for (nframes_t x = 0; x < to_read; ++x) {
+//                             for (framecnt_t x = 0; x < to_read; ++x) {
 //                                     spec.dataF[chan+(x*spec.channels)] = buf[x];
 //                             }
 //                     }
index c61fb72ae2249ce69b115c51bd4cd0d44da5ca78..38261f3cbb662a275dc6a184e7f187388d34b085 100644 (file)
@@ -238,7 +238,7 @@ AudioSource::initialize_peakfile (bool newfile, string audio_path)
 
                /* we found it in the peaks dir, so check it out */
 
-               if (statbuf.st_size == 0 || ((nframes_t) statbuf.st_size < ((length(_timeline_position) / _FPP) * sizeof (PeakData)))) {
+               if (statbuf.st_size == 0 || ((framecnt_t) statbuf.st_size < ((length(_timeline_position) / _FPP) * sizeof (PeakData)))) {
                        // empty
                        _peaks_built = false;
                } else {
@@ -938,7 +938,7 @@ AudioSource::available_peaks (double zoom_factor) const
 }
 
 void
-AudioSource::dec_read_data_count (nframes_t cnt)
+AudioSource::dec_read_data_count (framecnt_t cnt)
 {
         uint32_t val = cnt * sizeof (Sample);
 
index 37df6297da90f1efa0084e27e96e0b106fd90d0a..d7605f26e1b3bc4d28da7dae431dc8f54c9207ef 100644 (file)
@@ -193,7 +193,7 @@ Auditioner::audition_region (boost::shared_ptr<Region> region)
        length = the_region->length();
 
        int dir;
-       nframes_t offset = the_region->sync_offset (dir);
+       framecnt_t offset = the_region->sync_offset (dir);
 
        /* can't audition from a negative sync point */
 
@@ -208,10 +208,10 @@ Auditioner::audition_region (boost::shared_ptr<Region> region)
 }
 
 int
-Auditioner::play_audition (nframes_t nframes)
+Auditioner::play_audition (framecnt_t nframes)
 {
        bool need_butler = false;
-       nframes_t this_nframes;
+       framecnt_t this_nframes;
        int ret;
 
        if (g_atomic_int_get (&_auditioning) == 0) {
index 903ae5df75587baef6380ad9dbbebe379368cd4b..248bb96b520061cbafb5d0417fe7a50da361ae9b 100644 (file)
@@ -45,7 +45,7 @@ using namespace std;
 using namespace ARDOUR;
 using namespace PBD;
 
-nframes_t Automatable::_automation_interval = 0;
+framecnt_t Automatable::_automation_interval = 0;
 
 Automatable::Automatable(Session& session)
        : _a_session(session)
@@ -387,7 +387,7 @@ Automatable::protect_automation ()
 }
 
 void
-Automatable::automation_snapshot (nframes_t now, bool force)
+Automatable::automation_snapshot (framepos_t now, bool force)
 {
        if (force || _last_automation_snapshot > now || (now - _last_automation_snapshot) > _automation_interval) {
 
index c8f5d18aec7377c4c01362842e6486d2359eac47..f4f4f95238efe3defda0df552156544a263ddd38 100644 (file)
@@ -392,7 +392,7 @@ AutomationList::set_state (const XMLNode& node, int version)
                const XMLNodeList& elist = node.children();
                XMLNodeConstIterator i;
                XMLProperty* prop;
-               nframes_t x;
+               pframes_t x;
                double y;
 
                 ControlList::freeze ();
index 4c802b1443e26d815828a3846349b747f47301ca..c60c0ac2b91fbe20372822d6aba5df78b42a9512 100644 (file)
@@ -85,7 +85,7 @@ BufferSet::clear()
 /** Make this BufferSet a direct mirror of a PortSet's buffers.
  */
 void
-BufferSet::attach_buffers(PortSet& ports, nframes_t nframes, nframes_t offset)
+BufferSet::attach_buffers (PortSet& ports, framecnt_t nframes, framecnt_t offset)
 {
        clear();
 
@@ -224,7 +224,7 @@ BufferSet::get_lv2_midi(bool input, size_t i)
        ebuf->reset();
        if (input) {
                for (MidiBuffer::iterator e = mbuf.begin(); e != mbuf.end(); ++e) {
-                       const Evoral::MIDIEvent<nframes_t> ev(*e, false);
+                       const Evoral::MIDIEvent<framepos_t> ev(*e, false);
                        uint32_t type = LV2Plugin::midi_event_type();
                        ebuf->append(ev.time(), 0, type, ev.size(), ev.buffer());
                }
@@ -299,7 +299,7 @@ BufferSet::VSTBuffer::clear ()
 }
 
 void
-BufferSet::VSTBuffer::push_back (Evoral::MIDIEvent<nframes_t> const & ev)
+BufferSet::VSTBuffer::push_back (Evoral::MIDIEvent<framepos_t> const & ev)
 {
        if (ev.size() > 3) {
                /* XXX: this will silently drop MIDI messages longer than 3 bytes, so
@@ -333,7 +333,7 @@ BufferSet::VSTBuffer::push_back (Evoral::MIDIEvent<nframes_t> const & ev)
 #endif /* VST_SUPPORT */
 
 void
-BufferSet::read_from (const BufferSet& in, nframes_t nframes)
+BufferSet::read_from (const BufferSet& in, framecnt_t nframes)
 {
        assert(available() >= in.count());
 
@@ -349,7 +349,7 @@ BufferSet::read_from (const BufferSet& in, nframes_t nframes)
 }
 
 void
-BufferSet::merge_from (const BufferSet& in, nframes_t nframes)
+BufferSet::merge_from (const BufferSet& in, framecnt_t nframes)
 {
        /* merge all input buffers into out existing buffers.
 
@@ -367,7 +367,7 @@ BufferSet::merge_from (const BufferSet& in, nframes_t nframes)
 }
 
 void
-BufferSet::silence (nframes_t nframes, nframes_t offset)
+BufferSet::silence (framecnt_t nframes, framecnt_t offset)
 {
        for (std::vector<BufferVec>::iterator i = _buffers.begin(); i != _buffers.end(); ++i) {
                for (BufferVec::iterator b = i->begin(); b != i->end(); ++b) {
index a77c11b983b85faf23f5f73e711ec8299eb4e8cb..72f2a0971d0cce97d35799c3eb1c73fd6320fe76 100644 (file)
@@ -87,7 +87,7 @@ Butler::start_thread()
         */
        midi_dstream_buffer_size = (uint32_t) floor (Config->get_midi_track_buffer_seconds() * rate);
 
-       MidiDiskstream::set_readahead_frames ((nframes_t)(Config->get_midi_readahead() * rate));
+       MidiDiskstream::set_readahead_frames ((framecnt_t) (Config->get_midi_readahead() * rate));
 
        Crossfade::set_buffer_size (audio_dstream_playback_buffer_size);
 
index e78691a1dd41621cdb27723b83107ca6390c8b64..149f213222def48b574f0d236ee4dcc072fe7a8f 100644 (file)
@@ -36,12 +36,12 @@ CAImportableSource::~CAImportableSource ()
 {
 }
 
-nframes_t
-CAImportableSource::read (Sample* buffer, nframes_t nframes)
+framecnt_t
+CAImportableSource::read (Sample* buffer, framecnt_t nframes)
 {
-       nframes_t nread = 0;
+       framecnt_t nread = 0;
        AudioBufferList abl;
-       nframes_t per_channel;
+       framecnt_t per_channel;
        bool at_end = false;
 
        abl.mNumberBuffers = 1;
@@ -91,8 +91,8 @@ CAImportableSource::length () const
        return af.GetNumberFrames();
 }
 
-nframes_t
-CAImportableSource::samplerate() const
+framecnt_t
+CAImportableSource::samplerate () const
 {
        CAStreamBasicDescription client_asbd;
 
@@ -107,7 +107,7 @@ CAImportableSource::samplerate() const
 }
 
 void
-CAImportableSource::seek (nframes_t pos)
+CAImportableSource::seek (framepos_t pos)
 {
        try {
                af.Seek (pos);
index d1038faf623086181bfb21c434dcf0a370ee4cf4..09e06a49bcd96a40d2b2eaa6c7db3826f633c019 100644 (file)
@@ -92,7 +92,7 @@ CoreAudioSource::~CoreAudioSource ()
 }
 
 int
-CoreAudioSource::safe_read (Sample* dst, nframes_t start, framecnt_t cnt, AudioBufferList& abl) const
+CoreAudioSource::safe_read (Sample* dst, framepos_t start, framecnt_t cnt, AudioBufferList& abl) const
 {
        framecnt_t nread = 0;
 
index b1f477285272115122b1306d913880e74daaf945..242e5c2918d386f332433dde1b50091b3a23b27f 100644 (file)
@@ -555,7 +555,7 @@ const Sample Session::default_click_emphasis[] = {
       0, 0,
 };
 
-const nframes_t Session::default_click_emphasis_length = sizeof (default_click_emphasis) / sizeof (default_click_emphasis[0]);
+const framecnt_t Session::default_click_emphasis_length = sizeof (default_click_emphasis) / sizeof (default_click_emphasis[0]);
 
 const Sample Session::default_click[] = {
               0, -0.014312744, -0.03338623, 0.019165039, 0.042541504,
@@ -1171,4 +1171,4 @@ const Sample Session::default_click[] = {
               0, 0, 0, 0, 0, 0, 0, 0,
 };
 
-const nframes_t Session::default_click_length = sizeof (default_click) / sizeof (default_click[0]);
+const framecnt_t Session::default_click_length = sizeof (default_click) / sizeof (default_click[0]);
index 700efd8ac1eae88e52036f5e456c2e4b62431e04..9bf597ef66af29a2f78f7495d30dd2ff76a71e6f 100644 (file)
@@ -43,9 +43,9 @@ using namespace std;
 using namespace PBD;
 using namespace ARDOUR;
 
-PBD::Signal1<void,nframes_t> Delivery::CycleStart;
-PBD::Signal0<int>           Delivery::PannersLegal;
-bool                                     Delivery::panners_legal = false;
+PBD::Signal1<void, pframes_t> Delivery::CycleStart;
+PBD::Signal0<int>             Delivery::PannersLegal;
+bool                          Delivery::panners_legal = false;
 
 /* deliver to an existing IO object */
 
@@ -115,14 +115,14 @@ Delivery::display_name () const
 }
 
 void
-Delivery::cycle_start (nframes_t /*nframes*/)
+Delivery::cycle_start (pframes_t /*nframes*/)
 {
        _output_offset = 0;
        _no_outs_cuz_we_no_monitor = false;
 }
 
 void
-Delivery::increment_output_offset (nframes_t n)
+Delivery::increment_output_offset (framecnt_t n)
 {
        _output_offset += n;
 }
@@ -226,7 +226,7 @@ Delivery::configure_io (ChanCount in, ChanCount out)
 }
 
 void
-Delivery::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, nframes_t nframes, bool result_required)
+Delivery::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool result_required)
 {
        assert (_output);
 
@@ -441,7 +441,7 @@ Delivery::end_pan_touch (uint32_t which, bool mark, double when)
 
 
 void
-Delivery::flush_buffers (nframes_t nframes, framepos_t time)
+Delivery::flush_buffers (framecnt_t nframes, framepos_t time)
 {
        /* io_lock, not taken: function must be called from Session::process() calltree */
 
index 5b3fe348705d902f921703da4e8d556a0ba1bf73..bf77d7d6adb085d356f3e281f7e5ceb20c5eb49f 100644 (file)
@@ -66,7 +66,7 @@ using namespace PBD;
  * default from configuration_vars.h).  0 is not a good value for
  * allocating buffer sizes..
  */
-ARDOUR::nframes_t Diskstream::disk_io_chunk_frames = 1024 * 256;
+ARDOUR::framecnt_t Diskstream::disk_io_chunk_frames = 1024 * 256;
 
 PBD::Signal0<void>                Diskstream::DiskOverrun;
 PBD::Signal0<void>                Diskstream::DiskUnderrun;
@@ -110,9 +110,6 @@ Diskstream::Diskstream (Session &sess, const string &name, Flag flag)
         , in_set_state (false)
         , _persistent_alignment_style (ExistingMaterial)
         , first_input_change (true)
-        , scrub_start (0)
-        , scrub_buffer_size (0)
-        , scrub_offset (0)
         , _flags (flag)
 
 {
@@ -157,9 +154,6 @@ Diskstream::Diskstream (Session& sess, const XMLNode& /*node*/)
         , in_set_state (false)
         , _persistent_alignment_style (ExistingMaterial)
         , first_input_change (true)
-        , scrub_start (0)
-        , scrub_buffer_size (0)
-        , scrub_offset (0)
         , _flags (Recordable)
 {
 }
@@ -238,7 +232,7 @@ Diskstream::realtime_set_speed (double sp, bool global)
 
        if (new_speed != _actual_speed) {
 
-               nframes_t required_wrap_size = (nframes_t) floor (_session.get_block_size() *
+               framecnt_t required_wrap_size = (framecnt_t) floor (_session.get_block_size() *
                                                                   fabs (new_speed)) + 1;
 
                if (required_wrap_size > wrap_buffer_size) {
@@ -329,7 +323,7 @@ Diskstream::get_captured_frames (uint32_t n) const
 }
 
 void
-Diskstream::set_roll_delay (ARDOUR::nframes_t nframes)
+Diskstream::set_roll_delay (ARDOUR::framecnt_t nframes)
 {
        _roll_delay = nframes;
 }
@@ -639,7 +633,7 @@ Diskstream::route_going_away ()
 
 void
 Diskstream::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)
 {
        switch (ot) {
        case OverlapNone:
index 9f217c2cd99b644b15241fafb1516443335ea17a..4f635f1693ccef28b51afc745a23a98e37e84f99 100644 (file)
@@ -95,15 +95,15 @@ ElementImporter::timecode_to_string(Timecode::Time & time) const
        return oss.str();
 }
 
-nframes_t
-ElementImporter::rate_convert_samples (nframes_t samples) const
+framecnt_t
+ElementImporter::rate_convert_samples (framecnt_t samples) const
 {
        if (sample_rate == session.frame_rate()) {
                return samples;
        }
 
        // +0.5 for proper rounding
-       return static_cast<nframes_t> (samples * (static_cast<double> (session.nominal_frame_rate()) / sample_rate) + 0.5);
+       return static_cast<framecnt_t> (samples * (static_cast<double> (session.nominal_frame_rate()) / sample_rate) + 0.5);
 }
 
 string
index f94ee1325792e787dd6eba39c6f0bb690c732e8a..0f2548dd00b17247e13512822f8ca57a5560b880 100644 (file)
@@ -39,7 +39,7 @@ PortExportChannel::operator< (ExportChannel const & other) const
 }
 
 void
-PortExportChannel::read (Sample * data, nframes_t frames) const
+PortExportChannel::read (Sample * data, framecnt_t frames) const
 {
        memset (data, 0, frames * sizeof (float));
 
@@ -128,7 +128,7 @@ RegionExportChannelFactory::create (uint32_t channel)
 }
 
 void
-RegionExportChannelFactory::read (uint32_t channel, Sample * data, nframes_t frames_to_read)
+RegionExportChannelFactory::read (uint32_t channel, Sample * data, framecnt_t frames_to_read)
 {
        assert (channel < n_channels);
        assert (frames_to_read <= frames_per_cycle);
@@ -142,7 +142,7 @@ RegionExportChannelFactory::read (uint32_t channel, Sample * data, nframes_t fra
 }
 
 void
-RegionExportChannelFactory::update_buffers (nframes_t frames)
+RegionExportChannelFactory::update_buffers (framecnt_t frames)
 {
        assert (frames <= frames_per_cycle);
 
index 1658e8cffc5882ddd11836326d2d5b19844c06d1..315da339d4c02ab6adc3e0992769a2d39598f958 100644 (file)
@@ -55,11 +55,11 @@ ExportFormatSpecification::Time::operator= (AnyTime const & other)
        return *this;
 }
 
-nframes_t
-ExportFormatSpecification::Time::get_frames (nframes_t target_rate) const
+framecnt_t
+ExportFormatSpecification::Time::get_frames (framecnt_t target_rate) const
 {
        //TODO position
-       nframes_t duration = session.convert_to_frames_at (0, *this);
+       framecnt_t duration = session.convert_to_frames_at (0, *this);
 
        return ((double) target_rate / session.frame_rate()) * duration + 0.5;
 }
index 1cd3118eae85e822fce42a45a6c4876e90aa1bc8..ba7491c9762289496071156147d9971c33939e4e 100644 (file)
@@ -38,7 +38,7 @@ ExportGraphBuilder::~ExportGraphBuilder ()
 }
 
 int
-ExportGraphBuilder::process (nframes_t frames, bool last_cycle)
+ExportGraphBuilder::process (framecnt_t frames, bool last_cycle)
 {
        assert(frames <= process_buffer_frames);
        
@@ -187,7 +187,7 @@ ExportGraphBuilder::Encoder::copy_files (std::string orig_path)
 
 /* SFC */
 
-ExportGraphBuilder::SFC::SFC (ExportGraphBuilder &, FileSpec const & new_config, nframes_t max_frames)
+ExportGraphBuilder::SFC::SFC (ExportGraphBuilder &, FileSpec const & new_config, framecnt_t max_frames)
   : data_width(0)
 {
        config = new_config;
@@ -252,7 +252,7 @@ ExportGraphBuilder::SFC::operator== (FileSpec const & other_config) const
 
 /* Normalizer */
 
-ExportGraphBuilder::Normalizer::Normalizer (ExportGraphBuilder & parent, FileSpec const & new_config, nframes_t /*max_frames*/)
+ExportGraphBuilder::Normalizer::Normalizer (ExportGraphBuilder & parent, FileSpec const & new_config, framecnt_t /*max_frames*/)
   : parent (parent)
 {
        config = new_config;
@@ -306,7 +306,7 @@ ExportGraphBuilder::Normalizer::operator== (FileSpec const & other_config) const
 bool
 ExportGraphBuilder::Normalizer::process()
 {
-       nframes_t frames_read = tmp_file->read (*buffer);
+       framecnt_t frames_read = tmp_file->read (*buffer);
        return frames_read != buffer->frames();
 }
 
@@ -321,7 +321,7 @@ ExportGraphBuilder::Normalizer::start_post_processing()
 
 /* SRC */
 
-ExportGraphBuilder::SRC::SRC (ExportGraphBuilder & parent, FileSpec const & new_config, nframes_t max_frames)
+ExportGraphBuilder::SRC::SRC (ExportGraphBuilder & parent, FileSpec const & new_config, framecnt_t max_frames)
   : parent (parent)
 {
        config = new_config;
@@ -371,12 +371,12 @@ ExportGraphBuilder::SRC::operator== (FileSpec const & other_config) const
 }
 
 /* SilenceHandler */
-ExportGraphBuilder::SilenceHandler::SilenceHandler (ExportGraphBuilder & parent, FileSpec const & new_config, nframes_t max_frames)
+ExportGraphBuilder::SilenceHandler::SilenceHandler (ExportGraphBuilder & parent, FileSpec const & new_config, framecnt_t max_frames)
   : parent (parent)
 {
        config = new_config;
        max_frames_in = max_frames;
-       nframes_t sample_rate = parent.session.nominal_frame_rate();
+       framecnt_t sample_rate = parent.session.nominal_frame_rate();
        
        silence_trimmer.reset (new SilenceTrimmer<Sample>(max_frames_in));
        silence_trimmer->set_trim_beginning (config.format->trim_beginning());
@@ -457,7 +457,7 @@ ExportGraphBuilder::ChannelConfig::add_child (FileSpec const & new_config)
                }
        }
        
-       nframes_t max_frames_out = new_config.channel_config->get_n_chans() * max_frames;
+       framecnt_t const max_frames_out = new_config.channel_config->get_n_chans() * max_frames;
        children.push_back (new SilenceHandler (parent, new_config, max_frames_out));
        interleaver->add_output (children.back().sink ());
 }
index 9ffb7c17789915170f9b9ae2613b63e260402e2a..59a023c4d8483074d86aa04779d9ee22f1c6a327 100644 (file)
@@ -178,7 +178,7 @@ ExportHandler::start_timespan ()
 }
 
 int
-ExportHandler::process (nframes_t frames)
+ExportHandler::process (framecnt_t frames)
 {
        if (!export_status->running) {
                return 0;
@@ -190,11 +190,11 @@ ExportHandler::process (nframes_t frames)
 }
 
 int
-ExportHandler::process_timespan (nframes_t frames)
+ExportHandler::process_timespan (framecnt_t frames)
 {
        /* update position */
 
-       nframes_t frames_to_read = 0;
+       framecnt_t frames_to_read = 0;
        framepos_t const start = current_timespan->get_start();
        framepos_t const end = current_timespan->get_end();
        
@@ -538,7 +538,7 @@ void
 ExportHandler::frames_to_cd_frames_string (char* buf, framepos_t when)
 {
        framecnt_t remainder;
-       nframes_t fr = session.nominal_frame_rate();
+       framecnt_t fr = session.nominal_frame_rate();
        int mins, secs, frames;
 
        mins = when / (60 * fr);
index d745b1f94c536cb67d00eca35d119b5e67b5e20a..1b6f4406a5a66c9eb73a6f42e8ed19813adc5055 100644 (file)
@@ -290,7 +290,7 @@ ExportProfileManager::find_file (std::string const & pattern)
 }
 
 void
-ExportProfileManager::set_selection_range (nframes_t start, nframes_t end)
+ExportProfileManager::set_selection_range (framepos_t start, framepos_t end)
 {
 
        if (start || end) {
@@ -307,7 +307,7 @@ ExportProfileManager::set_selection_range (nframes_t start, nframes_t end)
 }
 
 std::string
-ExportProfileManager::set_single_range (nframes_t start, nframes_t end, string name)
+ExportProfileManager::set_single_range (framepos_t start, framepos_t end, string name)
 {
        single_range_mode = true;
 
index 948bf768d52bcdea3a34d75caf4b88db7937da87..5b62c7dfcc72072ac6636b0f904b83806beca44b 100644 (file)
 namespace ARDOUR
 {
 
-ExportTimespan::ExportTimespan (ExportStatusPtr status, nframes_t frame_rate) :
-  status (status),
-  start_frame (0),
-  end_frame (0),
-  position (0),
-  frame_rate (frame_rate)
+ExportTimespan::ExportTimespan (ExportStatusPtr status, framecnt_t frame_rate) :
+       status (status),
+       start_frame (0),
+       end_frame (0),
+       position (0),
+       frame_rate (frame_rate)
 {
+       
 }
 
 ExportTimespan::~ExportTimespan ()
@@ -41,7 +42,7 @@ ExportTimespan::~ExportTimespan ()
 }
 
 void
-ExportTimespan::set_range (nframes_t start, nframes_t end)
+ExportTimespan::set_range (framepos_t start, framepos_t end)
 {
        start_frame = start;
        position = start_frame;
index 6f2161f5782609761d4f3c6090d4a39e47e413a7..a3c27f42605769bb459ef06aa06339cee9f1f349 100644 (file)
@@ -41,21 +41,21 @@ Gain::operator= (const Gain& other)
 }
 
 void
-Gain::fill_linear_volume_fade_in (Gain& /*gain*/, nframes_t /*frames*/)
+Gain::fill_linear_volume_fade_in (Gain& /*gain*/, framecnt_t /*frames*/)
 {
 }
 
 void
-Gain::fill_linear_volume_fade_out (Gain& /*gain*/, nframes_t /*frames*/)
+Gain::fill_linear_volume_fade_out (Gain& /*gain*/, framecnt_t /*frames*/)
 {
 }
 
 void
-Gain::fill_linear_fade_in (Gain& /*gain*/, nframes_t /*frames*/)
+Gain::fill_linear_fade_in (Gain& /*gain*/, framecnt_t /*frames*/)
 {
 }
 
 void
-Gain::fill_linear_fade_out (Gain& /*gain*/, nframes_t /*frames*/)
+Gain::fill_linear_fade_out (Gain& /*gain*/, framecnt_t /*frames*/)
 {
 }
index a24fcad8ce791e88aa2c989f7e4cea9ea0984969..9549a9dcc98bdb5c8f658028f253c154d2433923 100644 (file)
@@ -445,7 +445,7 @@ Graph::dump (int chain)
 }
 
 int
-Graph::silent_process_routes (nframes_t nframes, framepos_t start_frame, framepos_t end_frame,
+Graph::silent_process_routes (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
                               bool can_record, bool rec_monitors_input, bool& need_butler)
 {
         _process_nframes = nframes;
@@ -471,7 +471,7 @@ Graph::silent_process_routes (nframes_t nframes, framepos_t start_frame, framepo
 }
 
 int
-Graph::process_routes (nframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick,
+Graph::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)
 {
        DEBUG_TRACE (DEBUG::Graph, string_compose ("graph execution from %1 to %2 = %3\n", start_frame, end_frame, nframes));
@@ -500,7 +500,7 @@ Graph::process_routes (nframes_t nframes, framepos_t start_frame, framepos_t end
 }
 
 int
-Graph::routes_no_roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame, 
+Graph::routes_no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, 
                        bool non_rt_pending, bool can_record, int declick)
 {
        DEBUG_TRACE (DEBUG::Graph, string_compose ("no-roll graph execution from %1 to %2 = %3\n", start_frame, end_frame, nframes));
index 3dd2a99ee109f8497d8ef1589e9eb6c78a4c1dda..deba3efb05f916c1e19ba0e220fac3e4a5e393d8 100644 (file)
@@ -73,7 +73,7 @@ using namespace ARDOUR;
 using namespace PBD;
 
 static boost::shared_ptr<ImportableSource>
-open_importable_source (const string& path, nframes_t samplerate, ARDOUR::SrcQuality quality)
+open_importable_source (const string& path, framecnt_t samplerate, ARDOUR::SrcQuality quality)
 {
        /* try libsndfile first, because it can get BWF info from .wav, which ExtAudioFile cannot.
           We don't necessarily need that information in an ImportableSource, but it keeps the 
@@ -274,7 +274,7 @@ static void
 write_audio_data_to_new_files (ImportableSource* source, ImportStatus& status,
                               vector<boost::shared_ptr<Source> >& newfiles)
 {
-       const nframes_t nframes = ResampledImportableSource::blocksize;
+       const framecnt_t nframes = ResampledImportableSource::blocksize;
        boost::shared_ptr<AudioFileSource> afs;
        uint channels = source->channels();
 
@@ -305,7 +305,7 @@ write_audio_data_to_new_files (ImportableSource* source, ImportStatus& status,
                uint read_count = 0;
                
                while (!status.cancel) {
-                       nframes_t const nread = source->read (data.get(), nframes);
+                       framecnt_t const nread = source->read (data.get(), nframes);
                        if (nread == 0) {
                                break;
                        }
@@ -330,7 +330,7 @@ write_audio_data_to_new_files (ImportableSource* source, ImportStatus& status,
 
        while (!status.cancel) {
 
-               nframes_t nread, nfread;
+               framecnt_t nread, nfread;
                uint x;
                uint chn;
 
@@ -349,7 +349,7 @@ write_audio_data_to_new_files (ImportableSource* source, ImportStatus& status,
 
                for (chn = 0; chn < channels; ++chn) {
 
-                       nframes_t n;
+                       framecnt_t n;
                        for (x = chn, n = 0; n < nfread; x += channels, ++n) {
                                channel_data[chn][n] = (Sample) data[x];
                        }
index 1d135cc44f2589fea4c95df40d9bfdd80133475a..8e058b69b14c14c53041a8cf2a22a2a1b0289113 100644 (file)
@@ -27,7 +27,7 @@
 using namespace std;
 using namespace ARDOUR;
 
-PBD::Signal1<void,nframes_t> InternalReturn::CycleStart;
+PBD::Signal1<void, pframes_t> InternalReturn::CycleStart;
 
 InternalReturn::InternalReturn (Session& s)
        : Return (s, true)
@@ -38,7 +38,7 @@ InternalReturn::InternalReturn (Session& s)
 }
 
 void
-InternalReturn::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end_frame*/, nframes_t nframes, bool)
+InternalReturn::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end_frame*/, pframes_t nframes, bool)
 {
        if (!_active && !_pending_active) {
                return;
@@ -64,14 +64,14 @@ InternalReturn::configure_io (ChanCount in, ChanCount out)
 }
 
 int
-InternalReturn::set_block_size (nframes_t nframes)
+InternalReturn::set_block_size (pframes_t nframes)
 {
        allocate_buffers (nframes);
         return 0;
 }
 
 void
-InternalReturn::allocate_buffers (nframes_t nframes)
+InternalReturn::allocate_buffers (pframes_t nframes)
 {
        buffers.ensure_buffers (_configured_input, nframes);
        buffers.set_count (_configured_input);
@@ -101,7 +101,7 @@ InternalReturn::release_buffers ()
 }
 
 void
-InternalReturn::cycle_start (nframes_t nframes)
+InternalReturn::cycle_start (pframes_t nframes)
 {
        /* called from process cycle - no lock necessary */
        if (user_count) {
index 8ec543030870a76c09a37892572e7ebe0af8519e..43276516ddfa53375ea16699845e70607c86c4e3 100644 (file)
@@ -81,7 +81,7 @@ InternalSend::send_to_going_away ()
 }
 
 void
-InternalSend::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, nframes_t nframes, bool)
+InternalSend::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool)
 {
        if ((!_active && !_pending_active) || !target || !_send_to) {
                _meter->reset ();
@@ -147,7 +147,7 @@ InternalSend::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame
 }
 
 int
-InternalSend::set_block_size (nframes_t nframes)
+InternalSend::set_block_size (pframes_t nframes)
 {
        mixbufs.ensure_buffers (_configured_input, nframes);
 
index 1393d8aae81e659c1e4c87b9954307e44c5ce8b3..0a9bbc3a7d731a629433bd3ba97ac2f57ec46d09 100644 (file)
@@ -6,11 +6,11 @@
 using namespace ARDOUR;
 
 
-nframes_t
-LinearInterpolation::interpolate (int channel, nframes_t nframes, Sample *input, Sample *output)
+framecnt_t
+LinearInterpolation::interpolate (int channel, framecnt_t nframes, Sample *input, Sample *output)
 {
        // index in the input buffers
-       nframes_t   i = 0;
+       framecnt_t   i = 0;
 
        double acceleration;
        double distance = 0.0;
@@ -22,7 +22,7 @@ LinearInterpolation::interpolate (int channel, nframes_t nframes, Sample *input,
        }
 
        distance = phase[channel];
-       for (nframes_t outsample = 0; outsample < nframes; ++outsample) {
+       for (framecnt_t outsample = 0; outsample < nframes; ++outsample) {
                i = floor(distance);
                Sample fractional_phase_part = distance - i;
                if (fractional_phase_part >= 1.0) {
@@ -45,11 +45,11 @@ LinearInterpolation::interpolate (int channel, nframes_t nframes, Sample *input,
        return i;
 }
 
-nframes_t
-CubicInterpolation::interpolate (int channel, nframes_t nframes, Sample *input, Sample *output)
+framecnt_t
+CubicInterpolation::interpolate (int channel, framecnt_t nframes, Sample *input, Sample *output)
 {
     // index in the input buffers
-    nframes_t   i = 0;
+    framecnt_t   i = 0;
 
     double acceleration;
     double distance = 0.0;
@@ -87,7 +87,7 @@ CubicInterpolation::interpolate (int channel, nframes_t nframes, Sample *input,
                    inm1 = input[i-1];
            }
 
-           for (nframes_t outsample = 0; outsample < nframes; ++outsample) {
+           for (framecnt_t outsample = 0; outsample < nframes; ++outsample) {
 
                    float f = floor (distance);
                    float fractional_phase_part = distance - f;
@@ -124,7 +124,7 @@ CubicInterpolation::interpolate (int channel, nframes_t nframes, Sample *input,
 
            /* not sure that this is ever utilized - it implies that one of the input/output buffers is missing */
 
-           for (nframes_t outsample = 0; outsample < nframes; ++outsample) {
+           for (framecnt_t outsample = 0; outsample < nframes; ++outsample) {
                    distance += _speed + acceleration;
            }
     }
index ebed41fd645fe570060d02b6f6c03dfe7302f8a7..c29ee51a5849b995165d067c23204a3c5884a23c 100644 (file)
@@ -96,7 +96,7 @@ IO::~IO ()
 }
 
 void
-IO::silence (nframes_t nframes)
+IO::silence (framecnt_t nframes)
 {
        /* io_lock, not taken: function must be called from Session::process() calltree */
 
@@ -1133,7 +1133,7 @@ IO::set_name (const string& requested_name)
 }
 
 void
-IO::set_port_latency (nframes_t nframes)
+IO::set_port_latency (framecnt_t nframes)
 {
        Glib::Mutex::Lock lm (io_lock);
 
@@ -1142,11 +1142,11 @@ IO::set_port_latency (nframes_t nframes)
        }
 }
 
-nframes_t
+framecnt_t
 IO::latency () const
 {
-       nframes_t max_latency;
-       nframes_t latency;
+       framecnt_t max_latency;
+       framecnt_t latency;
 
        max_latency = 0;
 
@@ -1521,7 +1521,7 @@ IO::connected_to (boost::shared_ptr<const IO> other) const
 }
 
 void
-IO::process_input (boost::shared_ptr<Processor> proc, framepos_t start_frame, framepos_t end_frame, nframes_t nframes)
+IO::process_input (boost::shared_ptr<Processor> proc, framepos_t start_frame, framepos_t end_frame, pframes_t nframes)
 {
        BufferSet bufs;
 
@@ -1532,7 +1532,7 @@ IO::process_input (boost::shared_ptr<Processor> proc, framepos_t start_frame, fr
 }
 
 void
-IO::collect_input (BufferSet& bufs, nframes_t nframes, ChanCount offset)
+IO::collect_input (BufferSet& bufs, pframes_t nframes, ChanCount offset)
 {
        assert(bufs.available() >= _ports.count());
 
@@ -1560,7 +1560,7 @@ IO::collect_input (BufferSet& bufs, nframes_t nframes, ChanCount offset)
 }
 
 void
-IO::copy_to_outputs (BufferSet& bufs, DataType type, nframes_t nframes, nframes_t offset)
+IO::copy_to_outputs (BufferSet& bufs, DataType type, pframes_t nframes, framecnt_t offset)
 {
        // Copy any buffers 1:1 to outputs
 
index 877e0422faae5cbc41964ee0cc2aa77c904229bb..8cad0ba6cb8c467410d9ba0387552152b0e465f8 100644 (file)
@@ -242,7 +242,7 @@ IOProcessor::set_state_2X (const XMLNode& node, int version)
 }
 
 void
-IOProcessor::silence (nframes_t nframes)
+IOProcessor::silence (framecnt_t nframes)
 {
        if (_own_output && _output) {
                _output->silence (nframes);
index 027c16e78cb30f292dcc2f38601307e78907084c..fb5a88e5f861b1acc9425fc552cbf592c704cfae 100644 (file)
@@ -53,7 +53,7 @@ using namespace std;
 using namespace ARDOUR;
 using namespace PBD;
 
-LadspaPlugin::LadspaPlugin (void *mod, AudioEngine& e, Session& session, uint32_t index, nframes_t rate)
+LadspaPlugin::LadspaPlugin (void *mod, AudioEngine& e, Session& session, uint32_t index, framecnt_t rate)
        : Plugin (e, session)
 {
        init (mod, index, rate);
@@ -71,7 +71,7 @@ LadspaPlugin::LadspaPlugin (const LadspaPlugin &other)
 }
 
 void
-LadspaPlugin::init (void *mod, uint32_t index, nframes_t rate)
+LadspaPlugin::init (void *mod, uint32_t index, framecnt_t rate)
 {
        LADSPA_Descriptor_Function dfunc;
        uint32_t i, port_cnt;
@@ -530,7 +530,7 @@ LadspaPlugin::describe_parameter (Evoral::Parameter which)
        }
 }
 
-ARDOUR::nframes_t
+ARDOUR::framecnt_t
 LadspaPlugin::signal_latency () const
 {
        if (_user_latency) {
@@ -538,7 +538,7 @@ LadspaPlugin::signal_latency () const
        }
 
        if (_latency_control_port) {
-               return (nframes_t) floor (*_latency_control_port);
+               return (framecnt_t) floor (*_latency_control_port);
        } else {
                return 0;
        }
@@ -563,7 +563,7 @@ LadspaPlugin::automatable () const
 int
 LadspaPlugin::connect_and_run (BufferSet& bufs,
                ChanMapping in_map, ChanMapping out_map,
-               nframes_t nframes, nframes_t offset)
+               pframes_t nframes, framecnt_t offset)
 {
        cycles_t now;
        cycles_t then = get_cycles ();
@@ -626,7 +626,7 @@ LadspaPlugin::print_parameter (uint32_t param, char *buf, uint32_t len) const
 }
 
 void
-LadspaPlugin::run_in_place (nframes_t nframes)
+LadspaPlugin::run_in_place (pframes_t nframes)
 {
        for (uint32_t i = 0; i < parameter_count(); ++i) {
                if (LADSPA_IS_PORT_INPUT(port_descriptor (i)) && LADSPA_IS_PORT_CONTROL(port_descriptor (i))) {
@@ -655,7 +655,7 @@ LadspaPlugin::latency_compute_run ()
        uint32_t port_index = 0;
        uint32_t in_index = 0;
        uint32_t out_index = 0;
-       const nframes_t bufsize = 1024;
+       const framecnt_t bufsize = 1024;
        LADSPA_Data buffer[bufsize];
 
        memset(buffer,0,sizeof(LADSPA_Data)*bufsize);
index 167461609615a69b28528a52abb3be315b868a8b..281e045ae3d09c9b24c6d83460c3a81c7e1a9ca0 100644 (file)
@@ -104,7 +104,7 @@ LocationImporter::~LocationImporter ()
 string
 LocationImporter::get_info () const
 {
-       nframes_t start, end;
+       framepos_t start, end;
        Timecode::Time start_time, end_time;
 
        // Get sample positions
index d8f83c98e9d256ccfe010e4a8e32797ccfa27835..9edd929aadd80fb5a33bed62a7d4e462e87cb770 100644 (file)
@@ -55,7 +55,7 @@ uint32_t LV2Plugin::_midi_event_type = _uri_map.uri_to_id(
                "http://lv2plug.in/ns/ext/event",
                "http://lv2plug.in/ns/ext/midi#MidiEvent");
 
-LV2Plugin::LV2Plugin (AudioEngine& e, Session& session, LV2World& world, SLV2Plugin plugin, nframes_t rate)
+LV2Plugin::LV2Plugin (AudioEngine& e, Session& session, LV2World& world, SLV2Plugin plugin, framecnt_t rate)
        : Plugin (e, session)
        , _world(world)
        , _features(NULL)
@@ -77,7 +77,7 @@ LV2Plugin::LV2Plugin (const LV2Plugin &other)
 }
 
 void
-LV2Plugin::init (LV2World& world, SLV2Plugin plugin, nframes_t rate)
+LV2Plugin::init (LV2World& world, SLV2Plugin plugin, framecnt_t rate)
 {
        _world                = world;
        _plugin               = plugin;
@@ -501,11 +501,11 @@ LV2Plugin::describe_parameter (Evoral::Parameter which)
        }
 }
 
-nframes_t
+framecnt_t
 LV2Plugin::signal_latency () const
 {
        if (_latency_control_port) {
-               return (nframes_t) floor (*_latency_control_port);
+               return (framecnt_t) floor (*_latency_control_port);
        } else {
                return 0;
        }
@@ -528,7 +528,7 @@ LV2Plugin::automatable () const
 int
 LV2Plugin::connect_and_run (BufferSet& bufs,
                ChanMapping in_map, ChanMapping out_map,
-               nframes_t nframes, nframes_t offset)
+               pframes_t nframes, framecnt_t offset)
 {
        cycles_t then = get_cycles ();
 
@@ -632,7 +632,7 @@ LV2Plugin::print_parameter (uint32_t param, char *buf, uint32_t len) const
 }
 
 void
-LV2Plugin::run (nframes_t nframes)
+LV2Plugin::run (pframes_t nframes)
 {
        for (uint32_t i = 0; i < parameter_count(); ++i) {
                if (parameter_is_control(i) && parameter_is_input(i))  {
@@ -660,7 +660,7 @@ LV2Plugin::latency_compute_run ()
        uint32_t in_index   = 0;
        uint32_t out_index  = 0;
 
-       const nframes_t bufsize = 1024;
+       const framecnt_t bufsize = 1024;
        float buffer[bufsize];
 
        memset(buffer, 0, sizeof(float) * bufsize);
index 443146cf135a4c94cfc5174a56b6d6b693fa7171..226cf417f3864f2b6987817d7a33224a26379c5e 100644 (file)
@@ -39,7 +39,7 @@ PBD::Signal0<void> Metering::Meter;
  * be set to 0.
  */
 void
-PeakMeter::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end_frame*/, nframes_t nframes, bool)
+PeakMeter::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end_frame*/, pframes_t nframes, bool)
 {
        if (!_active && !_pending_active) {
                return;
@@ -54,7 +54,7 @@ PeakMeter::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end_fr
        for (uint32_t i = 0; i < n_midi; ++i, ++n) {
                float val = 0.0f;
                for (MidiBuffer::iterator e = bufs.get_midi(i).begin(); e != bufs.get_midi(i).end(); ++e) {
-                       const Evoral::MIDIEvent<nframes_t> ev(*e, false);
+                       const Evoral::MIDIEvent<framepos_t> ev(*e, false);
                        if (ev.is_note_on()) {
                                const float this_vel = log(ev.buffer()[2] / 127.0 * (M_E*M_E-M_E) + M_E) - 1.0;
                                if (this_vel > val) {
index 2eb9df8c5c01e04b3b31c26a07c84ad324047b4d..c65ba58288bbec8a7a806d5afcbe6cb8440e376a 100644 (file)
@@ -79,7 +79,7 @@ MidiBuffer::copy(const MidiBuffer& copy)
  * Note that offset and nframes refer to sample time, NOT buffer offsets or event counts.
  */
 void
-MidiBuffer::read_from (const Buffer& src, nframes_t nframes, nframes_t dst_offset, nframes_t src_offset)
+MidiBuffer::read_from (const Buffer& src, framecnt_t nframes, framecnt_t dst_offset, framecnt_t src_offset)
 {
        assert (src.type() == DataType::MIDI);
        assert (&src != this);
@@ -109,7 +109,7 @@ MidiBuffer::read_from (const Buffer& src, nframes_t nframes, nframes_t dst_offse
 }
 
 void
-MidiBuffer::merge_from (const Buffer& src, nframes_t /*nframes*/, nframes_t /*dst_offset*/, nframes_t /*src_offset*/)
+MidiBuffer::merge_from (const Buffer& src, framecnt_t /*nframes*/, framecnt_t /*dst_offset*/, framecnt_t /*src_offset*/)
 {
        const MidiBuffer* mbuf = dynamic_cast<const MidiBuffer*>(&src);
        assert (mbuf);
@@ -253,7 +253,7 @@ MidiBuffer::reserve(TimeType time, size_t size)
 
 
 void
-MidiBuffer::silence (nframes_t /*nframes*/, nframes_t /*offset*/)
+MidiBuffer::silence (framecnt_t /*nframes*/, framecnt_t /*offset*/)
 {
        /* XXX iterate over existing events, find all in range given by offset & nframes,
           and delete them.
index f6fe0d0930fcb9a227eb898cc608632e153385ed..5dfd63fe1a65afc5896a96d0989a3a203bfc6b13 100644 (file)
@@ -355,10 +355,10 @@ MIDIClock_Slave::speed_and_position (double& speed, framepos_t& pos)
        return true;
 }
 
-ARDOUR::nframes_t
+ARDOUR::framecnt_t
 MIDIClock_Slave::resolution() const
 {
        // one beat
-       return (nframes_t) one_ppqn_in_frames * ppqn;
+       return (framecnt_t) one_ppqn_in_frames * ppqn;
 }
 
index f5b9cb5345e329d356564b8f8a43e329c4ebd708..29217d9e5e9e7f658e38cc434ac4458c5fd0f153 100644 (file)
@@ -67,7 +67,7 @@ using namespace std;
 using namespace ARDOUR;
 using namespace PBD;
 
-nframes_t MidiDiskstream::midi_readahead = 4096;
+framecnt_t MidiDiskstream::midi_readahead = 4096;
 
 MidiDiskstream::MidiDiskstream (Session &sess, const string &name, Diskstream::Flag flag)
        : Diskstream(sess, name, flag)
@@ -128,8 +128,8 @@ MidiDiskstream::init ()
        allocate_temporary_buffers ();
 
        const size_t size = _session.butler()->midi_diskstream_buffer_size();
-       _playback_buf = new MidiRingBuffer<nframes_t>(size);
-       _capture_buf = new MidiRingBuffer<nframes_t>(size);
+       _playback_buf = new MidiRingBuffer<framepos_t>(size);
+       _capture_buf = new MidiRingBuffer<framepos_t>(size);
 
        _n_channels = ChanCount(DataType::MIDI, 1);
 
@@ -488,11 +488,11 @@ trace_midi (ostream& o, MIDI::byte *msg, size_t len)
 #endif
 
 int
-MidiDiskstream::process (framepos_t transport_frame, nframes_t nframes, bool can_record, bool rec_monitors_input, bool& need_butler)
+MidiDiskstream::process (framepos_t transport_frame, pframes_t nframes, bool can_record, bool rec_monitors_input, bool& need_butler)
 {
        int       ret = -1;
-       nframes_t rec_offset = 0;
-       nframes_t rec_nframes = 0;
+       framecnt_t rec_offset = 0;
+       framecnt_t rec_nframes = 0;
        bool      nominally_recording;
        bool      re = record_enabled ();
 
@@ -588,7 +588,7 @@ MidiDiskstream::process (framepos_t transport_frame, nframes_t nframes, bool can
 }
 
 bool
-MidiDiskstream::commit (nframes_t nframes)
+MidiDiskstream::commit (framecnt_t nframes)
 {
        bool need_butler = false;
 
@@ -678,9 +678,9 @@ MidiDiskstream::internal_playback_seek (framecnt_t distance)
 
 /** @a start is set to the new frame position (TIME) read up to */
 int
-MidiDiskstream::read (framepos_t& start, nframes_t dur, bool reversed)
+MidiDiskstream::read (framepos_t& start, framecnt_t dur, bool reversed)
 {
-       nframes_t this_read = 0;
+       framecnt_t this_read = 0;
        bool reloop = false;
        framepos_t loop_end = 0;
        framepos_t loop_start = 0;
@@ -812,12 +812,12 @@ MidiDiskstream::do_refill ()
                return 0;
        }
 
-       nframes_t to_read = midi_readahead - (frames_written - frames_read);
+       framecnt_t to_read = midi_readahead - (frames_written - frames_read);
 
        //cout << "MDS read for midi_readahead " << to_read << "  rb_contains: "
        //      << frames_written - frames_read << endl;
 
-       to_read = (nframes_t) min ((framecnt_t) to_read, (framecnt_t) (max_framepos - file_frame));
+       to_read = (framecnt_t) min ((framecnt_t) to_read, (framecnt_t) (max_framepos - file_frame));
 
        if (read (file_frame, to_read, reversed)) {
                ret = -1;
@@ -841,7 +841,7 @@ MidiDiskstream::do_flush (RunContext /*context*/, bool force_flush)
 {
        uint32_t to_write;
        int32_t ret = 0;
-       nframes_t total;
+       framecnt_t total;
 
        _write_data_count = 0;
 
@@ -941,7 +941,7 @@ MidiDiskstream::transport_stopped_wallclock (struct tm& /*when*/, time_t /*twhen
 
                assert(_write_source);
 
-               nframes_t total_capture = 0;
+               framecnt_t total_capture = 0;
                for (ci = capture_info.begin(); ci != capture_info.end(); ++ci) {
                        total_capture += (*ci)->frames;
                }
@@ -1408,7 +1408,7 @@ MidiDiskstream::rename_write_sources ()
 }
 
 void
-MidiDiskstream::set_block_size (nframes_t /*nframes*/)
+MidiDiskstream::set_block_size (pframes_t /*nframes*/)
 {
 }
 
index abc0d682baa07f86cba845d3f289c4c081d72228..9986d9750c3a5b73e4532fad0df376199a52452d 100644 (file)
@@ -68,7 +68,7 @@ MidiPlaylist::MidiPlaylist (boost::shared_ptr<const MidiPlaylist> other, string
 {
 }
 
-MidiPlaylist::MidiPlaylist (boost::shared_ptr<const MidiPlaylist> other, nframes_t start, nframes_t dur, string name, bool hidden)
+MidiPlaylist::MidiPlaylist (boost::shared_ptr<const MidiPlaylist> other, framepos_t start, framecnt_t dur, string name, bool hidden)
        : Playlist (other, start, dur, name, hidden)
        , _note_mode(other->_note_mode)
 {
@@ -87,8 +87,8 @@ struct EventsSortByTime {
 };
 
 /** Returns the number of frames in time duration read (eg could be large when 0 events are read) */
-nframes_t
-MidiPlaylist::read (MidiRingBuffer<nframes_t>& dst, nframes_t start, nframes_t dur, unsigned chan_n)
+framecnt_t
+MidiPlaylist::read (MidiRingBuffer<framepos_t>& dst, framepos_t start, framecnt_t dur, unsigned chan_n)
 {
        /* this function is never called from a realtime thread, so
           its OK to block (for short intervals).
@@ -97,7 +97,7 @@ MidiPlaylist::read (MidiRingBuffer<nframes_t>& dst, nframes_t start, nframes_t d
        Glib::RecMutex::Lock rm (region_lock);
        DEBUG_TRACE (DEBUG::MidiPlaylistIO, string_compose ("++++++ %1 .. %2  +++++++++++++++++++++++++++++++++++++++++++++++\n", start, start + dur));
 
-       nframes_t end = start + dur - 1;
+       framepos_t end = start + dur - 1;
 
        _read_data_count = 0;
 
@@ -190,7 +190,7 @@ MidiPlaylist::read (MidiRingBuffer<nframes_t>& dst, nframes_t start, nframes_t d
 
                DEBUG_TRACE (DEBUG::MidiPlaylistIO, string_compose ("%1 regions to read, plus %2 trackers\n", regs.size(), tracker_info.size()));
 
-               Evoral::EventList<nframes_t> evlist;
+               Evoral::EventList<framepos_t> evlist;
 
                for (vector<TrackerInfo>::iterator t = tracker_info.begin(); t != tracker_info.end(); ++t) {
                        DEBUG_TRACE (DEBUG::MidiPlaylistIO, string_compose ("Resolve %1 notes\n", (*t).first->on()));
@@ -200,7 +200,7 @@ MidiPlaylist::read (MidiRingBuffer<nframes_t>& dst, nframes_t start, nframes_t d
 
 #ifndef NDEBUG
                DEBUG_TRACE (DEBUG::MidiPlaylistIO, string_compose ("After resolution we now have %1 events\n",  evlist.size()));
-               for (Evoral::EventList<nframes_t>::iterator x = evlist.begin(); x != evlist.end(); ++x) {
+               for (Evoral::EventList<framepos_t>::iterator x = evlist.begin(); x != evlist.end(); ++x) {
                        DEBUG_TRACE (DEBUG::MidiPlaylistIO, string_compose ("\t%1\n", **x));
                }
 #endif
@@ -235,7 +235,7 @@ MidiPlaylist::read (MidiRingBuffer<nframes_t>& dst, nframes_t start, nframes_t d
 
 #ifndef NDEBUG
                        DEBUG_TRACE (DEBUG::MidiPlaylistIO, string_compose ("After %1 (%2 .. %3) we now have %4\n", mr->name(), mr->position(), mr->last_frame(), evlist.size()));
-                       for (Evoral::EventList<nframes_t>::iterator x = evlist.begin(); x != evlist.end(); ++x) {
+                       for (Evoral::EventList<framepos_t>::iterator x = evlist.begin(); x != evlist.end(); ++x) {
                                DEBUG_TRACE (DEBUG::MidiPlaylistIO, string_compose ("\t%1\n", **x));
                        }
                        DEBUG_TRACE (DEBUG::MidiPlaylistIO, string_compose ("\tAFTER: tracker says there are %1 on notes\n", tracker->on()));
@@ -253,18 +253,18 @@ MidiPlaylist::read (MidiRingBuffer<nframes_t>& dst, nframes_t start, nframes_t d
                if (!evlist.empty()) {
 
                        /* sort the event list */
-                       EventsSortByTime<nframes_t> time_cmp;
+                       EventsSortByTime<framepos_t> time_cmp;
                        evlist.sort (time_cmp);
 
 #ifndef NDEBUG
                        DEBUG_TRACE (DEBUG::MidiPlaylistIO, string_compose ("Final we now have %1 events\n",  evlist.size()));
-                       for (Evoral::EventList<nframes_t>::iterator x = evlist.begin(); x != evlist.end(); ++x) {
+                       for (Evoral::EventList<framepos_t>::iterator x = evlist.begin(); x != evlist.end(); ++x) {
                                DEBUG_TRACE (DEBUG::MidiPlaylistIO, string_compose ("\t%1\n", **x));
                        }
 #endif
                        /* write into dst */
-                       for (Evoral::EventList<nframes_t>::iterator e = evlist.begin(); e != evlist.end(); ++e) {
-                               Evoral::Event<nframes_t>* ev (*e);
+                       for (Evoral::EventList<framepos_t>::iterator e = evlist.begin(); e != evlist.end(); ++e) {
+                               Evoral::Event<framepos_t>* ev (*e);
                                dst.write (ev->time(), ev->event_type(), ev->size(), ev->buffer());
                                delete ev;
                        }
index adf24c2eafced56e0496bbe5cf76ccc615fc46c1..5f18810122e713b84a490116fc3aa033324f0eaa 100644 (file)
@@ -39,7 +39,7 @@ MidiPort::~MidiPort()
 }
 
 void
-MidiPort::cycle_start (nframes_t nframes)
+MidiPort::cycle_start (pframes_t nframes)
 {
        _buffer->clear ();
        assert (_buffer->size () == 0);
@@ -50,7 +50,7 @@ MidiPort::cycle_start (nframes_t nframes)
 }
 
 MidiBuffer &
-MidiPort::get_midi_buffer (nframes_t nframes, nframes_t offset)
+MidiPort::get_midi_buffer (framecnt_t nframes, framecnt_t offset)
 {
        if (_has_been_mixed_down) {
                return *_buffer;
@@ -59,7 +59,7 @@ MidiPort::get_midi_buffer (nframes_t nframes, nframes_t offset)
        if (receives_input ()) {
 
                void* jack_buffer = jack_port_get_buffer (_jack_port, nframes);
-               const nframes_t event_count = jack_midi_get_event_count(jack_buffer);
+               const pframes_t event_count = jack_midi_get_event_count(jack_buffer);
 
                assert (event_count < _buffer->capacity());
 
@@ -67,7 +67,7 @@ MidiPort::get_midi_buffer (nframes_t nframes, nframes_t offset)
                   into our MidiBuffer
                */
 
-               for (nframes_t i = 0; i < event_count; ++i) {
+               for (pframes_t i = 0; i < event_count; ++i) {
 
                        jack_midi_event_t ev;
 
@@ -102,7 +102,7 @@ MidiPort::get_midi_buffer (nframes_t nframes, nframes_t offset)
 
 
 void
-MidiPort::cycle_end (nframes_t /*nframes*/)
+MidiPort::cycle_end (pframes_t /*nframes*/)
 {
        _has_been_mixed_down = false;
 }
@@ -114,7 +114,7 @@ MidiPort::cycle_split ()
 }
 
 void
-MidiPort::flush_buffers (nframes_t nframes, framepos_t time, nframes_t offset)
+MidiPort::flush_buffers (pframes_t nframes, framepos_t time, framecnt_t offset)
 {
        if (sends_output ()) {
 
@@ -133,7 +133,7 @@ MidiPort::flush_buffers (nframes_t nframes, framepos_t time, nframes_t offset)
                _resolve_in_process = false;
 
                for (MidiBuffer::iterator i = _buffer->begin(); i != _buffer->end(); ++i) {
-                       const Evoral::Event<nframes_t>& ev = *i;
+                       const Evoral::Event<framepos_t>& ev = *i;
 
                        // event times are in frames, relative to cycle start
 
@@ -157,8 +157,8 @@ MidiPort::transport_stopped ()
 }
 
 size_t
-MidiPort::raw_buffer_size (nframes_t nframes) const
+MidiPort::raw_buffer_size (pframes_t nframes) const
 {
-       return jack_midi_max_event_size(jack_port_get_buffer(_jack_port, nframes));
+       return jack_midi_max_event_size (jack_port_get_buffer (_jack_port, nframes));
 }
 
index e8d6229e911496ed2f2e4d4ca9b8f9772a3c375c..f9fb791bad28717857cbd65b8aea578f6ae2eb64 100644 (file)
@@ -129,19 +129,19 @@ MidiRegion::set_position_internal (framepos_t pos, bool allow_bbt_recompute)
 }
 
 framecnt_t
-MidiRegion::read_at (Evoral::EventSink<nframes_t>& out, framepos_t position, framecnt_t dur, uint32_t chan_n, NoteMode mode, MidiStateTracker* tracker) const
+MidiRegion::read_at (Evoral::EventSink<framepos_t>& out, framepos_t position, framecnt_t dur, uint32_t chan_n, NoteMode mode, MidiStateTracker* tracker) const
 {
        return _read_at (_sources, out, position, dur, chan_n, mode, tracker);
 }
 
 framecnt_t
-MidiRegion::master_read_at (MidiRingBuffer<nframes_t>& out, framepos_t position, framecnt_t dur, uint32_t chan_n, NoteMode mode) const
+MidiRegion::master_read_at (MidiRingBuffer<framepos_t>& out, framepos_t position, framecnt_t dur, uint32_t chan_n, NoteMode mode) const
 {
        return _read_at (_master_sources, out, position, dur, chan_n, mode); /* no tracker */
 }
 
 framecnt_t
-MidiRegion::_read_at (const SourceList& /*srcs*/, Evoral::EventSink<nframes_t>& dst, framepos_t position, framecnt_t dur, uint32_t chan_n, 
+MidiRegion::_read_at (const SourceList& /*srcs*/, Evoral::EventSink<framepos_t>& dst, framepos_t position, framecnt_t dur, uint32_t chan_n, 
                      NoteMode mode, MidiStateTracker* tracker) const
 {
        frameoffset_t internal_offset = 0;
index eb83d4164511958e954ed07ad875aed398a259bc..b25154fefb3d088bed3884893f416ba808457509 100644 (file)
@@ -34,7 +34,7 @@ using namespace PBD;
  */
 template<typename T>
 size_t
-MidiRingBuffer<T>::read(MidiBuffer& dst, nframes_t start, nframes_t end, nframes_t offset)
+MidiRingBuffer<T>::read(MidiBuffer& dst, framepos_t start, framepos_t end, framecnt_t offset)
 {
        if (this->read_space() == 0) {
                return 0;
@@ -97,7 +97,7 @@ MidiRingBuffer<T>::read(MidiBuffer& dst, nframes_t start, nframes_t end, nframes
                // This event marks a loop end (i.e. the next event's timestamp will be non-monotonic)
                if (ev_type == LoopEventType) {
                        assert (ev_size == sizeof (framepos_t));
-                       nframes_t loop_start;
+                       framepos_t loop_start;
                        read_contents (ev_size, (uint8_t *) &loop_start);
 
                        loop_offset = ev_time - loop_start;
@@ -240,5 +240,5 @@ MidiRingBuffer<T>::dump(ostream& str)
 }
 
 
-template class MidiRingBuffer<nframes_t>;
+template class MidiRingBuffer<framepos_t>;
 
index 5a703f6772e9a564908a36a15204388d4b71ed7c..120ee29e8eff58a536cf2401f9dae4444bafcf7e 100644 (file)
@@ -196,9 +196,9 @@ MidiSource::invalidate ()
 }
 
 /** @param filtered A set of parameters whose MIDI messages will not be returned */
-nframes_t
-MidiSource::midi_read (Evoral::EventSink<nframes_t>& dst, framepos_t source_start,
-                       framepos_t start, nframes_t cnt,
+framecnt_t
+MidiSource::midi_read (Evoral::EventSink<framepos_t>& dst, framepos_t source_start,
+                       framepos_t start, framecnt_t cnt,
                        MidiStateTracker* tracker,
                       std::set<Evoral::Parameter> const & filtered) const
 {
@@ -255,11 +255,11 @@ MidiSource::midi_read (Evoral::EventSink<nframes_t>& dst, framepos_t source_star
  *  @param source Source to read from.
  *  @param source_start This source's start position in session frames.
  */
-nframes_t
-MidiSource::midi_write (MidiRingBuffer<nframes_t>& source, framepos_t source_start, nframes_t duration)
+framecnt_t
+MidiSource::midi_write (MidiRingBuffer<framepos_t>& source, framepos_t source_start, framecnt_t duration)
 {
        Glib::Mutex::Lock lm (_lock);
-       const nframes_t ret = write_unlocked (source, source_start, duration);
+       const framecnt_t ret = write_unlocked (source, source_start, duration);
        _last_write_end += duration;
        return ret;
 }
index 24c9d2884c327e557b61a84b99e969ce966e34bb..cbbf73b682225988d6c4cb8c0779823fa04f301d 100644 (file)
@@ -111,7 +111,7 @@ MidiStateTracker::resolve_notes (MidiBuffer &dst, framepos_t time)
 }
 
 void
-MidiStateTracker::resolve_notes (Evoral::EventSink<nframes_t> &dst, framepos_t time)
+MidiStateTracker::resolve_notes (Evoral::EventSink<framepos_t> &dst, framepos_t time)
 {
        uint8_t buf[3];
 
index ee1ccc31ae283c8138415c9cd5fb1a3f34ff24dd..e5b773465f48ac745226ec351f3f0cecb644328c 100644 (file)
@@ -110,7 +110,7 @@ MidiStretch::run (boost::shared_ptr<Region> r, Progress* progress)
 
        const int ret = finish (region, nsrcs, new_name);
 
-       results[0]->set_length((nframes_t) floor (r->length() * _request.time_fraction), NULL);
+       results[0]->set_length((framecnt_t) floor (r->length() * _request.time_fraction), NULL);
 
        return ret;
 }
index 6e4f07cf15c23bbfc432c700ed8283bf44e43333..c994350ebcf5a545a3d9c96e0b7a3d4f4170ee05 100644 (file)
@@ -298,7 +298,7 @@ MidiTrack::set_state_part_two ()
 }
 
 int
-MidiTrack::roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick,
+MidiTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick,
                 bool can_record, bool rec_monitors_input, bool& needs_butler)
 {
        Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK);
@@ -320,8 +320,7 @@ MidiTrack::roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame
                return 0;
        }
 
-       nframes_t transport_frame = _session.transport_frame();
-
+       framepos_t transport_frame = _session.transport_frame();
 
        if ((nframes = check_initial_delay (nframes, transport_frame)) == 0) {
                /* need to do this so that the diskstream sets its
@@ -391,7 +390,7 @@ MidiTrack::roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame
 }
 
 int
-MidiTrack::no_roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame,
+MidiTrack::no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
                    bool state_changing, bool can_record, bool rec_monitors_input)
 {
        int ret = Track::no_roll (nframes, start_frame, end_frame, state_changing, can_record, rec_monitors_input);
@@ -410,7 +409,7 @@ MidiTrack::handle_transport_stopped (bool abort, bool did_locate, bool flush_pro
 }
 
 void
-MidiTrack::push_midi_input_to_step_edit_ringbuffer (nframes_t nframes)
+MidiTrack::push_midi_input_to_step_edit_ringbuffer (framecnt_t nframes)
 {
        PortSet& ports (_input->ports());
 
@@ -422,7 +421,7 @@ MidiTrack::push_midi_input_to_step_edit_ringbuffer (nframes_t nframes)
 
                for (MidiBuffer::const_iterator e = mb->begin(); e != mb->end(); ++e) {
 
-                       const Evoral::MIDIEvent<nframes_t> ev(*e, false);
+                       const Evoral::MIDIEvent<framepos_t> ev(*e, false);
 
                         /* note on, since for step edit, note length is determined
                            elsewhere 
@@ -437,7 +436,7 @@ MidiTrack::push_midi_input_to_step_edit_ringbuffer (nframes_t nframes)
 }
 
 void
-MidiTrack::write_out_of_band_data (BufferSet& bufs, framepos_t /*start*/, framepos_t /*end*/, nframes_t nframes)
+MidiTrack::write_out_of_band_data (BufferSet& bufs, framepos_t /*start*/, framepos_t /*end*/, framecnt_t nframes)
 {
        // Append immediate events
        MidiBuffer& buf (bufs.get_midi (0));
@@ -454,13 +453,13 @@ MidiTrack::write_out_of_band_data (BufferSet& bufs, framepos_t /*start*/, framep
 }
 
 int
-MidiTrack::export_stuff (BufferSet& /*bufs*/, nframes_t /*nframes*/, framepos_t /*end_frame*/)
+MidiTrack::export_stuff (BufferSet& /*bufs*/, framecnt_t /*nframes*/, framepos_t /*end_frame*/)
 {
        return -1;
 }
 
 void
-MidiTrack::set_latency_delay (nframes_t longest_session_latency)
+MidiTrack::set_latency_delay (framecnt_t longest_session_latency)
 {
        Route::set_latency_delay (longest_session_latency);
        _diskstream->set_roll_delay (_roll_delay);
@@ -477,7 +476,7 @@ MidiTrack::bounce (InterThreadInfo& /*itt*/)
 
 
 boost::shared_ptr<Region>
-MidiTrack::bounce_range (nframes_t /*start*/, nframes_t /*end*/, InterThreadInfo& /*itt*/, bool /*enable_processing*/)
+MidiTrack::bounce_range (framepos_t /*start*/, framepos_t /*end*/, InterThreadInfo& /*itt*/, bool /*enable_processing*/)
 {
        throw;
        //vector<MidiSource*> srcs;
index c058dec06b10e45d73f7ff590be5610ce5f429c6..3a873a8e5049d9e091ef9cd43cfdc5cefdb6fe08 100644 (file)
@@ -30,7 +30,7 @@ using namespace ARDOUR;
 // Debug wrappers
 
 float
-debug_compute_peak (ARDOUR::Sample *buf, nframes_t nsamples, float current)
+debug_compute_peak (ARDOUR::Sample *buf, pframes_t nsamples, float current)
 {
        if ( ((intptr_t)buf % 16) != 0) {
                std::cerr << "compute_peak(): buffer unaligned!" << std::endl;
@@ -40,7 +40,7 @@ debug_compute_peak (ARDOUR::Sample *buf, nframes_t nsamples, float current)
 }
 
 void
-debug_apply_gain_to_buffer (ARDOUR::Sample *buf, nframes_t nframes, float gain)
+debug_apply_gain_to_buffer (ARDOUR::Sample *buf, pframes_t nframes, float gain)
 {
        if ( ((intptr_t)buf % 16) != 0) {
                std::cerr << "apply_gain_to_buffer(): buffer unaligned!" << std::endl;
@@ -50,7 +50,7 @@ debug_apply_gain_to_buffer (ARDOUR::Sample *buf, nframes_t nframes, float gain)
 }
 
 void
-debug_mix_buffers_with_gain (ARDOUR::Sample *dst, ARDOUR::Sample *src, nframes_t nframes, float gain)
+debug_mix_buffers_with_gain (ARDOUR::Sample *dst, ARDOUR::Sample *src, pframes_t nframes, float gain)
 {
        if ( ((intptr_t)dst & 15) != 0) {
                std::cerr << "mix_buffers_with_gain(): dst unaligned!" << std::endl;
@@ -65,7 +65,7 @@ debug_mix_buffers_with_gain (ARDOUR::Sample *dst, ARDOUR::Sample *src, nframes_t
 }
 
 void
-debug_mix_buffers_no_gain (ARDOUR::Sample *dst, ARDOUR::Sample *src, nframes_t nframes)
+debug_mix_buffers_no_gain (ARDOUR::Sample *dst, ARDOUR::Sample *src, pframes_t nframes)
 {
        if ( ((intptr_t)dst & 15) != 0) {
                std::cerr << "mix_buffers_no_gain(): dst unaligned!" << std::endl;
@@ -83,9 +83,9 @@ debug_mix_buffers_no_gain (ARDOUR::Sample *dst, ARDOUR::Sample *src, nframes_t n
 
 
 float
-default_compute_peak (const ARDOUR::Sample * buf, nframes_t nsamples, float current)
+default_compute_peak (const ARDOUR::Sample * buf, pframes_t nsamples, float current)
 {
-       for (nframes_t i = 0; i < nsamples; ++i) {
+       for (pframes_t i = 0; i < nsamples; ++i) {
                current = f_max (current, fabsf (buf[i]));
        }
 
@@ -93,9 +93,9 @@ default_compute_peak (const ARDOUR::Sample * buf, nframes_t nsamples, float curr
 }
 
 void
-default_find_peaks (const ARDOUR::Sample * buf, nframes_t nframes, float *min, float *max)
+default_find_peaks (const ARDOUR::Sample * buf, pframes_t nframes, float *min, float *max)
 {
-       nframes_t i;
+       pframes_t i;
        float a, b;
 
        a = *max;
@@ -112,24 +112,24 @@ default_find_peaks (const ARDOUR::Sample * buf, nframes_t nframes, float *min, f
 }
 
 void
-default_apply_gain_to_buffer (ARDOUR::Sample * buf, nframes_t nframes, float gain)
+default_apply_gain_to_buffer (ARDOUR::Sample * buf, pframes_t nframes, float gain)
 {
-       for (nframes_t i=0; i<nframes; i++)
+       for (pframes_t i=0; i<nframes; i++)
                buf[i] *= gain;
 }
 
 void
-default_mix_buffers_with_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, nframes_t nframes, float gain)
+default_mix_buffers_with_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, pframes_t nframes, float gain)
 {
-       for (nframes_t i = 0; i < nframes; i++) {
+       for (pframes_t i = 0; i < nframes; i++) {
                dst[i] += src[i] * gain;
        }
 }
 
 void
-default_mix_buffers_no_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, nframes_t nframes)
+default_mix_buffers_no_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, pframes_t nframes)
 {
-       for (nframes_t i=0; i < nframes; i++) {
+       for (pframes_t i=0; i < nframes; i++) {
                dst[i] += src[i];
        }
 }
@@ -138,7 +138,7 @@ default_mix_buffers_no_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, n
 #include <Accelerate/Accelerate.h>
 
 float
-veclib_compute_peak (const ARDOUR::Sample * buf, nframes_t nsamples, float current)
+veclib_compute_peak (const ARDOUR::Sample * buf, pframes_t nsamples, float current)
 {
        float tmpmax = 0.0f;
        vDSP_maxmgv(buf, 1, &tmpmax, nsamples);
@@ -146,26 +146,26 @@ veclib_compute_peak (const ARDOUR::Sample * buf, nframes_t nsamples, float curre
 }
 
 void
-veclib_find_peaks (const ARDOUR::Sample * buf, nframes_t nframes, float *min, float *max)
+veclib_find_peaks (const ARDOUR::Sample * buf, pframes_t nframes, float *min, float *max)
 {
        vDSP_maxv (const_cast<ARDOUR::Sample*>(buf), 1, max, nframes);
        vDSP_minv (const_cast<ARDOUR::Sample*>(buf), 1, min, nframes);
 }
 
 void
-veclib_apply_gain_to_buffer (ARDOUR::Sample * buf, nframes_t nframes, float gain)
+veclib_apply_gain_to_buffer (ARDOUR::Sample * buf, pframes_t nframes, float gain)
 {
        vDSP_vsmul(buf, 1, &gain, buf, 1, nframes);
 }
 
 void
-veclib_mix_buffers_with_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, nframes_t nframes, float gain)
+veclib_mix_buffers_with_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, pframes_t nframes, float gain)
 {
        vDSP_vsma(src, 1, &gain, dst, 1, dst, 1, nframes);
 }
 
 void
-veclib_mix_buffers_no_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, nframes_t nframes)
+veclib_mix_buffers_no_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, pframes_t nframes)
 {
        // It seems that a vector mult only operation does not exist...
        float gain = 1.0f;
index a164f025e81b3e9dacfed77856c629d33cb34158..4f204031acaea4c7397efcf3d148677f44ba20e5 100644 (file)
@@ -245,7 +245,7 @@ MonitorProcessor::state (bool full)
 }
 
 void
-MonitorProcessor::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end_frame*/, nframes_t nframes, bool /*result_required*/)
+MonitorProcessor::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end_frame*/, pframes_t nframes, bool /*result_required*/)
 {
         uint32_t chn = 0;
         gain_t target_gain;
@@ -297,7 +297,7 @@ MonitorProcessor::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /
 
                 /* scale the first channel */
 
-                for (nframes_t n = 0; n < nframes; ++n) {
+                for (pframes_t n = 0; n < nframes; ++n) {
                         buf[n] *= scale;
                 }
 
@@ -307,7 +307,7 @@ MonitorProcessor::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /
                 for (; b != bufs.audio_end(); ++b) {
                         AudioBuffer& ob (*b);
                         Sample* obuf = ob.data ();
-                        for (nframes_t n = 0; n < nframes; ++n) {
+                        for (pframes_t n = 0; n < nframes; ++n) {
                                 buf[n] += obuf[n] * scale;
                         }
                 }
index 953b79083b86dadd58fe31cbec8d2cc74b348e2a..9564770f7f95ba7bdfc0431cf95fad198fb1782f 100644 (file)
@@ -101,7 +101,7 @@ MTC_Slave::rebind (MIDI::Port& p)
 }
 
 void
-MTC_Slave::update_mtc_qtr (Parser& /*p*/, int which_qtr, nframes_t now)
+MTC_Slave::update_mtc_qtr (Parser& /*p*/, int which_qtr, framepos_t now)
 {
        DEBUG_TRACE (DEBUG::MTC, string_compose ("qtr frame %1 at %2\n", which_qtr, now));
        maybe_reset ();
@@ -109,7 +109,7 @@ MTC_Slave::update_mtc_qtr (Parser& /*p*/, int which_qtr, nframes_t now)
 }
 
 void
-MTC_Slave::update_mtc_time (const byte *msg, bool was_full, nframes_t now)
+MTC_Slave::update_mtc_time (const byte *msg, bool was_full, framepos_t now)
 {
        /* "now" can be zero if this is called from a context where we do not have or do not want
           to use a timestamp indicating when this MTC time was received. example: when we received
@@ -395,7 +395,7 @@ MTC_Slave::speed_and_position (double& speed, framepos_t& pos)
 {
        framepos_t now = session.engine().frame_time();
        SafeTime last;
-       nframes_t elapsed;
+       framecnt_t elapsed;
        bool in_control = false;
 
        read_current (&last);
@@ -450,7 +450,7 @@ MTC_Slave::speed_and_position (double& speed, framepos_t& pos)
                /* scale elapsed time by the current MTC speed */
 
                if (last.timestamp && (now > last.timestamp)) {
-                       elapsed = (nframes_t) floor (last.speed * (now - last.timestamp));
+                       elapsed = (framecnt_t) floor (last.speed * (now - last.timestamp));
                        DEBUG_TRACE (DEBUG::MTC, string_compose ("last timecode received @ %1, now = %2, elapsed frames = %3 w/speed= %4\n",
                                                                 last.timestamp, now, elapsed, last.speed));
                } else {
@@ -476,10 +476,10 @@ MTC_Slave::speed_and_position (double& speed, framepos_t& pos)
        return true;
 }
 
-ARDOUR::nframes_t
-MTC_Slave::resolution() const
+ARDOUR::framecnt_t
+MTC_Slave::resolution () const
 {
-       return (nframes_t) session.frames_per_timecode_frame();
+       return (framecnt_t) session.frames_per_timecode_frame();
 }
 
 void
@@ -555,7 +555,7 @@ MTC_Slave::reset_window (framepos_t root)
 
        case MTC_Backward:
                if (session.slave_state() == Session::Running) {
-                       nframes_t d = session.frames_per_timecode_frame() * frame_tolerance;
+                       framecnt_t const d = session.frames_per_timecode_frame() * frame_tolerance;
                        if (root > d) {
                                window_begin = root - d;
                                window_end = root;
@@ -563,7 +563,7 @@ MTC_Slave::reset_window (framepos_t root)
                                window_begin = 0;
                        }
                } else {
-                       nframes_t d = seekahead_distance ();
+                       framecnt_t const d = seekahead_distance ();
                        if (root > d) {
                                window_begin = root - d;
                        } else {
@@ -581,7 +581,7 @@ MTC_Slave::reset_window (framepos_t root)
        DEBUG_TRACE (DEBUG::MTC, string_compose ("legal MTC window now %1 .. %2\n", window_begin, window_end));
 }
 
-framecnt_t
+ARDOUR::framecnt_t
 MTC_Slave::seekahead_distance () const
 {
        /* 1 second */
index abe7df70220f170394ceae5df377feafc4783c92..4f2151a03d233cc011252b1c398f629a23b6b6ed 100644 (file)
@@ -56,7 +56,7 @@ OnsetDetector::use_features (Plugin::FeatureSet& features, ostream* out)
                                (*out) << (*f).timestamp.toString() << endl;
                        }
 
-                       current_results->push_back (RealTime::realTime2Frame ((*f).timestamp, (nframes_t) floor(sample_rate)));
+                       current_results->push_back (RealTime::realTime2Frame ((*f).timestamp, (framecnt_t) floor(sample_rate)));
                }
        }
 
index 6bef67788ab89ccc4dd9f4036f04e5727651d0f0..c3f4d52a5678d73a3c0b738921d6afed2a1b99f7 100644 (file)
@@ -204,7 +204,7 @@ StreamPanner::get_state ()
 }
 
 void
-StreamPanner::distribute (AudioBuffer& src, BufferSet& obufs, gain_t gain_coeff, nframes_t nframes)
+StreamPanner::distribute (AudioBuffer& src, BufferSet& obufs, gain_t gain_coeff, pframes_t nframes)
 {
        if (_mono) {
                /* we're in mono mode, so just pan the input to all outputs equally */
@@ -220,7 +220,7 @@ StreamPanner::distribute (AudioBuffer& src, BufferSet& obufs, gain_t gain_coeff,
 
 void
 StreamPanner::distribute_automated (AudioBuffer& src, BufferSet& obufs,
-                                   nframes_t start, nframes_t end, nframes_t nframes, pan_t** buffers)
+                                   framepos_t start, framepos_t end, pframes_t nframes, pan_t** buffers)
 {
        if (_mono) {
                /* we're in mono mode, so just pan the input to all outputs equally */
@@ -260,7 +260,7 @@ BaseStereoPanner::load (istream& in, string path, uint32_t& linecnt)
        _control->list()->clear ();
 
        while (in.getline (line, sizeof (line), '\n')) {
-               nframes_t when;
+               framepos_t when;
                double value;
 
                ++linecnt;
@@ -269,7 +269,7 @@ BaseStereoPanner::load (istream& in, string path, uint32_t& linecnt)
                        break;
                }
 
-               if (sscanf (line, "%" PRIu32 " %lf", &when, &value) != 2) {
+               if (sscanf (line, "%" PRIu64 " %lf", &when, &value) != 2) {
                        warning << string_compose(_("badly formatted pan automation event record at line %1 of %2 (ignored) [%3]"), linecnt, path, line) << endmsg;
                        continue;
                }
@@ -285,7 +285,7 @@ BaseStereoPanner::load (istream& in, string path, uint32_t& linecnt)
 }
 
 void
-BaseStereoPanner::do_distribute (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gain_coeff, nframes_t nframes)
+BaseStereoPanner::do_distribute (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gain_coeff, pframes_t nframes)
 {
        assert(obufs.count().n_audio() == 2);
 
@@ -308,8 +308,8 @@ BaseStereoPanner::do_distribute (AudioBuffer& srcbuf, BufferSet& obufs, gain_t g
                /* we've moving the pan by an appreciable amount, so we must
                   interpolate over 64 frames or nframes, whichever is smaller */
 
-               nframes_t const limit = min ((nframes_t)64, nframes);
-               nframes_t n;
+               pframes_t const limit = min ((pframes_t) 64, nframes);
+               pframes_t n;
 
                delta = -(delta / (float) (limit));
 
@@ -365,8 +365,8 @@ BaseStereoPanner::do_distribute (AudioBuffer& srcbuf, BufferSet& obufs, gain_t g
                /* we're moving the pan by an appreciable amount, so we must
                   interpolate over 64 frames or nframes, whichever is smaller */
 
-               nframes_t const limit = min ((nframes_t)64, nframes);
-               nframes_t n;
+               pframes_t const limit = min ((pframes_t) 64, nframes);
+               pframes_t n;
 
                delta = -(delta / (float) (limit));
 
@@ -460,7 +460,7 @@ EqualPowerStereoPanner::update ()
 
 void
 EqualPowerStereoPanner::do_distribute_automated (AudioBuffer& srcbuf, BufferSet& obufs,
-                                                nframes_t start, nframes_t end, nframes_t nframes,
+                                                framepos_t start, framepos_t end, pframes_t nframes,
                                                 pan_t** buffers)
 {
        assert (obufs.count().n_audio() == 2);
@@ -496,7 +496,7 @@ EqualPowerStereoPanner::do_distribute_automated (AudioBuffer& srcbuf, BufferSet&
        const float pan_law_attenuation = -3.0f;
        const float scale = 2.0f - 4.0f * powf (10.0f,pan_law_attenuation/20.0f);
 
-       for (nframes_t n = 0; n < nframes; ++n) {
+       for (pframes_t n = 0; n < nframes; ++n) {
 
                float const panR = buffers[0][n];
                float const panL = 1 - panR;
@@ -510,7 +510,7 @@ EqualPowerStereoPanner::do_distribute_automated (AudioBuffer& srcbuf, BufferSet&
        dst = obufs.get_audio(0).data();
        pbuf = buffers[0];
 
-       for (nframes_t n = 0; n < nframes; ++n) {
+       for (pframes_t n = 0; n < nframes; ++n) {
                dst[n] += src[n] * pbuf[n];
        }
 
@@ -521,7 +521,7 @@ EqualPowerStereoPanner::do_distribute_automated (AudioBuffer& srcbuf, BufferSet&
        dst = obufs.get_audio(1).data();
        pbuf = buffers[1];
 
-       for (nframes_t n = 0; n < nframes; ++n) {
+       for (pframes_t n = 0; n < nframes; ++n) {
                dst[n] += src[n] * pbuf[n];
        }
 
@@ -1120,7 +1120,7 @@ Panner::set_position (const AngularVector& a, StreamPanner& orig)
 }
 
 void
-Panner::distribute_no_automation (BufferSet& inbufs, BufferSet& outbufs, nframes_t nframes, gain_t gain_coeff)
+Panner::distribute_no_automation (BufferSet& inbufs, BufferSet& outbufs, pframes_t nframes, gain_t gain_coeff)
 {
        if (outbufs.count().n_audio() == 0) {
                // Don't want to lose audio...
@@ -1191,7 +1191,7 @@ Panner::distribute_no_automation (BufferSet& inbufs, BufferSet& outbufs, nframes
 }
 
 void
-Panner::run (BufferSet& inbufs, BufferSet& outbufs, framepos_t start_frame, framepos_t end_frame, nframes_t nframes)
+Panner::run (BufferSet& inbufs, BufferSet& outbufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes)
 {
        if (outbufs.count().n_audio() == 0) {
                // Failing to deliver audio we were asked to deliver is a bug
index 00996a059d1951bfc2f614b49b97ad04941a15f7..f7556cc961fcba63761e48c064e62d540ea4e1ae 100644 (file)
@@ -94,7 +94,7 @@ PlaylistFactory::create (boost::shared_ptr<const Playlist> old, string name, boo
 }
 
 boost::shared_ptr<Playlist>
-PlaylistFactory::create (boost::shared_ptr<const Playlist> old, nframes_t start, nframes_t cnt, string name, bool hidden)
+PlaylistFactory::create (boost::shared_ptr<const Playlist> old, framepos_t start, framecnt_t cnt, string name, bool hidden)
 {
        boost::shared_ptr<Playlist> pl;
        boost::shared_ptr<const AudioPlaylist> apl;
index c852d6b2a93b95eca384b84ba2e12e932cd017ad..ecaca5cc50e6b3c0426686bf51401318dd571ea6 100644 (file)
@@ -223,7 +223,7 @@ PluginInsert::parameter_changed (Evoral::Parameter which, float val)
 }
 
 int
-PluginInsert::set_block_size (nframes_t nframes)
+PluginInsert::set_block_size (pframes_t nframes)
 {
         int ret = 0;
        for (Plugins::iterator i = _plugins.begin(); i != _plugins.end(); ++i) {
@@ -263,11 +263,11 @@ PluginInsert::flush ()
 }
 
 void
-PluginInsert::connect_and_run (BufferSet& bufs, nframes_t nframes, nframes_t offset, bool with_auto, nframes_t now)
+PluginInsert::connect_and_run (BufferSet& bufs, pframes_t nframes, framecnt_t offset, bool with_auto, framepos_t now)
 {
        // Calculate if, and how many frames we need to collect for analysis
-       nframes_t collect_signal_nframes = (_signal_analysis_collect_nframes_max -
-                                            _signal_analysis_collected_nframes);
+       framecnt_t collect_signal_nframes = (_signal_analysis_collect_nframes_max -
+                                            _signal_analysis_collected_nframes);
        if (nframes < collect_signal_nframes) { // we might not get all frames now
                collect_signal_nframes = nframes;
        }
@@ -355,7 +355,7 @@ PluginInsert::connect_and_run (BufferSet& bufs, nframes_t nframes, nframes_t off
 }
 
 void
-PluginInsert::silence (nframes_t nframes)
+PluginInsert::silence (framecnt_t nframes)
 {
        ChanMapping in_map(input_streams());
        ChanMapping out_map(output_streams());
@@ -368,7 +368,7 @@ PluginInsert::silence (nframes_t nframes)
 }
 
 void
-PluginInsert::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end_frame*/, nframes_t nframes, bool)
+PluginInsert::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end_frame*/, pframes_t nframes, bool)
 {
        if (_pending_active) {
                /* run as normal if we are active or moving from inactive to active */
@@ -437,12 +437,12 @@ PluginInsert::get_parameter (Evoral::Parameter param)
 }
 
 void
-PluginInsert::automation_run (BufferSet& bufs, nframes_t nframes)
+PluginInsert::automation_run (BufferSet& bufs, pframes_t nframes)
 {
        Evoral::ControlEvent next_event (0, 0.0f);
-       nframes_t now = _session.transport_frame ();
-       nframes_t end = now + nframes;
-       nframes_t offset = 0;
+       framepos_t now = _session.transport_frame ();
+       framepos_t end = now + nframes;
+       framecnt_t offset = 0;
 
        Glib::Mutex::Lock lm (control_lock(), Glib::TRY_LOCK);
 
@@ -461,7 +461,7 @@ PluginInsert::automation_run (BufferSet& bufs, nframes_t nframes)
 
        while (nframes) {
 
-               nframes_t cnt = min (((nframes_t) ceil (next_event.when) - now), nframes);
+               framecnt_t cnt = min (((framecnt_t) ceil (next_event.when) - now), (framecnt_t) nframes);
 
                connect_and_run (bufs, cnt, offset, true, now);
 
@@ -922,7 +922,7 @@ PluginInsert::describe_parameter (Evoral::Parameter param)
        return _plugins[0]->describe_parameter (param);
 }
 
-ARDOUR::nframes_t
+ARDOUR::framecnt_t
 PluginInsert::signal_latency() const
 {
        if (_user_latency) {
@@ -1040,7 +1040,7 @@ PluginInsert::get_impulse_analysis_plugin()
 }
 
 void
-PluginInsert::collect_signal_for_analysis(nframes_t nframes)
+PluginInsert::collect_signal_for_analysis (framecnt_t nframes)
 {
        // called from outside the audio thread, so this should be safe
        // only do audio as analysis is (currently) only for audio plugins
index ab38285f0cbf865a5f75e471721f8946e03bad43..fe234c593f10283ddd465218f275bade17ec74e6 100644 (file)
@@ -34,7 +34,7 @@ using namespace std;
 using namespace ARDOUR;
 
 AudioEngine* Port::_engine = 0;
-nframes_t Port::_buffer_size = 0;
+pframes_t Port::_buffer_size = 0;
 bool Port::_connecting_blocked = false;
 
 /** @param n Port short name */
@@ -220,7 +220,7 @@ Port::recompute_total_latency () const
 #endif
 }
 
-nframes_t
+framecnt_t
 Port::total_latency () const
 {
        jack_client_t* jack = _engine->jack();
@@ -293,7 +293,7 @@ Port::request_monitor_input (bool yn)
 }
 
 void
-Port::set_latency (nframes_t n)
+Port::set_latency (framecnt_t n)
 {
        jack_port_set_latency (_jack_port, n);
 }
index 4854c08d8b32e5d9b0fee3b0e65435d159a1a0a0..b738c68de85177a54a5d8584b686d7dfb76f5f6a 100644 (file)
@@ -78,12 +78,12 @@ PortInsert::stop_latency_detection ()
 }
 
 void
-PortInsert::set_measured_latency (nframes_t n)
+PortInsert::set_measured_latency (framecnt_t n)
 {
         _measured_latency = n;
 }
 
-nframes_t 
+framecnt_t 
 PortInsert::latency() const 
 {
        /* because we deliver and collect within the same cycle,
@@ -101,7 +101,7 @@ PortInsert::latency() const
 }
 
 void
-PortInsert::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, nframes_t nframes, bool)
+PortInsert::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool)
 {
        if (_output->n_ports().n_total() == 0) {
                return;
@@ -166,7 +166,7 @@ PortInsert::state (bool full)
        node.add_property ("type", "port");
        snprintf (buf, sizeof (buf), "%" PRIu32, bitslot);
        node.add_property ("bitslot", buf);
-        snprintf (buf, sizeof (buf), "%u", _measured_latency);
+        snprintf (buf, sizeof (buf), "%" PRId64, _measured_latency);
         node.add_property("latency", buf);
         snprintf (buf, sizeof (buf), "%u", _session.get_block_size());
         node.add_property("block_size", buf);
@@ -227,7 +227,7 @@ PortInsert::set_state (const XMLNode& node, int version)
        return 0;
 }
 
-ARDOUR::nframes_t
+ARDOUR::framecnt_t
 PortInsert::signal_latency() const
 {
        /* because we deliver and collect within the same cycle,
index e31cebe6021f3bbda6625a7151331956aca6ef6d..805782807ae37198c1c7279efad4f5d7f2949227 100644 (file)
@@ -70,16 +70,16 @@ RBEffect::run (boost::shared_ptr<Region> r, Progress*)
        }
 
        SourceList nsrcs;
-       nframes_t done;
+       framecnt_t done;
        int ret = -1;
-       const nframes_t bufsize = 256;
+       const framecnt_t bufsize = 256;
        gain_t* gain_buffer = 0;
        Sample** buffers = 0;
        char suffix[32];
        string new_name;
        string::size_type at;
-       nframes_t pos = 0;
-       int avail = 0;
+       framepos_t pos = 0;
+       framecnt_t avail = 0;
        boost::shared_ptr<AudioRegion> result;
        
        cerr << "RBEffect: source region: position = " << region->position()
@@ -148,11 +148,11 @@ RBEffect::run (boost::shared_ptr<Region> r, Progress*)
        double stretch = region->stretch() * tsr.time_fraction;
        double shift = region->shift() * tsr.pitch_fraction;
 
-       nframes_t read_start = region->ancestral_start() +
-               nframes_t(region->start() / (double)region->stretch());
+       framecnt_t read_start = region->ancestral_start() +
+               framecnt_t(region->start() / (double)region->stretch());
 
-       nframes_t read_duration =
-               nframes_t(region->length() / (double)region->stretch());
+       framecnt_t read_duration =
+               framecnt_t(region->length() / (double)region->stretch());
 
        uint32_t channels = region->n_channels();
 
@@ -206,16 +206,16 @@ RBEffect::run (boost::shared_ptr<Region> r, Progress*)
        try {
                while (pos < read_duration && !tsr.cancel) {
 
-                       nframes_t this_read = 0;
+                       framecnt_t this_read = 0;
 
                        for (uint32_t i = 0; i < channels; ++i) {
 
                                this_read = 0;
 
-                               nframes_t this_time;
+                               framepos_t this_time;
                                this_time = min(bufsize, read_duration - pos);
 
-                               nframes_t this_position;
+                               framepos_t this_position;
                                this_position = read_start + pos -
                                        region->start() + region->position();
 
@@ -248,15 +248,15 @@ RBEffect::run (boost::shared_ptr<Region> r, Progress*)
 
                while (pos < read_duration && !tsr.cancel) {
 
-                       nframes_t this_read = 0;
+                       framecnt_t this_read = 0;
 
                        for (uint32_t i = 0; i < channels; ++i) {
 
                                this_read = 0;
-                               nframes_t this_time;
+                               framepos_t this_time;
                                this_time = min(bufsize, read_duration - pos);
 
-                               nframes_t this_position;
+                               framepos_t this_position;
                                this_position = read_start + pos -
                                        region->start() + region->position();
 
@@ -283,11 +283,11 @@ RBEffect::run (boost::shared_ptr<Region> r, Progress*)
 
                        stretcher.process(buffers, this_read, pos == read_duration);
 
-                       int avail = 0;
+                       framecnt_t avail = 0;
 
                        while ((avail = stretcher.available()) > 0) {
 
-                               this_read = min(bufsize, uint32_t(avail));
+                               this_read = min (bufsize, avail);
 
                                stretcher.retrieve(buffers, this_read);
 
@@ -308,7 +308,7 @@ RBEffect::run (boost::shared_ptr<Region> r, Progress*)
 
                while ((avail = stretcher.available()) >= 0) {
 
-                       uint32_t this_read = min(bufsize, uint32_t(avail));
+                       framecnt_t this_read = min (bufsize, avail);
 
                        stretcher.retrieve(buffers, this_read);
 
index 33338e52ea8fa2597e8c7d51cf362b36c78635b3..09c2552c4834d954e6729a85dfbd4211c2d6dfe6 100644 (file)
@@ -774,26 +774,26 @@ Region::trim_front (framepos_t new_position, void *src)
 }
 
 void
-Region::cut_front (nframes_t new_position, void *src)
+Region::cut_front (framepos_t new_position, void *src)
 {
        modify_front (new_position, true, src);
 }
 
 void
-Region::cut_end (nframes_t new_endpoint, void *src)
+Region::cut_end (framepos_t new_endpoint, void *src)
 {
        modify_end (new_endpoint, true, src);
 }
 
 void
-Region::modify_front (nframes_t new_position, bool reset_fade, void *src)
+Region::modify_front (framepos_t new_position, bool reset_fade, void *src)
 {
        if (locked()) {
                return;
        }
 
-       nframes_t end = last_frame();
-       nframes_t source_zero;
+       framepos_t end = last_frame();
+       framepos_t source_zero;
 
        if (_position > _start) {
                source_zero = _position - _start;
@@ -803,7 +803,7 @@ Region::modify_front (nframes_t new_position, bool reset_fade, void *src)
 
        if (new_position < end) { /* can't trim it zero or negative length */
                
-               nframes_t newlen = 0;
+               framecnt_t newlen = 0;
                framepos_t delta = 0;
 
                /* can't trim it back passed where source position zero is located */
@@ -835,7 +835,7 @@ Region::modify_front (nframes_t new_position, bool reset_fade, void *src)
 }
 
 void
-Region::modify_end (nframes_t new_endpoint, bool reset_fade, void* /*src*/)
+Region::modify_end (framepos_t new_endpoint, bool reset_fade, void* /*src*/)
 {
        if (locked()) {
                return;
@@ -1045,7 +1045,7 @@ Region::clear_sync_position ()
 }
 
 /* @return the sync point relative the first frame of the region */
-framepos_t
+frameoffset_t
 Region::sync_offset (int& dir) const
 {
        if (sync_marked()) {
index 7379aa74afbd2d027edde496b903b721c2ac90e0..1d6028156528b2d04649c9a61977a5e29b78dad3 100644 (file)
@@ -28,7 +28,7 @@ using namespace PBD;
 
 const uint32_t ResampledImportableSource::blocksize = 16384U;
 
-ResampledImportableSource::ResampledImportableSource (boost::shared_ptr<ImportableSource> src, nframes_t rate, SrcQuality srcq)
+ResampledImportableSource::ResampledImportableSource (boost::shared_ptr<ImportableSource> src, framecnt_t rate, SrcQuality srcq)
        : source (src)
        , src_state (0)
 {
@@ -65,8 +65,8 @@ ResampledImportableSource::~ResampledImportableSource ()
        delete [] input;
 }
 
-nframes_t
-ResampledImportableSource::read (Sample* output, nframes_t nframes)
+framecnt_t
+ResampledImportableSource::read (Sample* output, framecnt_t nframes)
 {
        int err;
 
@@ -78,7 +78,7 @@ ResampledImportableSource::read (Sample* output, nframes_t nframes)
 
                /* The last read will not be a full buffer, so set end_of_input. */
 
-               if ((nframes_t) src_data.input_frames < blocksize) {
+               if ((framecnt_t) src_data.input_frames < blocksize) {
                        src_data.end_of_input = true;
                }
 
@@ -91,7 +91,7 @@ ResampledImportableSource::read (Sample* output, nframes_t nframes)
        if (!src_data.end_of_input) {
                src_data.output_frames = nframes / source->channels();
        } else {
-               src_data.output_frames = std::min ((nframes_t) src_data.input_frames, nframes / source->channels());
+               src_data.output_frames = std::min ((framecnt_t) src_data.input_frames, nframes / source->channels());
        }
 
        if ((err = src_process (src_state, &src_data))) {
@@ -112,7 +112,7 @@ ResampledImportableSource::read (Sample* output, nframes_t nframes)
 }
 
 void
-ResampledImportableSource::seek (nframes_t pos)
+ResampledImportableSource::seek (framepos_t pos)
 {
        source->seek (pos);
 
index d8c8dd22f8d40d375d02060bd98425c89e31ca1c..e64db79c869770e7c4d34e602fcf120dcce44ae9 100644 (file)
@@ -103,7 +103,7 @@ Return::set_state (const XMLNode& node, int version)
 }
 
 void
-Return::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, nframes_t nframes, bool)
+Return::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool)
 {
        if ((!_active && !_pending_active) || _input->n_ports() == ChanCount::ZERO) {
                return;
index 9fcfb8c1b19786a74f2211e1646ef1c270aff591..45d7c83051d7a54954ba37087d6d93179ee27700 100644 (file)
@@ -90,7 +90,7 @@ Reverse::run (boost::shared_ptr<Region> r, Progress*)
 
                        /* swap memory order */
 
-                       for (nframes_t i = 0; i < to_read/2; ++i) {
+                       for (framecnt_t i = 0; i < to_read/2; ++i) {
                                swap (buf[i],buf[to_read-1-i]);
                        }
 
index 1e0edc2077e3e5144c3a14595e0b5a21f60403cd..3577d3a659b4ace632e3dc9f9318bfda2311e01c 100644 (file)
@@ -382,7 +382,7 @@ Route::set_gain (gain_t val, void *src)
  */
 void
 Route::process_output_buffers (BufferSet& bufs,
-                              framepos_t start_frame, framepos_t end_frame, nframes_t nframes,
+                              framepos_t start_frame, framepos_t end_frame, pframes_t nframes,
                               bool /*with_processors*/, int declick)
 {
        bool monitor;
@@ -436,12 +436,12 @@ Route::process_output_buffers (BufferSet& bufs,
                                Sample* const sp = i->data();
 
                                if (_phase_invert[chn]) {
-                                       for (nframes_t nx = 0; nx < nframes; ++nx) {
+                                       for (pframes_t nx = 0; nx < nframes; ++nx) {
                                                sp[nx]  = -sp[nx];
                                                sp[nx] += 1.0e-27f;
                                        }
                                } else {
-                                       for (nframes_t nx = 0; nx < nframes; ++nx) {
+                                       for (pframes_t nx = 0; nx < nframes; ++nx) {
                                                sp[nx] += 1.0e-27f;
                                        }
                                }
@@ -453,7 +453,7 @@ Route::process_output_buffers (BufferSet& bufs,
                                Sample* const sp = i->data();
 
                                if (_phase_invert[chn]) {
-                                       for (nframes_t nx = 0; nx < nframes; ++nx) {
+                                       for (pframes_t nx = 0; nx < nframes; ++nx) {
                                                sp[nx] = -sp[nx];
                                        }
                                }
@@ -466,7 +466,7 @@ Route::process_output_buffers (BufferSet& bufs,
 
                        for (BufferSet::audio_iterator i = bufs.audio_begin(); i != bufs.audio_end(); ++i) {
                                Sample* const sp = i->data();
-                               for (nframes_t nx = 0; nx < nframes; ++nx) {
+                               for (pframes_t nx = 0; nx < nframes; ++nx) {
                                        sp[nx] += 1.0e-27f;
                                }
                        }
@@ -507,7 +507,7 @@ Route::n_process_buffers ()
 }
 
 void
-Route::passthru (framepos_t start_frame, framepos_t end_frame, nframes_t nframes, int declick)
+Route::passthru (framepos_t start_frame, framepos_t end_frame, pframes_t nframes, int declick)
 {
        BufferSet& bufs = _session.get_scratch_buffers (n_process_buffers());
 
@@ -547,7 +547,7 @@ Route::passthru (framepos_t start_frame, framepos_t end_frame, nframes_t nframes
 }
 
 void
-Route::passthru_silence (framepos_t start_frame, framepos_t end_frame, nframes_t nframes, int declick)
+Route::passthru_silence (framepos_t start_frame, framepos_t end_frame, pframes_t nframes, int declick)
 {
        BufferSet& bufs (_session.get_silent_buffers (n_process_buffers()));
        bufs.set_count (_input->n_ports());
@@ -2417,7 +2417,7 @@ Route::curve_reallocate ()
 }
 
 void
-Route::silence (nframes_t nframes)
+Route::silence (framecnt_t nframes)
 {
        Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK);
        if (!lm.locked()) {
@@ -2428,7 +2428,7 @@ Route::silence (nframes_t nframes)
 }
 
 void
-Route::silence_unlocked (nframes_t nframes)
+Route::silence_unlocked (framecnt_t nframes)
 {
        /* Must be called with the processor lock held */
        
@@ -2774,7 +2774,7 @@ Route::pans_required () const
 }
 
 int
-Route::no_roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame,
+Route::no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
                bool session_state_changing, bool /*can_record*/, bool /*rec_monitors_input*/)
 {
        Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK);
@@ -2811,8 +2811,8 @@ Route::no_roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame,
        return 0;
 }
 
-nframes_t
-Route::check_initial_delay (nframes_t nframes, nframes_t& transport_frame)
+framecnt_t
+Route::check_initial_delay (framecnt_t nframes, framecnt_t& transport_frame)
 {
        if (_roll_delay > nframes) {
 
@@ -2839,7 +2839,7 @@ Route::check_initial_delay (nframes_t nframes, nframes_t& transport_frame)
 }
 
 int
-Route::roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick,
+Route::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick,
             bool /*can_record*/, bool /*rec_monitors_input*/, bool& /* need_butler */)
 {
        Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK);
@@ -2858,7 +2858,7 @@ Route::roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame, in
                return 0;
        }
 
-       nframes_t unused = 0;
+       framecnt_t unused = 0;
 
        if ((nframes = check_initial_delay (nframes, unused)) == 0) {
                return 0;
@@ -2872,7 +2872,7 @@ Route::roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame, in
 }
 
 int
-Route::silent_roll (nframes_t nframes, framepos_t /*start_frame*/, framepos_t /*end_frame*/,
+Route::silent_roll (pframes_t nframes, framepos_t /*start_frame*/, framepos_t /*end_frame*/,
                    bool /*can_record*/, bool /*rec_monitors_input*/, bool& /* need_butler */)
 {
        silence (nframes);
@@ -3041,11 +3041,11 @@ Route::put_monitor_send_at (Placement p)
        _session.set_dirty ();
 }
 
-nframes_t
+framecnt_t
 Route::update_total_latency ()
 {
-       nframes_t old = _output->effective_latency();
-       nframes_t own_latency = _output->user_latency();
+       framecnt_t old = _output->effective_latency();
+       framecnt_t own_latency = _output->user_latency();
 
        for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
                if ((*i)->active ()) {
@@ -3080,16 +3080,16 @@ Route::update_total_latency ()
 }
 
 void
-Route::set_user_latency (nframes_t nframes)
+Route::set_user_latency (framecnt_t nframes)
 {
        _output->set_user_latency (nframes);
        _session.update_latency_compensation (false, false);
 }
 
 void
-Route::set_latency_delay (nframes_t longest_session_latency)
+Route::set_latency_delay (framecnt_t longest_session_latency)
 {
-       nframes_t old = _initial_delay;
+       framecnt_t old = _initial_delay;
 
        if (_output->effective_latency() < longest_session_latency) {
                _initial_delay = longest_session_latency - _output->effective_latency();
@@ -3107,7 +3107,7 @@ Route::set_latency_delay (nframes_t longest_session_latency)
 }
 
 void
-Route::automation_snapshot (nframes_t now, bool force)
+Route::automation_snapshot (framepos_t now, bool force)
 {
        panner()->automation_snapshot (now, force);
        
@@ -3186,7 +3186,7 @@ Route::MuteControllable::get_value (void) const
 }
 
 void
-Route::set_block_size (nframes_t nframes)
+Route::set_block_size (pframes_t nframes)
 {
        for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
                (*i)->set_block_size (nframes);
index 74212155ec8830ae0f8cc6793e69d654135ec36a..9e34080fe094a23e6e10dd9060570537b50e92b1 100644 (file)
@@ -71,7 +71,7 @@ Send::deactivate ()
 }
 
 void
-Send::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, nframes_t nframes, bool)
+Send::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool)
 {
        if (_output->n_ports() == ChanCount::ZERO) {
                _meter->reset ();
index 5abaaf3508a3df6ec1becd981da22073b34b1bca..690fbc5e9a7a44576bad9cfa2377a174674c251e 100644 (file)
@@ -115,7 +115,7 @@ bool Session::_disable_all_loaded_plugins = false;
 
 PBD::Signal1<void,std::string> Session::Dialog;
 PBD::Signal0<int> Session::AskAboutPendingState;
-PBD::Signal2<int,nframes_t,nframes_t> Session::AskAboutSampleRateMismatch;
+PBD::Signal2<int, framecnt_t, framecnt_t> Session::AskAboutSampleRateMismatch;
 PBD::Signal0<void> Session::SendFeedback;
 PBD::Signal3<int,Session*,std::string,DataType> Session::MissingFile;
 
@@ -826,7 +826,7 @@ Session::auto_punch_start_changed (Location* location)
 void
 Session::auto_punch_end_changed (Location* location)
 {
-       nframes_t when_to_stop = location->end();
+       framepos_t when_to_stop = location->end();
        // when_to_stop += _worst_output_latency + _worst_input_latency;
        replace_event (SessionEvent::PunchOut, when_to_stop);
 }
@@ -834,7 +834,7 @@ Session::auto_punch_end_changed (Location* location)
 void
 Session::auto_punch_changed (Location* location)
 {
-       nframes_t when_to_stop = location->end();
+       framepos_t when_to_stop = location->end();
 
        replace_event (SessionEvent::PunchIn, location->start());
        //when_to_stop += _worst_output_latency + _worst_input_latency;
@@ -1122,7 +1122,7 @@ Session::audible_frame () const
 {
        framepos_t ret;
        framepos_t tf;
-       nframes_t offset;
+       framecnt_t offset;
 
        /* the first of these two possible settings for "offset"
           mean that the audible frame is stationary until
@@ -1197,9 +1197,9 @@ Session::audible_frame () const
 }
 
 void
-Session::set_frame_rate (nframes_t frames_per_second)
+Session::set_frame_rate (framecnt_t frames_per_second)
 {
-       /** \fn void Session::set_frame_size(nframes_t)
+       /** \fn void Session::set_frame_size(framecnt_t)
                the AudioEngine object that calls this guarantees
                that it will not be called while we are also in
                ::process(). Its fine to do things that block
@@ -1210,7 +1210,7 @@ Session::set_frame_rate (nframes_t frames_per_second)
 
        sync_time_vars();
 
-       Automatable::set_automation_interval ((jack_nframes_t) ceil ((double) frames_per_second * (0.001 * Config->get_automation_interval())));
+       Automatable::set_automation_interval (ceil ((double) frames_per_second * (0.001 * Config->get_automation_interval())));
 
        clear_clicks ();
 
@@ -1223,7 +1223,7 @@ Session::set_frame_rate (nframes_t frames_per_second)
 }
 
 void
-Session::set_block_size (nframes_t nframes)
+Session::set_block_size (pframes_t nframes)
 {
        /* the AudioEngine guarantees
           that it will not be called while we are also in
@@ -1258,7 +1258,7 @@ void
 Session::set_default_fade (float /*steepness*/, float /*fade_msecs*/)
 {
 #if 0
-       nframes_t fade_frames;
+       framecnt_t fade_frames;
 
        /* Don't allow fade of less 1 frame */
 
@@ -1269,7 +1269,7 @@ Session::set_default_fade (float /*steepness*/, float /*fade_msecs*/)
 
        } else {
 
-               fade_frames = (nframes_t) floor (fade_msecs * _current_frame_rate * 0.001);
+               fade_frames = (framecnt_t) floor (fade_msecs * _current_frame_rate * 0.001);
 
        }
 
@@ -4029,7 +4029,7 @@ Session::current_end_frame () const
 }
 
 void
-Session::add_session_range_location (nframes_t start, nframes_t end)
+Session::add_session_range_location (framepos_t start, framepos_t end)
 {
        _session_range_location = new Location (*this, start, end, _("session"), Location::IsSessionRange);
        _locations->add (_session_range_location);
index 363c5911b8e9d9cfd00c2be6105ea1888a8335e9..0a83a0f6d98b875022f7c8483e7b54d30a755cf5 100644 (file)
@@ -38,7 +38,7 @@ using namespace PBD;
 Pool Click::pool ("click", sizeof (Click), 128);
 
 void
-Session::click (nframes_t start, nframes_t nframes)
+Session::click (framepos_t start, framecnt_t nframes)
 {
        TempoMap::BBTPointList *points;
        Sample *buf;
@@ -54,7 +54,7 @@ Session::click (nframes_t start, nframes_t nframes)
                return;
        }
 
-       const nframes_t end = start + nframes;
+       const framepos_t end = start + nframes;
 
        BufferSet& bufs = get_scratch_buffers(ChanCount(DataType::AUDIO, 1));
        buf = bufs.get_audio(0).data();
@@ -90,8 +90,8 @@ Session::click (nframes_t start, nframes_t nframes)
 
        for (list<Click*>::iterator i = clicks.begin(); i != clicks.end(); ) {
 
-               nframes_t copy;
-               nframes_t internal_offset;
+               framecnt_t copy;
+               framecnt_t internal_offset;
                Click *clk;
                list<Click*>::iterator next;
 
index 75c8fd0dd75404d53d3beaa37bd405122334210a..2c4d8a1a22666e663b1556aa0f18840264e1a8c9 100644 (file)
@@ -96,7 +96,7 @@ Session::pre_export ()
 }
 
 int
-Session::start_audio_export (nframes_t position, bool /* realtime */)
+Session::start_audio_export (framepos_t position, bool /* realtime */)
 {
        if (!_exporting) {
                pre_export ();
@@ -149,7 +149,7 @@ Session::start_audio_export (nframes_t position, bool /* realtime */)
 }
 
 void
-Session::process_export (nframes_t nframes)
+Session::process_export (pframes_t nframes)
 {
        if (_export_rolling && export_status->stop) {
                stop_audio_export ();
@@ -178,7 +178,7 @@ Session::process_export (nframes_t nframes)
 }
 
 int
-Session::process_export_fw (nframes_t nframes)
+Session::process_export_fw (pframes_t nframes)
 {
         _engine.main_thread()->get_buffers ();
        process_export (nframes);
index 6914b9db9474a9ca702732ce6db5b49fb37f8525..ee43a7263a680b8f0e9e692ef749d706c55cea1f 100644 (file)
@@ -90,7 +90,7 @@ Session::setup_midi_control ()
 }
 
 void
-Session::spp_start (Parser &, nframes_t /*timestamp*/)
+Session::spp_start (Parser &, framepos_t /*timestamp*/)
 {
        if (Config->get_mmc_control() && (!config.get_external_sync() || config.get_sync_source() != JACK)) {
                request_transport_speed (1.0);
@@ -98,13 +98,13 @@ Session::spp_start (Parser &, nframes_t /*timestamp*/)
 }
 
 void
-Session::spp_continue (Parser& ignored, nframes_t timestamp)
+Session::spp_continue (Parser& ignored, framepos_t timestamp)
 {
        spp_start (ignored, timestamp);
 }
 
 void
-Session::spp_stop (Parser&, nframes_t /*timestamp*/)
+Session::spp_stop (Parser&, framepos_t /*timestamp*/)
 {
        if (Config->get_mmc_control()) {
                request_stop ();
@@ -373,7 +373,7 @@ Session::send_full_time_code (framepos_t const t)
        if (((mtc_timecode_bits >> 5) != MIDI::MTC_25_FPS) && (transmitting_timecode_time.frames % 2)) {
                // start MTC quarter frame transmission on an even frame
                Timecode::increment (transmitting_timecode_time, config.get_subframes_per_frame());
-               outbound_mtc_timecode_frame += (nframes_t) _frames_per_timecode_frame;
+               outbound_mtc_timecode_frame += _frames_per_timecode_frame;
        }
 
        // Compensate for audio latency
@@ -410,7 +410,7 @@ Session::send_full_time_code (framepos_t const t)
  * earlier already this cycle by send_full_time_code)
  */
 int
-Session::send_midi_time_code_for_cycle(nframes_t nframes)
+Session::send_midi_time_code_for_cycle (pframes_t nframes)
 {
        if (_slave || !session_send_mtc || transmitting_timecode_time.negative || (next_quarter_frame_to_send < 0)) {
                // cerr << "(MTC) Not sending MTC\n";
@@ -421,7 +421,7 @@ Session::send_midi_time_code_for_cycle(nframes_t nframes)
        assert (next_quarter_frame_to_send <= 7);
 
        /* Duration of one quarter frame */
-       nframes_t quarter_frame_duration = ((nframes_t) _frames_per_timecode_frame) >> 2;
+       framecnt_t quarter_frame_duration = ((framecnt_t) _frames_per_timecode_frame) >> 2;
 
        DEBUG_TRACE (DEBUG::MTC, string_compose ("TF %1 SF %2 NQ %3 FD %4\n",  _transport_frame, outbound_mtc_timecode_frame,
                                                 next_quarter_frame_to_send, quarter_frame_duration));
@@ -463,14 +463,14 @@ Session::send_midi_time_code_for_cycle(nframes_t nframes)
                                break;
                }
 
-               const nframes_t msg_time = (outbound_mtc_timecode_frame
+               const framepos_t msg_time = (outbound_mtc_timecode_frame
                        + (quarter_frame_duration * next_quarter_frame_to_send));
 
                // This message must fall within this block or something is broken
                assert(msg_time >= _transport_frame);
                assert(msg_time < _transport_frame + nframes);
 
-               nframes_t out_stamp = msg_time - _transport_frame;
+               framepos_t out_stamp = msg_time - _transport_frame;
                assert(out_stamp < nframes);
 
                if (MIDI::Manager::instance()->mtc_output_port()->midimsg (mtc_msg, 2, out_stamp)) {
index 7f88642b12667b5c95b01fe25d588497b43fe942..fe851098692c5169f25dc16c16e7331465bf07f6 100644 (file)
@@ -52,7 +52,7 @@ using namespace std;
  * @param nframes Number of frames to process.
  */
 void
-Session::process (nframes_t nframes)
+Session::process (pframes_t nframes)
 {
        MIDI::Manager::instance()->cycle_start(nframes);
 
@@ -76,8 +76,8 @@ Session::process (nframes_t nframes)
         _engine.main_thread()->drop_buffers ();
 
        // the ticker is for sending time information like MidiClock
-       nframes_t transport_frames = transport_frame();
-       BBT_Time  transport_bbt;
+       framepos_t transport_frames = transport_frame();
+       BBT_Time transport_bbt;
        bbt_time(transport_frames, transport_bbt);
        Timecode::Time transport_timecode;
        timecode_time(transport_frames, transport_timecode);
@@ -89,15 +89,15 @@ Session::process (nframes_t nframes)
 }
 
 int
-Session::fail_roll (nframes_t nframes)
+Session::fail_roll (pframes_t nframes)
 {
        return no_roll (nframes);
 }
 
 int
-Session::no_roll (nframes_t nframes)
+Session::no_roll (pframes_t nframes)
 {
-       nframes_t end_frame = _transport_frame + nframes; // FIXME: varispeed + no_roll ??
+       framepos_t end_frame = _transport_frame + nframes; // FIXME: varispeed + no_roll ??
        int ret = 0;
        bool declick = get_transport_declick_required();
        boost::shared_ptr<RouteList> r = routes.reader ();
@@ -130,7 +130,7 @@ Session::no_roll (nframes_t nframes)
 }
 
 int
-Session::process_routes (nframes_t nframes, bool& need_butler)
+Session::process_routes (pframes_t nframes, bool& need_butler)
 {
        bool record_active;
        int  declick = get_transport_declick_required();
@@ -144,8 +144,8 @@ Session::process_routes (nframes_t nframes, bool& need_butler)
 
        record_active = actively_recording(); // || (get_record_enabled() && get_punch_in());
 
-       const nframes_t start_frame = _transport_frame;
-       const nframes_t end_frame = _transport_frame + (nframes_t)floor(nframes * _transport_speed);
+       const framepos_t start_frame = _transport_frame;
+       const framepos_t end_frame = _transport_frame + floor (nframes * _transport_speed);
 
        DEBUG_TRACE(DEBUG::Graph,"calling graph/process-routes\n");
        route_graph->process_routes( nframes, start_frame, end_frame, declick, record_active, rec_monitors, need_butler);
@@ -170,7 +170,7 @@ Session::process_routes (nframes_t nframes, bool& need_butler)
 }
 
 int
-Session::silent_process_routes (nframes_t nframes, bool& need_butler)
+Session::silent_process_routes (pframes_t nframes, bool& need_butler)
 {
        bool record_active = actively_recording();
        int  declick = get_transport_declick_required();
@@ -182,8 +182,8 @@ Session::silent_process_routes (nframes_t nframes, bool& need_butler)
                declick = -1;
        }
 
-       const nframes_t start_frame = _transport_frame;
-       const nframes_t end_frame = _transport_frame + lrintf(nframes * _transport_speed);
+       const framepos_t start_frame = _transport_frame;
+       const framepos_t end_frame = _transport_frame + lrintf(nframes * _transport_speed);
 
        route_graph->silent_process_routes( nframes, start_frame, end_frame, record_active, rec_monitors, need_butler);
 /*
@@ -233,10 +233,10 @@ Session::get_track_statistics ()
 
 /** Process callback used when the auditioner is not active */
 void
-Session::process_with_events (nframes_t nframes)
+Session::process_with_events (pframes_t nframes)
 {
        SessionEvent*  ev;
-       nframes_t      this_nframes;
+       pframes_t      this_nframes;
        framepos_t     end_frame;
        bool           session_needs_butler = false;
        framepos_t     stop_limit;
@@ -291,7 +291,7 @@ Session::process_with_events (nframes_t nframes)
                frames_moved = (framecnt_t) interpolation.interpolate (0, nframes, 0, 0);
        }
 
-       end_frame = _transport_frame + (nframes_t)frames_moved;
+       end_frame = _transport_frame + frames_moved;
 
        {
                SessionEvent* this_event;
@@ -350,7 +350,7 @@ Session::process_with_events (nframes_t nframes)
                        if (this_event && this_event->action_frame <= end_frame && this_event->action_frame >= _transport_frame) {
                                /* this isn't quite right for reverse play */
                                frames_moved = (framecnt_t) (this_event->action_frame - _transport_frame);
-                               this_nframes = (nframes_t) abs( floor(frames_moved / _transport_speed) );
+                               this_nframes = abs (floor(frames_moved / _transport_speed));
                        }
 
                        if (this_nframes) {
@@ -399,7 +399,7 @@ Session::process_with_events (nframes_t nframes)
                        }
 
                        /* this is necessary to handle the case of seamless looping */
-                       end_frame = _transport_frame + (nframes_t) floor (nframes * _transport_speed);
+                       end_frame = _transport_frame + floor (nframes * _transport_speed);
 
                }
 
@@ -434,11 +434,11 @@ Session::transport_locked () const
 }
 
 bool
-Session::follow_slave (nframes_t nframes)
+Session::follow_slave (pframes_t nframes)
 {
        double slave_speed;
        framepos_t slave_transport_frame;
-       nframes_t this_delta;
+       framecnt_t this_delta;
        int dir;
 
        if (!_slave->ok()) {
@@ -538,7 +538,7 @@ Session::follow_slave (nframes_t nframes)
                        }
                        
 #if 1
-                       if ((nframes_t) abs(average_slave_delta) > _slave->resolution()) {
+                       if ((framecnt_t) abs(average_slave_delta) > _slave->resolution()) {
                                cerr << "average slave delta greater than slave resolution (" << _slave->resolution() << "), going to silent motion\n";
                                goto silent_motion;
                        }
@@ -564,7 +564,7 @@ Session::follow_slave (nframes_t nframes)
 }
 
 void
-Session::calculate_moving_average_of_slave_delta(int dir, nframes_t this_delta)
+Session::calculate_moving_average_of_slave_delta (int dir, framecnt_t this_delta)
 {
        if (delta_accumulator_cnt >= delta_accumulator_size) {
                have_first_delta_accumulator = true;
@@ -572,7 +572,7 @@ Session::calculate_moving_average_of_slave_delta(int dir, nframes_t this_delta)
        }
 
        if (delta_accumulator_cnt != 0 || this_delta < _current_frame_rate) {
-               delta_accumulator[delta_accumulator_cnt++] = (nframes_t) dir *  (nframes_t) this_delta;
+               delta_accumulator[delta_accumulator_cnt++] = (framecnt_t) dir *  (framecnt_t) this_delta;
        }
 
        if (have_first_delta_accumulator) {
@@ -591,7 +591,7 @@ Session::calculate_moving_average_of_slave_delta(int dir, nframes_t this_delta)
 }
 
 void
-Session::track_slave_state (float slave_speed, nframes_t slave_transport_frame, nframes_t this_delta)
+Session::track_slave_state (float slave_speed, framepos_t slave_transport_frame, framecnt_t this_delta)
 {
        if (slave_speed != 0.0f) {
 
@@ -644,7 +644,7 @@ Session::track_slave_state (float slave_speed, nframes_t slave_transport_frame,
 
 
                                bool ok = true;
-                               nframes_t frame_delta = slave_transport_frame - _transport_frame;
+                               framecnt_t frame_delta = slave_transport_frame - _transport_frame;
 
                                boost::shared_ptr<RouteList> rl = routes.reader();
                                for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
@@ -699,7 +699,7 @@ Session::track_slave_state (float slave_speed, nframes_t slave_transport_frame,
 }
 
 void
-Session::follow_slave_silently (nframes_t nframes, float slave_speed)
+Session::follow_slave_silently (pframes_t nframes, float slave_speed)
 {
        if (slave_speed && _transport_speed) {
 
@@ -742,7 +742,7 @@ Session::follow_slave_silently (nframes_t nframes, float slave_speed)
 }
 
 void
-Session::process_without_events (nframes_t nframes)
+Session::process_without_events (pframes_t nframes)
 {
        bool session_needs_butler = false;
        framepos_t stop_limit;
@@ -822,7 +822,7 @@ Session::process_without_events (nframes_t nframes)
  * @param nframes number of frames to process.
  */
 void
-Session::process_audition (nframes_t nframes)
+Session::process_audition (pframes_t nframes)
 {
        SessionEvent* ev;
        boost::shared_ptr<RouteList> r = routes.reader ();
@@ -869,9 +869,9 @@ Session::process_audition (nframes_t nframes)
 }
 
 bool
-Session::maybe_sync_start (nframes_t& nframes)
+Session::maybe_sync_start (pframes_t & nframes)
 {
-       nframes_t sync_offset;
+       pframes_t sync_offset;
 
        if (!waiting_for_sync_offset) {
                return false;
index dea341bf15b31f4f86af2d276b155028658333ba..b67de14d07f629426468f357d3cfa6c1b7e2c700 100644 (file)
@@ -225,7 +225,7 @@ Session::first_stage_init (string fullpath, string snapshot_name)
 
        /* default short fade = 15ms */
 
-       Crossfade::set_short_xfade_length ((nframes_t) floor (config.get_short_xfade_seconds() * frame_rate()));
+       Crossfade::set_short_xfade_length ((framecnt_t) floor (config.get_short_xfade_seconds() * frame_rate()));
        SndFileSource::setup_standard_crossfades (*this, frame_rate());
 
        last_mmc_step.tv_sec = 0;
@@ -1017,7 +1017,7 @@ Session::state(bool full_state)
        if (full_state) {
 
                node->add_property ("name", _name);
-               snprintf (buf, sizeof (buf), "%" PRId32, _nominal_frame_rate);
+               snprintf (buf, sizeof (buf), "%" PRId64, _nominal_frame_rate);
                node->add_property ("sample-rate", buf);
 
                if (session_dirs.size() > 1) {
index e33fe3a9fba1e736eedbb5aeca3535178e75cbfe..b5137e0d6ac14bb345f72805ff5b7874594e27c9 100644 (file)
@@ -47,7 +47,7 @@ using namespace PBD;
 /* BBT TIME*/
 
 void
-Session::bbt_time (nframes_t when, BBT_Time& bbt)
+Session::bbt_time (framepos_t when, BBT_Time& bbt)
 {
        _tempo_map->bbt_time (when, bbt);
 }
@@ -155,14 +155,14 @@ Session::timecode_drop_frames() const
 void
 Session::sync_time_vars ()
 {
-       _current_frame_rate = (nframes_t) round (_base_frame_rate * (1.0 + (config.get_video_pullup()/100.0)));
+       _current_frame_rate = (framecnt_t) round (_base_frame_rate * (1.0 + (config.get_video_pullup()/100.0)));
        _frames_per_timecode_frame = (double) _current_frame_rate / (double) timecode_frames_per_second();
        if (timecode_drop_frames()) {
          _frames_per_hour = (int32_t)(107892 * _frames_per_timecode_frame);
        } else {
          _frames_per_hour = (int32_t)(3600 * rint(timecode_frames_per_second()) * _frames_per_timecode_frame);
        }
-       _timecode_frames_per_hour = (nframes_t)rint(timecode_frames_per_second() * 3600.0);
+       _timecode_frames_per_hour = rint(timecode_frames_per_second() * 3600.0);
 
        last_timecode_valid = false;
        // timecode type bits are the middle two in the upper nibble
@@ -231,13 +231,13 @@ Session::timecode_to_sample( Timecode::Time& timecode, framepos_t& sample, bool
                //  Per Sigmond <per@sigmond.no>
 
                // Samples inside time dividable by 10 minutes (real time accurate)
-               nframes_t base_samples = (nframes_t) (((timecode.hours * 107892) + ((timecode.minutes / 10) * 17982)) * _frames_per_timecode_frame);
+               framecnt_t base_samples = (framecnt_t) (((timecode.hours * 107892) + ((timecode.minutes / 10) * 17982)) * _frames_per_timecode_frame);
 
                // Samples inside time exceeding the nearest 10 minutes (always offset, see above)
                int32_t exceeding_df_minutes = timecode.minutes % 10;
                int32_t exceeding_df_seconds = (exceeding_df_minutes * 60) + timecode.seconds;
                int32_t exceeding_df_frames = (30 * exceeding_df_seconds) + timecode.frames - (2 * exceeding_df_minutes);
-               nframes_t exceeding_samples = (nframes_t) rint(exceeding_df_frames * _frames_per_timecode_frame);
+               framecnt_t exceeding_samples = (framecnt_t) rint(exceeding_df_frames * _frames_per_timecode_frame);
                sample = base_samples + exceeding_samples;
        } else {
                /*
@@ -247,7 +247,7 @@ Session::timecode_to_sample( Timecode::Time& timecode, framepos_t& sample, bool
                   frame_rate() in the non-integer Timecode rate case.
                */
 
-               sample = (nframes_t)rint((((timecode.hours * 60 * 60) + (timecode.minutes * 60) + timecode.seconds) * (rint(timecode.rate) * _frames_per_timecode_frame)) + (timecode.frames * _frames_per_timecode_frame));
+               sample = (framecnt_t)rint((((timecode.hours * 60 * 60) + (timecode.minutes * 60) + timecode.seconds) * (rint(timecode.rate) * _frames_per_timecode_frame)) + (timecode.frames * _frames_per_timecode_frame));
        }
 
        if (use_subframes) {
@@ -376,7 +376,7 @@ Session::sample_to_timecode (framepos_t sample, Timecode::Time& timecode, bool u
 }
 
 void
-Session::timecode_time (nframes_t when, Timecode::Time& timecode)
+Session::timecode_time (framepos_t when, Timecode::Time& timecode)
 {
        if (last_timecode_valid && when == last_timecode_when) {
                timecode = last_timecode;
@@ -391,7 +391,7 @@ Session::timecode_time (nframes_t when, Timecode::Time& timecode)
 }
 
 void
-Session::timecode_time_subframes (nframes_t when, Timecode::Time& timecode)
+Session::timecode_time_subframes (framepos_t when, Timecode::Time& timecode)
 {
        if (last_timecode_valid && when == last_timecode_when) {
                timecode = last_timecode;
@@ -469,7 +469,7 @@ Session::jack_sync_callback (jack_transport_state_t state,
 
 void
 Session::jack_timebase_callback (jack_transport_state_t /*state*/,
-                                nframes_t /*nframes*/,
+                                pframes_t /*nframes*/,
                                 jack_position_t* pos,
                                 int /*new_position*/)
 {
@@ -546,14 +546,14 @@ Session::jack_timebase_callback (jack_transport_state_t /*state*/,
 #endif
 }
 
-ARDOUR::nframes_t
-Session::convert_to_frames_at (nframes_t /*position*/, AnyTime const & any)
+ARDOUR::framecnt_t
+Session::convert_to_frames_at (framepos_t /*position*/, AnyTime const & any)
 {
        double secs;
 
        switch (any.type) {
        case AnyTime::BBT:
-               return _tempo_map->frame_time ( any.bbt);
+               return _tempo_map->frame_time (any.bbt);
                break;
 
        case AnyTime::Timecode:
@@ -563,14 +563,14 @@ Session::convert_to_frames_at (nframes_t /*position*/, AnyTime const & any)
                secs += any.timecode.seconds;
                secs += any.timecode.frames / timecode_frames_per_second();
                if (config.get_timecode_offset_negative()) {
-                       return (nframes_t) floor (secs * frame_rate()) - config.get_timecode_offset();
+                       return (framecnt_t) floor (secs * frame_rate()) - config.get_timecode_offset();
                } else {
-                       return (nframes_t) floor (secs * frame_rate()) + config.get_timecode_offset();
+                       return (framecnt_t) floor (secs * frame_rate()) + config.get_timecode_offset();
                }
                break;
 
        case AnyTime::Seconds:
-               return (nframes_t) floor (any.seconds * frame_rate());
+               return (framecnt_t) floor (any.seconds * frame_rate());
                break;
 
        case AnyTime::Frames:
index 3c500656846ac6fb806cca3bca2088830b765a75..bb20fe97ac1ab6bc462beb74c0c2bb221488c0bc 100644 (file)
@@ -751,7 +751,7 @@ Session::start_locate (framepos_t target_frame, bool with_roll, bool with_flush,
 }
 
 int
-Session::micro_locate (nframes_t distance)
+Session::micro_locate (framecnt_t distance)
 {
        boost::shared_ptr<RouteList> rl = routes.reader();
        for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
@@ -1182,7 +1182,7 @@ Session::post_transport ()
 }
 
 void
-Session::reset_rf_scale (nframes_t motion)
+Session::reset_rf_scale (framecnt_t motion)
 {
        cumulative_rf_motion += motion;
 
@@ -1359,7 +1359,7 @@ Session::set_play_range (list<AudioRange>& range, bool leave_rolling)
                        /* locating/stopping is subject to delays for declicking.
                         */
                        
-                       nframes_t requested_frame = (*i).end;
+                       framepos_t requested_frame = i->end;
                        
                        if (requested_frame > current_block_size) {
                                requested_frame -= current_block_size;
@@ -1490,8 +1490,8 @@ Session::update_latency_compensation (bool with_stop, bool abort)
                        (*i)->handle_transport_stopped (abort, (ptw & PostTransportLocate), (!(ptw & PostTransportLocate) || pending_locate_flush));
                }
 
-               nframes_t old_latency = (*i)->output()->signal_latency ();
-               nframes_t track_latency = (*i)->update_total_latency ();
+               framecnt_t old_latency = (*i)->output()->signal_latency ();
+               framecnt_t track_latency = (*i)->update_total_latency ();
 
                if (old_latency != track_latency) {
                        (*i)->input()->update_port_total_latencies ();
@@ -1547,7 +1547,7 @@ Session::reset_jack_connection (jack_client_t* jack)
 }
 
 bool
-Session::maybe_stop (nframes_t limit)
+Session::maybe_stop (framepos_t limit)
 {
        if ((_transport_speed > 0.0f && _transport_frame >= limit) || (_transport_speed < 0.0f && _transport_frame == 0)) {
                if (synced_to_jack () && config.get_jack_time_master ()) {
index ce03f0b17ead819ac6f5a3961b89f91e835f1598..1cbcba8ee6b42d332a5269d47462c1d22ebfdae0 100644 (file)
@@ -29,7 +29,7 @@ SlaveSessionProxy::tempo_map() const
        return session.tempo_map();
 }
 
-nframes_t
+framecnt_t
 SlaveSessionProxy::frame_rate() const
 {
        return session.frame_rate();
@@ -47,7 +47,7 @@ SlaveSessionProxy::transport_frame() const
        return session.transport_frame();
 }
 
-nframes_t
+pframes_t
 SlaveSessionProxy::frames_since_cycle_start() const
 {
        return session.engine().frames_since_cycle_start();
index 7a664b30d6ed3c86bc5da2711a62821e28b4ba9e..4e939a3762c62cea1a6e9174f98bafcffcb3cb03 100644 (file)
@@ -106,9 +106,9 @@ SMFSource::~SMFSource ()
 }
 
 /** All stamps in audio frames */
-nframes_t
-SMFSource::read_unlocked (Evoral::EventSink<nframes_t>& destination, framepos_t const source_start,
-                         framepos_t start, nframes_t duration,
+framecnt_t
+SMFSource::read_unlocked (Evoral::EventSink<framepos_t>& destination, framepos_t const source_start,
+                         framepos_t start, framecnt_t duration,
                          MidiStateTracker* tracker) const
 {
        int      ret  = 0;
@@ -207,12 +207,12 @@ SMFSource::read_unlocked (Evoral::EventSink<nframes_t>& destination, framepos_t
  *  @param source Buffer to read from.
  *  @param position This source's start position in session frames.
  */
-nframes_t
-SMFSource::write_unlocked (MidiRingBuffer<nframes_t>& source, framepos_t position, nframes_t duration)
+framecnt_t
+SMFSource::write_unlocked (MidiRingBuffer<framepos_t>& source, framepos_t position, framecnt_t duration)
 {
        _write_data_count = 0;
 
-       nframes_t         time;
+       framepos_t        time;
        Evoral::EventType type;
        uint32_t          size;
 
@@ -223,7 +223,7 @@ SMFSource::write_unlocked (MidiRingBuffer<nframes_t>& source, framepos_t positio
                _model->start_write();
        }
 
-       Evoral::MIDIEvent<nframes_t> ev;
+       Evoral::MIDIEvent<framepos_t> ev;
 
        while (true) {
                bool ret = source.peek_time(&time);
@@ -315,9 +315,9 @@ SMFSource::append_event_unlocked_beats (const Evoral::Event<double>& ev)
 
 }
 
-/** Append an event with a timestamp in frames (nframes_t) */
+/** Append an event with a timestamp in frames (framepos_t) */
 void
-SMFSource::append_event_unlocked_frames (const Evoral::Event<nframes_t>& ev, framepos_t position)
+SMFSource::append_event_unlocked_frames (const Evoral::Event<framepos_t>& ev, framepos_t position)
 {
        assert(_writing);
        if (ev.size() == 0)  {
index b51ad3634a974aa4b4fcaa2976c690c0a30b2749..75bfb9da57cd11f24cac3cf529e7a563471df9e7 100644 (file)
@@ -43,10 +43,10 @@ SndFileImportableSource::~SndFileImportableSource ()
 {
 }
 
-nframes_t
-SndFileImportableSource::read (Sample* buffer, nframes_t nframes)
+framecnt_t
+SndFileImportableSource::read (Sample* buffer, framecnt_t nframes)
 {
-       nframes_t per_channel = nframes / sf_info.channels;
+       framecnt_t per_channel = nframes / sf_info.channels;
        per_channel = sf_readf_float (in.get(), buffer, per_channel);
        return per_channel * sf_info.channels;
 }
@@ -63,14 +63,14 @@ SndFileImportableSource::length () const
        return (framecnt_t) sf_info.frames;
 }
 
-nframes_t
-SndFileImportableSource::samplerate() const
+framecnt_t
+SndFileImportableSource::samplerate () const
 {
        return sf_info.samplerate;
 }
 
 void
-SndFileImportableSource::seek (nframes_t /*pos*/)
+SndFileImportableSource::seek (framepos_t /*pos*/)
 {
        sf_seek (in.get(), 0, SEEK_SET);
 }
index 0afe50a3111f977836597910de66793c3c898598..fa2e761d8edd327171e054c4ecb0e9718f5ca47b 100644 (file)
@@ -83,7 +83,7 @@ SndFileSource::SndFileSource (Session& s, const string& path, int chn, Flag flag
 
 /** This constructor is used to construct new files, not open existing ones. */
 SndFileSource::SndFileSource (Session& s, const string& path, const string& origin,
-                              SampleFormat sfmt, HeaderFormat hf, nframes_t rate, Flag flags)
+                              SampleFormat sfmt, HeaderFormat hf, framecnt_t rate, Flag flags)
        : Source(s, DataType::AUDIO, path, flags)
        , AudioFileSource (s, path, origin, flags, sfmt, hf)
 {
@@ -321,7 +321,7 @@ SndFileSource::read_unlocked (Sample *dst, framepos_t start, framecnt_t cnt) con
                }
 
                if (_info.channels == 1) {
-                       nframes_t ret = sf_read_float (sf, dst, file_cnt);
+                       framecnt_t ret = sf_read_float (sf, dst, file_cnt);
                        _read_data_count = ret * sizeof(float);
                        if (ret != file_cnt) {
                                char errbuf[256];
@@ -420,8 +420,8 @@ SndFileSource::destructive_write_unlocked (Sample* data, framecnt_t cnt)
                file_pos = capture_start_frame - _timeline_position;
 
                // split cnt in half
-               nframes_t subcnt = cnt / 2;
-               nframes_t ofilepos = file_pos;
+               framecnt_t subcnt = cnt / 2;
+               framecnt_t ofilepos = file_pos;
 
                // fade in
                if (crossfade (data, subcnt, 1) != subcnt) {
@@ -804,7 +804,7 @@ SndFileSource::handle_header_position_change ()
 }
 
 void
-SndFileSource::setup_standard_crossfades (Session const & s, nframes_t rate)
+SndFileSource::setup_standard_crossfades (Session const & s, framecnt_t rate)
 {
        /* This static method is assumed to have been called by the Session
           before any DFS's are created.
index c9f7386c008e073b66565a7d743bb3c93fd5dac6..f886f952bdb676ca23fe4650d47115291ddfec3f 100644 (file)
@@ -257,7 +257,7 @@ SourceFactory::createReadable (DataType type, Session& s, const string& path,
 
 boost::shared_ptr<Source>
 SourceFactory::createWritable (DataType type, Session& s, const std::string& path, const std::string& origin,
-                              bool destructive, nframes_t rate, bool announce, bool defer_peaks)
+                              bool destructive, framecnt_t rate, bool announce, bool defer_peaks)
 {
        /* this might throw failed_constructor(), which is OK */
 
index b3e3342cb8951dc5da6bc49cef479178ef034bc0..48212ea8e1b839363cc08e45e2ce2e86222cf72b 100644 (file)
@@ -22,7 +22,7 @@
 #include "ardour/types.h"
 
 void
-x86_sse_find_peaks(const ARDOUR::Sample* buf, ARDOUR::nframes_t nframes, float *min, float *max)
+x86_sse_find_peaks(const ARDOUR::Sample* buf, ARDOUR::pframes_t nframes, float *min, float *max)
 {
        __m128 current_max, current_min, work;
 
index 748c854daf26c9180b13f398b8da4014747bd96e..3660ff34d385431923e5932b8f472958242b63ab 100644 (file)
@@ -67,10 +67,10 @@ int
 STStretch::run (boost::shared_ptr<Region> a_region)
 {
        SourceList nsrcs;
-       nframes_t total_frames;
-       nframes_t done;
+       framecnt_t total_frames;
+       framecnt_t done;
        int ret = -1;
-       const nframes_t bufsize = 16384;
+       const framecnt_t bufsize = 16384;
        gain_t *gain_buffer = 0;
        Sample *buffer = 0;
        char suffix[32];
@@ -108,13 +108,13 @@ STStretch::run (boost::shared_ptr<Region> a_region)
                        boost::shared_ptr<AudioSource> asrc
                                = boost::dynamic_pointer_cast<AudioSource>(nsrcs[i]);
 
-                       nframes_t pos = 0;
-                       nframes_t this_read = 0;
+                       framepos_t pos = 0;
+                       framecnt_t this_read = 0;
 
                        st.clear();
 
                        while (!tsr.cancel && pos < region->length()) {
-                               nframes_t this_time;
+                               framecnt_t this_time;
 
                                this_time = min (bufsize, region->length() - pos);
 
@@ -179,16 +179,16 @@ STStretch::run (boost::shared_ptr<Region> a_region)
        for (vector<boost::shared_ptr<Region> >::iterator x = results.begin(); x != results.end(); ++x) {
                framepos_t astart = (*x)->ancestral_start();
                framepos_t alength = (*x)->ancestral_length();
-               nframes_t start;
-               nframes_t length;
+               framepos_t start;
+               framecnt_t length;
 
                // note: tsr.fraction is a percentage of original length. 100 = no change,
                // 50 is half as long, 200 is twice as long, etc.
 
                float stretch = (*x)->stretch() * (tsr.time_fraction/100.0);
 
-               start = (nframes_t) floor (astart + ((astart - (*x)->start()) / stretch));
-               length = (nframes_t) floor (alength / stretch);
+               start = (framepos_t) floor (astart + ((astart - (*x)->start()) / stretch));
+               length = (framecnt_t) floor (alength / stretch);
 
                (*x)->set_ancestral_data (start, length, stretch, (*x)->shift());
        }
index a7308b06abf3f3d09e7de8d3f8b8b16a6fd03b9a..cf03c2df8ba95b8e54bd473d851209f7f4419845 100644 (file)
@@ -35,7 +35,7 @@ using namespace ARDOUR;
  *  @param fade_length Length of fade in/out to apply to trimmed regions, in samples.
  */
 
-StripSilence::StripSilence (Session & s, double threshold, nframes_t minimum_length, nframes_t fade_length)
+StripSilence::StripSilence (Session & s, double threshold, framecnt_t minimum_length, framecnt_t fade_length)
        : Filter (s), _threshold (threshold), _minimum_length (minimum_length), _fade_length (fade_length)
 {
 
index 67c3419b1b6a9f88724f3ccd68f5ab2ff677b6c5..8afdfb140bb92748834805c38d16a6512d3055c4 100644 (file)
@@ -45,7 +45,7 @@ Tempo    TempoMap::_default_tempo (120.0);
 
 const double Meter::ticks_per_beat = 1920.0;
 
-double Tempo::frames_per_beat (nframes_t sr, const Meter& meter) const
+double Tempo::frames_per_beat (framecnt_t sr, const Meter& meter) const
 {
        return  ((60.0 * sr) / (_beats_per_minute * meter.note_divisor()/_note_type));
 }
@@ -53,7 +53,7 @@ double Tempo::frames_per_beat (nframes_t sr, const Meter& meter) const
 /***********************************************************************/
 
 double
-Meter::frames_per_bar (const Tempo& tempo, nframes_t sr) const
+Meter::frames_per_bar (const Tempo& tempo, framecnt_t sr) const
 {
        return ((60.0 * sr * _beats_per_bar) / (tempo.beats_per_minute() * _note_type/tempo.note_type()));
 }
@@ -218,7 +218,7 @@ struct MetricSectionSorter {
     }
 };
 
-TempoMap::TempoMap (nframes_t fr)
+TempoMap::TempoMap (framecnt_t fr)
 {
        metrics = new Metrics;
        _frame_rate = fr;
index ef47417c6ea6ddeca5ce78d5bf4f3810fa38ecc5..0bbb697b85f68ac7b6324190eaa4e83651b5abd6 100644 (file)
@@ -9,7 +9,7 @@ using namespace ARDOUR;
 void
 InterpolationTest::linearInterpolationTest ()
 {
-       nframes_t result = 0;
+       framecnt_t result = 0;
 //     cout << "\nLinear Interpolation Test\n";
 
 //     cout << "\nSpeed: 1/3";
@@ -25,7 +25,7 @@ InterpolationTest::linearInterpolationTest ()
        linear.set_speed (1.0);
        linear.set_target_speed (linear.speed());
        result = linear.interpolate (0, NUM_SAMPLES, input, output);
-       CPPUNIT_ASSERT_EQUAL ((uint32_t)(NUM_SAMPLES * linear.speed()), result);
+       CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES * linear.speed()), result);
        for (int i = 0; i < NUM_SAMPLES; i += INTERVAL) {
                CPPUNIT_ASSERT_EQUAL (1.0f, output[i]);
        }
@@ -35,7 +35,7 @@ InterpolationTest::linearInterpolationTest ()
        linear.set_speed (0.5);
        linear.set_target_speed (linear.speed());
        result = linear.interpolate (0, NUM_SAMPLES, input, output);
-       CPPUNIT_ASSERT_EQUAL ((uint32_t)(NUM_SAMPLES * linear.speed()), result);
+       CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES * linear.speed()), result);
        for (int i = 0; i < NUM_SAMPLES; i += (INTERVAL / linear.speed() +0.5)) {
                CPPUNIT_ASSERT_EQUAL (1.0f, output[i]);
        }
@@ -45,14 +45,14 @@ InterpolationTest::linearInterpolationTest ()
        linear.set_speed (0.2);
        linear.set_target_speed (linear.speed());
        result = linear.interpolate (0, NUM_SAMPLES, input, output);
-       CPPUNIT_ASSERT_EQUAL ((uint32_t)(NUM_SAMPLES * linear.speed()), result);
+       CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES * linear.speed()), result);
 
 //     cout << "\nSpeed: 0.02";
        linear.reset();
        linear.set_speed (0.02);
        linear.set_target_speed (linear.speed());
        result = linear.interpolate (0, NUM_SAMPLES, input, output);
-       CPPUNIT_ASSERT_EQUAL ((uint32_t)(NUM_SAMPLES * linear.speed()), result);
+       CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES * linear.speed()), result);
 
        /* This one fails due too error accumulation
           cout << "\nSpeed: 0.002";
@@ -61,7 +61,7 @@ InterpolationTest::linearInterpolationTest ()
           linear.set_target_speed (linear.speed());
           result = linear.interpolate (0, NUM_SAMPLES, input, output);
           linear.speed();
-          CPPUNIT_ASSERT_EQUAL ((nframes_t)(NUM_SAMPLES * linear.speed()), result);
+          CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES * linear.speed()), result);
           */
 
 //     cout << "\nSpeed: 2.0";
@@ -69,7 +69,7 @@ InterpolationTest::linearInterpolationTest ()
        linear.set_speed (2.0);
        linear.set_target_speed (linear.speed());
        result = linear.interpolate (0, NUM_SAMPLES / 2, input, output);
-       CPPUNIT_ASSERT_EQUAL ((uint32_t)(NUM_SAMPLES / 2 * linear.speed()), result);
+       CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES / 2 * linear.speed()), result);
        for (int i = 0; i < NUM_SAMPLES / 2; i += (INTERVAL / linear.speed() +0.5)) {
                CPPUNIT_ASSERT_EQUAL (1.0f, output[i]);
        }
@@ -78,7 +78,7 @@ InterpolationTest::linearInterpolationTest ()
        linear.set_speed (10.0);
        linear.set_target_speed (linear.speed());
        result = linear.interpolate (0, NUM_SAMPLES / 10, input, output);
-       CPPUNIT_ASSERT_EQUAL ((uint32_t)(NUM_SAMPLES / 10 * linear.speed()), result);
+       CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES / 10 * linear.speed()), result);
        for (int i = 0; i < NUM_SAMPLES / 10; i += (INTERVAL / linear.speed() +0.5)) {
                CPPUNIT_ASSERT_EQUAL (1.0f, output[i]);
        }
@@ -92,7 +92,7 @@ InterpolationTest::linearInterpolationTest ()
 void
 InterpolationTest::cubicInterpolationTest ()
 {
-       nframes_t result = 0;
+       framecnt_t result = 0;
 //     cout << "\nCubic Interpolation Test\n";
 
 //     cout << "\nSpeed: 1/3";
@@ -108,7 +108,7 @@ InterpolationTest::cubicInterpolationTest ()
        cubic.set_speed (1.0);
        cubic.set_target_speed (cubic.speed());
        result = cubic.interpolate (0, NUM_SAMPLES, input, output);
-       CPPUNIT_ASSERT_EQUAL ((uint32_t)(NUM_SAMPLES * cubic.speed()), result);
+       CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES * cubic.speed()), result);
        for (int i = 0; i < NUM_SAMPLES; i += INTERVAL) {
                CPPUNIT_ASSERT_EQUAL (1.0f, output[i]);
        }
@@ -118,7 +118,7 @@ InterpolationTest::cubicInterpolationTest ()
        cubic.set_speed (0.5);
        cubic.set_target_speed (cubic.speed());
        result = cubic.interpolate (0, NUM_SAMPLES, input, output);
-       CPPUNIT_ASSERT_EQUAL ((uint32_t)(NUM_SAMPLES * cubic.speed()), result);
+       CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES * cubic.speed()), result);
        for (int i = 0; i < NUM_SAMPLES; i += (INTERVAL / cubic.speed() +0.5)) {
                CPPUNIT_ASSERT_EQUAL (1.0f, output[i]);
        }
@@ -128,14 +128,14 @@ InterpolationTest::cubicInterpolationTest ()
        cubic.set_speed (0.2);
        cubic.set_target_speed (cubic.speed());
        result = cubic.interpolate (0, NUM_SAMPLES, input, output);
-       CPPUNIT_ASSERT_EQUAL ((uint32_t)(NUM_SAMPLES * cubic.speed()), result);
+       CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES * cubic.speed()), result);
 
 //     cout << "\nSpeed: 0.02";
        cubic.reset();
        cubic.set_speed (0.02);
        cubic.set_target_speed (cubic.speed());
        result = cubic.interpolate (0, NUM_SAMPLES, input, output);
-       CPPUNIT_ASSERT_EQUAL ((uint32_t)(NUM_SAMPLES * cubic.speed()), result);
+       CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES * cubic.speed()), result);
 
        /* This one fails due too error accumulation
           cout << "\nSpeed: 0.002";
@@ -144,7 +144,7 @@ InterpolationTest::cubicInterpolationTest ()
           cubic.set_target_speed (cubic.speed());
           result = cubic.interpolate (0, NUM_SAMPLES, input, output);
           cubic.speed();
-          CPPUNIT_ASSERT_EQUAL ((nframes_t)(NUM_SAMPLES * cubic.speed()), result);
+          CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES * cubic.speed()), result);
           */
 
 //     cout << "\nSpeed: 2.0";
@@ -152,7 +152,7 @@ InterpolationTest::cubicInterpolationTest ()
        cubic.set_speed (2.0);
        cubic.set_target_speed (cubic.speed());
        result = cubic.interpolate (0, NUM_SAMPLES / 2, input, output);
-       CPPUNIT_ASSERT_EQUAL ((uint32_t)(NUM_SAMPLES / 2 * cubic.speed()), result);
+       CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES / 2 * cubic.speed()), result);
        for (int i = 0; i < NUM_SAMPLES / 2; i += (INTERVAL / cubic.speed() +0.5)) {
                CPPUNIT_ASSERT_EQUAL (1.0f, output[i]);
        }
@@ -161,7 +161,7 @@ InterpolationTest::cubicInterpolationTest ()
        cubic.set_speed (10.0);
        cubic.set_target_speed (cubic.speed());
        result = cubic.interpolate (0, NUM_SAMPLES / 10, input, output);
-       CPPUNIT_ASSERT_EQUAL ((uint32_t)(NUM_SAMPLES / 10 * cubic.speed()), result);
+       CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES / 10 * cubic.speed()), result);
        for (int i = 0; i < NUM_SAMPLES / 10; i += (INTERVAL / cubic.speed() +0.5)) {
                CPPUNIT_ASSERT_EQUAL (1.0f, output[i]);
        }
index 3b9278b872e406013363c13852a90acddb19e8ec..7bc73fdab4feb68a8df183ef44cbd2f0141b5172 100644 (file)
@@ -61,11 +61,11 @@ class TestSlaveSessionProxy : public ISlaveSessionProxy {
         }
 
         // Implementation
-       TempoMap&   tempo_map ()                const { return *_tempo_map; }
-       nframes_t   frame_rate ()               const { return FRAME_RATE; }
+       TempoMap&  tempo_map ()                const { return *_tempo_map; }
+       framecnt_t frame_rate ()               const { return FRAME_RATE; }
        framepos_t audible_frame ()            const { return _transport_frame; }
        framepos_t transport_frame ()          const { return _transport_frame; }
-       nframes_t  frames_since_cycle_start () const { return 0; }
+       pframes_t  frames_since_cycle_start () const { return 0; }
        framecnt_t frame_time ()               const { return _frame_time; }
 
        void request_locate (framepos_t frame, bool with_roll = false) { 
index e319acc32930403851b586aedc4494ebd3439998..2436b6d36549a969c4d52d0a29616764fe982808 100644 (file)
@@ -66,7 +66,7 @@ ThreadBuffers::ensure_buffers (ChanCount howmany)
 }
 
 void
-ThreadBuffers::allocate_pan_automation_buffers (nframes_t nframes, uint32_t howmany, bool force)
+ThreadBuffers::allocate_pan_automation_buffers (framecnt_t nframes, uint32_t howmany, bool force)
 {
        if (!force && howmany <= npan_buffers) {
                return;
index 98f0632c45c6ef71fa761c6b21f200f2d35cb3f5..d3499c13be899707830a40024de0987a873478ef 100644 (file)
@@ -72,8 +72,8 @@ void MidiClockTicker::transport_state_changed()
                return;
        }
 
-       float     speed    = _session->transport_speed();
-       nframes_t position = _session->transport_frame();
+       float      speed    = _session->transport_speed();
+       framepos_t position = _session->transport_frame();
 #ifdef DEBUG_MIDI_CLOCK
        cerr << "Transport state change, speed:" << speed << "position:" << position<< " play loop " << _session->get_play_loop() << endl;
 #endif
@@ -108,7 +108,7 @@ void MidiClockTicker::transport_state_changed()
        tick(position, *((ARDOUR::BBT_Time *) 0), *((Timecode::Time *)0));
 }
 
-void MidiClockTicker::position_changed(nframes_t position)
+void MidiClockTicker::position_changed (framepos_t position)
 {
 #ifdef DEBUG_MIDI_CLOCK
        cerr << "Position changed:" << position << endl;
@@ -131,18 +131,18 @@ void MidiClockTicker::transport_looped()
 
        // adjust _last_tick, so that the next MIDI clock message is sent
        // in due time (and the tick interval is still constant)
-       nframes_t elapsed_since_last_tick = loop_location->end() - _last_tick;
+       framecnt_t elapsed_since_last_tick = loop_location->end() - _last_tick;
        _last_tick = loop_location->start() - elapsed_since_last_tick;
 }
 
-void MidiClockTicker::tick(const nframes_t& transport_frames, const BBT_Time& /*transport_bbt*/, const Timecode::Time& /*transport_smpt*/)
+void MidiClockTicker::tick (const framepos_t& transport_frames, const BBT_Time& /*transport_bbt*/, const Timecode::Time& /*transport_smpt*/)
 {
        if (!Config->get_send_midi_clock() || _session == 0 || _session->transport_speed() != 1.0f || _midi_port == 0)
                return;
 
        while (true) {
                double next_tick = _last_tick + one_ppqn_in_frames(transport_frames);
-               nframes_t next_tick_offset = nframes_t(next_tick) - transport_frames;
+               framecnt_t next_tick_offset = framecnt_t(next_tick) - transport_frames;
 
 #ifdef DEBUG_MIDI_CLOCK
                cerr << "Transport:" << transport_frames
@@ -162,7 +162,7 @@ void MidiClockTicker::tick(const nframes_t& transport_frames, const BBT_Time& /*
        }
 }
 
-double MidiClockTicker::one_ppqn_in_frames(nframes_t transport_position)
+double MidiClockTicker::one_ppqn_in_frames (framepos_t transport_position)
 {
        const Tempo& current_tempo = _session->tempo_map().tempo_at(transport_position);
        const Meter& current_meter = _session->tempo_map().meter_at(transport_position);
@@ -176,7 +176,7 @@ double MidiClockTicker::one_ppqn_in_frames(nframes_t transport_position)
        return frames_per_quarter_note / double (_ppqn);
 }
 
-void MidiClockTicker::send_midi_clock_event(nframes_t offset)
+void MidiClockTicker::send_midi_clock_event (framecnt_t offset)
 {
        if (!_midi_port) {
                return;
@@ -190,7 +190,7 @@ void MidiClockTicker::send_midi_clock_event(nframes_t offset)
        _midi_port->write(_midi_clock_tick, 1, offset);
 }
 
-void MidiClockTicker::send_start_event(nframes_t offset)
+void MidiClockTicker::send_start_event (framecnt_t offset)
 {
        if (!_midi_port) {
                return;
@@ -200,7 +200,7 @@ void MidiClockTicker::send_start_event(nframes_t offset)
        _midi_port->write(_midi_clock_tick, 1, offset);
 }
 
-void MidiClockTicker::send_continue_event(nframes_t offset)
+void MidiClockTicker::send_continue_event (framecnt_t offset)
 {
        if (!_midi_port) {
                return;
@@ -210,7 +210,7 @@ void MidiClockTicker::send_continue_event(nframes_t offset)
        _midi_port->write(_midi_clock_tick, 1, offset);
 }
 
-void MidiClockTicker::send_stop_event(nframes_t offset)
+void MidiClockTicker::send_stop_event (framecnt_t offset)
 {
        if (!_midi_port) {
                return;
index f480638d131eeddfba23ddfafe4b4ef3a0ad1c44..6a39553cf7cb792cef12434d8659637ca738c408 100644 (file)
@@ -85,11 +85,11 @@ Track::toggle_monitor_input ()
        }
 }
 
-ARDOUR::nframes_t
+ARDOUR::framecnt_t
 Track::update_total_latency ()
 {
-       nframes_t old = _output->effective_latency();
-       nframes_t own_latency = _output->user_latency();
+       framecnt_t old = _output->effective_latency();
+       framecnt_t own_latency = _output->user_latency();
 
        for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
                if ((*i)->active ()) {
@@ -221,7 +221,7 @@ Track::set_name (const string& str)
 }
 
 void
-Track::set_latency_delay (nframes_t longest_session_latency)
+Track::set_latency_delay (framecnt_t longest_session_latency)
 {
        Route::set_latency_delay (longest_session_latency);
        _diskstream->set_roll_delay (_roll_delay);
@@ -236,7 +236,7 @@ Track::zero_diskstream_id_in_xml (XMLNode& node)
 }
 
 int
-Track::no_roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame,
+Track::no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
                bool session_state_changing, bool can_record, bool /*rec_monitors_input*/)
 {
        Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK);
@@ -336,7 +336,7 @@ Track::no_roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame,
 }
 
 int
-Track::silent_roll (nframes_t nframes, framepos_t /*start_frame*/, framepos_t /*end_frame*/,
+Track::silent_roll (pframes_t nframes, framepos_t /*start_frame*/, framepos_t /*end_frame*/,
                    bool can_record, bool rec_monitors_input, bool& need_butler)
 {
        Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK);
@@ -662,7 +662,7 @@ Track::diskstream_id () const
 }
 
 void
-Track::set_block_size (nframes_t n)
+Track::set_block_size (pframes_t n)
 {
        Route::set_block_size (n);
        _diskstream->set_block_size (n);
index 65732623931a0a0ebde0ec00870fb0ae44fecb6c..27abf9a0b39a8a655e9a65b8e9842598180bb66d 100644 (file)
@@ -49,13 +49,13 @@ TransientDetector::use_features (Plugin::FeatureSet& features, ostream* out)
 
        for (Plugin::FeatureList::const_iterator f = fl.begin(); f != fl.end(); ++f) {
 
-               if ((*f).hasTimestamp) {
+               if (f->hasTimestamp) {
 
                        if (out) {
                                (*out) << (*f).timestamp.toString() << endl;
                        }
 
-                       current_results->push_back (RealTime::realTime2Frame ((*f).timestamp, (nframes_t) floor(sample_rate)));
+                       current_results->push_back (RealTime::realTime2Frame (f->timestamp, (framecnt_t) floor(sample_rate)));
                }
        }
 
index 9698486e9061eb4862b853350da8b1c9d15c999b..64e06b6f12cac0bf1b3099eed7e8e64467cbbdd6 100644 (file)
@@ -341,7 +341,7 @@ CFStringRefToStdString(CFStringRef stringRef)
 #endif // __APPLE__
 
 void
-compute_equal_power_fades (nframes_t nframes, float* in, float* out)
+compute_equal_power_fades (framecnt_t nframes, float* in, float* out)
 {
        double step;
 
@@ -349,7 +349,7 @@ compute_equal_power_fades (nframes_t nframes, float* in, float* out)
 
        in[0] = 0.0f;
 
-       for (nframes_t i = 1; i < nframes - 1; ++i) {
+       for (framecnt_t i = 1; i < nframes - 1; ++i) {
                in[i] = in[i-1] + step;
        }
 
@@ -358,7 +358,7 @@ compute_equal_power_fades (nframes_t nframes, float* in, float* out)
        const float pan_law_attenuation = -3.0f;
        const float scale = 2.0f - 4.0f * powf (10.0f,pan_law_attenuation/20.0f);
 
-       for (nframes_t n = 0; n < nframes; ++n) {
+       for (framecnt_t n = 0; n < nframes; ++n) {
                float inVal = in[n];
                float outVal = 1 - inVal;
                out[n] = outVal * (scale * outVal + 1.0f - scale);
index 4e54327acfd840c0f79b9812bfc6dc6c81d79361..d727293b05ed4ac9337e53a7398e13ddc25adbd0 100644 (file)
@@ -141,7 +141,7 @@ VBAPanner::compute_gains (double gains[3], int speaker_ids[3], int azi, int ele)
 }
 
 void
-VBAPanner::do_distribute (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gain_coefficient, nframes_t nframes)
+VBAPanner::do_distribute (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gain_coefficient, pframes_t nframes)
 {
        if (_muted) {
                return;
@@ -179,7 +179,7 @@ VBAPanner::do_distribute (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gain_coe
        for (int o = 0; o < 3; ++o) {
                if (desired_outputs[o] != -1) {
 
-                       nframes_t n = 0;
+                       pframes_t n = 0;
 
                        /* XXX TODO: interpolate across changes in gain and/or outputs
                         */
@@ -209,7 +209,7 @@ VBAPanner::do_distribute (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gain_coe
 
 void 
 VBAPanner::do_distribute_automated (AudioBuffer& src, BufferSet& obufs,
-                                    nframes_t start, nframes_t end, nframes_t nframes, pan_t** buffers)
+                                    framepos_t start, framepos_t end, pframes_t nframes, pan_t** buffers)
 {
 }
 
index d805a2feec0fa9ff2b3c791d3cda9103e7ec24a4..ee7c165fb39397cffe43de632341885647d0c394 100644 (file)
@@ -107,7 +107,7 @@ VSTPlugin::~VSTPlugin ()
 }
 
 int 
-VSTPlugin::set_block_size (nframes_t nframes)
+VSTPlugin::set_block_size (pframes_t nframes)
 {
        deactivate ();
        _plugin->dispatcher (_plugin, effSetBlockSize, 0, nframes, NULL, 0.0f);
@@ -357,7 +357,7 @@ VSTPlugin::describe_parameter (Evoral::Parameter param)
        return name;
 }
 
-nframes_t
+framecnt_t
 VSTPlugin::signal_latency () const
 {
        if (_user_latency) {
@@ -365,7 +365,7 @@ VSTPlugin::signal_latency () const
        }
 
 #ifdef VESTIGE_HEADER
-        return *((nframes_t *) (((char *) &_plugin->flags) + 12)); /* initialDelay */
+        return *((framecnt_t *) (((char *) &_plugin->flags) + 12)); /* initialDelay */
 #else
        return _plugin->initial_delay;
 #endif
@@ -386,7 +386,7 @@ VSTPlugin::automatable () const
 int
 VSTPlugin::connect_and_run (BufferSet& bufs,
                ChanMapping in_map, ChanMapping out_map,
-               nframes_t nframes, nframes_t offset)
+               pframes_t nframes, framecnt_t offset)
 {
        float *ins[_plugin->numInputs];
        float *outs[_plugin->numOutputs];
index 38345acb1fcc1d1beed5d9f9d640bfcef5f9603b..397d67ffc57c49b0939b548643b3d18ba2f52bd3 100644 (file)
@@ -20,7 +20,7 @@ class Chunker
        /** Constructs a new Chunker with a constant chunk size.
          * \n NOT RT safe
          */
-       Chunker (nframes_t chunk_size)
+       Chunker (framecnt_t chunk_size)
          : chunk_size (chunk_size)
          , position (0)
        {
@@ -41,12 +41,12 @@ class Chunker
        {
                check_flags (*this, context);
                
-               nframes_t frames_left = context.frames();
-               nframes_t input_position = 0;
+               framecnt_t frames_left = context.frames();
+               framecnt_t input_position = 0;
                
                while (position + frames_left >= chunk_size) {
                        // Copy from context to buffer
-                       nframes_t const frames_to_copy = chunk_size - position;
+                       framecnt_t const frames_to_copy = chunk_size - position;
                        TypeUtils<T>::copy (&context.data()[input_position], &buffer[position], frames_to_copy);
                        
                        // Output whole buffer
@@ -73,8 +73,8 @@ class Chunker
        using Sink<T>::process;
        
   private:
-       nframes_t chunk_size;
-       nframes_t position;
+       framecnt_t chunk_size;
+       framecnt_t position;
        T * buffer;
        
 };
index 2a6ad64ef26fccc2b7c413c6e7527b71b31a46bd..96d77b1f7b2f4f86f0a124f8c9f185b97ef7e920 100644 (file)
@@ -34,7 +34,7 @@ class DeInterleaver
        typedef boost::shared_ptr<Source<T> > SourcePtr;
        
        /// Inits the deinterleaver. Must be called before using. \n Not RT safe
-       void init (unsigned int num_channels, nframes_t max_frames_per_channel)
+       void init (unsigned int num_channels, framecnt_t max_frames_per_channel)
        {
                reset();
                channels = num_channels;
@@ -59,10 +59,10 @@ class DeInterleaver
        /// Deinterleaves data and outputs it to the outputs. \n RT safe
        void process (ProcessContext<T> const & c)
        {
-               nframes_t frames = c.frames();
+               framecnt_t frames = c.frames();
                T const * data = c.data();
                
-               nframes_t const  frames_per_channel = frames / channels;
+               framecnt_t const  frames_per_channel = frames / channels;
                
                if (throw_level (ThrowProcess) && c.channels() != channels) {
                        throw Exception (*this, "wrong amount of channels given to process()");
@@ -100,7 +100,7 @@ class DeInterleaver
        
        std::vector<OutputPtr> outputs;
        unsigned int channels;
-       nframes_t max_frames;
+       framecnt_t max_frames;
        T * buffer;
 };
 
index 98a71f3afd22dba8d87189f1eb013b4502da9a75..924c1d04a58863bcd5718bbab9abc6fd428f5ca7 100644 (file)
@@ -31,7 +31,7 @@ class Interleaver
        ~Interleaver() { reset(); }
        
        /// Inits the interleaver. Must be called before using. \n Not RT safe
-       void init (unsigned int num_channels, nframes_t max_frames_per_channel)
+       void init (unsigned int num_channels, framecnt_t max_frames_per_channel)
        {
                reset();
                channels = num_channels;
@@ -78,11 +78,11 @@ class Interleaver
                
                using Sink<T>::process;
                
-               nframes_t frames() { return frames_written; }
+               framecnt_t frames() { return frames_written; }
                void reset() { frames_written = 0; }
                
          private:
-               nframes_t frames_written;
+               framecnt_t frames_written;
                Interleaver & parent;
                unsigned int channel;
        };
@@ -115,7 +115,7 @@ class Interleaver
                        buffer[channel + (channels * i)] = c.data()[i];
                }
                
-               nframes_t const ready_frames = ready_to_output();
+               framecnt_t const ready_frames = ready_to_output();
                if (ready_frames) {
                        ProcessContext<T> c_out (c, buffer, ready_frames, channels);
                        ListedSource<T>::output (c_out);
@@ -123,13 +123,13 @@ class Interleaver
                }
        }
 
-       nframes_t ready_to_output()
+       framecnt_t ready_to_output()
        {
-               nframes_t ready_frames = inputs[0]->frames();
+               framecnt_t ready_frames = inputs[0]->frames();
                if (!ready_frames) { return 0; }
 
                for (unsigned int i = 1; i < channels; ++i) {
-                       nframes_t const frames = inputs[i]->frames();
+                       framecnt_t const frames = inputs[i]->frames();
                        if (!frames) { return 0; }
                        if (throw_level (ThrowProcess) && frames != ready_frames) {
                                init (channels, max_frames);
@@ -143,7 +143,7 @@ class Interleaver
        std::vector<InputPtr> inputs;
        
        unsigned int channels;
-       nframes_t max_frames;
+       framecnt_t max_frames;
        T * buffer;
 };
 
index 205f6e70e58a09d648789035f53185a4ff347dcf..48d0fe8b0b8f3a78edf98669445fb49d4b2bf274 100644 (file)
@@ -48,7 +48,7 @@ class Normalizer
          * non-const ProcessContexts are given to \a process() .
          * \n Not RT safe
          */
-       void alloc_buffer(nframes_t frames)
+       void alloc_buffer(framecnt_t frames)
        {
                delete [] buffer;
                buffer = new float[frames];
@@ -86,7 +86,7 @@ class Normalizer
        float     gain;
        
        float *   buffer;
-       nframes_t buffer_size;
+       framecnt_t buffer_size;
 };
 
 
index 8dda57c4cc180200d8e30e441a6cf4108cfcfd65..a200f378254acac35b7fad99a1e019ff50214a8e 100644 (file)
@@ -40,7 +40,7 @@ class SampleFormatConverter
          * \note If the non-const version of process() is used with floats,
          *       there is no need to call this function.
          */
-       void init (nframes_t max_frames, int type, int data_width);
+       void init (framecnt_t max_frames, int type, int data_width);
 
        /// Set whether or not clipping to [-1.0, 1.0] should occur when TOut = float. Clipping is off by default
        void set_clip_floats (bool yn) { clip_floats = yn; }
@@ -53,12 +53,12 @@ class SampleFormatConverter
 
   private:
        void reset();
-       void init_common(nframes_t max_frames); // not-template-specialized part of init
-       void check_frame_and_channel_count(nframes_t frames, ChannelCount channels_);
+       void init_common (framecnt_t max_frames); // not-template-specialized part of init
+       void check_frame_and_channel_count (framecnt_t frames, ChannelCount channels_);
 
        ChannelCount channels;
        GDither      dither;
-       nframes_t    data_out_size;
+       framecnt_t   data_out_size;
        TOut *       data_out;
 
        bool         clip_floats;
index 5256d4a8ccc70380c89c72138df1764984580a89..8782a25d4bc85f28f634ed32b7f3076e4b40918e 100644 (file)
@@ -22,7 +22,7 @@ class SilenceTrimmer
   public:
 
        /// Constructor, \see reset() \n Not RT safe
-       SilenceTrimmer(nframes_t silence_buffer_size_ = 1024)
+       SilenceTrimmer(framecnt_t silence_buffer_size_ = 1024)
          : silence_buffer_size (0)
          , silence_buffer (0)
        {
@@ -40,7 +40,7 @@ class SilenceTrimmer
          * This also defines the maximum length of output process context
          * which can be output during long intermediate silence.
          */
-       void reset (nframes_t silence_buffer_size_ = 1024)
+       void reset (framecnt_t silence_buffer_size_ = 1024)
        {
                if (throw_level (ThrowObject) && silence_buffer_size_ == 0) {
                        throw Exception (*this,
@@ -68,7 +68,7 @@ class SilenceTrimmer
          * Needs to be called before starting processing.
          * \n RT safe
          */
-       void add_silence_to_beginning (nframes_t frames_per_channel)
+       void add_silence_to_beginning (framecnt_t frames_per_channel)
        {
                if (throw_level (ThrowObject) && !in_beginning) {
                        throw Exception(*this, "Tried to add silence to beginning after already outputting data");
@@ -80,7 +80,7 @@ class SilenceTrimmer
          * Needs to be called before end is reached.
          * \n RT safe
          */
-       void add_silence_to_end (nframes_t frames_per_channel)
+       void add_silence_to_end (framecnt_t frames_per_channel)
        {
                if (throw_level (ThrowObject) && in_end) {
                        throw Exception(*this, "Tried to add silence to end after already reaching end");
@@ -131,7 +131,7 @@ class SilenceTrimmer
                }
                in_end = c.has_flag (ProcessContext<T>::EndOfInput);
                
-               nframes_t frame_index = 0;
+               framecnt_t frame_index = 0;
                
                if (in_beginning) {
                        
@@ -223,9 +223,9 @@ class SilenceTrimmer
 
   private:
 
-       bool find_first_non_zero_sample (ProcessContext<T> const & c, nframes_t & result_frame)
+       bool find_first_non_zero_sample (ProcessContext<T> const & c, framecnt_t & result_frame)
        {
-               for (nframes_t i = 0; i < c.frames(); ++i) {
+               for (framecnt_t i = 0; i < c.frames(); ++i) {
                        if (c.data()[i] != static_cast<T>(0.0)) {
                                result_frame = i;
                                // Round down to nearest interleaved "frame" beginning
@@ -236,13 +236,13 @@ class SilenceTrimmer
                return false;
        }
        
-       void output_silence_frames (ProcessContext<T> const & c, nframes_t & total_frames, bool adding_to_end = false)
+       void output_silence_frames (ProcessContext<T> const & c, framecnt_t & total_frames, bool adding_to_end = false)
        {
                bool end_of_input = c.has_flag (ProcessContext<T>::EndOfInput);
                c.remove_flag (ProcessContext<T>::EndOfInput);
                
                while (total_frames > 0) {
-                       nframes_t frames = std::min (silence_buffer_size, total_frames);
+                       framecnt_t frames = std::min (silence_buffer_size, total_frames);
                        if (max_output_frames) {
                                frames = std::min (frames, max_output_frames);
                        }
@@ -262,20 +262,20 @@ class SilenceTrimmer
        }
 
 
-       bool      in_beginning;
-       bool      in_end;
+       bool       in_beginning;
+       bool       in_end;
        
-       bool      trim_beginning;
-       bool      trim_end;
+       bool       trim_beginning;
+       bool       trim_end;
        
-       nframes_t silence_frames;
-       nframes_t max_output_frames;
+       framecnt_t silence_frames;
+       framecnt_t max_output_frames;
        
-       nframes_t add_to_beginning;
-       nframes_t add_to_end;
+       framecnt_t add_to_beginning;
+       framecnt_t add_to_end;
        
-       nframes_t silence_buffer_size;
-       T *       silence_buffer;
+       framecnt_t silence_buffer_size;
+       T *        silence_buffer;
 };
 
 } // namespace
index f28c8f6953e23eede31c3d4dc9901ee5d96ac792..a3298bbf975e4f63231307ba137de48ee32851ab 100644 (file)
@@ -25,10 +25,10 @@ class SampleRateConverter
        ~SampleRateConverter ();
 
        /// Init converter \n Not RT safe
-       void init (nframes_t in_rate, nframes_t out_rate, int quality = 0);
+       void init (framecnt_t in_rate, framecnt_t out_rate, int quality = 0);
        
        /// Returns max amount of frames that will be output \n RT safe
-       nframes_t allocate_buffers (nframes_t max_frames);
+       framecnt_t allocate_buffers (framecnt_t max_frames);
        
        /** Does sample rate conversion.
          * Note that outpt size may vary a lot.
@@ -46,14 +46,14 @@ class SampleRateConverter
 
        bool           active;
        uint32_t       channels;
-       nframes_t      max_frames_in;
+       framecnt_t     max_frames_in;
        
        float *        leftover_data;
-       nframes_t      leftover_frames;
-       nframes_t      max_leftover_frames;
+       framecnt_t     leftover_frames;
+       framecnt_t     max_leftover_frames;
 
        float *        data_out;
-       nframes_t      data_out_size;
+       framecnt_t     data_out_size;
 
        SRC_DATA       src_data;
        SRC_STATE*     src_state;
index 3ad84d7708d110a0b60fd87fd8ef8b5331a5500e..843c09b618138b157f674eb5770295a15583301a 100644 (file)
@@ -37,7 +37,7 @@ public:
 public:
 
        /// Basic constructor with data, frame and channel count
-       ProcessContext (T * data, nframes_t frames, ChannelCount channels)
+       ProcessContext (T * data, framecnt_t frames, ChannelCount channels)
                : _data (data), _frames (frames), _channels (channels)
        { validate_data(); }
        
@@ -48,13 +48,13 @@ public:
        
        /// "Copy constructor" with unique data, frame and channel count, but copies flags
        template<typename Y>
-       ProcessContext (ProcessContext<Y> const & other, T * data, nframes_t frames, ChannelCount channels)
+       ProcessContext (ProcessContext<Y> const & other, T * data, framecnt_t frames, ChannelCount channels)
                : _data (data), _frames (frames), _channels (channels), _flags (other.flags())
        { validate_data(); }
        
        /// "Copy constructor" with unique data and frame count, but copies channel count and flags
        template<typename Y>
-       ProcessContext (ProcessContext<Y> const & other, T * data, nframes_t frames)
+       ProcessContext (ProcessContext<Y> const & other, T * data, framecnt_t frames)
                : _data (data), _frames (frames), _channels (other.channels()), _flags (other.flags())
        { validate_data(); }
        
@@ -65,7 +65,7 @@ public:
        { /* No need to validate data */ }
        
        /// Make new Context out of the beginning of this context
-       ProcessContext beginning (nframes_t frames)
+       ProcessContext beginning (framecnt_t frames)
        {
                if (throw_level (ThrowProcess) && frames > _frames) {
                        throw Exception (*this, boost::str (boost::format
@@ -84,7 +84,7 @@ public:
        inline T *                  data()           { return _data; }
        
        /// \a frames tells how many frames the array pointed by data contains
-       inline nframes_t const &    frames()   const { return _frames; }
+       inline framecnt_t const &    frames()   const { return _frames; }
        
        /** \a channels tells how many interleaved channels \a data contains
          * If \a channels is greater than 1, each channel contains \a frames / \a channels frames of data
@@ -92,7 +92,7 @@ public:
        inline ChannelCount const & channels() const { return _channels; }
        
        /// Returns the amount of frames per channel
-       inline nframes_t            frames_per_channel() const { return _frames / _channels; }
+       inline framecnt_t            frames_per_channel() const { return _frames / _channels; }
 
        /* Flags */
        
@@ -103,7 +103,7 @@ public:
        
 protected:
        T * const              _data;
-       nframes_t              _frames;
+       framecnt_t              _frames;
        ChannelCount           _channels;
        
        mutable FlagField      _flags;
@@ -124,11 +124,11 @@ template <typename T = DefaultSampleType>
 struct AllocatingProcessContext : public ProcessContext<T>
 {
        /// Allocates uninitialized memory
-       AllocatingProcessContext (nframes_t frames, ChannelCount channels)
+       AllocatingProcessContext (framecnt_t frames, ChannelCount channels)
                : ProcessContext<T> (new T[frames], frames, channels) {}
        
        /// Allocates and copies data from raw buffer
-       AllocatingProcessContext (T const * data, nframes_t frames, ChannelCount channels)
+       AllocatingProcessContext (T const * data, framecnt_t frames, ChannelCount channels)
                : ProcessContext<T> (new T[frames], frames, channels)
        { TypeUtils<float>::copy (data, ProcessContext<T>::_data, frames); }
        
@@ -139,12 +139,12 @@ struct AllocatingProcessContext : public ProcessContext<T>
        
        /// "Copy constructor" with uninitialized data, unique frame and channel count, but copies flags
        template<typename Y>
-       AllocatingProcessContext (ProcessContext<Y> const & other, nframes_t frames, ChannelCount channels)
+       AllocatingProcessContext (ProcessContext<Y> const & other, framecnt_t frames, ChannelCount channels)
                : ProcessContext<T> (other, new T[frames], frames, channels) {}
        
        /// "Copy constructor" with uninitialized data, unique frame count, but copies channel count and flags
        template<typename Y>
-       AllocatingProcessContext (ProcessContext<Y> const & other, nframes_t frames)
+       AllocatingProcessContext (ProcessContext<Y> const & other, framecnt_t frames)
                : ProcessContext<T> (other, new T[frames], frames, other.channels()) {}
        
        /// "Copy constructor" uninitialized data, that copies frame and channel count + flags
@@ -161,7 +161,7 @@ class ConstProcessContext
 {
   public:
        /// Basic constructor with data, frame and channel count
-       ConstProcessContext (T const * data, nframes_t frames, ChannelCount channels)
+       ConstProcessContext (T const * data, framecnt_t frames, ChannelCount channels)
          : context (const_cast<T *>(data), frames, channels) {}
        
        /// Copy constructor from const ProcessContext
@@ -170,12 +170,12 @@ class ConstProcessContext
        
        /// "Copy constructor", with unique data, frame and channel count, but copies flags
        template<typename ProcessContext>
-       ConstProcessContext (ProcessContext const & other, T const * data, nframes_t frames, ChannelCount channels)
+       ConstProcessContext (ProcessContext const & other, T const * data, framecnt_t frames, ChannelCount channels)
                : context (other, const_cast<T *>(data), frames, channels) {}
        
        /// "Copy constructor", with unique data and frame count, but copies channel count and flags
        template<typename ProcessContext>
-       ConstProcessContext (ProcessContext const & other, T const * data, nframes_t frames)
+       ConstProcessContext (ProcessContext const & other, T const * data, framecnt_t frames)
                : context (other, const_cast<T *>(data), frames) {}
        
        /// "Copy constructor", with unique data, but copies frame and channel count + flags
index 4db2298a906cc004c4bb63331d5311be737d9bc0..939e5f8a2ce9298850a29a03a4edf44dc650b148 100644 (file)
@@ -16,7 +16,7 @@ class Sndfile : public SndfileWriter<T>, public SndfileReader<T>
   public:
        
        Sndfile (std::string const & filename, SndfileBase::Mode mode = SndfileBase::ReadWrite, int format = 0,
-                ChannelCount channels = 0, nframes_t samplerate = 0)
+                ChannelCount channels = 0, framecnt_t samplerate = 0)
          : SndfileHandle (filename, mode, format, channels, samplerate)
        {}
        
@@ -27,4 +27,4 @@ class Sndfile : public SndfileWriter<T>, public SndfileReader<T>
 
 } // namespace
 
-#endif // AUDIOGRAPHER_SNDFILE_H
\ No newline at end of file
+#endif // AUDIOGRAPHER_SNDFILE_H
index f5f7adcb3a722853e16d71ca1b489e9038c6a33d..f7a04f22d620cb2e3c6ecfb09d7303f634a4ca83 100644 (file)
@@ -29,7 +29,7 @@ class SndfileReader
         *  Note that the data read is output to the outputs, as well as read into the context
         *  \return number of frames read
         */
-       nframes_t read (ProcessContext<T> & context)
+       framecnt_t read (ProcessContext<T> & context)
        {
                if (throw_level (ThrowStrict) && context.channels() != channels() ) {
                        throw Exception (*this, boost::str (boost::format
@@ -37,7 +37,7 @@ class SndfileReader
                                % context.channels() % channels()));
                }
                
-               nframes_t frames_read = SndfileHandle::read (context.data(), context.frames());
+               framecnt_t const frames_read = SndfileHandle::read (context.data(), context.frames());
                ProcessContext<T> c_out = context.beginning (frames_read);
                
                if (frames_read < context.frames()) {
@@ -54,4 +54,4 @@ class SndfileReader
 
 } // namespace
 
-#endif // AUDIOGRAPHER_SNDFILE_READER_H
\ No newline at end of file
+#endif // AUDIOGRAPHER_SNDFILE_READER_H
index a6f338487a96fd6dec37517c2b929e7e636f8dbc..7b3c2968fff0dfd690537347fdc1995fc055a042 100644 (file)
@@ -27,7 +27,7 @@ class SndfileWriter
   , public FlagDebuggable<>
 {
   public:
-       SndfileWriter (std::string const & path, int format, ChannelCount channels, nframes_t samplerate, boost::shared_ptr<BroadcastInfo> broadcast_info)
+       SndfileWriter (std::string const & path, int format, ChannelCount channels, framecnt_t samplerate, boost::shared_ptr<BroadcastInfo> broadcast_info)
          : SndfileHandle (path, Write, format, channels, samplerate)
          , path (path)
        {
@@ -54,7 +54,7 @@ class SndfileWriter
                                % c.channels() % channels()));
                }
                
-               nframes_t written = write (c.data(), c.frames());
+               framecnt_t const written = write (c.data(), c.frames());
                if (throw_level (ThrowProcess) && written != c.frames()) {
                        throw Exception (*this, boost::str (boost::format
                                ("Could not write data to output file (%1%)")
index e312007247c9a3f3c3a5d27e5bbd0fa1861c5f5a..a4e7b2679a6b5cb6ead2f90f29fbc528ad006935 100644 (file)
@@ -13,7 +13,7 @@ class TmpFile : public SndfileWriter<T>, public SndfileReader<T>
 {
   public:
        
-       TmpFile (int format, ChannelCount channels, nframes_t samplerate)
+       TmpFile (int format, ChannelCount channels, framecnt_t samplerate)
          : SndfileHandle (fileno (tmpfile()), true, SndfileBase::ReadWrite, format, channels, samplerate)
        {}
        
@@ -24,4 +24,4 @@ class TmpFile : public SndfileWriter<T>, public SndfileReader<T>
 
 } // namespace
 
-#endif // AUDIOGRAPHER_TMP_FILE_H
\ No newline at end of file
+#endif // AUDIOGRAPHER_TMP_FILE_H
index d17f3634ed56a70f92f2321b835f08aa3a2f103c..360168d55df417b3bb91a6e71271408404de8d85 100644 (file)
@@ -16,11 +16,11 @@ class TypeUtilsBase
   protected:
        
        template<typename T, bool b>
-       static void do_zero_fill(T * buffer, nframes_t frames, const boost::integral_constant<bool, b>&)
+       static void do_zero_fill(T * buffer, framecnt_t frames, const boost::integral_constant<bool, b>&)
                { std::uninitialized_fill_n (buffer, frames, T()); }
 
        template<typename T>
-       static void do_zero_fill(T * buffer, nframes_t frames, const boost::true_type&)
+       static void do_zero_fill(T * buffer, framecnt_t frames, const boost::true_type&)
                { memset (buffer, 0, frames * sizeof(T)); }
 };
 
@@ -39,21 +39,21 @@ class TypeUtils : private TypeUtilsBase
          * if T is not a floating point or signed integer type
          * \n RT safe
          */
-       inline static void zero_fill (T * buffer, nframes_t frames)
+       inline static void zero_fill (T * buffer, framecnt_t frames)
                { do_zero_fill(buffer, frames, zero_fillable()); }
        
        /** Copies \a frames frames of data from \a source to \a destination
          * The source and destination may NOT overlap.
          * \n RT safe
          */
-       inline static void copy (T const * source, T * destination, nframes_t frames)
+       inline static void copy (T const * source, T * destination, framecnt_t frames)
                { std::uninitialized_copy (source, &source[frames], destination); }
        
        /** Moves \a frames frames of data from \a source to \a destination
          * The source and destination may overlap in any way.
          * \n RT safe
          */
-       inline static void move (T const * source, T * destination, nframes_t frames)
+       inline static void move (T const * source, T * destination, framecnt_t frames)
        {
                if (destination < source) {
                        std::copy (source, &source[frames], destination);
index 558bab302f06d00ff98b12e5b38984c75b57e66c..ae98cde7bdf83f8fed2c1a06d60e1b80aa053497 100644 (file)
@@ -5,11 +5,13 @@
 
 namespace AudioGrapher {
 
-typedef int64_t nframes_t;
+/* XXX: copied from libardour */       
+typedef int64_t framecnt_t;
+       
 typedef uint8_t ChannelCount;
 
 typedef float DefaultSampleType;
 
 } // namespace
 
-#endif // AUDIOGRAPHER_TYPES_H
\ No newline at end of file
+#endif // AUDIOGRAPHER_TYPES_H
index a827f670785d1d223289610a0035ffc675121a7b..a1aa4d88a9bb515fd34dd065c9393e6fa90d7fcc 100644 (file)
@@ -21,7 +21,7 @@ SampleFormatConverter<TOut>::SampleFormatConverter (ChannelCount channels) :
 
 template <>
 void
-SampleFormatConverter<float>::init (nframes_t max_frames, int /* type */, int data_width)
+SampleFormatConverter<float>::init (framecnt_t max_frames, int /* type */, int data_width)
 {
        if (throw_level (ThrowObject) && data_width != 32) {
                throw Exception (*this, "Unsupported data width");
@@ -32,7 +32,7 @@ SampleFormatConverter<float>::init (nframes_t max_frames, int /* type */, int da
 
 template <>
 void
-SampleFormatConverter<int32_t>::init (nframes_t max_frames, int type, int data_width)
+SampleFormatConverter<int32_t>::init (framecnt_t max_frames, int type, int data_width)
 {
        if(throw_level (ThrowObject) && data_width < 24) {
                throw Exception (*this, "Trying to use SampleFormatConverter<int32_t> for data widths < 24");
@@ -51,7 +51,7 @@ SampleFormatConverter<int32_t>::init (nframes_t max_frames, int type, int data_w
 
 template <>
 void
-SampleFormatConverter<int16_t>::init (nframes_t max_frames, int type, int data_width)
+SampleFormatConverter<int16_t>::init (framecnt_t max_frames, int type, int data_width)
 {
        if (throw_level (ThrowObject) && data_width != 16) {
                throw Exception (*this, "Unsupported data width");
@@ -62,7 +62,7 @@ SampleFormatConverter<int16_t>::init (nframes_t max_frames, int type, int data_w
 
 template <>
 void
-SampleFormatConverter<uint8_t>::init (nframes_t max_frames, int type, int data_width)
+SampleFormatConverter<uint8_t>::init (framecnt_t max_frames, int type, int data_width)
 {
        if (throw_level (ThrowObject) && data_width != 8) {
                throw Exception (*this, "Unsupported data width");
@@ -73,7 +73,7 @@ SampleFormatConverter<uint8_t>::init (nframes_t max_frames, int type, int data_w
 
 template <typename TOut>
 void
-SampleFormatConverter<TOut>::init_common (nframes_t max_frames )
+SampleFormatConverter<TOut>::init_common (framecnt_t max_frames)
 {
        reset();
        if (max_frames  > data_out_size) {
@@ -141,11 +141,11 @@ template<>
 void
 SampleFormatConverter<float>::process (ProcessContext<float> & c_in)
 {
-       nframes_t frames = c_in.frames();
+       framecnt_t frames = c_in.frames();
        float * data = c_in.data();
        
        if (clip_floats) {
-               for (nframes_t x = 0; x < frames; ++x) {
+               for (framecnt_t x = 0; x < frames; ++x) {
                        if (data[x] > 1.0f) {
                                data[x] = 1.0f;
                        } else if (data[x] < -1.0f) {
@@ -172,7 +172,7 @@ SampleFormatConverter<float>::process (ProcessContext<float> const & c_in)
 
 template<typename TOut>
 void
-SampleFormatConverter<TOut>::check_frame_and_channel_count(nframes_t frames, ChannelCount channels_)
+SampleFormatConverter<TOut>::check_frame_and_channel_count (framecnt_t frames, ChannelCount channels_)
 {
        if (throw_level (ThrowStrict) && channels_ != channels) {
                throw Exception (*this, boost::str (boost::format
index 1fbed12128950fa99ff084b64e9e9a5d17da72bb..5661f6039480626c523c55d258d022d124b5dc83 100644 (file)
@@ -26,7 +26,7 @@ SampleRateConverter::SampleRateConverter (uint32_t channels)
 }
 
 void
-SampleRateConverter::init (nframes_t in_rate, nframes_t out_rate, int quality)
+SampleRateConverter::init (framecnt_t in_rate, framecnt_t out_rate, int quality)
 {
        reset();
        
@@ -52,12 +52,12 @@ SampleRateConverter::~SampleRateConverter ()
        reset();
 }
 
-nframes_t
-SampleRateConverter::allocate_buffers (nframes_t max_frames)
+framecnt_t
+SampleRateConverter::allocate_buffers (framecnt_t max_frames)
 {
        if (!active) { return max_frames; }
        
-       nframes_t max_frames_out = (nframes_t) ceil (max_frames * src_data.src_ratio);
+       framecnt_t max_frames_out = (framecnt_t) ceil (max_frames * src_data.src_ratio);
        if (data_out_size < max_frames_out) {
 
                delete[] data_out;
@@ -87,7 +87,7 @@ SampleRateConverter::process (ProcessContext<float> const & c)
                return;
        }
 
-       nframes_t frames = c.frames();
+       framecnt_t frames = c.frames();
        float * in = const_cast<float *> (c.data()); // TODO check if this is safe!
 
        if (throw_level (ThrowProcess) && frames > max_frames_in) {
index c667360601ff3147278fcf5a0ef035ab268509d0..ea5c29a4108216609e29d5465ecf9dc660bb7062 100644 (file)
@@ -33,13 +33,13 @@ class ChunkerTest : public CppUnit::TestFixture
        void testSynchronousProcess()
        {
                chunker->add_output (sink);
-               nframes_t frames_output = 0;
+               framecnt_t frames_output = 0;
                
                ProcessContext<float> const context (random_data, frames, 1);
                
                chunker->process (context);
                frames_output = sink->get_data().size();
-               CPPUNIT_ASSERT_EQUAL ((nframes_t) 0, frames_output);
+               CPPUNIT_ASSERT_EQUAL ((framecnt_t) 0, frames_output);
                
                chunker->process (context);
                frames_output = sink->get_data().size();
@@ -51,7 +51,7 @@ class ChunkerTest : public CppUnit::TestFixture
                
                chunker->process (context);
                frames_output = sink->get_data().size();
-               CPPUNIT_ASSERT_EQUAL ((nframes_t) 0, frames_output);
+               CPPUNIT_ASSERT_EQUAL ((framecnt_t) 0, frames_output);
                
                chunker->process (context);
                frames_output = sink->get_data().size();
@@ -65,7 +65,7 @@ class ChunkerTest : public CppUnit::TestFixture
                assert (frames % 2 == 0);
                
                chunker->add_output (sink);
-               nframes_t frames_output = 0;
+               framecnt_t frames_output = 0;
                
                ProcessContext<float> const half_context (random_data, frames / 2, 1);
                ProcessContext<float> const context (random_data, frames, 1);
@@ -73,12 +73,12 @@ class ChunkerTest : public CppUnit::TestFixture
                // 0.5
                chunker->process (half_context);
                frames_output = sink->get_data().size();
-               CPPUNIT_ASSERT_EQUAL ((nframes_t) 0, frames_output);
+               CPPUNIT_ASSERT_EQUAL ((framecnt_t) 0, frames_output);
                
                // 1.5
                chunker->process (context);
                frames_output = sink->get_data().size();
-               CPPUNIT_ASSERT_EQUAL ((nframes_t) 0, frames_output);
+               CPPUNIT_ASSERT_EQUAL ((framecnt_t) 0, frames_output);
                
                // 2.5
                chunker->process (context);
@@ -93,7 +93,7 @@ class ChunkerTest : public CppUnit::TestFixture
                // 3.5
                chunker->process (context);
                frames_output = sink->get_data().size();
-               CPPUNIT_ASSERT_EQUAL ((nframes_t) 0, frames_output);
+               CPPUNIT_ASSERT_EQUAL ((framecnt_t) 0, frames_output);
                
                // 4.0
                chunker->process (half_context);
@@ -112,7 +112,7 @@ class ChunkerTest : public CppUnit::TestFixture
                chunker.reset (new Chunker<float>(frames / 4));
                
                chunker->add_output (sink);
-               nframes_t frames_output = 0;
+               framecnt_t frames_output = 0;
                
                ProcessContext<float> const half_context (random_data, frames / 2, 1);
                ProcessContext<float> const context (random_data, frames, 1);
@@ -120,12 +120,12 @@ class ChunkerTest : public CppUnit::TestFixture
                // 0.5
                chunker->process (half_context);
                frames_output = sink->get_data().size();
-               CPPUNIT_ASSERT_EQUAL ((nframes_t) frames / 2, frames_output);
+               CPPUNIT_ASSERT_EQUAL ((framecnt_t) frames / 2, frames_output);
                
                // 1.5
                chunker->process (context);
                frames_output = sink->get_data().size();
-               CPPUNIT_ASSERT_EQUAL ((nframes_t) frames / 2 * 3, frames_output);
+               CPPUNIT_ASSERT_EQUAL ((framecnt_t) frames / 2 * 3, frames_output);
                
                // 2.5
                chunker->process (context);
@@ -141,7 +141,7 @@ class ChunkerTest : public CppUnit::TestFixture
        boost::shared_ptr<VectorSink<float> > sink;
 
        float * random_data;
-       nframes_t frames;
+       framecnt_t frames;
 };
 
 CPPUNIT_TEST_SUITE_REGISTRATION (ChunkerTest);
index 3d644a3cf117b3ac84f93084dccc54245390da1f..3260045b110e7ec46be771f7953009b554f18dae 100644 (file)
@@ -61,9 +61,9 @@ class DeInterleaverTest : public CppUnit::TestFixture
                CPPUNIT_ASSERT_THROW (deinterleaver->process (c.beginning (total_frames - 1)), Exception);
        }
 
-       void assert_outputs (nframes_t expected_frames)
+       void assert_outputs (framecnt_t expected_frames)
        {
-               nframes_t generated_frames = 0;
+               framecnt_t generated_frames = 0;
                
                generated_frames = sink_a->get_data().size();
                CPPUNIT_ASSERT_EQUAL (expected_frames, generated_frames);
@@ -89,7 +89,7 @@ class DeInterleaverTest : public CppUnit::TestFixture
                assert_outputs (frames_per_channel);
                
                // Now with less frames
-               nframes_t const less_frames = frames_per_channel / 4;
+               framecnt_t const less_frames = frames_per_channel / 4;
                deinterleaver->process (c.beginning (less_frames * channels));
                assert_outputs (less_frames);
        }
@@ -120,8 +120,8 @@ class DeInterleaverTest : public CppUnit::TestFixture
        boost::shared_ptr<VectorSink<float> > sink_c;
 
        float * random_data;
-       nframes_t frames_per_channel;
-       nframes_t total_frames;
+       framecnt_t frames_per_channel;
+       framecnt_t total_frames;
        unsigned int channels;
 };
 
index 908abafdf23a755308f1a89283fd4ff3f4983099..da042b949478c8805108f9ae56b75dcf668f7207 100644 (file)
@@ -55,7 +55,7 @@ class InterleaverDeInterleaverTest : public CppUnit::TestFixture
                CPPUNIT_ASSERT (TestUtils::array_equals (random_data_a, sink_a->get_array(), total_frames));
                
                // And a second round...
-               nframes_t less_frames = (frames_per_channel / 10) * channels;
+               framecnt_t less_frames = (frames_per_channel / 10) * channels;
                deinterleaver->process (c.beginning (less_frames));
                CPPUNIT_ASSERT (TestUtils::array_equals (random_data_a, sink_a->get_array(), less_frames));
        }
@@ -85,7 +85,7 @@ class InterleaverDeInterleaverTest : public CppUnit::TestFixture
                CPPUNIT_ASSERT (TestUtils::array_equals (random_data_c, sink_c->get_array(), frames_per_channel));
                
                // And a second round...
-               nframes_t less_frames = frames_per_channel / 5;
+               framecnt_t less_frames = frames_per_channel / 5;
                interleaver->input (0)->process (c_a.beginning (less_frames));
                interleaver->input (1)->process (c_b.beginning (less_frames));
                interleaver->input (2)->process (c_c.beginning (less_frames));
@@ -108,8 +108,8 @@ class InterleaverDeInterleaverTest : public CppUnit::TestFixture
        float * random_data_b;
        float * random_data_c;
        
-       nframes_t frames_per_channel;
-       nframes_t total_frames;
+       framecnt_t frames_per_channel;
+       framecnt_t total_frames;
        unsigned int channels;
 };
 
index 1512d054fc7a59d88c3fa361d7133fbc964776a1..b82aac74bb5b6a822cd9aae9d428f9197441204e 100644 (file)
@@ -69,11 +69,11 @@ class InterleaverTest : public CppUnit::TestFixture
                interleaver->input (1)->process (c);
                interleaver->input (2)->process (c);
 
-               nframes_t expected_frames = frames * channels;
-               nframes_t generated_frames = sink->get_data().size();
+               framecnt_t expected_frames = frames * channels;
+               framecnt_t generated_frames = sink->get_data().size();
                CPPUNIT_ASSERT_EQUAL (expected_frames, generated_frames);
 
-               nframes_t less_frames = frames / 2;
+               framecnt_t less_frames = frames / 2;
                interleaver->input (0)->process (c.beginning (less_frames));
                interleaver->input (1)->process (c.beginning (less_frames));
                interleaver->input (2)->process (c.beginning (less_frames));
@@ -100,8 +100,8 @@ class InterleaverTest : public CppUnit::TestFixture
                interleaver->input (1)->process (c);
                interleaver->input (2)->process (c);
 
-               nframes_t expected_frames = frames * channels;
-               nframes_t generated_frames = sink->get_data().size();
+               framecnt_t expected_frames = frames * channels;
+               framecnt_t generated_frames = sink->get_data().size();
                CPPUNIT_ASSERT_EQUAL (expected_frames, generated_frames);
        }
 
@@ -119,9 +119,9 @@ class InterleaverTest : public CppUnit::TestFixture
 
        boost::shared_ptr<VectorSink<float> > sink;
 
-       nframes_t channels;
+       framecnt_t channels;
        float * random_data;
-       nframes_t frames;
+       framecnt_t frames;
 };
 
 CPPUNIT_TEST_SUITE_REGISTRATION (InterleaverTest);
index b08fd73a0e1a1d4d5b771afe917c7a8ddef618c3..be236802022fd2b6801ebf2e5329f0b81b04560c 100644 (file)
@@ -54,7 +54,7 @@ class NormalizerTest : public CppUnit::TestFixture
        boost::shared_ptr<VectorSink<float> > sink;
 
        float * random_data;
-       nframes_t frames;
+       framecnt_t frames;
 };
 
 CPPUNIT_TEST_SUITE_REGISTRATION (NormalizerTest);
index 53b7a1517438c56487ad66b9f5484f6a8fd7739c..6b60598a2ee67e96118cf2d74c8aa03383757a6c 100644 (file)
@@ -48,7 +48,7 @@ class PeakReaderTest : public CppUnit::TestFixture
        boost::shared_ptr<PeakReader> reader;
 
        float * random_data;
-       nframes_t frames;
+       framecnt_t frames;
 };
 
 CPPUNIT_TEST_SUITE_REGISTRATION (PeakReaderTest);
index 1456528ebffaf87574246893e98ab24fd41a396e..9239564d5b24944d0933b8ba3fef1ede46b47b83 100644 (file)
@@ -62,7 +62,7 @@ class SampleFormatConverterTest : public CppUnit::TestFixture
                
                converter->init (frames, D_Tri, 32);
                converter->add_output (sink);
-               nframes_t frames_output = 0;
+               framecnt_t frames_output = 0;
                
                {
                ProcessContext<float> pc(random_data, frames / 2, 1);
@@ -88,7 +88,7 @@ class SampleFormatConverterTest : public CppUnit::TestFixture
        {
                boost::shared_ptr<SampleFormatConverter<float> > converter (new SampleFormatConverter<float>(1));
                boost::shared_ptr<VectorSink<float> > sink (new VectorSink<float>());
-               nframes_t frames_output = 0;
+               framecnt_t frames_output = 0;
                
                converter->init(frames, D_Tri, 32);
                converter->add_output (sink);
@@ -110,7 +110,7 @@ class SampleFormatConverterTest : public CppUnit::TestFixture
                CPPUNIT_ASSERT_EQUAL (frames, frames_output);
                CPPUNIT_ASSERT (TestUtils::array_filled(sink->get_array(), frames));
                
-               for (nframes_t i = 0; i < frames; ++i) {
+               for (framecnt_t i = 0; i < frames; ++i) {
                        // fp comparison needs a bit of tolerance, 1.01 << 1.5
                        CPPUNIT_ASSERT(sink->get_data()[i] < 1.01);
                        CPPUNIT_ASSERT(sink->get_data()[i] > -1.01);
@@ -121,7 +121,7 @@ class SampleFormatConverterTest : public CppUnit::TestFixture
        {
                boost::shared_ptr<SampleFormatConverter<int32_t> > converter (new SampleFormatConverter<int32_t>(1));
                boost::shared_ptr<VectorSink<int32_t> > sink (new VectorSink<int32_t>());
-               nframes_t frames_output = 0;
+               framecnt_t frames_output = 0;
                
                converter->init(frames, D_Tri, 32);
                converter->add_output (sink);
@@ -137,7 +137,7 @@ class SampleFormatConverterTest : public CppUnit::TestFixture
        {
                boost::shared_ptr<SampleFormatConverter<int32_t> > converter (new SampleFormatConverter<int32_t>(1));
                boost::shared_ptr<VectorSink<int32_t> > sink (new VectorSink<int32_t>());
-               nframes_t frames_output = 0;
+               framecnt_t frames_output = 0;
                
                converter->init(frames, D_Tri, 24);
                converter->add_output (sink);
@@ -153,7 +153,7 @@ class SampleFormatConverterTest : public CppUnit::TestFixture
        {
                boost::shared_ptr<SampleFormatConverter<int16_t> > converter (new SampleFormatConverter<int16_t>(1));
                boost::shared_ptr<VectorSink<int16_t> > sink (new VectorSink<int16_t>());
-               nframes_t frames_output = 0;
+               framecnt_t frames_output = 0;
                
                converter->init(frames, D_Tri, 16);
                converter->add_output (sink);
@@ -169,7 +169,7 @@ class SampleFormatConverterTest : public CppUnit::TestFixture
        {
                boost::shared_ptr<SampleFormatConverter<uint8_t> > converter (new SampleFormatConverter<uint8_t>(1));
                boost::shared_ptr<VectorSink<uint8_t> > sink (new VectorSink<uint8_t>());
-               nframes_t frames_output = 0;
+               framecnt_t frames_output = 0;
                
                converter->init(frames, D_Tri, 8);
                converter->add_output (sink);
@@ -185,7 +185,7 @@ class SampleFormatConverterTest : public CppUnit::TestFixture
        {
                boost::shared_ptr<SampleFormatConverter<int32_t> > converter (new SampleFormatConverter<int32_t>(3));
                boost::shared_ptr<VectorSink<int32_t> > sink (new VectorSink<int32_t>());
-               nframes_t frames_output = 0;
+               framecnt_t frames_output = 0;
                
                converter->init(frames, D_Tri, 32);
                converter->add_output (sink);
@@ -193,7 +193,7 @@ class SampleFormatConverterTest : public CppUnit::TestFixture
                ProcessContext<float> pc(random_data, 4, 1);
                CPPUNIT_ASSERT_THROW (converter->process (pc), Exception);
                
-               nframes_t new_frame_count = frames - (frames % 3);
+               framecnt_t new_frame_count = frames - (frames % 3);
                converter->process (ProcessContext<float> (pc.data(), new_frame_count, 3));
                frames_output = sink->get_data().size();
                CPPUNIT_ASSERT_EQUAL (new_frame_count, frames_output);
@@ -203,7 +203,7 @@ class SampleFormatConverterTest : public CppUnit::TestFixture
   private:
 
        float * random_data;
-       nframes_t frames;
+       framecnt_t frames;
 };
 
 CPPUNIT_TEST_SUITE_REGISTRATION (SampleFormatConverterTest);
index add24d026ac5905bbaa463d9aeeebb78f265fb39..dfcf3c7ca29674fa7194f183722eb77dfcedc433 100644 (file)
@@ -50,14 +50,14 @@ class SilenceTrimmerTest : public CppUnit::TestFixture
                {
                ProcessContext<float> c (zero_data, frames, 1);
                trimmer->process (c);
-               nframes_t frames_processed = sink->get_data().size();
-               CPPUNIT_ASSERT_EQUAL ((nframes_t) 0, frames_processed);
+               framecnt_t frames_processed = sink->get_data().size();
+               CPPUNIT_ASSERT_EQUAL ((framecnt_t) 0, frames_processed);
                }
                
                {
                ProcessContext<float> c (random_data, frames, 1);
                trimmer->process (c);
-               nframes_t frames_processed = sink->get_data().size();
+               framecnt_t frames_processed = sink->get_data().size();
                CPPUNIT_ASSERT_EQUAL (frames, frames_processed);
                CPPUNIT_ASSERT (TestUtils::array_equals (sink->get_array(), random_data, frames));
                }
@@ -65,14 +65,14 @@ class SilenceTrimmerTest : public CppUnit::TestFixture
                {
                ProcessContext<float> c (zero_data, frames, 1);
                trimmer->process (c);
-               nframes_t frames_processed = sink->get_data().size();
+               framecnt_t frames_processed = sink->get_data().size();
                CPPUNIT_ASSERT_EQUAL (frames, frames_processed);
                }
                
                {
                ProcessContext<float> c (random_data, frames, 1);
                trimmer->process (c);
-               nframes_t frames_processed = sink->get_data().size();
+               framecnt_t frames_processed = sink->get_data().size();
                CPPUNIT_ASSERT_EQUAL (3 * frames, frames_processed);
                CPPUNIT_ASSERT (TestUtils::array_equals (sink->get_array(), random_data, frames));
                CPPUNIT_ASSERT (TestUtils::array_equals (&sink->get_array()[frames], zero_data, frames));
@@ -82,7 +82,7 @@ class SilenceTrimmerTest : public CppUnit::TestFixture
                {
                ProcessContext<float> c (zero_data, frames, 1);
                trimmer->process (c);
-               nframes_t frames_processed = sink->get_data().size();
+               framecnt_t frames_processed = sink->get_data().size();
                CPPUNIT_ASSERT_EQUAL (3 * frames, frames_processed);
                }
        }
@@ -97,7 +97,7 @@ class SilenceTrimmerTest : public CppUnit::TestFixture
                {
                ProcessContext<float> c (half_random_data, frames, 1);
                trimmer->process (c);
-               nframes_t frames_processed = sink->get_data().size();
+               framecnt_t frames_processed = sink->get_data().size();
                CPPUNIT_ASSERT_EQUAL (frames / 2, frames_processed);
                CPPUNIT_ASSERT (TestUtils::array_equals (sink->get_array(), &half_random_data[frames / 2], frames / 2));
                }
@@ -105,14 +105,14 @@ class SilenceTrimmerTest : public CppUnit::TestFixture
                {
                ProcessContext<float> c (zero_data, frames, 1);
                trimmer->process (c);
-               nframes_t frames_processed = sink->get_data().size();
+               framecnt_t frames_processed = sink->get_data().size();
                CPPUNIT_ASSERT_EQUAL (frames / 2, frames_processed);
                }
                
                {
                ProcessContext<float> c (half_random_data, frames, 1);
                trimmer->process (c);
-               nframes_t frames_processed = sink->get_data().size();
+               framecnt_t frames_processed = sink->get_data().size();
                CPPUNIT_ASSERT_EQUAL (2 * frames + frames / 2, frames_processed);
                CPPUNIT_ASSERT (TestUtils::array_equals (&sink->get_array()[frames + frames / 2], half_random_data, frames));
                }
@@ -129,7 +129,7 @@ class SilenceTrimmerTest : public CppUnit::TestFixture
        {
                trimmer->add_output (sink);
                
-               nframes_t silence = frames / 2;
+               framecnt_t silence = frames / 2;
                trimmer->add_silence_to_beginning (silence);
                
                {
@@ -145,7 +145,7 @@ class SilenceTrimmerTest : public CppUnit::TestFixture
        {
                trimmer->add_output (sink);
                
-               nframes_t silence = frames / 3;
+               framecnt_t silence = frames / 3;
                trimmer->add_silence_to_end (silence);
                
                {
@@ -159,8 +159,8 @@ class SilenceTrimmerTest : public CppUnit::TestFixture
                trimmer->process (c);
                }
                
-               nframes_t frames_processed = sink->get_data().size();
-               nframes_t total_frames = 2 * frames + silence;
+               framecnt_t frames_processed = sink->get_data().size();
+               framecnt_t total_frames = 2 * frames + silence;
                CPPUNIT_ASSERT_EQUAL (total_frames, frames_processed);
                CPPUNIT_ASSERT (TestUtils::array_equals (sink->get_array(), random_data, frames));
                CPPUNIT_ASSERT (TestUtils::array_equals (&sink->get_array()[frames], random_data, frames));
@@ -174,7 +174,7 @@ class SilenceTrimmerTest : public CppUnit::TestFixture
        float * random_data;
        float * zero_data;
        float * half_random_data;
-       nframes_t frames;
+       framecnt_t frames;
 };
 
 CPPUNIT_TEST_SUITE_REGISTRATION (SilenceTrimmerTest);
index 68e21d3558bf7ef39778b70795825d10da1f1833..75834127f5a5bf272d4b133a0adcf3a9b6cad0f1 100644 (file)
@@ -31,8 +31,8 @@ class SampleRateConverterTest : public CppUnit::TestFixture
        void testNoConversion()
        {
                assert (frames % 2 == 0);
-               nframes_t const half_frames = frames / 2;
-               nframes_t frames_output = 0;
+               framecnt_t const half_frames = frames / 2;
+               framecnt_t frames_output = 0;
                
                converter->init (44100, 44100);
                converter->add_output (sink);
@@ -52,8 +52,8 @@ class SampleRateConverterTest : public CppUnit::TestFixture
        void testUpsampleLength()
        {
                assert (frames % 2 == 0);
-               nframes_t const half_frames = frames / 2;
-               nframes_t frames_output = 0;
+               framecnt_t const half_frames = frames / 2;
+               framecnt_t frames_output = 0;
                
                converter->init (44100, 88200);
                converter->allocate_buffers (half_frames);
@@ -66,15 +66,15 @@ class SampleRateConverterTest : public CppUnit::TestFixture
                converter->process (c2);
 
                frames_output = sink->get_data().size();
-               nframes_t tolerance = 3;
+               framecnt_t tolerance = 3;
                CPPUNIT_ASSERT (2 * frames - tolerance < frames_output && frames_output < 2 * frames + tolerance);
        }
 
        void testDownsampleLength()
        {
                assert (frames % 2 == 0);
-               nframes_t const half_frames = frames / 2;
-               nframes_t frames_output = 0;
+               framecnt_t const half_frames = frames / 2;
+               framecnt_t frames_output = 0;
                
                converter->init (88200, 44100);
                converter->allocate_buffers (half_frames);
@@ -87,14 +87,14 @@ class SampleRateConverterTest : public CppUnit::TestFixture
                converter->process (c2);
                
                frames_output = sink->get_data().size();
-               nframes_t tolerance = 3;
+               framecnt_t tolerance = 3;
                CPPUNIT_ASSERT (half_frames - tolerance < frames_output && frames_output < half_frames + tolerance);
        }
        
        void testRespectsEndOfInput()
        {
                assert (frames % 2 == 0);
-               nframes_t const half_frames = frames / 2;
+               framecnt_t const half_frames = frames / 2;
                
                converter->init (44100, 48000);
                converter->allocate_buffers (half_frames);
@@ -123,7 +123,7 @@ class SampleRateConverterTest : public CppUnit::TestFixture
        boost::shared_ptr<ProcessContextGrabber<float> > grabber;
 
        float * random_data;
-       nframes_t frames;
+       framecnt_t frames;
 };
 
 CPPUNIT_TEST_SUITE_REGISTRATION (SampleRateConverterTest);
index c599d879532fa7570b9de793992d6971f754d147..1e87c8d34d6841bbd8c776c2fe74b12d16199075 100644 (file)
@@ -149,7 +149,7 @@ class ThreaderTest : public CppUnit::TestFixture
 
        float * random_data;
        float * zero_data;
-       nframes_t frames;
+       framecnt_t frames;
 };
 
 CPPUNIT_TEST_SUITE_REGISTRATION (ThreaderTest);
index d2d1b3581edd59e85dc3b0197362c8302ef3f85e..94647cc1a688f2e2f25e9f86d8688677f229abca 100644 (file)
@@ -40,7 +40,7 @@ class TmpFileTest : public CppUnit::TestFixture
        boost::shared_ptr<TmpFile<float> > file;
 
        float * random_data;
-       nframes_t frames;
+       framecnt_t frames;
 };
 
 CPPUNIT_TEST_SUITE_REGISTRATION (TmpFileTest);
index b13a7b7f07f3864758e97d3d97292e7747bf8d83..bc882b679c2ab3bb9179f1579bc4039dfbb38b91 100644 (file)
 #include <cstdlib>
 #include <ctime>
 
-using AudioGrapher::nframes_t;
+using AudioGrapher::framecnt_t;
 
 struct TestUtils
 {
        template<typename T>
-       static bool array_equals (T const * a, T const * b, nframes_t frames)
+       static bool array_equals (T const * a, T const * b, framecnt_t frames)
        {
-               for (nframes_t i = 0; i < frames; ++i) {
+               for (framecnt_t i = 0; i < frames; ++i) {
                        if (a[i] != b[i]) {
                                return false;
                        }
@@ -33,9 +33,9 @@ struct TestUtils
        }
 
        template<typename T>
-       static bool array_filled (T const * array, nframes_t frames)
+       static bool array_filled (T const * array, framecnt_t frames)
        {
-               for (nframes_t i = 0; i < frames; ++i) {
+               for (framecnt_t i = 0; i < frames; ++i) {
                        if (array[i] == static_cast<T> (0.0)) {
                                return false;
                        }
@@ -44,13 +44,13 @@ struct TestUtils
        }
 
        /// Generate random data, all samples guaranteed not to be 0.0, 1.0 or -1.0
-       static float * init_random_data (nframes_t frames, float range = 1.0)
+       static float * init_random_data (framecnt_t frames, float range = 1.0)
        {
                unsigned int const granularity = 4096;
                float * data = new float[frames];
                srand (std::time (NULL));
                
-               for (nframes_t i = 0; i < frames; ++i) {
+               for (framecnt_t i = 0; i < frames; ++i) {
                        do {
                                int biased_int = (rand() % granularity) - (granularity / 2);
                                data[i] = (range * biased_int) / granularity;
@@ -102,7 +102,7 @@ class AppendingVectorSink : public VectorSink<T>
        }
 
   private:
-       nframes_t total_frames;
+       framecnt_t total_frames;
 };
 
 
index 165af66a9d96fe5ffef3783d789889fe990286b9..799dcca386fca00d4363fefd08b3de3be0ca0f86 100644 (file)
@@ -37,7 +37,7 @@ class IdentityVertexTest : public CppUnit::TestFixture
                vertex->add_output (sink_a);
                vertex->add_output (sink_b);
                
-               nframes_t frames_output = 0;
+               framecnt_t frames_output = 0;
                
                ProcessContext<float> c (random_data, frames, 1);
                vertex->process (c);
@@ -93,7 +93,7 @@ class IdentityVertexTest : public CppUnit::TestFixture
 
        float * random_data;
        float * zero_data;
-       nframes_t frames;
+       framecnt_t frames;
 };
 
 CPPUNIT_TEST_SUITE_REGISTRATION (IdentityVertexTest);
index b886d4b39e8daa7c496a96d5873cdb6fc1e3a7e0..930a18e77b045e11fbdabb6bf4dae9b1421557ea 100644 (file)
@@ -93,7 +93,7 @@ Event<Timestamp>::~Event() {
 #endif // EVORAL_EVENT_ALLOC
 
 template class Event<Evoral::MusicalTime>;
-template class Event<uint32_t>;
+template class Event<int64_t>;
 
 } // namespace Evoral
 
index e96a4b4edc88ce4fd211e623a34b4e864154f4c6..ae889058c4f973e0e66c28d9f6f3ac41f32a196f 100644 (file)
@@ -47,7 +47,7 @@ Channel::connect_signals ()
 }
 
 void
-Channel::reset (timestamp_t timestamp, nframes_t /*nframes*/, bool notes_off)
+Channel::reset (timestamp_t timestamp, framecnt_t /*nframes*/, bool notes_off)
 {
        _program_number = _channel_number;
        _bank_number = 0;
index cab42d8d81b643cbe4e3e688b1264236df15f278..d4b9b00715fe525f8ef672fc1573ecc71cbfd357 100644 (file)
@@ -72,7 +72,7 @@ Manager::add_port (Port* p)
 }
 
 void
-Manager::cycle_start(nframes_t nframes)
+Manager::cycle_start (pframes_t nframes)
 {
        for (PortList::iterator p = _ports.begin(); p != _ports.end(); ++p) {
                (*p)->cycle_start (nframes);
index 7afaffb27494a4dd0f803f76748cb63e93320f58..162eea1e9a38c1f04587871f2877f88bf7c48b3c 100644 (file)
@@ -141,7 +141,7 @@ class Channel : public PBD::ScopedConnectionList {
        bool               _mono;
        size_t             _notes_on;
 
-       void reset (timestamp_t timestamp, nframes_t nframes, bool notes_off = true);
+       void reset (timestamp_t timestamp, framecnt_t nframes, bool notes_off = true);
        
        void process_note_off (Parser &, EventTwoBytes *);
        void process_note_on (Parser &, EventTwoBytes *);
index 915f650c9dddd4295a32549d5ba4b912bb439ea9..dec9d0d9f17b91dd0cd290780bd2e56b2b49b901 100644 (file)
@@ -39,14 +39,14 @@ class Manager {
         * This MUST be called before any reading/writing for this cycle.
         * Realtime safe.
         */
-       void cycle_start(nframes_t nframes);
+       void cycle_start (pframes_t nframes);
        
        /** Signal the end of an audio cycle.
         * This signifies that the cycle began with @ref cycle_start has ended.
         * This MUST be called at the end of each cycle.
         * Realtime safe.
         */
-       void cycle_end();
+       void cycle_end ();
 
        MachineControl* mmc () const { return _mmc; }
        Port *mtc_input_port() const { return _mtc_input_port; }
index 65d91686b36c355c8b0489493429dd7161537bb9..cc8891db2ca9602aea57a1154522876f929863e1 100644 (file)
@@ -270,9 +270,9 @@ class MachineControl
        int  do_shuttle (byte *, size_t len);
        
        void write_track_status (byte *, size_t len, byte reg);
-       void spp_start (Parser&, nframes_t);
-       void spp_continue (Parser&, nframes_t);
-       void spp_stop (Parser&, nframes_t);
+       void spp_start (Parser&, framecnt_t);
+       void spp_continue (Parser&, framecnt_t);
+       void spp_stop (Parser&, framecnt_t);
 };
 
 /** Class to describe a MIDI machine control command to be sent.
index 43cf80c067aaefaef4cdd58bb538e29bd97b0552..e57323e72d00c8ffaf9a89bb7804e9b0beeed0bc 100644 (file)
@@ -33,7 +33,7 @@ class Port;
 class Parser;
 
 typedef PBD::Signal1<void,Parser&>                   ZeroByteSignal;
-typedef PBD::Signal2<void,Parser&,nframes_t>         TimestampedSignal;
+typedef PBD::Signal2<void,Parser&,framecnt_t>        TimestampedSignal;
 typedef PBD::Signal2<void,Parser&, byte>             OneByteSignal;
 typedef PBD::Signal2<void,Parser &, EventTwoBytes *> TwoByteSignal;
 typedef PBD::Signal2<void,Parser &, pitchbend_t>     PitchBendSignal;
@@ -49,8 +49,8 @@ class Parser {
           therefore be set before every byte passed into ::scanner().
        */
        
-       nframes_t get_timestamp() const { return _timestamp; }
-       void set_timestamp (const nframes_t timestamp) { _timestamp = timestamp; } 
+       framecnt_t get_timestamp() const { return _timestamp; }
+       void set_timestamp (const framecnt_t timestamp) { _timestamp = timestamp; } 
 
        /* signals that anyone can connect to */
        
@@ -124,10 +124,10 @@ class Parser {
        const byte *mtc_current() const { return _mtc_time; }
        bool        mtc_locked() const  { return _mtc_locked; }
        
-       PBD::Signal3<void,Parser&,int,nframes_t>      mtc_qtr;
-       PBD::Signal3<void,const byte*,bool,nframes_t> mtc_time;
-       PBD::Signal1<void,MTC_Status>                 mtc_status;
-       PBD::Signal0<bool>                           mtc_skipped;
+       PBD::Signal3<void, Parser &, int, framecnt_t>      mtc_qtr;
+       PBD::Signal3<void, const byte *, bool, framecnt_t> mtc_time;
+       PBD::Signal1<void, MTC_Status>                     mtc_status;
+       PBD::Signal0<bool>                                 mtc_skipped;
 
        void set_mtc_forwarding (bool yn) {
                _mtc_forward = yn;
@@ -172,7 +172,7 @@ class Parser {
        bool       _mtc_locked;
        byte last_qtr_frame;
        
-       nframes_t _timestamp;
+       framecnt_t _timestamp;
 
        ParseState pre_variable_state;
        MIDI::eventType pre_variable_msgtype;
index d0b6249ebe5e06dafbbbadf97bd0af3a29eff4ee..f7bef36b1fcd4bc27e6d98908ee0394edf9d0e5a 100644 (file)
@@ -57,9 +57,9 @@ class Port {
        // FIXME: make Manager a friend of port so these can be hidden?
 
        /* Only for use by MidiManager.  Don't ever call this. */
-       void cycle_start(nframes_t nframes);
+       void cycle_start (pframes_t nframes);
        /* Only for use by MidiManager.  Don't ever call this. */
-       void cycle_end();
+       void cycle_end ();
 
        /** Write a message to port.
         * @param msg Raw MIDI message to send
@@ -76,7 +76,7 @@ class Port {
         */
        int read (byte *buf, size_t bufsize);
 
-       void parse (nframes_t timestamp);
+       void parse (framecnt_t timestamp);
        
        /** Write a message to port.
         * @return true on success.
@@ -124,7 +124,7 @@ class Port {
            XMLNode& get_state();
        };
 
-       nframes_t nframes_this_cycle() const {  return _nframes_this_cycle; }
+       pframes_t nframes_this_cycle() const { return _nframes_this_cycle; }
 
        void reestablish (jack_client_t *);
        void reconnect ();
@@ -141,7 +141,7 @@ class Port {
 private:       
        bool             _ok;
        bool             _currently_in_cycle;
-       nframes_t        _nframes_this_cycle;
+       pframes_t        _nframes_this_cycle;
        std::string      _tagname;
        size_t           _number;
        Channel          *_channel[16];
@@ -151,7 +151,7 @@ private:
 
        jack_client_t* _jack_client;
        jack_port_t*   _jack_port;
-       nframes_t      _last_read_index;
+       framecnt_t     _last_read_index;
        timestamp_t    _last_write_timestamp;
 
        /** Channel used to signal to the MidiControlUI that input has arrived */
index a7929e16f53a0ac6c2a384dd32fdf2aa51e15aef..185e1e6f3f1c12cb4d462cb7f0e0ee44e09ff8ae 100644 (file)
@@ -20,6 +20,7 @@
 #ifndef __midi_types_h__
 #define __midi_types_h__
 
+#include <jack/jack.h>
 #include <inttypes.h>
 
 namespace MIDI {
@@ -28,9 +29,12 @@ namespace MIDI {
        typedef float          controller_value_t;
        typedef unsigned char  byte;
        typedef unsigned short pitchbend_t;
-       typedef uint32_t       nframes_t;
        typedef uint32_t       timestamp_t;
 
+       /** XXX: dupes from libardour */
+       typedef int64_t        framecnt_t;
+       typedef jack_nframes_t pframes_t;
+
        enum eventType {
            none = 0x0,
            raw = 0xF4, /* undefined in MIDI spec */
index fd18648de2d2b6294913cc184eed9d8dbfa38658..31e0fdfa23b1f9aaeb2a509a2bf15c45bd9bbf45 100644 (file)
@@ -649,19 +649,19 @@ MachineControl::send (MachineControlCommand const & c)
 }
 
 void
-MachineControl::spp_start (Parser& parser, nframes_t timestamp)
+MachineControl::spp_start (Parser& parser, framecnt_t timestamp)
 {
        SPPStart (parser, timestamp); /* EMIT SIGNAL */
 }
 
 void
-MachineControl::spp_continue (Parser& parser, nframes_t timestamp)
+MachineControl::spp_continue (Parser& parser, framecnt_t timestamp)
 {
        SPPContinue (parser, timestamp); /* EMIT SIGNAL */
 }
 
 void
-MachineControl::spp_stop (Parser& parser, nframes_t timestamp)
+MachineControl::spp_stop (Parser& parser, framecnt_t timestamp)
 {
        SPPStop (parser, timestamp); /* EMIT SIGNAL */
 }
index 600886a94dc3f935380d4feb5ad71e89b22c0dec..539d5c49cbe840f8106036c1929285b7e93a8c49 100644 (file)
@@ -119,7 +119,7 @@ Port::~Port ()
 }
 
 void
-Port::parse (nframes_t timestamp)
+Port::parse (framecnt_t timestamp)
 {
        byte buf[512];
 
@@ -171,7 +171,7 @@ Port::clock (timestamp_t timestamp)
 }
 
 void
-Port::cycle_start (nframes_t nframes)
+Port::cycle_start (pframes_t nframes)
 {
        assert (_jack_port);
        
@@ -190,12 +190,12 @@ Port::cycle_start (nframes_t nframes)
        
        if (receives_input()) {
                void* jack_buffer = jack_port_get_buffer(_jack_port, nframes);
-               const nframes_t event_count = jack_midi_get_event_count(jack_buffer);
+               const pframes_t event_count = jack_midi_get_event_count(jack_buffer);
 
                jack_midi_event_t ev;
                timestamp_t cycle_start_frame = jack_last_frame_time (_jack_client);
 
-               for (nframes_t i = 0; i < event_count; ++i) {
+               for (pframes_t i = 0; i < event_count; ++i) {
                        jack_midi_event_get (&ev, jack_buffer, i);
                        input_fifo.write (cycle_start_frame + ev.time, (Evoral::EventType) 0, ev.size, ev.buffer);
                }       
index 1924a4df946ebbe46d43e02afa95646adc39ae3a..f6a8f4d4b705219d273c9380e9db8887dcef6e3c 100644 (file)
@@ -555,7 +555,7 @@ TranzportControlProtocol::show_meter ()
 }
 
 void
-TranzportControlProtocol::show_bbt (nframes_t where)
+TranzportControlProtocol::show_bbt (framepos_t where)
 { 
        if ((where != last_where) || lcd_isdamaged(1,9,8)) {
                char buf[16];
@@ -591,12 +591,11 @@ TranzportControlProtocol::show_bbt (nframes_t where)
 void
 TranzportControlProtocol::show_transport_time ()
 {
-       nframes_t where = session->transport_frame();
-       show_bbt(where);
+       show_bbt (session->transport_frame ());
 }      
 
 void
-TranzportControlProtocol::show_smpte (nframes_t where)
+TranzportControlProtocol::show_smpte (framepos_t where)
 {
        if ((where != last_where) || lcd_isdamaged(1,9,10)) {
 
index 4e37da99167dd78c36b7eba94cc503f07a9bcc0c..0c7f600e2cbdf08b7b943e6a825d64e591b92e23 100644 (file)
@@ -151,7 +151,7 @@ class TranzportControlProtocol : public ARDOUR::ControlProtocol
        uint32_t       last_mins;
        uint32_t       last_secs;
        uint32_t       last_frames;
-       nframes_t last_where;
+       framepos_t     last_where;
        ARDOUR::gain_t last_track_gain;
        uint32_t       last_meter_fill;
        struct timeval last_wheel_motion;
@@ -246,8 +246,8 @@ class TranzportControlProtocol : public ARDOUR::ControlProtocol
        void show_current_track ();
        void show_track_gain ();
        void show_transport_time ();
-       void show_bbt (nframes_t where);        
-       void show_smpte (nframes_t where);
+       void show_bbt (framepos_t where);       
+       void show_smpte (framepos_t where);
        void show_wheel_mode ();
        void show_gain ();
        void show_pan ();
index 44e6b28d78142e59a34a55ef1d79d0bc6b0fa91f..25b5679c459efa1e582b1e865e017ee400db09b0 100644 (file)
@@ -1048,7 +1048,7 @@ MackieControlProtocol::update_automation (RouteSignal & rs)
 }
 
 string 
-MackieControlProtocol::format_bbt_timecode (nframes_t now_frame)
+MackieControlProtocol::format_bbt_timecode (framepos_t now_frame)
 {
        BBT_Time bbt_time;
        session->bbt_time (now_frame, bbt_time);
@@ -1078,7 +1078,7 @@ MackieControlProtocol::format_bbt_timecode (nframes_t now_frame)
 }
 
 string 
-MackieControlProtocol::format_timecode_timecode (nframes_t now_frame)
+MackieControlProtocol::format_timecode_timecode (framepos_t now_frame)
 {
        Timecode::Time timecode;
        session->timecode_time (now_frame, timecode);
@@ -1101,7 +1101,7 @@ MackieControlProtocol::update_timecode_display()
        if (surface().has_timecode_display())
        {
                // do assignment here so current_frame is fixed
-               nframes_t current_frame = session->transport_frame();
+               framepos_t current_frame = session->transport_frame();
                string timecode;
 
                switch (_timecode_type)
@@ -1592,7 +1592,7 @@ MackieControlProtocol::marker_press (Button &)
 {
        // cut'n'paste from LocationUI::add_new_location()
        string markername;
-       nframes_t where = session->audible_frame();
+       framepos_t where = session->audible_frame();
        session->locations()->next_available_name(markername,"mcu");
        Location *location = new Location (*session, where, where, markername, Location::IsMark);
        session->begin_reversible_command (_("add marker"));
index 3007df8f5a5d60a37dce0a4cee3a8f5426829b34..458dc86172ec04cb0633c07c502c8792d49760cc 100644 (file)
@@ -283,8 +283,8 @@ class MackieControlProtocol
        // also called from poll_automation to update timecode display
        void update_timecode_display();
 
-       std::string format_bbt_timecode (ARDOUR::nframes_t now_frame);
-       std::string format_timecode_timecode (ARDOUR::nframes_t now_frame);
+       std::string format_bbt_timecode (ARDOUR::framepos_t now_frame);
+       std::string format_timecode_timecode (ARDOUR::framepos_t now_frame);
        
        /**
           notification that the port is about to start it's init sequence.
index cefe5f2dd1060702ff6a2a5f09e848e983208878..c7eb11216a534c1543ec52b6509ebe6c0bae69b3 100644 (file)
@@ -284,7 +284,7 @@ TranzportControlProtocol::show_meter ()
 }
 
 void
-TranzportControlProtocol::show_bbt (nframes_t where)
+TranzportControlProtocol::show_bbt (framepos_t where)
 { 
        if (where != last_where) {
                char buf[16];
@@ -348,12 +348,11 @@ TranzportControlProtocol::show_bbt (nframes_t where)
 void
 TranzportControlProtocol::show_transport_time ()
 {
-       nframes_t where = session->transport_frame();
-       show_bbt(where);
+       show_bbt (session->transport_frame ());
 }      
 
 void
-TranzportControlProtocol::show_timecode (nframes_t where)
+TranzportControlProtocol::show_timecode (framepos_t where)
 {
        if ((where != last_where) || lcd_isdamaged(1,9,10)) {
 
index e85234c7a34dbc41c688e8db5626312cf1d3c813..53d64e8e98a2e1da57e1fc913f4282dd5f2b911f 100644 (file)
@@ -193,7 +193,7 @@ private:
        uint32_t       last_mins;
        uint32_t       last_secs;
        uint32_t       last_frames;
-       nframes_t      last_where;
+       framepos_t     last_where;
        ARDOUR::gain_t last_track_gain;
        uint32_t       last_meter_fill;
        struct timeval last_wheel_motion;
@@ -301,8 +301,8 @@ private:
        void show_current_track ();
        void show_track_gain ();
        void show_transport_time ();
-       void show_bbt (nframes_t where);        
-       void show_timecode (nframes_t where);
+       void show_bbt (framepos_t where);       
+       void show_timecode (framepos_t where);
        void show_wheel_mode ();
        void show_gain ();
        void show_pan ();