globally change all use of "frame" to refer to audio into "sample".
Generated by tools/f2s. Some hand-editing will be required in a few places to fix up comments related to timecode and video in order to keep the legible
This commit is contained in:
parent
cb956e3e48
commit
30b087ab3d
|
@ -204,12 +204,12 @@ You may select:\n \
|
|||
desc_scroller->set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
|
||||
desc_scroller->add (trk_template_desc);
|
||||
|
||||
//this is the outer frame that surrounds the description and the settings-table
|
||||
trk_template_outer_frame.set_name (X_("TextHighlightFrame"));
|
||||
//this is the outer sample that surrounds the description and the settings-table
|
||||
trk_template_outer_sample.set_name (X_("TextHighlightFrame"));
|
||||
|
||||
//this is the "inner frame" that surrounds the description text
|
||||
trk_template_desc_frame.set_name (X_("TextHighlightFrame"));
|
||||
trk_template_desc_frame.add (*desc_scroller);
|
||||
trk_template_desc_sample.set_name (X_("TextHighlightFrame"));
|
||||
trk_template_desc_sample.add (*desc_scroller);
|
||||
|
||||
/* template_chooser is the treeview showing available templates */
|
||||
trk_template_model = TreeStore::create (track_template_columns);
|
||||
|
@ -238,14 +238,14 @@ You may select:\n \
|
|||
settings_table->set_border_width (12);
|
||||
|
||||
VBox* settings_vbox = manage (new VBox);
|
||||
settings_vbox->pack_start(trk_template_desc_frame , true, true);
|
||||
settings_vbox->pack_start(trk_template_desc_sample , true, true);
|
||||
settings_vbox->pack_start(*settings_table , true, true);
|
||||
settings_vbox->set_border_width (4);
|
||||
|
||||
trk_template_outer_frame.add (*settings_vbox);
|
||||
trk_template_outer_sample.add (*settings_vbox);
|
||||
|
||||
template_hbox->pack_start (*template_scroller, true, true);
|
||||
template_hbox->pack_start (trk_template_outer_frame, true, true);
|
||||
template_hbox->pack_start (trk_template_outer_sample, true, true);
|
||||
|
||||
vbox->pack_start (*template_hbox, true, true);
|
||||
|
||||
|
|
|
@ -141,8 +141,8 @@ private:
|
|||
void trk_template_row_selected ();
|
||||
|
||||
Gtk::TextView trk_template_desc;
|
||||
Gtk::Frame trk_template_outer_frame;
|
||||
Gtk::Frame trk_template_desc_frame;
|
||||
Gtk::Frame trk_template_outer_sample;
|
||||
Gtk::Frame trk_template_desc_sample;
|
||||
|
||||
void reset_template_option_visibility ();
|
||||
void new_group_dialog_finished (int, RouteGroupDialog*);
|
||||
|
|
|
@ -693,7 +693,7 @@ AddVideoDialog::request_preview(std::string u)
|
|||
clip_yoff = (PREVIEW_HEIGHT - clip_height)/2;
|
||||
|
||||
char url[2048];
|
||||
snprintf(url, sizeof(url), "%s%s?frame=%lli&w=%d&h=%di&file=%s&format=rgb"
|
||||
snprintf(url, sizeof(url), "%s%s?sample=%lli&w=%d&h=%di&file=%s&format=rgb"
|
||||
, video_server_url.c_str()
|
||||
, (video_server_url.length()>0 && video_server_url.at(video_server_url.length()-1) == '/')?"":"/"
|
||||
, (long long) (video_duration * seek_slider.get_value() / 1000.0)
|
||||
|
|
|
@ -260,7 +260,7 @@ AnalysisWindow::analyze_data (Gtk::Button * /*button*/)
|
|||
|
||||
int n;
|
||||
for (int channel = 0; channel < n_inputs; channel++) {
|
||||
framecnt_t x = 0;
|
||||
samplecnt_t x = 0;
|
||||
|
||||
while (x < j->length()) {
|
||||
// TODO: What about stereo+ channels? composite all to one, I guess
|
||||
|
@ -313,8 +313,8 @@ AnalysisWindow::analyze_data (Gtk::Button * /*button*/)
|
|||
int n;
|
||||
for (unsigned int channel = 0; channel < arv->region()->n_channels(); channel++) {
|
||||
|
||||
framecnt_t x = 0;
|
||||
framecnt_t length = arv->region()->length();
|
||||
samplecnt_t x = 0;
|
||||
samplecnt_t length = arv->region()->length();
|
||||
|
||||
while (x < length) {
|
||||
// TODO: What about stereo+ channels? composite all to one, I guess
|
||||
|
|
|
@ -202,7 +202,7 @@ using namespace Editing;
|
|||
|
||||
ARDOUR_UI *ARDOUR_UI::theArdourUI = 0;
|
||||
|
||||
sigc::signal<void, framepos_t, bool, framepos_t> ARDOUR_UI::Clock;
|
||||
sigc::signal<void, samplepos_t, bool, samplepos_t> ARDOUR_UI::Clock;
|
||||
sigc::signal<void> ARDOUR_UI::CloseAllDialogs;
|
||||
|
||||
static bool
|
||||
|
@ -1581,7 +1581,7 @@ ARDOUR_UI::set_fps_timeout_connection ()
|
|||
* signals to the GUI Thread..
|
||||
*/
|
||||
interval = floor(500. /* update twice per FPS, since Glib::signal_timeout is very irregular */
|
||||
* _session->frame_rate() / _session->nominal_frame_rate()
|
||||
* _session->sample_rate() / _session->nominal_sample_rate()
|
||||
/ _session->timecode_frames_per_second()
|
||||
);
|
||||
#ifdef PLATFORM_WINDOWS
|
||||
|
@ -1601,7 +1601,7 @@ ARDOUR_UI::set_fps_timeout_connection ()
|
|||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::update_sample_rate (framecnt_t)
|
||||
ARDOUR_UI::update_sample_rate (samplecnt_t)
|
||||
{
|
||||
char buf[64];
|
||||
|
||||
|
@ -1613,7 +1613,7 @@ ARDOUR_UI::update_sample_rate (framecnt_t)
|
|||
|
||||
} else {
|
||||
|
||||
framecnt_t rate = AudioEngine::instance()->sample_rate();
|
||||
samplecnt_t rate = AudioEngine::instance()->sample_rate();
|
||||
|
||||
if (rate == 0) {
|
||||
/* no sample rate available */
|
||||
|
@ -1789,43 +1789,43 @@ ARDOUR_UI::update_disk_space()
|
|||
return;
|
||||
}
|
||||
|
||||
boost::optional<framecnt_t> opt_frames = _session->available_capture_duration();
|
||||
boost::optional<samplecnt_t> opt_samples = _session->available_capture_duration();
|
||||
char buf[64];
|
||||
framecnt_t fr = _session->frame_rate();
|
||||
samplecnt_t fr = _session->sample_rate();
|
||||
|
||||
if (fr == 0) {
|
||||
/* skip update - no SR available */
|
||||
return;
|
||||
}
|
||||
|
||||
if (!opt_frames) {
|
||||
if (!opt_samples) {
|
||||
/* Available space is unknown */
|
||||
snprintf (buf, sizeof (buf), "%s", _("Disk: <span foreground=\"green\">Unknown</span>"));
|
||||
} else if (opt_frames.get_value_or (0) == max_framecnt) {
|
||||
} else if (opt_samples.get_value_or (0) == max_samplecnt) {
|
||||
snprintf (buf, sizeof (buf), "%s", _("Disk: <span foreground=\"green\">24hrs+</span>"));
|
||||
} else {
|
||||
rec_enabled_streams = 0;
|
||||
_session->foreach_route (this, &ARDOUR_UI::count_recenabled_streams, false);
|
||||
|
||||
framecnt_t frames = opt_frames.get_value_or (0);
|
||||
samplecnt_t samples = opt_samples.get_value_or (0);
|
||||
|
||||
if (rec_enabled_streams) {
|
||||
frames /= rec_enabled_streams;
|
||||
samples /= rec_enabled_streams;
|
||||
}
|
||||
|
||||
int hrs;
|
||||
int mins;
|
||||
int secs;
|
||||
|
||||
hrs = frames / (fr * 3600);
|
||||
hrs = samples / (fr * 3600);
|
||||
|
||||
if (hrs > 24) {
|
||||
snprintf (buf, sizeof (buf), "%s", _("Disk: <span foreground=\"green\">>24 hrs</span>"));
|
||||
} else {
|
||||
frames -= hrs * fr * 3600;
|
||||
mins = frames / (fr * 60);
|
||||
frames -= mins * fr * 60;
|
||||
secs = frames / fr;
|
||||
samples -= hrs * fr * 3600;
|
||||
mins = samples / (fr * 60);
|
||||
samples -= mins * fr * 60;
|
||||
secs = samples / fr;
|
||||
|
||||
bool const low = (hrs == 0 && mins <= 30);
|
||||
|
||||
|
@ -2180,7 +2180,7 @@ ARDOUR_UI::transport_goto_start ()
|
|||
*/
|
||||
|
||||
if (editor) {
|
||||
editor->center_screen (_session->current_start_frame ());
|
||||
editor->center_screen (_session->current_start_sample ());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2208,30 +2208,30 @@ ARDOUR_UI::transport_goto_wallclock ()
|
|||
|
||||
time_t now;
|
||||
struct tm tmnow;
|
||||
framepos_t frames;
|
||||
samplepos_t samples;
|
||||
|
||||
time (&now);
|
||||
localtime_r (&now, &tmnow);
|
||||
|
||||
framecnt_t frame_rate = _session->frame_rate();
|
||||
samplecnt_t sample_rate = _session->sample_rate();
|
||||
|
||||
if (frame_rate == 0) {
|
||||
if (sample_rate == 0) {
|
||||
/* no frame rate available */
|
||||
return;
|
||||
}
|
||||
|
||||
frames = tmnow.tm_hour * (60 * 60 * frame_rate);
|
||||
frames += tmnow.tm_min * (60 * frame_rate);
|
||||
frames += tmnow.tm_sec * frame_rate;
|
||||
samples = tmnow.tm_hour * (60 * 60 * sample_rate);
|
||||
samples += tmnow.tm_min * (60 * sample_rate);
|
||||
samples += tmnow.tm_sec * sample_rate;
|
||||
|
||||
_session->request_locate (frames, _session->transport_rolling ());
|
||||
_session->request_locate (samples, _session->transport_rolling ());
|
||||
|
||||
/* force displayed area in editor to start no matter
|
||||
what "follow playhead" setting is.
|
||||
*/
|
||||
|
||||
if (editor) {
|
||||
editor->center_screen (frames);
|
||||
editor->center_screen (samples);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2240,15 +2240,15 @@ void
|
|||
ARDOUR_UI::transport_goto_end ()
|
||||
{
|
||||
if (_session) {
|
||||
framepos_t const frame = _session->current_end_frame();
|
||||
_session->request_locate (frame);
|
||||
samplepos_t const sample = _session->current_end_sample();
|
||||
_session->request_locate (sample);
|
||||
|
||||
/* force displayed area in editor to start no matter
|
||||
what "follow playhead" setting is.
|
||||
*/
|
||||
|
||||
if (editor) {
|
||||
editor->center_screen (frame);
|
||||
editor->center_screen (sample);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2461,9 +2461,9 @@ ARDOUR_UI::toggle_roll (bool with_abort, bool roll_out_of_bounded_mode)
|
|||
* want to do this.
|
||||
*/
|
||||
|
||||
if (UIConfiguration::instance().get_follow_edits() && ( editor->get_selection().time.front().start == _session->transport_frame() ) ) { //if playhead is exactly at the start of a range, we can assume it was placed there by follow_edits
|
||||
if (UIConfiguration::instance().get_follow_edits() && ( editor->get_selection().time.front().start == _session->transport_sample() ) ) { //if playhead is exactly at the start of a range, we can assume it was placed there by follow_edits
|
||||
_session->request_play_range (&editor->get_selection().time, true);
|
||||
_session->set_requested_return_frame( editor->get_selection().time.front().start ); //force an auto-return here
|
||||
_session->set_requested_return_sample( editor->get_selection().time.front().start ); //force an auto-return here
|
||||
}
|
||||
_session->request_transport_speed (1.0f);
|
||||
}
|
||||
|
@ -2706,7 +2706,7 @@ ARDOUR_UI::update_clocks ()
|
|||
if (!_session) return;
|
||||
|
||||
if (editor && !editor->dragging_playhead()) {
|
||||
Clock (_session->audible_frame(), false, editor->get_preferred_edit_position (EDIT_IGNORE_PHEAD)); /* EMIT_SIGNAL */
|
||||
Clock (_session->audible_sample(), false, editor->get_preferred_edit_position (EDIT_IGNORE_PHEAD)); /* EMIT_SIGNAL */
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4345,7 +4345,7 @@ ARDOUR_UI::cleanup_peakfiles ()
|
|||
RegionSelection rs;
|
||||
TrackViewList empty;
|
||||
empty.clear();
|
||||
editor->get_regions_after(rs, (framepos_t) 0, empty);
|
||||
editor->get_regions_after(rs, (samplepos_t) 0, empty);
|
||||
std::list<RegionView*> views = rs.by_layer();
|
||||
|
||||
// remove displayed audio-region-views waveforms
|
||||
|
@ -4794,10 +4794,10 @@ ARDOUR_UI::add_video (Gtk::Window* float_window)
|
|||
LTCFileReader ltcr (audio_from_video, video_timeline->get_video_file_fps());
|
||||
/* TODO ASK user which channel: 0 .. ltcr->channels() - 1 */
|
||||
|
||||
ltc_seq = ltcr.read_ltc (/*channel*/ 0, /*max LTC frames to decode*/ 15);
|
||||
ltc_seq = ltcr.read_ltc (/*channel*/ 0, /*max LTC samples to decode*/ 15);
|
||||
|
||||
/* TODO seek near end of file, and read LTC until end.
|
||||
* if it fails to find any LTC frames, scan complete file
|
||||
* if it fails to find any LTC samples, scan complete file
|
||||
*
|
||||
* calculate drift of LTC compared to video-duration,
|
||||
* ask user for reference (timecode from start/mid/end)
|
||||
|
@ -4813,16 +4813,16 @@ ARDOUR_UI::add_video (Gtk::Window* float_window)
|
|||
} else {
|
||||
/* the very first TC in the file is somteimes not aligned properly */
|
||||
int i = ltc_seq.size() -1;
|
||||
ARDOUR::frameoffset_t video_start_offset =
|
||||
_session->nominal_frame_rate() * (ltc_seq[i].timecode_sec - ltc_seq[i].framepos_sec);
|
||||
ARDOUR::sampleoffset_t video_start_offset =
|
||||
_session->nominal_sample_rate() * (ltc_seq[i].timecode_sec - ltc_seq[i].framepos_sec);
|
||||
PBD::info << string_compose (_("Align video-start to %1 [samples]"), video_start_offset) << endmsg;
|
||||
video_timeline->set_offset(video_start_offset);
|
||||
}
|
||||
}
|
||||
|
||||
_session->maybe_update_session_range(
|
||||
std::max(video_timeline->get_offset(), (ARDOUR::frameoffset_t) 0),
|
||||
std::max(video_timeline->get_offset() + video_timeline->get_duration(), (ARDOUR::frameoffset_t) 0));
|
||||
std::max(video_timeline->get_offset(), (ARDOUR::sampleoffset_t) 0),
|
||||
std::max(video_timeline->get_offset() + video_timeline->get_duration(), (ARDOUR::sampleoffset_t) 0));
|
||||
|
||||
|
||||
if (add_video_dialog->launch_xjadeo() && local_file) {
|
||||
|
@ -4988,7 +4988,7 @@ ARDOUR_UI::keyboard_settings () const
|
|||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::create_xrun_marker (framepos_t where)
|
||||
ARDOUR_UI::create_xrun_marker (samplepos_t where)
|
||||
{
|
||||
if (_session) {
|
||||
Location *location = new Location (*_session, where, where, _("xrun"), Location::IsMark, 0);
|
||||
|
@ -5005,7 +5005,7 @@ ARDOUR_UI::halt_on_xrun_message ()
|
|||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::xrun_handler (framepos_t where)
|
||||
ARDOUR_UI::xrun_handler (samplepos_t where)
|
||||
{
|
||||
if (!_session) {
|
||||
return;
|
||||
|
@ -5229,7 +5229,7 @@ what you would like to do.\n"), PROGRAM_NAME));
|
|||
}
|
||||
|
||||
int
|
||||
ARDOUR_UI::sr_mismatch_dialog (framecnt_t desired, framecnt_t actual)
|
||||
ARDOUR_UI::sr_mismatch_dialog (samplecnt_t desired, samplecnt_t actual)
|
||||
{
|
||||
HBox* hbox = new HBox();
|
||||
Image* image = new Image (Stock::DIALOG_WARNING, ICON_SIZE_DIALOG);
|
||||
|
@ -5262,7 +5262,7 @@ audio may be played at the wrong sample rate.\n"), desired, PROGRAM_NAME, actual
|
|||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::sr_mismatch_message (framecnt_t desired, framecnt_t actual)
|
||||
ARDOUR_UI::sr_mismatch_message (samplecnt_t desired, samplecnt_t actual)
|
||||
{
|
||||
MessageDialog msg (string_compose (_("\
|
||||
This session was created with a sample rate of %1 Hz, but\n\
|
||||
|
@ -5286,7 +5286,7 @@ ARDOUR_UI::use_config ()
|
|||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::update_transport_clocks (framepos_t pos)
|
||||
ARDOUR_UI::update_transport_clocks (samplepos_t pos)
|
||||
{
|
||||
if (UIConfiguration::instance().get_primary_clock_delta_edit_cursor()) {
|
||||
primary_clock->set (pos, false, editor->get_preferred_edit_position (EDIT_IGNORE_PHEAD));
|
||||
|
|
|
@ -228,12 +228,12 @@ public:
|
|||
|
||||
static PublicEditor* _instance;
|
||||
|
||||
/** Emitted frequently with the audible frame, false, and the edit point as
|
||||
/** Emitted frequently with the audible sample, false, and the edit point as
|
||||
* parameters respectively.
|
||||
*
|
||||
* (either RapidScreenUpdate || SuperRapidScreenUpdate - user-config)
|
||||
*/
|
||||
static sigc::signal<void, framepos_t, bool, framepos_t> Clock;
|
||||
static sigc::signal<void, samplepos_t, bool, samplepos_t> Clock;
|
||||
|
||||
static void close_all_dialogs () { CloseAllDialogs(); }
|
||||
static sigc::signal<void> CloseAllDialogs;
|
||||
|
@ -249,8 +249,8 @@ public:
|
|||
gboolean configure_handler (GdkEventConfigure* conf);
|
||||
|
||||
void halt_on_xrun_message ();
|
||||
void xrun_handler (framepos_t);
|
||||
void create_xrun_marker (framepos_t);
|
||||
void xrun_handler (samplepos_t);
|
||||
void create_xrun_marker (samplepos_t);
|
||||
|
||||
GUIObjectState* gui_object_state;
|
||||
|
||||
|
@ -437,7 +437,7 @@ private:
|
|||
void start_clocking ();
|
||||
void stop_clocking ();
|
||||
|
||||
void update_transport_clocks (framepos_t pos);
|
||||
void update_transport_clocks (samplepos_t pos);
|
||||
void record_state_changed ();
|
||||
|
||||
std::list<MidiTracer*> _midi_tracer_windows;
|
||||
|
@ -445,7 +445,7 @@ private:
|
|||
/* Transport Control */
|
||||
|
||||
Gtk::Table transport_table;
|
||||
Gtk::Frame transport_frame;
|
||||
Gtk::Frame transport_sample;
|
||||
Gtk::HBox transport_hbox;
|
||||
|
||||
ArdourWidgets::ArdourVSpacer* secondary_clock_spacer;
|
||||
|
@ -604,7 +604,7 @@ private:
|
|||
void update_buffer_load ();
|
||||
|
||||
Gtk::Label sample_rate_label;
|
||||
void update_sample_rate (ARDOUR::framecnt_t);
|
||||
void update_sample_rate (ARDOUR::samplecnt_t);
|
||||
|
||||
Gtk::Label format_label;
|
||||
void update_format ();
|
||||
|
@ -777,8 +777,8 @@ private:
|
|||
|
||||
void session_dialog (std::string);
|
||||
int pending_state_dialog ();
|
||||
int sr_mismatch_dialog (ARDOUR::framecnt_t, ARDOUR::framecnt_t);
|
||||
void sr_mismatch_message (ARDOUR::framecnt_t, ARDOUR::framecnt_t);
|
||||
int sr_mismatch_dialog (ARDOUR::samplecnt_t, ARDOUR::samplecnt_t);
|
||||
void sr_mismatch_message (ARDOUR::samplecnt_t, ARDOUR::samplecnt_t);
|
||||
|
||||
Gtk::MenuItem* jack_disconnect_item;
|
||||
Gtk::MenuItem* jack_reconnect_item;
|
||||
|
|
|
@ -456,19 +456,19 @@ ARDOUR_UI::setup_transport ()
|
|||
transport_table.set_row_spacings (4);
|
||||
transport_table.set_border_width (2);
|
||||
|
||||
transport_frame.set_name ("TransportFrame");
|
||||
transport_frame.set_shadow_type (Gtk::SHADOW_NONE);
|
||||
transport_sample.set_name ("TransportFrame");
|
||||
transport_sample.set_shadow_type (Gtk::SHADOW_NONE);
|
||||
|
||||
/* An event box to hold the table. We use this because we want specific
|
||||
control over the background color, and without this event box,
|
||||
nothing inside the transport_frame actually draws a background. We
|
||||
nothing inside the transport_sample actually draws a background. We
|
||||
would therefore end up seeing the background of the parent widget,
|
||||
which is probably some default color. Adding the EventBox adds a
|
||||
widget that will draw the background, using a style based on
|
||||
the parent, "TransportFrame".
|
||||
*/
|
||||
Gtk::EventBox* ebox = manage (new Gtk::EventBox);
|
||||
transport_frame.add (*ebox);
|
||||
transport_sample.add (*ebox);
|
||||
ebox->add (transport_table);
|
||||
|
||||
/* transport controls sub-group */
|
||||
|
|
|
@ -296,9 +296,9 @@ ARDOUR_UI::setup_windows ()
|
|||
|
||||
main_vpacker.pack_start (top_packer, false, false);
|
||||
|
||||
/* now add the transport frame to the top of main window */
|
||||
/* now add the transport sample to the top of main window */
|
||||
|
||||
main_vpacker.pack_start (transport_frame, false, false);
|
||||
main_vpacker.pack_start (transport_sample, false, false);
|
||||
main_vpacker.pack_start (_tabs, true, true);
|
||||
|
||||
#ifdef TOP_MENUBAR
|
||||
|
@ -336,7 +336,7 @@ ARDOUR_UI::setup_windows ()
|
|||
*/
|
||||
|
||||
_main_window.add (main_vpacker);
|
||||
transport_frame.show_all ();
|
||||
transport_sample.show_all ();
|
||||
|
||||
const XMLNode* mnode = main_window_settings ();
|
||||
|
||||
|
|
|
@ -568,7 +568,7 @@ ARDOUR_UI::install_actions ()
|
|||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
act = global_actions.register_action (transport_actions, X_("primary-clock-minsec"), _("Minutes & Seconds"), sigc::bind (sigc::mem_fun(primary_clock, &AudioClock::set_mode), AudioClock::MinSec, false));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
act = global_actions.register_action (transport_actions, X_("primary-clock-samples"), _("Samples"), sigc::bind (sigc::mem_fun(primary_clock, &AudioClock::set_mode), AudioClock::Frames, false));
|
||||
act = global_actions.register_action (transport_actions, X_("primary-clock-samples"), _("Samples"), sigc::bind (sigc::mem_fun(primary_clock, &AudioClock::set_mode), AudioClock::Samples, false));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
|
||||
act = global_actions.register_action (transport_actions, X_("secondary-clock-timecode"), _("Timecode"), sigc::bind (sigc::mem_fun(secondary_clock, &AudioClock::set_mode), AudioClock::Timecode, false));
|
||||
|
@ -577,7 +577,7 @@ ARDOUR_UI::install_actions ()
|
|||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
act = global_actions.register_action (transport_actions, X_("secondary-clock-minsec"), _("Minutes & Seconds"), sigc::bind (sigc::mem_fun(secondary_clock, &AudioClock::set_mode), AudioClock::MinSec, false));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
act = global_actions.register_action (transport_actions, X_("secondary-clock-samples"), _("Samples"), sigc::bind (sigc::mem_fun(secondary_clock, &AudioClock::set_mode), AudioClock::Frames, false));
|
||||
act = global_actions.register_action (transport_actions, X_("secondary-clock-samples"), _("Samples"), sigc::bind (sigc::mem_fun(secondary_clock, &AudioClock::set_mode), AudioClock::Samples, false));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
|
||||
act = global_actions.register_toggle_action (transport_actions, X_("SessionMonitorIn"), _("All Input"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_session_monitoring_in));
|
||||
|
|
|
@ -562,8 +562,8 @@ ARDOUR_UI::reset_main_clocks ()
|
|||
ENSURE_GUI_THREAD (*this, &ARDOUR_UI::reset_main_clocks)
|
||||
|
||||
if (_session) {
|
||||
primary_clock->set (_session->audible_frame(), true);
|
||||
secondary_clock->set (_session->audible_frame(), true);
|
||||
primary_clock->set (_session->audible_sample(), true);
|
||||
secondary_clock->set (_session->audible_sample(), true);
|
||||
} else {
|
||||
primary_clock->set (0, true);
|
||||
secondary_clock->set (0, true);
|
||||
|
|
|
@ -132,7 +132,7 @@ private:
|
|||
|
||||
NSWindow* cocoa_window;
|
||||
NSView* au_view;
|
||||
NSRect last_au_frame;
|
||||
NSRect last_au_sample;
|
||||
bool in_live_resize;
|
||||
uint32_t plugin_requested_resize;
|
||||
|
||||
|
|
|
@ -453,7 +453,7 @@ AudioClock::get_field (Field f)
|
|||
case Timecode_Seconds:
|
||||
return edit_string.substr (7, 2);
|
||||
break;
|
||||
case Timecode_Frames:
|
||||
case Timecode_frames:
|
||||
return edit_string.substr (10, 2);
|
||||
break;
|
||||
case MS_Hours:
|
||||
|
@ -477,7 +477,7 @@ AudioClock::get_field (Field f)
|
|||
case Ticks:
|
||||
return edit_string.substr (8, 4);
|
||||
break;
|
||||
case AudioFrames:
|
||||
case S_Samples:
|
||||
return edit_string;
|
||||
break;
|
||||
}
|
||||
|
@ -504,7 +504,7 @@ AudioClock::end_edit (bool modify)
|
|||
ok = minsec_validate_edit (edit_string);
|
||||
break;
|
||||
|
||||
case Frames:
|
||||
case Samples:
|
||||
if (edit_string.length() < 1) {
|
||||
edit_string = pre_edit_string;
|
||||
}
|
||||
|
@ -520,27 +520,27 @@ AudioClock::end_edit (bool modify)
|
|||
} else {
|
||||
|
||||
editing = false;
|
||||
framepos_t pos = 0; /* stupid gcc */
|
||||
samplepos_t pos = 0; /* stupid gcc */
|
||||
|
||||
switch (_mode) {
|
||||
case Timecode:
|
||||
pos = frames_from_timecode_string (edit_string);
|
||||
pos = samples_from_timecode_string (edit_string);
|
||||
break;
|
||||
|
||||
case BBT:
|
||||
if (is_duration) {
|
||||
pos = frame_duration_from_bbt_string (bbt_reference_time, edit_string);
|
||||
pos = sample_duration_from_bbt_string (bbt_reference_time, edit_string);
|
||||
} else {
|
||||
pos = frames_from_bbt_string (0, edit_string);
|
||||
pos = samples_from_bbt_string (0, edit_string);
|
||||
}
|
||||
break;
|
||||
|
||||
case MinSec:
|
||||
pos = frames_from_minsec_string (edit_string);
|
||||
pos = samples_from_minsec_string (edit_string);
|
||||
break;
|
||||
|
||||
case Frames:
|
||||
pos = frames_from_audioframes_string (edit_string);
|
||||
case Samples:
|
||||
pos = samples_from_audioframes_string (edit_string);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -575,10 +575,10 @@ AudioClock::drop_focus ()
|
|||
}
|
||||
}
|
||||
|
||||
framecnt_t
|
||||
AudioClock::parse_as_frames_distance (const std::string& str)
|
||||
samplecnt_t
|
||||
AudioClock::parse_as_samples_distance (const std::string& str)
|
||||
{
|
||||
framecnt_t f;
|
||||
samplecnt_t f;
|
||||
|
||||
if (sscanf (str.c_str(), "%" PRId64, &f) == 1) {
|
||||
return f;
|
||||
|
@ -587,10 +587,10 @@ AudioClock::parse_as_frames_distance (const std::string& str)
|
|||
return 0;
|
||||
}
|
||||
|
||||
framecnt_t
|
||||
samplecnt_t
|
||||
AudioClock::parse_as_minsec_distance (const std::string& str)
|
||||
{
|
||||
framecnt_t sr = _session->frame_rate();
|
||||
samplecnt_t sr = _session->sample_rate();
|
||||
int msecs;
|
||||
int secs;
|
||||
int mins;
|
||||
|
@ -637,12 +637,12 @@ AudioClock::parse_as_minsec_distance (const std::string& str)
|
|||
return 0;
|
||||
}
|
||||
|
||||
framecnt_t
|
||||
samplecnt_t
|
||||
AudioClock::parse_as_timecode_distance (const std::string& str)
|
||||
{
|
||||
double fps = _session->timecode_frames_per_second();
|
||||
framecnt_t sr = _session->frame_rate();
|
||||
int frames;
|
||||
samplecnt_t sr = _session->sample_rate();
|
||||
int samples;
|
||||
int secs;
|
||||
int mins;
|
||||
int hrs;
|
||||
|
@ -652,32 +652,32 @@ AudioClock::parse_as_timecode_distance (const std::string& str)
|
|||
return 0;
|
||||
case 1:
|
||||
case 2:
|
||||
sscanf (str.c_str(), "%" PRId32, &frames);
|
||||
return llrint ((frames/(float)fps) * sr);
|
||||
sscanf (str.c_str(), "%" PRId32, &samples);
|
||||
return llrint ((samples/(float)fps) * sr);
|
||||
|
||||
case 3:
|
||||
sscanf (str.c_str(), "%1" PRId32 "%" PRId32, &secs, &frames);
|
||||
return (secs * sr) + llrint ((frames/(float)fps) * sr);
|
||||
sscanf (str.c_str(), "%1" PRId32 "%" PRId32, &secs, &samples);
|
||||
return (secs * sr) + llrint ((samples/(float)fps) * sr);
|
||||
|
||||
case 4:
|
||||
sscanf (str.c_str(), "%2" PRId32 "%" PRId32, &secs, &frames);
|
||||
return (secs * sr) + llrint ((frames/(float)fps) * sr);
|
||||
sscanf (str.c_str(), "%2" PRId32 "%" PRId32, &secs, &samples);
|
||||
return (secs * sr) + llrint ((samples/(float)fps) * sr);
|
||||
|
||||
case 5:
|
||||
sscanf (str.c_str(), "%1" PRId32 "%2" PRId32 "%" PRId32, &mins, &secs, &frames);
|
||||
return (mins * 60 * sr) + (secs * sr) + llrint ((frames/(float)fps) * sr);
|
||||
sscanf (str.c_str(), "%1" PRId32 "%2" PRId32 "%" PRId32, &mins, &secs, &samples);
|
||||
return (mins * 60 * sr) + (secs * sr) + llrint ((samples/(float)fps) * sr);
|
||||
|
||||
case 6:
|
||||
sscanf (str.c_str(), "%2" PRId32 "%2" PRId32 "%" PRId32, &mins, &secs, &frames);
|
||||
return (mins * 60 * sr) + (secs * sr) + llrint ((frames/(float)fps) * sr);
|
||||
sscanf (str.c_str(), "%2" PRId32 "%2" PRId32 "%" PRId32, &mins, &secs, &samples);
|
||||
return (mins * 60 * sr) + (secs * sr) + llrint ((samples/(float)fps) * sr);
|
||||
|
||||
case 7:
|
||||
sscanf (str.c_str(), "%1" PRId32 "%2" PRId32 "%2" PRId32 "%" PRId32, &hrs, &mins, &secs, &frames);
|
||||
return (hrs * 3600 * sr) + (mins * 60 * sr) + (secs * sr) + llrint ((frames/(float)fps) * sr);
|
||||
sscanf (str.c_str(), "%1" PRId32 "%2" PRId32 "%2" PRId32 "%" PRId32, &hrs, &mins, &secs, &samples);
|
||||
return (hrs * 3600 * sr) + (mins * 60 * sr) + (secs * sr) + llrint ((samples/(float)fps) * sr);
|
||||
|
||||
case 8:
|
||||
sscanf (str.c_str(), "%2" PRId32 "%2" PRId32 "%2" PRId32 "%" PRId32, &hrs, &mins, &secs, &frames);
|
||||
return (hrs * 3600 * sr) + (mins * 60 * sr) + (secs * sr) + llrint ((frames/(float)fps) * sr);
|
||||
sscanf (str.c_str(), "%2" PRId32 "%2" PRId32 "%2" PRId32 "%" PRId32, &hrs, &mins, &secs, &samples);
|
||||
return (hrs * 3600 * sr) + (mins * 60 * sr) + (secs * sr) + llrint ((samples/(float)fps) * sr);
|
||||
|
||||
default:
|
||||
break;
|
||||
|
@ -686,21 +686,21 @@ AudioClock::parse_as_timecode_distance (const std::string& str)
|
|||
return 0;
|
||||
}
|
||||
|
||||
framecnt_t
|
||||
samplecnt_t
|
||||
AudioClock::parse_as_bbt_distance (const std::string&)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
framecnt_t
|
||||
samplecnt_t
|
||||
AudioClock::parse_as_distance (const std::string& instr)
|
||||
{
|
||||
switch (_mode) {
|
||||
case Timecode:
|
||||
return parse_as_timecode_distance (instr);
|
||||
break;
|
||||
case Frames:
|
||||
return parse_as_frames_distance (instr);
|
||||
case Samples:
|
||||
return parse_as_samples_distance (instr);
|
||||
break;
|
||||
case BBT:
|
||||
return parse_as_bbt_distance (instr);
|
||||
|
@ -730,7 +730,7 @@ AudioClock::end_edit_relative (bool add)
|
|||
ok = minsec_validate_edit (edit_string);
|
||||
break;
|
||||
|
||||
case Frames:
|
||||
case Samples:
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -744,21 +744,21 @@ AudioClock::end_edit_relative (bool add)
|
|||
return;
|
||||
}
|
||||
|
||||
framecnt_t frames = parse_as_distance (input_string);
|
||||
samplecnt_t samples = parse_as_distance (input_string);
|
||||
|
||||
editing = false;
|
||||
|
||||
editing = false;
|
||||
_layout->set_attributes (normal_attributes);
|
||||
|
||||
if (frames != 0) {
|
||||
if (samples != 0) {
|
||||
if (add) {
|
||||
set (current_time() + frames, true);
|
||||
set (current_time() + samples, true);
|
||||
} else {
|
||||
framepos_t c = current_time();
|
||||
samplepos_t c = current_time();
|
||||
|
||||
if (c > frames || _negative_allowed) {
|
||||
set (c - frames, true);
|
||||
if (c > samples || _negative_allowed) {
|
||||
set (c - samples, true);
|
||||
} else {
|
||||
set (0, true);
|
||||
}
|
||||
|
@ -794,7 +794,7 @@ AudioClock::session_configuration_changed (std::string p)
|
|||
return;
|
||||
}
|
||||
|
||||
framecnt_t current;
|
||||
samplecnt_t current;
|
||||
|
||||
switch (_mode) {
|
||||
case Timecode:
|
||||
|
@ -811,7 +811,7 @@ AudioClock::session_configuration_changed (std::string p)
|
|||
}
|
||||
|
||||
void
|
||||
AudioClock::set (framepos_t when, bool force, framecnt_t offset)
|
||||
AudioClock::set (samplepos_t when, bool force, samplecnt_t offset)
|
||||
{
|
||||
if ((!force && !is_visible()) || _session == 0) {
|
||||
return;
|
||||
|
@ -866,8 +866,8 @@ AudioClock::set (framepos_t when, bool force, framecnt_t offset)
|
|||
set_minsec (when, force);
|
||||
break;
|
||||
|
||||
case Frames:
|
||||
set_frames (when, force);
|
||||
case Samples:
|
||||
set_samples (when, force);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -970,7 +970,7 @@ AudioClock::set_out_of_bounds (bool negative)
|
|||
}
|
||||
|
||||
void
|
||||
AudioClock::set_frames (framepos_t when, bool /*force*/)
|
||||
AudioClock::set_samples (samplepos_t when, bool /*force*/)
|
||||
{
|
||||
char buf[32];
|
||||
bool negative = false;
|
||||
|
@ -998,7 +998,7 @@ AudioClock::set_frames (framepos_t when, bool /*force*/)
|
|||
}
|
||||
|
||||
if (_with_info) {
|
||||
framecnt_t rate = _session->frame_rate();
|
||||
samplecnt_t rate = _session->sample_rate();
|
||||
|
||||
if (fmod (rate, 100.0) == 0.0) {
|
||||
sprintf (buf, "%.1fkHz", rate/1000.0);
|
||||
|
@ -1020,9 +1020,9 @@ AudioClock::set_frames (framepos_t when, bool /*force*/)
|
|||
}
|
||||
|
||||
void
|
||||
AudioClock::print_minsec (framepos_t when, char* buf, size_t bufsize, float frame_rate)
|
||||
AudioClock::print_minsec (samplepos_t when, char* buf, size_t bufsize, float sample_rate)
|
||||
{
|
||||
framecnt_t left;
|
||||
samplecnt_t left;
|
||||
int hrs;
|
||||
int mins;
|
||||
int secs;
|
||||
|
@ -1037,13 +1037,13 @@ AudioClock::print_minsec (framepos_t when, char* buf, size_t bufsize, float fram
|
|||
}
|
||||
|
||||
left = when;
|
||||
hrs = (int) floor (left / (frame_rate * 60.0f * 60.0f));
|
||||
left -= (framecnt_t) floor (hrs * frame_rate * 60.0f * 60.0f);
|
||||
mins = (int) floor (left / (frame_rate * 60.0f));
|
||||
left -= (framecnt_t) floor (mins * frame_rate * 60.0f);
|
||||
secs = (int) floor (left / (float) frame_rate);
|
||||
left -= (framecnt_t) floor ((double)(secs * frame_rate));
|
||||
millisecs = floor (left * 1000.0 / (float) frame_rate);
|
||||
hrs = (int) floor (left / (sample_rate * 60.0f * 60.0f));
|
||||
left -= (samplecnt_t) floor (hrs * sample_rate * 60.0f * 60.0f);
|
||||
mins = (int) floor (left / (sample_rate * 60.0f));
|
||||
left -= (samplecnt_t) floor (mins * sample_rate * 60.0f);
|
||||
secs = (int) floor (left / (float) sample_rate);
|
||||
left -= (samplecnt_t) floor ((double)(secs * sample_rate));
|
||||
millisecs = floor (left * 1000.0 / (float) sample_rate);
|
||||
|
||||
if (negative) {
|
||||
snprintf (buf, bufsize, "-%02" PRId32 ":%02" PRId32 ":%02" PRId32 ".%03" PRId32, hrs, mins, secs, millisecs);
|
||||
|
@ -1054,7 +1054,7 @@ AudioClock::print_minsec (framepos_t when, char* buf, size_t bufsize, float fram
|
|||
}
|
||||
|
||||
void
|
||||
AudioClock::set_minsec (framepos_t when, bool /*force*/)
|
||||
AudioClock::set_minsec (samplepos_t when, bool /*force*/)
|
||||
{
|
||||
char buf[32];
|
||||
|
||||
|
@ -1069,7 +1069,7 @@ AudioClock::set_minsec (framepos_t when, bool /*force*/)
|
|||
if (when >= _limit_pos || when <= -_limit_pos) {
|
||||
set_out_of_bounds (when < 0);
|
||||
} else {
|
||||
print_minsec (when, buf, sizeof (buf), _session->frame_rate());
|
||||
print_minsec (when, buf, sizeof (buf), _session->sample_rate());
|
||||
_layout->set_text (buf);
|
||||
}
|
||||
|
||||
|
@ -1077,7 +1077,7 @@ AudioClock::set_minsec (framepos_t when, bool /*force*/)
|
|||
}
|
||||
|
||||
void
|
||||
AudioClock::set_timecode (framepos_t when, bool /*force*/)
|
||||
AudioClock::set_timecode (samplepos_t when, bool /*force*/)
|
||||
{
|
||||
Timecode::Time TC;
|
||||
bool negative = false;
|
||||
|
@ -1113,7 +1113,7 @@ AudioClock::set_timecode (framepos_t when, bool /*force*/)
|
|||
}
|
||||
|
||||
void
|
||||
AudioClock::set_bbt (framepos_t when, framecnt_t offset, bool /*force*/)
|
||||
AudioClock::set_bbt (samplepos_t when, samplecnt_t offset, bool /*force*/)
|
||||
{
|
||||
char buf[64];
|
||||
Timecode::BBT_Time BBT;
|
||||
|
@ -1144,15 +1144,15 @@ AudioClock::set_bbt (framepos_t when, framecnt_t offset, bool /*force*/)
|
|||
offset = bbt_reference_time;
|
||||
}
|
||||
|
||||
const double divisions = tmap.meter_section_at_frame (offset).divisions_per_bar();
|
||||
const double divisions = tmap.meter_section_at_sample (offset).divisions_per_bar();
|
||||
Timecode::BBT_Time sub_bbt;
|
||||
|
||||
if (negative) {
|
||||
BBT = tmap.bbt_at_beat (tmap.beat_at_frame (offset));
|
||||
sub_bbt = tmap.bbt_at_frame (offset - when);
|
||||
BBT = tmap.bbt_at_beat (tmap.beat_at_sample (offset));
|
||||
sub_bbt = tmap.bbt_at_sample (offset - when);
|
||||
} else {
|
||||
BBT = tmap.bbt_at_beat (tmap.beat_at_frame (when + offset));
|
||||
sub_bbt = tmap.bbt_at_frame (offset);
|
||||
BBT = tmap.bbt_at_beat (tmap.beat_at_sample (when + offset));
|
||||
sub_bbt = tmap.bbt_at_sample (offset);
|
||||
}
|
||||
|
||||
BBT.bars -= sub_bbt.bars;
|
||||
|
@ -1177,7 +1177,7 @@ AudioClock::set_bbt (framepos_t when, framecnt_t offset, bool /*force*/)
|
|||
}
|
||||
}
|
||||
} else {
|
||||
BBT = _session->tempo_map().bbt_at_frame (when);
|
||||
BBT = _session->tempo_map().bbt_at_sample (when);
|
||||
}
|
||||
|
||||
if (negative) {
|
||||
|
@ -1191,7 +1191,7 @@ AudioClock::set_bbt (framepos_t when, framecnt_t offset, bool /*force*/)
|
|||
_layout->set_text (buf);
|
||||
|
||||
if (_with_info) {
|
||||
framepos_t pos;
|
||||
samplepos_t pos;
|
||||
|
||||
if (bbt_reference_time < 0) {
|
||||
pos = when;
|
||||
|
@ -1202,13 +1202,13 @@ AudioClock::set_bbt (framepos_t when, framecnt_t offset, bool /*force*/)
|
|||
TempoMetric m (_session->tempo_map().metric_at (pos));
|
||||
|
||||
if (m.tempo().note_type() == 4) {
|
||||
snprintf (buf, sizeof(buf), "\u2669 = %.3f", _session->tempo_map().tempo_at_frame (pos).note_types_per_minute());
|
||||
snprintf (buf, sizeof(buf), "\u2669 = %.3f", _session->tempo_map().tempo_at_sample (pos).note_types_per_minute());
|
||||
_left_btn.set_text (string_compose ("%1", buf), true);
|
||||
} else if (m.tempo().note_type() == 8) {
|
||||
snprintf (buf, sizeof(buf), "\u266a = %.3f", _session->tempo_map().tempo_at_frame (pos).note_types_per_minute());
|
||||
snprintf (buf, sizeof(buf), "\u266a = %.3f", _session->tempo_map().tempo_at_sample (pos).note_types_per_minute());
|
||||
_left_btn.set_text (string_compose ("%1", buf), true);
|
||||
} else {
|
||||
snprintf (buf, sizeof(buf), "%.1f = %.3f", m.tempo().note_type(), _session->tempo_map().tempo_at_frame (pos).note_types_per_minute());
|
||||
snprintf (buf, sizeof(buf), "%.1f = %.3f", m.tempo().note_type(), _session->tempo_map().tempo_at_sample (pos).note_types_per_minute());
|
||||
_left_btn.set_text (string_compose ("%1: %2", S_("Tempo|T"), buf), true);
|
||||
}
|
||||
|
||||
|
@ -1226,7 +1226,7 @@ AudioClock::set_session (Session *s)
|
|||
|
||||
int64_t limit_sec = UIConfiguration::instance().get_clock_display_limit ();
|
||||
if (limit_sec > 0) {
|
||||
_limit_pos = (framecnt_t) floor ((double)(limit_sec * _session->frame_rate()));
|
||||
_limit_pos = (samplecnt_t) floor ((double)(limit_sec * _session->sample_rate()));
|
||||
}
|
||||
|
||||
Config->ParameterChanged.connect (_session_connections, invalidator (*this), boost::bind (&AudioClock::session_configuration_changed, this, _1), gui_context());
|
||||
|
@ -1268,7 +1268,7 @@ AudioClock::on_key_press_event (GdkEventKey* ev)
|
|||
string new_text;
|
||||
char new_char = 0;
|
||||
int highlight_length;
|
||||
framepos_t pos;
|
||||
samplepos_t pos;
|
||||
|
||||
switch (ev->keyval) {
|
||||
case GDK_0:
|
||||
|
@ -1368,7 +1368,7 @@ AudioClock::on_key_press_event (GdkEventKey* ev)
|
|||
use_input_string:
|
||||
|
||||
switch (_mode) {
|
||||
case Frames:
|
||||
case Samples:
|
||||
/* get this one in the right order, and to the right width */
|
||||
if (ev->keyval == GDK_Delete || ev->keyval == GDK_BackSpace) {
|
||||
edit_string = edit_string.substr (0, edit_string.length() - 1);
|
||||
|
@ -1487,7 +1487,7 @@ AudioClock::index_to_field (int index) const
|
|||
} else if (index < 10) {
|
||||
return Timecode_Seconds;
|
||||
} else {
|
||||
return Timecode_Frames;
|
||||
return Timecode_frames;
|
||||
}
|
||||
break;
|
||||
case BBT:
|
||||
|
@ -1510,8 +1510,8 @@ AudioClock::index_to_field (int index) const
|
|||
return MS_Milliseconds;
|
||||
}
|
||||
break;
|
||||
case Frames:
|
||||
return AudioFrames;
|
||||
case Samples:
|
||||
return S_Samples;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1601,7 +1601,7 @@ AudioClock::on_button_release_event (GdkEventButton *ev)
|
|||
f = index_to_field (index);
|
||||
|
||||
switch (f) {
|
||||
case Timecode_Frames:
|
||||
case Timecode_frames:
|
||||
case MS_Milliseconds:
|
||||
case Ticks:
|
||||
f = Field (0);
|
||||
|
@ -1668,32 +1668,32 @@ AudioClock::on_scroll_event (GdkEventScroll *ev)
|
|||
}
|
||||
|
||||
Field f = index_to_field (index);
|
||||
framepos_t frames = 0;
|
||||
samplepos_t samples = 0;
|
||||
|
||||
switch (ev->direction) {
|
||||
|
||||
case GDK_SCROLL_UP:
|
||||
frames = get_frame_step (f, current_time(), 1);
|
||||
if (frames != 0) {
|
||||
samples = get_sample_step (f, current_time(), 1);
|
||||
if (samples != 0) {
|
||||
if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
|
||||
frames *= 10;
|
||||
samples *= 10;
|
||||
}
|
||||
set (current_time() + frames, true);
|
||||
set (current_time() + samples, true);
|
||||
ValueChanged (); /* EMIT_SIGNAL */
|
||||
}
|
||||
break;
|
||||
|
||||
case GDK_SCROLL_DOWN:
|
||||
frames = get_frame_step (f, current_time(), -1);
|
||||
if (frames != 0) {
|
||||
samples = get_sample_step (f, current_time(), -1);
|
||||
if (samples != 0) {
|
||||
if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
|
||||
frames *= 10;
|
||||
samples *= 10;
|
||||
}
|
||||
|
||||
if (!_negative_allowed && (double)current_time() - (double)frames < 0.0) {
|
||||
if (!_negative_allowed && (double)current_time() - (double)samples < 0.0) {
|
||||
set (0, true);
|
||||
} else {
|
||||
set (current_time() - frames, true);
|
||||
set (current_time() - samples, true);
|
||||
}
|
||||
|
||||
ValueChanged (); /* EMIT_SIGNAL */
|
||||
|
@ -1715,35 +1715,35 @@ AudioClock::on_motion_notify_event (GdkEventMotion *ev)
|
|||
return false;
|
||||
}
|
||||
|
||||
float pixel_frame_scale_factor = 0.2f;
|
||||
float pixel_sample_scale_factor = 0.2f;
|
||||
|
||||
if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
|
||||
pixel_frame_scale_factor = 0.1f;
|
||||
pixel_sample_scale_factor = 0.1f;
|
||||
}
|
||||
|
||||
|
||||
if (Keyboard::modifier_state_contains (ev->state,
|
||||
Keyboard::PrimaryModifier|Keyboard::SecondaryModifier)) {
|
||||
pixel_frame_scale_factor = 0.025f;
|
||||
pixel_sample_scale_factor = 0.025f;
|
||||
}
|
||||
|
||||
double y_delta = ev->y - drag_y;
|
||||
|
||||
drag_accum += y_delta*pixel_frame_scale_factor;
|
||||
drag_accum += y_delta*pixel_sample_scale_factor;
|
||||
|
||||
drag_y = ev->y;
|
||||
|
||||
if (floor (drag_accum) != 0) {
|
||||
|
||||
framepos_t frames;
|
||||
framepos_t pos;
|
||||
samplepos_t samples;
|
||||
samplepos_t pos;
|
||||
int dir;
|
||||
dir = (drag_accum < 0 ? 1:-1);
|
||||
pos = current_time();
|
||||
frames = get_frame_step (drag_field, pos, dir);
|
||||
samples = get_sample_step (drag_field, pos, dir);
|
||||
|
||||
if (frames != 0 && frames * drag_accum < current_time()) {
|
||||
set ((framepos_t) floor (pos - drag_accum * frames), false); // minus because up is negative in GTK
|
||||
if (samples != 0 && samples * drag_accum < current_time()) {
|
||||
set ((samplepos_t) floor (pos - drag_accum * samples), false); // minus because up is negative in GTK
|
||||
} else {
|
||||
set (0 , false);
|
||||
}
|
||||
|
@ -1755,40 +1755,40 @@ AudioClock::on_motion_notify_event (GdkEventMotion *ev)
|
|||
return true;
|
||||
}
|
||||
|
||||
framepos_t
|
||||
AudioClock::get_frame_step (Field field, framepos_t pos, int dir)
|
||||
samplepos_t
|
||||
AudioClock::get_sample_step (Field field, samplepos_t pos, int dir)
|
||||
{
|
||||
framecnt_t f = 0;
|
||||
samplecnt_t f = 0;
|
||||
Timecode::BBT_Time BBT;
|
||||
switch (field) {
|
||||
case Timecode_Hours:
|
||||
f = (framecnt_t) floor (3600.0 * _session->frame_rate());
|
||||
f = (samplecnt_t) floor (3600.0 * _session->sample_rate());
|
||||
break;
|
||||
case Timecode_Minutes:
|
||||
f = (framecnt_t) floor (60.0 * _session->frame_rate());
|
||||
f = (samplecnt_t) floor (60.0 * _session->sample_rate());
|
||||
break;
|
||||
case Timecode_Seconds:
|
||||
f = _session->frame_rate();
|
||||
f = _session->sample_rate();
|
||||
break;
|
||||
case Timecode_Frames:
|
||||
f = (framecnt_t) floor (_session->frame_rate() / _session->timecode_frames_per_second());
|
||||
case Timecode_frames:
|
||||
f = (samplecnt_t) floor (_session->sample_rate() / _session->timecode_frames_per_second());
|
||||
break;
|
||||
|
||||
case AudioFrames:
|
||||
case S_Samples:
|
||||
f = 1;
|
||||
break;
|
||||
|
||||
case MS_Hours:
|
||||
f = (framecnt_t) floor (3600.0 * _session->frame_rate());
|
||||
f = (samplecnt_t) floor (3600.0 * _session->sample_rate());
|
||||
break;
|
||||
case MS_Minutes:
|
||||
f = (framecnt_t) floor (60.0 * _session->frame_rate());
|
||||
f = (samplecnt_t) floor (60.0 * _session->sample_rate());
|
||||
break;
|
||||
case MS_Seconds:
|
||||
f = (framecnt_t) _session->frame_rate();
|
||||
f = (samplecnt_t) _session->sample_rate();
|
||||
break;
|
||||
case MS_Milliseconds:
|
||||
f = (framecnt_t) floor (_session->frame_rate() / 1000.0);
|
||||
f = (samplecnt_t) floor (_session->sample_rate() / 1000.0);
|
||||
break;
|
||||
|
||||
case Bars:
|
||||
|
@ -1810,7 +1810,7 @@ AudioClock::get_frame_step (Field field, framepos_t pos, int dir)
|
|||
f = _session->tempo_map().bbt_duration_at(pos,BBT,dir);
|
||||
break;
|
||||
default:
|
||||
error << string_compose (_("programming error: %1"), "attempt to get frames from non-text field!") << endmsg;
|
||||
error << string_compose (_("programming error: %1"), "attempt to get samples from non-text field!") << endmsg;
|
||||
f = 0;
|
||||
break;
|
||||
}
|
||||
|
@ -1818,30 +1818,30 @@ AudioClock::get_frame_step (Field field, framepos_t pos, int dir)
|
|||
return f;
|
||||
}
|
||||
|
||||
framepos_t
|
||||
AudioClock::current_time (framepos_t) const
|
||||
samplepos_t
|
||||
AudioClock::current_time (samplepos_t) const
|
||||
{
|
||||
return last_when;
|
||||
}
|
||||
|
||||
framepos_t
|
||||
AudioClock::current_duration (framepos_t pos) const
|
||||
samplepos_t
|
||||
AudioClock::current_duration (samplepos_t pos) const
|
||||
{
|
||||
framepos_t ret = 0;
|
||||
samplepos_t ret = 0;
|
||||
|
||||
switch (_mode) {
|
||||
case Timecode:
|
||||
ret = last_when;
|
||||
break;
|
||||
case BBT:
|
||||
ret = frame_duration_from_bbt_string (pos, _layout->get_text());
|
||||
ret = sample_duration_from_bbt_string (pos, _layout->get_text());
|
||||
break;
|
||||
|
||||
case MinSec:
|
||||
ret = last_when;
|
||||
break;
|
||||
|
||||
case Frames:
|
||||
case Samples:
|
||||
ret = last_when;
|
||||
break;
|
||||
}
|
||||
|
@ -1930,15 +1930,15 @@ AudioClock::minsec_validate_edit (const string& str)
|
|||
return true;
|
||||
}
|
||||
|
||||
framepos_t
|
||||
AudioClock::frames_from_timecode_string (const string& str) const
|
||||
samplepos_t
|
||||
AudioClock::samples_from_timecode_string (const string& str) const
|
||||
{
|
||||
if (_session == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
Timecode::Time TC;
|
||||
framepos_t sample;
|
||||
samplepos_t sample;
|
||||
char ignored[2];
|
||||
int hours;
|
||||
|
||||
|
@ -1960,26 +1960,26 @@ AudioClock::frames_from_timecode_string (const string& str) const
|
|||
return sample;
|
||||
}
|
||||
|
||||
framepos_t
|
||||
AudioClock::frames_from_minsec_string (const string& str) const
|
||||
samplepos_t
|
||||
AudioClock::samples_from_minsec_string (const string& str) const
|
||||
{
|
||||
if (_session == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int hrs, mins, secs, millisecs;
|
||||
framecnt_t sr = _session->frame_rate();
|
||||
samplecnt_t sr = _session->sample_rate();
|
||||
|
||||
if (sscanf (str.c_str(), "%d:%d:%d.%d", &hrs, &mins, &secs, &millisecs) != 4) {
|
||||
error << string_compose (_("programming error: %1 %2"), "badly formatted minsec clock string", str) << endmsg;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return (framepos_t) floor ((hrs * 60.0f * 60.0f * sr) + (mins * 60.0f * sr) + (secs * sr) + (millisecs * sr / 1000.0));
|
||||
return (samplepos_t) floor ((hrs * 60.0f * 60.0f * sr) + (mins * 60.0f * sr) + (secs * sr) + (millisecs * sr / 1000.0));
|
||||
}
|
||||
|
||||
framepos_t
|
||||
AudioClock::frames_from_bbt_string (framepos_t pos, const string& str) const
|
||||
samplepos_t
|
||||
AudioClock::samples_from_bbt_string (samplepos_t pos, const string& str) const
|
||||
{
|
||||
if (_session == 0) {
|
||||
error << "AudioClock::current_time() called with BBT mode but without session!" << endmsg;
|
||||
|
@ -1996,18 +1996,18 @@ AudioClock::frames_from_bbt_string (framepos_t pos, const string& str) const
|
|||
if (is_duration) {
|
||||
any.bbt.bars++;
|
||||
any.bbt.beats++;
|
||||
return _session->any_duration_to_frames (pos, any);
|
||||
return _session->any_duration_to_samples (pos, any);
|
||||
} else {
|
||||
return _session->convert_to_frames (any);
|
||||
return _session->convert_to_samples (any);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
framepos_t
|
||||
AudioClock::frame_duration_from_bbt_string (framepos_t pos, const string& str) const
|
||||
samplepos_t
|
||||
AudioClock::sample_duration_from_bbt_string (samplepos_t pos, const string& str) const
|
||||
{
|
||||
if (_session == 0) {
|
||||
error << "AudioClock::frame_duration_from_bbt_string() called with BBT mode but without session!" << endmsg;
|
||||
error << "AudioClock::sample_duration_from_bbt_string() called with BBT mode but without session!" << endmsg;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -2020,10 +2020,10 @@ AudioClock::frame_duration_from_bbt_string (framepos_t pos, const string& str) c
|
|||
return _session->tempo_map().bbt_duration_at(pos,bbt,1);
|
||||
}
|
||||
|
||||
framepos_t
|
||||
AudioClock::frames_from_audioframes_string (const string& str) const
|
||||
samplepos_t
|
||||
AudioClock::samples_from_audioframes_string (const string& str) const
|
||||
{
|
||||
framepos_t f;
|
||||
samplepos_t f;
|
||||
sscanf (str.c_str(), "%" PRId64, &f);
|
||||
return f;
|
||||
}
|
||||
|
@ -2057,7 +2057,7 @@ AudioClock::build_ops_menu ()
|
|||
ops_items.push_back (MenuElem (_("Timecode"), sigc::bind (sigc::mem_fun(*this, &AudioClock::set_mode), Timecode, false)));
|
||||
ops_items.push_back (MenuElem (_("Bars:Beats"), sigc::bind (sigc::mem_fun(*this, &AudioClock::set_mode), BBT, false)));
|
||||
ops_items.push_back (MenuElem (_("Minutes:Seconds"), sigc::bind (sigc::mem_fun(*this, &AudioClock::set_mode), MinSec, false)));
|
||||
ops_items.push_back (MenuElem (_("Samples"), sigc::bind (sigc::mem_fun(*this, &AudioClock::set_mode), Frames, false)));
|
||||
ops_items.push_back (MenuElem (_("Samples"), sigc::bind (sigc::mem_fun(*this, &AudioClock::set_mode), Samples, false)));
|
||||
|
||||
if (editable && !_off && !is_duration && !_follows_playhead) {
|
||||
ops_items.push_back (SeparatorElem());
|
||||
|
@ -2075,7 +2075,7 @@ AudioClock::set_from_playhead ()
|
|||
return;
|
||||
}
|
||||
|
||||
set (_session->transport_frame());
|
||||
set (_session->transport_sample());
|
||||
ValueChanged ();
|
||||
}
|
||||
|
||||
|
@ -2141,7 +2141,7 @@ AudioClock::set_mode (Mode m, bool noemit)
|
|||
insert_map.push_back (1);
|
||||
break;
|
||||
|
||||
case Frames:
|
||||
case Samples:
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -2155,7 +2155,7 @@ AudioClock::set_mode (Mode m, bool noemit)
|
|||
}
|
||||
|
||||
void
|
||||
AudioClock::set_bbt_reference (framepos_t pos)
|
||||
AudioClock::set_bbt_reference (samplepos_t pos)
|
||||
{
|
||||
bbt_reference_time = pos;
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ class AudioClock : public CairoWidget, public ARDOUR::SessionHandlePtr
|
|||
Timecode,
|
||||
BBT,
|
||||
MinSec,
|
||||
Frames
|
||||
Samples
|
||||
};
|
||||
|
||||
AudioClock (const std::string& clock_name, bool is_transient, const std::string& widget_name,
|
||||
|
@ -66,19 +66,19 @@ class AudioClock : public CairoWidget, public ARDOUR::SessionHandlePtr
|
|||
|
||||
void focus ();
|
||||
|
||||
void set (framepos_t, bool force = false, ARDOUR::framecnt_t offset = 0);
|
||||
void set (samplepos_t, bool force = false, ARDOUR::samplecnt_t offset = 0);
|
||||
void set_from_playhead ();
|
||||
void locate ();
|
||||
void set_mode (Mode, bool noemit = false);
|
||||
void set_bbt_reference (framepos_t);
|
||||
void set_bbt_reference (samplepos_t);
|
||||
void set_is_duration (bool);
|
||||
|
||||
void copy_text_to_clipboard () const;
|
||||
|
||||
std::string name() const { return _name; }
|
||||
|
||||
framepos_t current_time (framepos_t position = 0) const;
|
||||
framepos_t current_duration (framepos_t position = 0) const;
|
||||
samplepos_t current_time (samplepos_t position = 0) const;
|
||||
samplepos_t current_duration (samplepos_t position = 0) const;
|
||||
void set_session (ARDOUR::Session *s);
|
||||
void set_negative_allowed (bool yn);
|
||||
|
||||
|
@ -93,7 +93,7 @@ class AudioClock : public CairoWidget, public ARDOUR::SessionHandlePtr
|
|||
*/
|
||||
void set_scale (double x, double y);
|
||||
|
||||
static void print_minsec (framepos_t, char* buf, size_t bufsize, float frame_rate);
|
||||
static void print_minsec (samplepos_t, char* buf, size_t bufsize, float sample_rate);
|
||||
|
||||
sigc::signal<void> ValueChanged;
|
||||
sigc::signal<void> mode_changed;
|
||||
|
@ -130,7 +130,7 @@ class AudioClock : public CairoWidget, public ARDOUR::SessionHandlePtr
|
|||
bool _negative_allowed;
|
||||
bool edit_is_negative;
|
||||
|
||||
framepos_t _limit_pos;
|
||||
samplepos_t _limit_pos;
|
||||
|
||||
Glib::RefPtr<Pango::Layout> _layout;
|
||||
|
||||
|
@ -158,7 +158,7 @@ class AudioClock : public CairoWidget, public ARDOUR::SessionHandlePtr
|
|||
Timecode_Hours = 1,
|
||||
Timecode_Minutes,
|
||||
Timecode_Seconds,
|
||||
Timecode_Frames,
|
||||
Timecode_frames,
|
||||
MS_Hours,
|
||||
MS_Minutes,
|
||||
MS_Seconds,
|
||||
|
@ -166,7 +166,7 @@ class AudioClock : public CairoWidget, public ARDOUR::SessionHandlePtr
|
|||
Bars,
|
||||
Beats,
|
||||
Ticks,
|
||||
AudioFrames,
|
||||
S_Samples,
|
||||
};
|
||||
|
||||
Field index_to_field (int index) const;
|
||||
|
@ -184,8 +184,8 @@ class AudioClock : public CairoWidget, public ARDOUR::SessionHandlePtr
|
|||
std::string pre_edit_string;
|
||||
std::string input_string;
|
||||
|
||||
framepos_t bbt_reference_time;
|
||||
framepos_t last_when;
|
||||
samplepos_t bbt_reference_time;
|
||||
samplepos_t last_when;
|
||||
bool last_pdelta;
|
||||
bool last_sdelta;
|
||||
|
||||
|
@ -205,25 +205,25 @@ class AudioClock : public CairoWidget, public ARDOUR::SessionHandlePtr
|
|||
bool on_focus_out_event (GdkEventFocus*);
|
||||
|
||||
void set_slave_info ();
|
||||
void set_timecode (framepos_t, bool);
|
||||
void set_bbt (framepos_t, ARDOUR::framecnt_t, bool);
|
||||
void set_minsec (framepos_t, bool);
|
||||
void set_frames (framepos_t, bool);
|
||||
void set_timecode (samplepos_t, bool);
|
||||
void set_bbt (samplepos_t, ARDOUR::samplecnt_t, bool);
|
||||
void set_minsec (samplepos_t, bool);
|
||||
void set_samples (samplepos_t, bool);
|
||||
void set_out_of_bounds (bool negative);
|
||||
|
||||
void set_clock_dimensions (Gtk::Requisition&);
|
||||
|
||||
framepos_t get_frame_step (Field, framepos_t pos = 0, int dir = 1);
|
||||
samplepos_t get_sample_step (Field, samplepos_t pos = 0, int dir = 1);
|
||||
|
||||
bool timecode_validate_edit (const std::string&);
|
||||
bool bbt_validate_edit (const std::string&);
|
||||
bool minsec_validate_edit (const std::string&);
|
||||
|
||||
framepos_t frames_from_timecode_string (const std::string&) const;
|
||||
framepos_t frames_from_bbt_string (framepos_t, const std::string&) const;
|
||||
framepos_t frame_duration_from_bbt_string (framepos_t, const std::string&) const;
|
||||
framepos_t frames_from_minsec_string (const std::string&) const;
|
||||
framepos_t frames_from_audioframes_string (const std::string&) const;
|
||||
samplepos_t samples_from_timecode_string (const std::string&) const;
|
||||
samplepos_t samples_from_bbt_string (samplepos_t, const std::string&) const;
|
||||
samplepos_t sample_duration_from_bbt_string (samplepos_t, const std::string&) const;
|
||||
samplepos_t samples_from_minsec_string (const std::string&) const;
|
||||
samplepos_t samples_from_audioframes_string (const std::string&) const;
|
||||
|
||||
void session_configuration_changed (std::string);
|
||||
void session_property_changed (const PBD::PropertyChange&);
|
||||
|
@ -234,12 +234,12 @@ class AudioClock : public CairoWidget, public ARDOUR::SessionHandlePtr
|
|||
void end_edit (bool);
|
||||
void end_edit_relative (bool);
|
||||
void edit_next_field ();
|
||||
ARDOUR::framecnt_t parse_as_distance (const std::string&);
|
||||
ARDOUR::samplecnt_t parse_as_distance (const std::string&);
|
||||
|
||||
ARDOUR::framecnt_t parse_as_timecode_distance (const std::string&);
|
||||
ARDOUR::framecnt_t parse_as_minsec_distance (const std::string&);
|
||||
ARDOUR::framecnt_t parse_as_bbt_distance (const std::string&);
|
||||
ARDOUR::framecnt_t parse_as_frames_distance (const std::string&);
|
||||
ARDOUR::samplecnt_t parse_as_timecode_distance (const std::string&);
|
||||
ARDOUR::samplecnt_t parse_as_minsec_distance (const std::string&);
|
||||
ARDOUR::samplecnt_t parse_as_bbt_distance (const std::string&);
|
||||
ARDOUR::samplecnt_t parse_as_samples_distance (const std::string&);
|
||||
|
||||
void set_font (Pango::FontDescription);
|
||||
void set_colors ();
|
||||
|
|
|
@ -292,7 +292,7 @@ AudioRegionView::~AudioRegionView ()
|
|||
}
|
||||
_data_ready_connections.clear ();
|
||||
|
||||
for (list<std::pair<framepos_t, ArdourCanvas::Line*> >::iterator i = feature_lines.begin(); i != feature_lines.end(); ++i) {
|
||||
for (list<std::pair<samplepos_t, ArdourCanvas::Line*> >::iterator i = feature_lines.begin(); i != feature_lines.end(); ++i) {
|
||||
delete ((*i).second);
|
||||
}
|
||||
|
||||
|
@ -389,7 +389,7 @@ AudioRegionView::region_renamed ()
|
|||
{
|
||||
std::string str = RegionView::make_name ();
|
||||
|
||||
if (audio_region()->speed_mismatch (trackview.session()->frame_rate())) {
|
||||
if (audio_region()->speed_mismatch (trackview.session()->sample_rate())) {
|
||||
str = string ("*") + str;
|
||||
}
|
||||
|
||||
|
@ -436,9 +436,9 @@ AudioRegionView::region_resized (const PropertyChange& what_changed)
|
|||
}
|
||||
|
||||
/* hide transient lines that extend beyond the region */
|
||||
list<std::pair<framepos_t, ArdourCanvas::Line*> >::iterator l;
|
||||
framepos_t first = _region->first_frame();
|
||||
framepos_t last = _region->last_frame();
|
||||
list<std::pair<samplepos_t, ArdourCanvas::Line*> >::iterator l;
|
||||
samplepos_t first = _region->first_sample();
|
||||
samplepos_t last = _region->last_sample();
|
||||
|
||||
for (l = feature_lines.begin(); l != feature_lines.end(); ++l) {
|
||||
if (l->first < first || l->first >= last) {
|
||||
|
@ -483,10 +483,10 @@ AudioRegionView::reset_width_dependent_items (double pixel_width)
|
|||
return;
|
||||
}
|
||||
|
||||
framepos_t position = _region->position();
|
||||
samplepos_t position = _region->position();
|
||||
|
||||
AnalysisFeatureList::const_iterator i;
|
||||
list<std::pair<framepos_t, ArdourCanvas::Line*> >::iterator l;
|
||||
list<std::pair<samplepos_t, ArdourCanvas::Line*> >::iterator l;
|
||||
double y1;
|
||||
if (_height >= NAME_HIGHLIGHT_THRESH) {
|
||||
y1 = _height - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 1;
|
||||
|
@ -580,8 +580,8 @@ AudioRegionView::set_height (gdouble height)
|
|||
reset_fade_shapes ();
|
||||
|
||||
/* Update heights for any feature lines */
|
||||
framepos_t position = _region->position();
|
||||
list<std::pair<framepos_t, ArdourCanvas::Line*> >::iterator l;
|
||||
samplepos_t position = _region->position();
|
||||
list<std::pair<samplepos_t, ArdourCanvas::Line*> >::iterator l;
|
||||
double y1;
|
||||
if (_height >= NAME_HIGHLIGHT_THRESH) {
|
||||
y1 = _height - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 1;
|
||||
|
@ -611,20 +611,20 @@ AudioRegionView::reset_fade_shapes ()
|
|||
void
|
||||
AudioRegionView::reset_fade_in_shape ()
|
||||
{
|
||||
reset_fade_in_shape_width (audio_region(), (framecnt_t) audio_region()->fade_in()->back()->when);
|
||||
reset_fade_in_shape_width (audio_region(), (samplecnt_t) audio_region()->fade_in()->back()->when);
|
||||
}
|
||||
|
||||
void
|
||||
AudioRegionView::reset_fade_in_shape_width (boost::shared_ptr<AudioRegion> ar, framecnt_t width, bool drag_active)
|
||||
AudioRegionView::reset_fade_in_shape_width (boost::shared_ptr<AudioRegion> ar, samplecnt_t width, bool drag_active)
|
||||
{
|
||||
trim_fade_in_drag_active = drag_active;
|
||||
if (fade_in_handle == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* smallest size for a fade is 64 frames */
|
||||
/* smallest size for a fade is 64 samples */
|
||||
|
||||
width = std::max ((framecnt_t) 64, width);
|
||||
width = std::max ((samplecnt_t) 64, width);
|
||||
|
||||
/* round here to prevent little visual glitches with sub-pixel placement */
|
||||
double const pwidth = floor (width / samples_per_pixel);
|
||||
|
@ -682,33 +682,33 @@ AudioRegionView::reset_fade_in_shape_width (boost::shared_ptr<AudioRegion> ar, f
|
|||
redraw_start_xfade_to (ar, width, points, effective_height, handle_left);
|
||||
|
||||
/* ensure trim handle stays on top */
|
||||
if (frame_handle_start) {
|
||||
frame_handle_start->raise_to_top();
|
||||
if (sample_handle_start) {
|
||||
sample_handle_start->raise_to_top();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
AudioRegionView::reset_fade_out_shape ()
|
||||
{
|
||||
reset_fade_out_shape_width (audio_region(), (framecnt_t) audio_region()->fade_out()->back()->when);
|
||||
reset_fade_out_shape_width (audio_region(), (samplecnt_t) audio_region()->fade_out()->back()->when);
|
||||
}
|
||||
|
||||
void
|
||||
AudioRegionView::reset_fade_out_shape_width (boost::shared_ptr<AudioRegion> ar, framecnt_t width, bool drag_active)
|
||||
AudioRegionView::reset_fade_out_shape_width (boost::shared_ptr<AudioRegion> ar, samplecnt_t width, bool drag_active)
|
||||
{
|
||||
trim_fade_out_drag_active = drag_active;
|
||||
if (fade_out_handle == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* smallest size for a fade is 64 frames */
|
||||
/* smallest size for a fade is 64 samples */
|
||||
|
||||
width = std::max ((framecnt_t) 64, width);
|
||||
width = std::max ((samplecnt_t) 64, width);
|
||||
|
||||
|
||||
double const pwidth = floor(trackview.editor().sample_to_pixel (width));
|
||||
|
||||
/* the right edge should be right on the region frame is the pixel
|
||||
/* the right edge should be right on the region sample is the pixel
|
||||
* width is zero. Hence the additional + 1.0 at the end.
|
||||
*/
|
||||
|
||||
|
@ -768,18 +768,18 @@ AudioRegionView::reset_fade_out_shape_width (boost::shared_ptr<AudioRegion> ar,
|
|||
redraw_end_xfade_to (ar, width, points, effective_height, handle_right, pwidth);
|
||||
|
||||
/* ensure trim handle stays on top */
|
||||
if (frame_handle_end) {
|
||||
frame_handle_end->raise_to_top();
|
||||
if (sample_handle_end) {
|
||||
sample_handle_end->raise_to_top();
|
||||
}
|
||||
}
|
||||
|
||||
framepos_t
|
||||
samplepos_t
|
||||
AudioRegionView::get_fade_in_shape_width ()
|
||||
{
|
||||
return audio_region()->fade_in()->back()->when;
|
||||
}
|
||||
|
||||
framepos_t
|
||||
samplepos_t
|
||||
AudioRegionView::get_fade_out_shape_width ()
|
||||
{
|
||||
return audio_region()->fade_out()->back()->when;
|
||||
|
@ -800,7 +800,7 @@ AudioRegionView::redraw_start_xfade ()
|
|||
}
|
||||
|
||||
void
|
||||
AudioRegionView::redraw_start_xfade_to (boost::shared_ptr<AudioRegion> ar, framecnt_t /*width*/, Points& points, double effective_height,
|
||||
AudioRegionView::redraw_start_xfade_to (boost::shared_ptr<AudioRegion> ar, samplecnt_t /*width*/, Points& points, double effective_height,
|
||||
double rect_width)
|
||||
{
|
||||
if (points.size() < 2) {
|
||||
|
@ -889,7 +889,7 @@ AudioRegionView::redraw_end_xfade ()
|
|||
}
|
||||
|
||||
void
|
||||
AudioRegionView::redraw_end_xfade_to (boost::shared_ptr<AudioRegion> ar, framecnt_t width, Points& points, double effective_height,
|
||||
AudioRegionView::redraw_end_xfade_to (boost::shared_ptr<AudioRegion> ar, samplecnt_t width, Points& points, double effective_height,
|
||||
double rect_edge, double rect_width)
|
||||
{
|
||||
if (points.size() < 2) {
|
||||
|
@ -1234,7 +1234,7 @@ AudioRegionView::create_one_wave (uint32_t which, bool /*direct*/)
|
|||
}
|
||||
|
||||
/* first waveview starts at 1.0, not 0.0 since that will overlap the
|
||||
* frame
|
||||
* sample
|
||||
*/
|
||||
|
||||
gdouble yoff = which * ht;
|
||||
|
@ -1303,7 +1303,7 @@ AudioRegionView::create_one_wave (uint32_t which, bool /*direct*/)
|
|||
/* Restore stacked coverage */
|
||||
LayerDisplay layer_display;
|
||||
if (trackview.get_gui_property ("layer-display", layer_display)) {
|
||||
update_coverage_frames (layer_display);
|
||||
update_coverage_samples (layer_display);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1332,14 +1332,14 @@ AudioRegionView::add_gain_point_event (ArdourCanvas::Item *item, GdkEvent *ev, b
|
|||
|
||||
item->canvas_to_item (mx, my);
|
||||
|
||||
framecnt_t const frame_within_region = (framecnt_t) floor (mx * samples_per_pixel);
|
||||
samplecnt_t const sample_within_region = (samplecnt_t) floor (mx * samples_per_pixel);
|
||||
|
||||
if (!gain_line->control_points_adjacent (frame_within_region, before_p, after_p)) {
|
||||
if (!gain_line->control_points_adjacent (sample_within_region, before_p, after_p)) {
|
||||
/* no adjacent points */
|
||||
return;
|
||||
}
|
||||
|
||||
/*y is in item frame */
|
||||
/*y is in item sample */
|
||||
double const bx = gain_line->nth (before_p)->get_x();
|
||||
double const ax = gain_line->nth (after_p)->get_x();
|
||||
double const click_ratio = (ax - mx) / (ax - bx);
|
||||
|
@ -1349,10 +1349,10 @@ AudioRegionView::add_gain_point_event (ArdourCanvas::Item *item, GdkEvent *ev, b
|
|||
/* don't create points that can't be seen */
|
||||
|
||||
update_envelope_visibility ();
|
||||
framepos_t rpos = region ()->position ();
|
||||
MusicFrame snap_pos (trackview.editor().pixel_to_sample (mx) + rpos, 0);
|
||||
samplepos_t rpos = region ()->position ();
|
||||
MusicSample snap_pos (trackview.editor().pixel_to_sample (mx) + rpos, 0);
|
||||
trackview.editor ().snap_to_with_modifier (snap_pos, ev);
|
||||
framepos_t fx = snap_pos.frame - rpos;
|
||||
samplepos_t fx = snap_pos.sample - rpos;
|
||||
|
||||
if (fx > _region->length()) {
|
||||
return;
|
||||
|
@ -1589,13 +1589,13 @@ AudioRegionView::set_some_waveform_colors (vector<ArdourWaveView::WaveView*>& wa
|
|||
}
|
||||
|
||||
void
|
||||
AudioRegionView::set_frame_color ()
|
||||
AudioRegionView::set_sample_color ()
|
||||
{
|
||||
if (!frame) {
|
||||
if (!sample) {
|
||||
return;
|
||||
}
|
||||
|
||||
RegionView::set_frame_color ();
|
||||
RegionView::set_sample_color ();
|
||||
|
||||
set_waveform_colors ();
|
||||
}
|
||||
|
@ -1623,9 +1623,9 @@ AudioRegionView::set_fade_visibility (bool yn)
|
|||
}
|
||||
|
||||
void
|
||||
AudioRegionView::update_coverage_frames (LayerDisplay d)
|
||||
AudioRegionView::update_coverage_samples (LayerDisplay d)
|
||||
{
|
||||
RegionView::update_coverage_frames (d);
|
||||
RegionView::update_coverage_samples (d);
|
||||
|
||||
if (d == Stacked) {
|
||||
if (fade_in_handle) { fade_in_handle->raise_to_top (); }
|
||||
|
@ -1651,9 +1651,9 @@ AudioRegionView::transients_changed ()
|
|||
{
|
||||
AnalysisFeatureList analysis_features;
|
||||
_region->transients (analysis_features);
|
||||
framepos_t position = _region->position();
|
||||
framepos_t first = _region->first_frame();
|
||||
framepos_t last = _region->last_frame();
|
||||
samplepos_t position = _region->position();
|
||||
samplepos_t first = _region->first_sample();
|
||||
samplepos_t last = _region->last_sample();
|
||||
|
||||
double y1;
|
||||
if (_height >= NAME_HIGHLIGHT_THRESH) {
|
||||
|
@ -1686,7 +1686,7 @@ AudioRegionView::transients_changed ()
|
|||
}
|
||||
|
||||
AnalysisFeatureList::const_iterator i;
|
||||
list<std::pair<framepos_t, ArdourCanvas::Line*> >::iterator l;
|
||||
list<std::pair<samplepos_t, ArdourCanvas::Line*> >::iterator l;
|
||||
|
||||
for (i = analysis_features.begin(), l = feature_lines.begin(); i != analysis_features.end() && l != feature_lines.end(); ++i, ++l) {
|
||||
|
||||
|
@ -1712,8 +1712,8 @@ AudioRegionView::transients_changed ()
|
|||
void
|
||||
AudioRegionView::update_transient(float /*old_pos*/, float new_pos)
|
||||
{
|
||||
/* Find frame at old pos, calulate new frame then update region transients*/
|
||||
list<std::pair<framepos_t, ArdourCanvas::Line*> >::iterator l;
|
||||
/* Find sample at old pos, calulate new sample then update region transients*/
|
||||
list<std::pair<samplepos_t, ArdourCanvas::Line*> >::iterator l;
|
||||
|
||||
for (l = feature_lines.begin(); l != feature_lines.end(); ++l) {
|
||||
|
||||
|
@ -1722,10 +1722,10 @@ AudioRegionView::update_transient(float /*old_pos*/, float new_pos)
|
|||
float* pos = (float*) (*l).second->get_data ("position");
|
||||
|
||||
if (rint(new_pos) == rint(*pos)) {
|
||||
framepos_t position = _region->position();
|
||||
framepos_t old_frame = (*l).first;
|
||||
framepos_t new_frame = trackview.editor().pixel_to_sample (new_pos) + position;
|
||||
_region->update_transient (old_frame, new_frame);
|
||||
samplepos_t position = _region->position();
|
||||
samplepos_t old_sample = (*l).first;
|
||||
samplepos_t new_sample = trackview.editor().pixel_to_sample (new_pos) + position;
|
||||
_region->update_transient (old_sample, new_sample);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1737,9 +1737,9 @@ AudioRegionView::remove_transient (float pos)
|
|||
/* this is called from Editor::remove_transient () with pos == get_data ("position")
|
||||
* which is the item's x-coordinate inside the ARV.
|
||||
*
|
||||
* Find frame at old pos, calulate new frame then update region transients
|
||||
* Find sample at old pos, calulate new sample then update region transients
|
||||
*/
|
||||
list<std::pair<framepos_t, ArdourCanvas::Line*> >::iterator l;
|
||||
list<std::pair<samplepos_t, ArdourCanvas::Line*> >::iterator l;
|
||||
|
||||
for (l = feature_lines.begin(); l != feature_lines.end(); ++l) {
|
||||
float *line_pos = (float*) (*l).second->get_data ("position");
|
||||
|
|
|
@ -97,14 +97,14 @@ public:
|
|||
|
||||
GhostRegion* add_ghost (TimeAxisView&);
|
||||
|
||||
void reset_fade_in_shape_width (boost::shared_ptr<ARDOUR::AudioRegion> ar, framecnt_t, bool drag_active = false);
|
||||
void reset_fade_out_shape_width (boost::shared_ptr<ARDOUR::AudioRegion> ar, framecnt_t, bool drag_active = false);
|
||||
void reset_fade_in_shape_width (boost::shared_ptr<ARDOUR::AudioRegion> ar, samplecnt_t, bool drag_active = false);
|
||||
void reset_fade_out_shape_width (boost::shared_ptr<ARDOUR::AudioRegion> ar, samplecnt_t, bool drag_active = false);
|
||||
|
||||
framepos_t get_fade_in_shape_width ();
|
||||
framepos_t get_fade_out_shape_width ();
|
||||
samplepos_t get_fade_in_shape_width ();
|
||||
samplepos_t get_fade_out_shape_width ();
|
||||
|
||||
void set_fade_visibility (bool);
|
||||
void update_coverage_frames (LayerDisplay);
|
||||
void update_coverage_samples (LayerDisplay);
|
||||
|
||||
void update_transient(float old_pos, float new_pos);
|
||||
void remove_transient(float pos);
|
||||
|
@ -119,8 +119,8 @@ public:
|
|||
void drag_start ();
|
||||
void drag_end ();
|
||||
|
||||
void redraw_start_xfade_to (boost::shared_ptr<ARDOUR::AudioRegion>, framecnt_t, ArdourCanvas::Points&, double, double);
|
||||
void redraw_end_xfade_to (boost::shared_ptr<ARDOUR::AudioRegion>, framecnt_t, ArdourCanvas::Points&, double, double, double);
|
||||
void redraw_start_xfade_to (boost::shared_ptr<ARDOUR::AudioRegion>, samplecnt_t, ArdourCanvas::Points&, double, double);
|
||||
void redraw_end_xfade_to (boost::shared_ptr<ARDOUR::AudioRegion>, samplecnt_t, ArdourCanvas::Points&, double, double, double);
|
||||
void redraw_start_xfade ();
|
||||
void redraw_end_xfade ();
|
||||
|
||||
|
@ -155,7 +155,7 @@ protected:
|
|||
std::vector<ArdourWaveView::WaveView *> waves;
|
||||
std::vector<ArdourWaveView::WaveView *> tmp_waves; ///< see ::create_waves()
|
||||
|
||||
std::list<std::pair<framepos_t, ArdourCanvas::Line*> > feature_lines;
|
||||
std::list<std::pair<samplepos_t, ArdourCanvas::Line*> > feature_lines;
|
||||
|
||||
ArdourCanvas::Polygon* sync_mark; ///< polgyon for sync position
|
||||
ArdourCanvas::Rectangle* fade_in_handle; ///< fade in handle, or 0
|
||||
|
@ -197,7 +197,7 @@ protected:
|
|||
void set_colors ();
|
||||
void set_waveform_colors ();
|
||||
void reset_width_dependent_items (double pixel_width);
|
||||
void set_frame_color ();
|
||||
void set_sample_color ();
|
||||
|
||||
void color_handler ();
|
||||
|
||||
|
|
|
@ -210,10 +210,10 @@ AudioStreamView::setup_rec_box ()
|
|||
|
||||
// handle multi
|
||||
|
||||
framepos_t start = 0;
|
||||
samplepos_t start = 0;
|
||||
if (rec_regions.size() > 0) {
|
||||
start = rec_regions.back().first->start()
|
||||
+ _trackview.track()->get_captured_frames(rec_regions.size()-1);
|
||||
+ _trackview.track()->get_captured_samples(rec_regions.size()-1);
|
||||
}
|
||||
|
||||
PropertyList plist;
|
||||
|
@ -227,17 +227,17 @@ AudioStreamView::setup_rec_box ()
|
|||
boost::dynamic_pointer_cast<AudioRegion>(RegionFactory::create (sources, plist, false)));
|
||||
|
||||
assert(region);
|
||||
region->set_position (_trackview.session()->transport_frame());
|
||||
region->set_position (_trackview.session()->transport_sample());
|
||||
rec_regions.push_back (make_pair(region, (RegionView*) 0));
|
||||
}
|
||||
|
||||
/* start a new rec box */
|
||||
|
||||
boost::shared_ptr<AudioTrack> at = _trackview.audio_track();
|
||||
framepos_t const frame_pos = at->current_capture_start ();
|
||||
samplepos_t const sample_pos = at->current_capture_start ();
|
||||
double const width = ((at->mode() == Destructive) ? 2 : 0);
|
||||
|
||||
create_rec_box(frame_pos, width);
|
||||
create_rec_box(sample_pos, width);
|
||||
|
||||
} else if (rec_active &&
|
||||
(_trackview.session()->record_status() != Session::Recording ||
|
||||
|
@ -289,7 +289,7 @@ AudioStreamView::setup_rec_box ()
|
|||
}
|
||||
|
||||
void
|
||||
AudioStreamView::rec_peak_range_ready (framepos_t start, framecnt_t cnt, boost::weak_ptr<Source> weak_src)
|
||||
AudioStreamView::rec_peak_range_ready (samplepos_t start, samplecnt_t cnt, boost::weak_ptr<Source> weak_src)
|
||||
{
|
||||
ENSURE_GUI_THREAD (*this, &AudioStreamView::rec_peak_range_ready, start, cnt, weak_src)
|
||||
|
||||
|
@ -301,8 +301,8 @@ AudioStreamView::rec_peak_range_ready (framepos_t start, framecnt_t cnt, boost::
|
|||
|
||||
// this is called from the peak building thread
|
||||
|
||||
if (rec_data_ready_map.size() == 0 || start + cnt > last_rec_data_frame) {
|
||||
last_rec_data_frame = start + cnt;
|
||||
if (rec_data_ready_map.size() == 0 || start + cnt > last_rec_data_sample) {
|
||||
last_rec_data_sample = start + cnt;
|
||||
}
|
||||
|
||||
rec_data_ready_map[src] = true;
|
||||
|
@ -314,7 +314,7 @@ AudioStreamView::rec_peak_range_ready (framepos_t start, framecnt_t cnt, boost::
|
|||
}
|
||||
|
||||
void
|
||||
AudioStreamView::update_rec_regions (framepos_t start, framecnt_t cnt)
|
||||
AudioStreamView::update_rec_regions (samplepos_t start, samplecnt_t cnt)
|
||||
{
|
||||
if (!UIConfiguration::instance().get_show_waveforms_while_recording ()) {
|
||||
return;
|
||||
|
@ -342,19 +342,19 @@ AudioStreamView::update_rec_regions (framepos_t start, framecnt_t cnt)
|
|||
continue;
|
||||
}
|
||||
|
||||
framecnt_t origlen = region->length();
|
||||
samplecnt_t origlen = region->length();
|
||||
|
||||
if (region == rec_regions.back().first && rec_active) {
|
||||
|
||||
if (last_rec_data_frame > region->start()) {
|
||||
if (last_rec_data_sample > region->start()) {
|
||||
|
||||
framecnt_t nlen = last_rec_data_frame - region->start();
|
||||
samplecnt_t nlen = last_rec_data_sample - region->start();
|
||||
|
||||
if (nlen != region->length()) {
|
||||
|
||||
region->suspend_property_changes ();
|
||||
/* set non-musical position / length */
|
||||
region->set_position (_trackview.track()->get_capture_start_frame(n));
|
||||
region->set_position (_trackview.track()->get_capture_start_sample(n));
|
||||
region->set_length (nlen, 0);
|
||||
region->resume_property_changes ();
|
||||
|
||||
|
@ -374,14 +374,14 @@ AudioStreamView::update_rec_regions (framepos_t start, framecnt_t cnt)
|
|||
|
||||
} else {
|
||||
|
||||
framecnt_t nlen = _trackview.track()->get_captured_frames(n);
|
||||
samplecnt_t nlen = _trackview.track()->get_captured_samples(n);
|
||||
|
||||
if (nlen != region->length()) {
|
||||
|
||||
if (region->source_length(0) >= region->start() + nlen) {
|
||||
|
||||
region->suspend_property_changes ();
|
||||
region->set_position (_trackview.track()->get_capture_start_frame(n));
|
||||
region->set_position (_trackview.track()->get_capture_start_sample(n));
|
||||
region->set_length (nlen, 0);
|
||||
region->resume_property_changes ();
|
||||
|
||||
|
@ -438,7 +438,7 @@ AudioStreamView::hide_xfades_with (boost::shared_ptr<AudioRegion> ar)
|
|||
for (list<RegionView*>::iterator i = region_views.begin(); i != region_views.end(); ++i) {
|
||||
AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*i);
|
||||
if (arv) {
|
||||
switch (arv->region()->coverage (ar->position(), ar->last_frame())) {
|
||||
switch (arv->region()->coverage (ar->position(), ar->last_sample())) {
|
||||
case Evoral::OverlapNone:
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -66,8 +66,8 @@ public:
|
|||
|
||||
private:
|
||||
void setup_rec_box ();
|
||||
void rec_peak_range_ready (framepos_t start, ARDOUR::framecnt_t cnt, boost::weak_ptr<ARDOUR::Source> src);
|
||||
void update_rec_regions (ARDOUR::framepos_t, ARDOUR::framecnt_t);
|
||||
void rec_peak_range_ready (samplepos_t start, ARDOUR::samplecnt_t cnt, boost::weak_ptr<ARDOUR::Source> src);
|
||||
void update_rec_regions (ARDOUR::samplepos_t, ARDOUR::samplecnt_t);
|
||||
|
||||
RegionView* add_region_view_internal (boost::shared_ptr<ARDOUR::Region>, bool wait_for_waves, bool recording = false);
|
||||
void remove_audio_region_view (boost::shared_ptr<ARDOUR::AudioRegion> );
|
||||
|
|
|
@ -93,10 +93,10 @@ AudioTimeAxisView::set_route (boost::shared_ptr<Route> rt)
|
|||
|
||||
if (is_audio_track()) {
|
||||
controls_ebox.set_name ("AudioTrackControlsBaseUnselected");
|
||||
time_axis_frame.set_name ("AudioTrackControlsBaseUnselected");
|
||||
time_axis_sample.set_name ("AudioTrackControlsBaseUnselected");
|
||||
} else { // bus
|
||||
controls_ebox.set_name ("AudioBusControlsBaseUnselected");
|
||||
time_axis_frame.set_name ("AudioBusControlsBaseUnselected");
|
||||
time_axis_sample.set_name ("AudioBusControlsBaseUnselected");
|
||||
}
|
||||
|
||||
/* if set_state above didn't create a gain automation child, we need to make one */
|
||||
|
@ -308,10 +308,10 @@ AudioTimeAxisView::update_control_names ()
|
|||
|
||||
if (selected()) {
|
||||
controls_ebox.set_name (controls_base_selected_name);
|
||||
time_axis_frame.set_name (controls_base_selected_name);
|
||||
time_axis_sample.set_name (controls_base_selected_name);
|
||||
} else {
|
||||
controls_ebox.set_name (controls_base_unselected_name);
|
||||
time_axis_frame.set_name (controls_base_unselected_name);
|
||||
time_axis_sample.set_name (controls_base_unselected_name);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -194,13 +194,13 @@ AutomationController::value_adjusted ()
|
|||
void
|
||||
AutomationController::start_touch()
|
||||
{
|
||||
_controllable->start_touch (_controllable->session().transport_frame());
|
||||
_controllable->start_touch (_controllable->session().transport_sample());
|
||||
}
|
||||
|
||||
void
|
||||
AutomationController::end_touch ()
|
||||
{
|
||||
_controllable->stop_touch (_controllable->session().transport_frame());
|
||||
_controllable->stop_touch (_controllable->session().transport_sample());
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -258,8 +258,8 @@ AutomationController::set_freq_beats(double beats)
|
|||
{
|
||||
const ARDOUR::ParameterDescriptor& desc = _controllable->desc();
|
||||
const ARDOUR::Session& session = _controllable->session();
|
||||
const framepos_t pos = session.transport_frame();
|
||||
const ARDOUR::Tempo& tempo = session.tempo_map().tempo_at_frame (pos);
|
||||
const samplepos_t pos = session.transport_sample();
|
||||
const ARDOUR::Tempo& tempo = session.tempo_map().tempo_at_sample (pos);
|
||||
const double bpm = tempo.note_types_per_minute();
|
||||
const double bps = bpm / 60.0;
|
||||
const double freq = bps / beats;
|
||||
|
|
|
@ -70,7 +70,7 @@ using namespace ARDOUR;
|
|||
using namespace PBD;
|
||||
using namespace Editing;
|
||||
|
||||
/** @param converter A TimeConverter whose origin_b is the start time of the AutomationList in session frames.
|
||||
/** @param converter A TimeConverter whose origin_b is the start time of the AutomationList in session samples.
|
||||
* This will not be deleted by AutomationLine.
|
||||
*/
|
||||
AutomationLine::AutomationLine (const string& name,
|
||||
|
@ -78,14 +78,14 @@ AutomationLine::AutomationLine (const string& name,
|
|||
ArdourCanvas::Item& parent,
|
||||
boost::shared_ptr<AutomationList> al,
|
||||
const ParameterDescriptor& desc,
|
||||
Evoral::TimeConverter<double, framepos_t>* converter)
|
||||
Evoral::TimeConverter<double, samplepos_t>* converter)
|
||||
: trackview (tv)
|
||||
, _name (name)
|
||||
, alist (al)
|
||||
, _time_converter (converter ? converter : new Evoral::IdentityConverter<double, framepos_t>)
|
||||
, _time_converter (converter ? converter : new Evoral::IdentityConverter<double, samplepos_t>)
|
||||
, _parent_group (parent)
|
||||
, _offset (0)
|
||||
, _maximum_time (max_framepos)
|
||||
, _maximum_time (max_samplepos)
|
||||
, _fill (false)
|
||||
, _desc (desc)
|
||||
{
|
||||
|
@ -488,9 +488,9 @@ AutomationLine::ContiguousControlPoints::compute_x_bounds (PublicEditor& e)
|
|||
if (front()->view_index() > 0) {
|
||||
before_x = line.nth (front()->view_index() - 1)->get_x();
|
||||
|
||||
const framepos_t pos = e.pixel_to_sample(before_x);
|
||||
const Meter& meter = map.meter_at_frame (pos);
|
||||
const framecnt_t len = ceil (meter.frames_per_bar (map.tempo_at_frame (pos), e.session()->frame_rate())
|
||||
const samplepos_t pos = e.pixel_to_sample(before_x);
|
||||
const Meter& meter = map.meter_at_sample (pos);
|
||||
const samplecnt_t len = ceil (meter.samples_per_bar (map.tempo_at_sample (pos), e.session()->sample_rate())
|
||||
/ (Timecode::BBT_Time::ticks_per_beat * meter.divisions_per_bar()) );
|
||||
const double one_tick_in_pixels = e.sample_to_pixel_unrounded (len);
|
||||
|
||||
|
@ -504,9 +504,9 @@ AutomationLine::ContiguousControlPoints::compute_x_bounds (PublicEditor& e)
|
|||
if (back()->view_index() < (line.npoints() - 1)) {
|
||||
after_x = line.nth (back()->view_index() + 1)->get_x();
|
||||
|
||||
const framepos_t pos = e.pixel_to_sample(after_x);
|
||||
const Meter& meter = map.meter_at_frame (pos);
|
||||
const framecnt_t len = ceil (meter.frames_per_bar (map.tempo_at_frame (pos), e.session()->frame_rate())
|
||||
const samplepos_t pos = e.pixel_to_sample(after_x);
|
||||
const Meter& meter = map.meter_at_sample (pos);
|
||||
const samplecnt_t len = ceil (meter.samples_per_bar (map.tempo_at_sample (pos), e.session()->sample_rate())
|
||||
/ (Timecode::BBT_Time::ticks_per_beat * meter.divisions_per_bar()));
|
||||
const double one_tick_in_pixels = e.sample_to_pixel_unrounded (len);
|
||||
|
||||
|
@ -872,14 +872,14 @@ AutomationLine::remove_point (ControlPoint& cp)
|
|||
}
|
||||
|
||||
/** Get selectable points within an area.
|
||||
* @param start Start position in session frames.
|
||||
* @param end End position in session frames.
|
||||
* @param start Start position in session samples.
|
||||
* @param end End position in session samples.
|
||||
* @param bot Bottom y range, as a fraction of line height, where 0 is the bottom of the line.
|
||||
* @param top Top y range, as a fraction of line height, where 0 is the bottom of the line.
|
||||
* @param result Filled in with selectable things; in this case, ControlPoints.
|
||||
*/
|
||||
void
|
||||
AutomationLine::get_selectables (framepos_t start, framepos_t end, double botfrac, double topfrac, list<Selectable*>& results)
|
||||
AutomationLine::get_selectables (samplepos_t start, samplepos_t end, double botfrac, double topfrac, list<Selectable*>& results)
|
||||
{
|
||||
/* convert fractions to display coordinates with 0 at the top of the track */
|
||||
double const bot_track = (1 - topfrac) * trackview.current_height ();
|
||||
|
@ -889,12 +889,12 @@ AutomationLine::get_selectables (framepos_t start, framepos_t end, double botfra
|
|||
double const model_when = (*(*i)->model())->when;
|
||||
|
||||
/* model_when is relative to the start of the source, so we just need to add on the origin_b here
|
||||
(as it is the session frame position of the start of the source)
|
||||
(as it is the session sample position of the start of the source)
|
||||
*/
|
||||
|
||||
framepos_t const session_frames_when = _time_converter->to (model_when) + _time_converter->origin_b ();
|
||||
samplepos_t const session_samples_when = _time_converter->to (model_when) + _time_converter->origin_b ();
|
||||
|
||||
if (session_frames_when >= start && session_frames_when <= end && (*i)->get_y() >= bot_track && (*i)->get_y() <= top_track) {
|
||||
if (session_samples_when >= start && session_samples_when <= end && (*i)->get_y() >= bot_track && (*i)->get_y() <= top_track) {
|
||||
results.push_back (*i);
|
||||
}
|
||||
}
|
||||
|
@ -988,7 +988,7 @@ AutomationLine::reset_callback (const Evoral::ControlList& events)
|
|||
continue;
|
||||
}
|
||||
|
||||
if (tx >= max_framepos || tx < 0 || tx >= _maximum_time) {
|
||||
if (tx >= max_samplepos || tx < 0 || tx >= _maximum_time) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1307,7 +1307,7 @@ AutomationLine::memento_command_binder ()
|
|||
* to the start of the track or region that it is on.
|
||||
*/
|
||||
void
|
||||
AutomationLine::set_maximum_time (framecnt_t t)
|
||||
AutomationLine::set_maximum_time (samplecnt_t t)
|
||||
{
|
||||
if (_maximum_time == t) {
|
||||
return;
|
||||
|
@ -1318,11 +1318,11 @@ AutomationLine::set_maximum_time (framecnt_t t)
|
|||
}
|
||||
|
||||
|
||||
/** @return min and max x positions of points that are in the list, in session frames */
|
||||
pair<framepos_t, framepos_t>
|
||||
/** @return min and max x positions of points that are in the list, in session samples */
|
||||
pair<samplepos_t, samplepos_t>
|
||||
AutomationLine::get_point_x_range () const
|
||||
{
|
||||
pair<framepos_t, framepos_t> r (max_framepos, 0);
|
||||
pair<samplepos_t, samplepos_t> r (max_samplepos, 0);
|
||||
|
||||
for (AutomationList::const_iterator i = the_list()->begin(); i != the_list()->end(); ++i) {
|
||||
r.first = min (r.first, session_position (i));
|
||||
|
@ -1332,14 +1332,14 @@ AutomationLine::get_point_x_range () const
|
|||
return r;
|
||||
}
|
||||
|
||||
framepos_t
|
||||
samplepos_t
|
||||
AutomationLine::session_position (AutomationList::const_iterator p) const
|
||||
{
|
||||
return _time_converter->to ((*p)->when) + _offset + _time_converter->origin_b ();
|
||||
}
|
||||
|
||||
void
|
||||
AutomationLine::set_offset (framepos_t off)
|
||||
AutomationLine::set_offset (samplepos_t off)
|
||||
{
|
||||
if (_offset == off) {
|
||||
return;
|
||||
|
|
|
@ -66,7 +66,7 @@ public:
|
|||
ArdourCanvas::Item& parent,
|
||||
boost::shared_ptr<ARDOUR::AutomationList> al,
|
||||
const ARDOUR::ParameterDescriptor& desc,
|
||||
Evoral::TimeConverter<double, ARDOUR::framepos_t>* converter = 0);
|
||||
Evoral::TimeConverter<double, ARDOUR::samplepos_t>* converter = 0);
|
||||
|
||||
virtual ~AutomationLine ();
|
||||
|
||||
|
@ -76,7 +76,7 @@ public:
|
|||
void set_fill (bool f) { _fill = f; } // owner needs to call set_height
|
||||
|
||||
void set_selected_points (PointSelection const &);
|
||||
void get_selectables (ARDOUR::framepos_t, ARDOUR::framepos_t, double, double, std::list<Selectable*>&);
|
||||
void get_selectables (ARDOUR::samplepos_t, ARDOUR::samplepos_t, double, double, std::list<Selectable*>&);
|
||||
void get_inverted_selectables (Selection&, std::list<Selectable*>& results);
|
||||
|
||||
virtual void remove_point (ControlPoint&);
|
||||
|
@ -145,22 +145,22 @@ public:
|
|||
|
||||
virtual MementoCommandBinder<ARDOUR::AutomationList>* memento_command_binder ();
|
||||
|
||||
const Evoral::TimeConverter<double, ARDOUR::framepos_t>& time_converter () const {
|
||||
const Evoral::TimeConverter<double, ARDOUR::samplepos_t>& time_converter () const {
|
||||
return *_time_converter;
|
||||
}
|
||||
|
||||
std::pair<ARDOUR::framepos_t, ARDOUR::framepos_t> get_point_x_range () const;
|
||||
std::pair<ARDOUR::samplepos_t, ARDOUR::samplepos_t> get_point_x_range () const;
|
||||
|
||||
void set_maximum_time (ARDOUR::framecnt_t);
|
||||
ARDOUR::framecnt_t maximum_time () const {
|
||||
void set_maximum_time (ARDOUR::samplecnt_t);
|
||||
ARDOUR::samplecnt_t maximum_time () const {
|
||||
return _maximum_time;
|
||||
}
|
||||
|
||||
void set_offset (ARDOUR::framecnt_t);
|
||||
ARDOUR::framecnt_t offset () { return _offset; }
|
||||
void set_width (ARDOUR::framecnt_t);
|
||||
void set_offset (ARDOUR::samplecnt_t);
|
||||
ARDOUR::samplecnt_t offset () { return _offset; }
|
||||
void set_width (ARDOUR::samplecnt_t);
|
||||
|
||||
framepos_t session_position (ARDOUR::AutomationList::const_iterator) const;
|
||||
samplepos_t session_position (ARDOUR::AutomationList::const_iterator) const;
|
||||
|
||||
protected:
|
||||
|
||||
|
@ -169,7 +169,7 @@ protected:
|
|||
uint32_t _line_color;
|
||||
|
||||
boost::shared_ptr<ARDOUR::AutomationList> alist;
|
||||
Evoral::TimeConverter<double, ARDOUR::framepos_t>* _time_converter;
|
||||
Evoral::TimeConverter<double, ARDOUR::samplepos_t>* _time_converter;
|
||||
/** true if _time_converter belongs to us (ie we should delete it on destruction) */
|
||||
bool _our_time_converter;
|
||||
|
||||
|
@ -225,7 +225,7 @@ private:
|
|||
/** offset from the start of the automation list to the start of the line, so that
|
||||
* a +ve offset means that the 0 on the line is at _offset in the list
|
||||
*/
|
||||
ARDOUR::framecnt_t _offset;
|
||||
ARDOUR::samplecnt_t _offset;
|
||||
|
||||
bool is_stepped() const;
|
||||
void update_visibility ();
|
||||
|
@ -238,7 +238,7 @@ private:
|
|||
PBD::ScopedConnectionList _list_connections;
|
||||
|
||||
/** maximum time that a point on this line can be at, relative to the position of its region or start of its track */
|
||||
ARDOUR::framecnt_t _maximum_time;
|
||||
ARDOUR::samplecnt_t _maximum_time;
|
||||
|
||||
bool _fill;
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ AutomationRegionView::init (bool /*wfd*/)
|
|||
|
||||
set_height (trackview.current_height());
|
||||
|
||||
fill_color_name = "midi frame base";
|
||||
fill_color_name = "midi sample base";
|
||||
set_colors ();
|
||||
|
||||
_enable_display = true;
|
||||
|
@ -110,11 +110,11 @@ AutomationRegionView::get_fill_color() const
|
|||
{
|
||||
const std::string mod_name = (_dragging ? "dragging region" :
|
||||
trackview.editor().internal_editing() ? "editable region" :
|
||||
"midi frame base");
|
||||
"midi sample base");
|
||||
if (_selected) {
|
||||
return UIConfiguration::instance().color_mod ("selected region base", mod_name);
|
||||
} else if (high_enough_for_name || !UIConfiguration::instance().get_color_regions_using_track_color()) {
|
||||
return UIConfiguration::instance().color_mod ("midi frame base", mod_name);
|
||||
return UIConfiguration::instance().color_mod ("midi sample base", mod_name);
|
||||
}
|
||||
return UIConfiguration::instance().color_mod (fill_color, mod_name);
|
||||
}
|
||||
|
@ -122,8 +122,8 @@ AutomationRegionView::get_fill_color() const
|
|||
void
|
||||
AutomationRegionView::mouse_mode_changed ()
|
||||
{
|
||||
// Adjust frame colour (become more transparent for internal tools)
|
||||
set_frame_color();
|
||||
// Adjust sample colour (become more transparent for internal tools)
|
||||
set_sample_color();
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -160,11 +160,11 @@ AutomationRegionView::canvas_group_event (GdkEvent* ev)
|
|||
return RegionView::canvas_group_event (ev);
|
||||
}
|
||||
|
||||
/** @param when Position in frames, where 0 is the start of the region.
|
||||
/** @param when Position in samples, where 0 is the start of the region.
|
||||
* @param y y position, relative to our TimeAxisView.
|
||||
*/
|
||||
void
|
||||
AutomationRegionView::add_automation_event (GdkEvent *, framepos_t when, double y, bool with_guard_points)
|
||||
AutomationRegionView::add_automation_event (GdkEvent *, samplepos_t when, double y, bool with_guard_points)
|
||||
{
|
||||
if (!_line) {
|
||||
boost::shared_ptr<Evoral::Control> c = _region->control(_parameter, true);
|
||||
|
@ -182,9 +182,9 @@ AutomationRegionView::add_automation_event (GdkEvent *, framepos_t when, double
|
|||
const double h = trackview.current_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 2;
|
||||
y = 1.0 - (y / h);
|
||||
|
||||
/* snap frame */
|
||||
/* snap sample */
|
||||
|
||||
when = snap_frame_to_frame (when - _region->start ()).frame + _region->start ();
|
||||
when = snap_sample_to_sample (when - _region->start ()).sample + _region->start ();
|
||||
|
||||
/* map using line */
|
||||
|
||||
|
@ -206,7 +206,7 @@ AutomationRegionView::add_automation_event (GdkEvent *, framepos_t when, double
|
|||
}
|
||||
|
||||
bool
|
||||
AutomationRegionView::paste (framepos_t pos,
|
||||
AutomationRegionView::paste (samplepos_t pos,
|
||||
unsigned paste_count,
|
||||
float times,
|
||||
boost::shared_ptr<const ARDOUR::AutomationList> slist)
|
||||
|
@ -227,7 +227,7 @@ AutomationRegionView::paste (framepos_t pos
|
|||
/* add multi-paste offset if applicable */
|
||||
if (parameter_is_midi (src_type)) {
|
||||
// convert length to samples (incl tempo-ramps)
|
||||
len = DoubleBeatsFramesConverter (view->session()->tempo_map(), pos).to (len * paste_count);
|
||||
len = DoubleBeatsSamplesConverter (view->session()->tempo_map(), pos).to (len * paste_count);
|
||||
pos += view->editor ().get_paste_offset (pos, paste_count > 0 ? 1 : 0, len);
|
||||
} else {
|
||||
pos += view->editor ().get_paste_offset (pos, paste_count, len);
|
||||
|
@ -238,7 +238,7 @@ AutomationRegionView::paste (framepos_t pos
|
|||
pos - _source_relative_time_converter.origin_b());
|
||||
|
||||
XMLNode& before = my_list->get_state();
|
||||
my_list->paste(*slist, model_pos, DoubleBeatsFramesConverter (view->session()->tempo_map(), pos));
|
||||
my_list->paste(*slist, model_pos, DoubleBeatsSamplesConverter (view->session()->tempo_map(), pos));
|
||||
view->session()->add_command(
|
||||
new MementoCommand<ARDOUR::AutomationList>(_line->memento_command_binder(), &before, &my_list->get_state()));
|
||||
|
||||
|
@ -256,7 +256,7 @@ AutomationRegionView::set_height (double h)
|
|||
}
|
||||
|
||||
bool
|
||||
AutomationRegionView::set_position (framepos_t pos, void* src, double* ignored)
|
||||
AutomationRegionView::set_position (samplepos_t pos, void* src, double* ignored)
|
||||
{
|
||||
if (_line) {
|
||||
_line->set_maximum_time (_region->length ());
|
||||
|
|
|
@ -49,16 +49,16 @@ public:
|
|||
|
||||
void init (bool wfd);
|
||||
|
||||
bool paste (framepos_t pos,
|
||||
bool paste (samplepos_t pos,
|
||||
unsigned paste_count,
|
||||
float times,
|
||||
boost::shared_ptr<const ARDOUR::AutomationList> slist);
|
||||
|
||||
ARDOUR::DoubleBeatsFramesConverter const & region_relative_time_converter () const {
|
||||
ARDOUR::DoubleBeatsSamplesConverter const & region_relative_time_converter () const {
|
||||
return _region_relative_time_converter;
|
||||
}
|
||||
|
||||
ARDOUR::DoubleBeatsFramesConverter const & source_relative_time_converter () const {
|
||||
ARDOUR::DoubleBeatsSamplesConverter const & source_relative_time_converter () const {
|
||||
return _source_relative_time_converter;
|
||||
}
|
||||
|
||||
|
@ -77,17 +77,17 @@ public:
|
|||
|
||||
protected:
|
||||
void create_line(boost::shared_ptr<ARDOUR::AutomationList> list);
|
||||
bool set_position(framepos_t pos, void* src, double* ignored);
|
||||
bool set_position(samplepos_t pos, void* src, double* ignored);
|
||||
void region_resized (const PBD::PropertyChange&);
|
||||
bool canvas_group_event(GdkEvent* ev);
|
||||
void add_automation_event (GdkEvent* event, framepos_t when, double y, bool with_guard_points);
|
||||
void add_automation_event (GdkEvent* event, samplepos_t when, double y, bool with_guard_points);
|
||||
void mouse_mode_changed ();
|
||||
void entered();
|
||||
void exited();
|
||||
|
||||
private:
|
||||
ARDOUR::DoubleBeatsFramesConverter _region_relative_time_converter;
|
||||
ARDOUR::DoubleBeatsFramesConverter _source_relative_time_converter;
|
||||
ARDOUR::DoubleBeatsSamplesConverter _region_relative_time_converter;
|
||||
ARDOUR::DoubleBeatsSamplesConverter _source_relative_time_converter;
|
||||
Evoral::Parameter _parameter;
|
||||
boost::shared_ptr<AutomationLine> _line;
|
||||
PBD::ScopedConnection _mouse_mode_connection;
|
||||
|
|
|
@ -275,15 +275,15 @@ AutomationStreamView::clear ()
|
|||
}
|
||||
}
|
||||
|
||||
/** @param start Start position in session frames.
|
||||
* @param end End position in session frames.
|
||||
/** @param start Start position in session samples.
|
||||
* @param end End position in session samples.
|
||||
* @param bot Bottom position expressed as a fraction of track height where 0 is the bottom of the track.
|
||||
* @param top Top position expressed as a fraction of track height where 0 is the bottom of the track.
|
||||
* NOTE: this y system is different to that for the StreamView method that this overrides, which is a little
|
||||
* confusing.
|
||||
*/
|
||||
void
|
||||
AutomationStreamView::get_selectables (framepos_t start, framepos_t end, double botfrac, double topfrac, list<Selectable*>& results, bool /*within*/)
|
||||
AutomationStreamView::get_selectables (samplepos_t start, samplepos_t end, double botfrac, double topfrac, list<Selectable*>& results, bool /*within*/)
|
||||
{
|
||||
for (list<RegionView*>::iterator i = region_views.begin(); i != region_views.end(); ++i) {
|
||||
AutomationRegionView* arv = dynamic_cast<AutomationRegionView*> (*i);
|
||||
|
@ -319,7 +319,7 @@ AutomationStreamView::get_lines () const
|
|||
}
|
||||
|
||||
bool
|
||||
AutomationStreamView::paste (framepos_t pos,
|
||||
AutomationStreamView::paste (samplepos_t pos,
|
||||
unsigned paste_count,
|
||||
float times,
|
||||
boost::shared_ptr<ARDOUR::AutomationList> alist)
|
||||
|
|
|
@ -60,12 +60,12 @@ public:
|
|||
|
||||
void clear ();
|
||||
|
||||
void get_selectables (ARDOUR::framepos_t, ARDOUR::framepos_t, double, double, std::list<Selectable*> &, bool within = false);
|
||||
void get_selectables (ARDOUR::samplepos_t, ARDOUR::samplepos_t, double, double, std::list<Selectable*> &, bool within = false);
|
||||
void set_selected_points (PointSelection &);
|
||||
|
||||
std::list<boost::shared_ptr<AutomationLine> > get_lines () const;
|
||||
|
||||
bool paste (framepos_t pos,
|
||||
bool paste (samplepos_t pos,
|
||||
unsigned paste_count,
|
||||
float times,
|
||||
boost::shared_ptr<ARDOUR::AutomationList> list);
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#include "pbd/unwind.h"
|
||||
|
||||
#include "ardour/automation_control.h"
|
||||
#include "ardour/beats_frames_converter.h"
|
||||
#include "ardour/beats_samples_converter.h"
|
||||
#include "ardour/event_type_map.h"
|
||||
#include "ardour/parameter_types.h"
|
||||
#include "ardour/profile.h"
|
||||
|
@ -275,7 +275,7 @@ AutomationTimeAxisView::AutomationTimeAxisView (
|
|||
controls_base_unselected_name = X_("AutomationTrackControlsBase");
|
||||
|
||||
controls_ebox.set_name (controls_base_unselected_name);
|
||||
time_axis_frame.set_name (controls_base_unselected_name);
|
||||
time_axis_sample.set_name (controls_base_unselected_name);
|
||||
|
||||
/* ask for notifications of any new RegionViews */
|
||||
if (show_regions) {
|
||||
|
@ -726,7 +726,7 @@ AutomationTimeAxisView::build_display_menu ()
|
|||
}
|
||||
|
||||
void
|
||||
AutomationTimeAxisView::add_automation_event (GdkEvent* event, framepos_t frame, double y, bool with_guard_points)
|
||||
AutomationTimeAxisView::add_automation_event (GdkEvent* event, samplepos_t sample, double y, bool with_guard_points)
|
||||
{
|
||||
if (!_line) {
|
||||
return;
|
||||
|
@ -741,14 +741,14 @@ AutomationTimeAxisView::add_automation_event (GdkEvent* event, framepos_t frame,
|
|||
return;
|
||||
}
|
||||
|
||||
MusicFrame when (frame, 0);
|
||||
MusicSample when (sample, 0);
|
||||
_editor.snap_to_with_modifier (when, event);
|
||||
|
||||
if (UIConfiguration::instance().get_new_automation_points_on_lane()) {
|
||||
if (_control->list()->size () == 0) {
|
||||
y = _control->get_value ();
|
||||
} else {
|
||||
y = _control->list()->eval (when.frame);
|
||||
y = _control->list()->eval (when.sample);
|
||||
}
|
||||
} else {
|
||||
double x = 0;
|
||||
|
@ -762,12 +762,12 @@ AutomationTimeAxisView::add_automation_event (GdkEvent* event, framepos_t frame,
|
|||
XMLNode& before = list->get_state();
|
||||
std::list<Selectable*> results;
|
||||
|
||||
if (list->editor_add (when.frame, y, with_guard_points)) {
|
||||
if (list->editor_add (when.sample, y, with_guard_points)) {
|
||||
XMLNode& after = list->get_state();
|
||||
_editor.begin_reversible_command (_("add automation event"));
|
||||
_session->add_command (new MementoCommand<ARDOUR::AutomationList> (*list.get (), &before, &after));
|
||||
|
||||
_line->get_selectables (when.frame, when.frame, 0.0, 1.0, results);
|
||||
_line->get_selectables (when.sample, when.sample, 0.0, 1.0, results);
|
||||
_editor.get_selection ().set (results);
|
||||
|
||||
_editor.commit_reversible_command ();
|
||||
|
@ -776,7 +776,7 @@ AutomationTimeAxisView::add_automation_event (GdkEvent* event, framepos_t frame,
|
|||
}
|
||||
|
||||
bool
|
||||
AutomationTimeAxisView::paste (framepos_t pos, const Selection& selection, PasteContext& ctx, const int32_t divisions)
|
||||
AutomationTimeAxisView::paste (samplepos_t pos, const Selection& selection, PasteContext& ctx, const int32_t divisions)
|
||||
{
|
||||
if (_line) {
|
||||
return paste_one (pos, ctx.count, ctx.times, selection, ctx.counts, ctx.greedy);
|
||||
|
@ -797,7 +797,7 @@ AutomationTimeAxisView::paste (framepos_t pos, const Selection& selection, Paste
|
|||
}
|
||||
|
||||
bool
|
||||
AutomationTimeAxisView::paste_one (framepos_t pos, unsigned paste_count, float times, const Selection& selection, ItemCounts& counts, bool greedy)
|
||||
AutomationTimeAxisView::paste_one (samplepos_t pos, unsigned paste_count, float times, const Selection& selection, ItemCounts& counts, bool greedy)
|
||||
{
|
||||
boost::shared_ptr<AutomationList> alist(_line->the_list());
|
||||
|
||||
|
@ -824,7 +824,7 @@ AutomationTimeAxisView::paste_one (framepos_t pos, unsigned paste_count, float t
|
|||
|
||||
if (parameter_is_midi (src_type)) {
|
||||
// convert length to samples (incl tempo-ramps)
|
||||
len = DoubleBeatsFramesConverter (_session->tempo_map(), pos).to (len * paste_count);
|
||||
len = DoubleBeatsSamplesConverter (_session->tempo_map(), pos).to (len * paste_count);
|
||||
pos += _editor.get_paste_offset (pos, paste_count > 0 ? 1 : 0, len);
|
||||
} else {
|
||||
pos += _editor.get_paste_offset (pos, paste_count, len);
|
||||
|
@ -834,14 +834,14 @@ AutomationTimeAxisView::paste_one (framepos_t pos, unsigned paste_count, float t
|
|||
double const model_pos = _line->time_converter().from (pos - _line->time_converter().origin_b ());
|
||||
|
||||
XMLNode &before = alist->get_state();
|
||||
alist->paste (**p, model_pos, DoubleBeatsFramesConverter (_session->tempo_map(), pos));
|
||||
alist->paste (**p, model_pos, DoubleBeatsSamplesConverter (_session->tempo_map(), pos));
|
||||
_session->add_command (new MementoCommand<AutomationList>(*alist.get(), &before, &alist->get_state()));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
AutomationTimeAxisView::get_selectables (framepos_t start, framepos_t end, double top, double bot, list<Selectable*>& results, bool /*within*/)
|
||||
AutomationTimeAxisView::get_selectables (samplepos_t start, samplepos_t end, double top, double bot, list<Selectable*>& results, bool /*within*/)
|
||||
{
|
||||
if (!_line && !_view) {
|
||||
return;
|
||||
|
@ -1138,7 +1138,7 @@ AutomationTimeAxisView::cut_copy_clear_one (AutomationLine& line, Selection& sel
|
|||
XMLNode &before = alist->get_state();
|
||||
|
||||
/* convert time selection to automation list model coordinates */
|
||||
const Evoral::TimeConverter<double, ARDOUR::framepos_t>& tc = line.time_converter ();
|
||||
const Evoral::TimeConverter<double, ARDOUR::samplepos_t>& tc = line.time_converter ();
|
||||
double const start = tc.from (selection.time.front().start - tc.origin_b ());
|
||||
double const end = tc.from (selection.time.front().end - tc.origin_b ());
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ public:
|
|||
boost::shared_ptr<ARDOUR::Stripable> stripable() const;
|
||||
ARDOUR::PresentationInfo const & presentation_info () const;
|
||||
|
||||
void add_automation_event (GdkEvent *, framepos_t, double, bool with_guard_points);
|
||||
void add_automation_event (GdkEvent *, samplepos_t, double, bool with_guard_points);
|
||||
|
||||
void clear_lines ();
|
||||
|
||||
|
@ -91,16 +91,16 @@ public:
|
|||
std::list<boost::shared_ptr<AutomationLine> > lines () const;
|
||||
|
||||
void set_selected_points (PointSelection&);
|
||||
void get_selectables (ARDOUR::framepos_t start, ARDOUR::framepos_t end, double top, double bot, std::list<Selectable *>&, bool within = false);
|
||||
void get_selectables (ARDOUR::samplepos_t start, ARDOUR::samplepos_t end, double top, double bot, std::list<Selectable *>&, bool within = false);
|
||||
void get_inverted_selectables (Selection&, std::list<Selectable*>& results);
|
||||
|
||||
void show_timestretch (framepos_t /*start*/, framepos_t /*end*/, int /*layers*/, int /*layer*/) {}
|
||||
void show_timestretch (samplepos_t /*start*/, samplepos_t /*end*/, int /*layers*/, int /*layer*/) {}
|
||||
void hide_timestretch () {}
|
||||
|
||||
/* editing operations */
|
||||
|
||||
void cut_copy_clear (Selection&, Editing::CutCopyOp);
|
||||
bool paste (ARDOUR::framepos_t, const Selection&, PasteContext&, const int32_t sub_num);
|
||||
bool paste (ARDOUR::samplepos_t, const Selection&, PasteContext&, const int32_t sub_num);
|
||||
|
||||
int set_state (const XMLNode&, int version);
|
||||
|
||||
|
@ -183,7 +183,7 @@ protected:
|
|||
void build_display_menu ();
|
||||
|
||||
void cut_copy_clear_one (AutomationLine&, Selection&, Editing::CutCopyOp);
|
||||
bool paste_one (ARDOUR::framepos_t, unsigned, float times, const Selection&, ItemCounts& counts, bool greedy=false);
|
||||
bool paste_one (ARDOUR::samplepos_t, unsigned, float times, const Selection&, ItemCounts& counts, bool greedy=false);
|
||||
void route_going_away ();
|
||||
|
||||
void set_automation_state (ARDOUR::AutoState);
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
ClockGroup::ClockGroup ()
|
||||
: ignore_changes (false)
|
||||
, _clock_mode (AudioClock::Frames)
|
||||
, _clock_mode (AudioClock::Samples)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -197,7 +197,7 @@ EditNoteDialog::done (int r)
|
|||
}
|
||||
}
|
||||
|
||||
framecnt_t const region_samples = _time_clock.current_time() - (_region_view->region()->position() - _region_view->region()->start());
|
||||
samplecnt_t const region_samples = _time_clock.current_time() - (_region_view->region()->position() - _region_view->region()->start());
|
||||
Evoral::Beats const t = _region_view->source_relative_time_converter().from (region_samples);
|
||||
|
||||
if (!_time_all.get_sensitive() || _time_all.get_active ()) {
|
||||
|
@ -211,7 +211,7 @@ EditNoteDialog::done (int r)
|
|||
|
||||
if (!_length_all.get_sensitive() || _length_all.get_active ()) {
|
||||
for (set<NoteBase*>::iterator i = _events.begin(); i != _events.end(); ++i) {
|
||||
framepos_t const note_end_sample = region_samples + _length_clock.current_duration (_time_clock.current_time());
|
||||
samplepos_t const note_end_sample = region_samples + _length_clock.current_duration (_time_clock.current_time());
|
||||
Evoral::Beats const d = _region_view->source_relative_time_converter().from (note_end_sample) - (*i)->note()->time();
|
||||
if (d != (*i)->note()->length()) {
|
||||
_region_view->change_note_length (*i, d);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -149,10 +149,10 @@ public:
|
|||
void first_idle ();
|
||||
virtual bool have_idled () const { return _have_idled; }
|
||||
|
||||
framepos_t leftmost_sample() const { return leftmost_frame; }
|
||||
samplepos_t leftmost_sample() const { return _leftmost_sample; }
|
||||
|
||||
framecnt_t current_page_samples() const {
|
||||
return (framecnt_t) _visible_canvas_width * samples_per_pixel;
|
||||
samplecnt_t current_page_samples() const {
|
||||
return (samplecnt_t) _visible_canvas_width * samples_per_pixel;
|
||||
}
|
||||
|
||||
double visible_canvas_height () const {
|
||||
|
@ -219,7 +219,7 @@ public:
|
|||
account any scrolling offsets.
|
||||
*/
|
||||
|
||||
framepos_t pixel_to_sample_from_event (double pixel) const {
|
||||
samplepos_t pixel_to_sample_from_event (double pixel) const {
|
||||
|
||||
/* pixel can be less than zero when motion events
|
||||
are processed. since we've already run the world->canvas
|
||||
|
@ -234,22 +234,22 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
framepos_t pixel_to_sample (double pixel) const {
|
||||
samplepos_t pixel_to_sample (double pixel) const {
|
||||
return pixel * samples_per_pixel;
|
||||
}
|
||||
|
||||
double sample_to_pixel (framepos_t sample) const {
|
||||
double sample_to_pixel (samplepos_t sample) const {
|
||||
return round (sample / (double) samples_per_pixel);
|
||||
}
|
||||
|
||||
double sample_to_pixel_unrounded (framepos_t sample) const {
|
||||
double sample_to_pixel_unrounded (samplepos_t sample) const {
|
||||
return sample / (double) samples_per_pixel;
|
||||
}
|
||||
|
||||
/* selection */
|
||||
|
||||
Selection& get_selection() const { return *selection; }
|
||||
bool get_selection_extents (framepos_t &start, framepos_t &end) const; // the time extents of the current selection, whether Range, Region(s), Control Points, or Notes
|
||||
bool get_selection_extents (samplepos_t &start, samplepos_t &end) const; // the time extents of the current selection, whether Range, Region(s), Control Points, or Notes
|
||||
Selection& get_cut_buffer() const { return *cut_buffer; }
|
||||
|
||||
void set_selection (std::list<Selectable*>, Selection::Operation);
|
||||
|
@ -257,7 +257,7 @@ public:
|
|||
bool extend_selection_to_track (TimeAxisView&);
|
||||
|
||||
void play_selection ();
|
||||
void maybe_locate_with_edit_preroll (framepos_t);
|
||||
void maybe_locate_with_edit_preroll (samplepos_t);
|
||||
void play_with_preroll ();
|
||||
void rec_with_preroll ();
|
||||
void rec_with_count_in ();
|
||||
|
@ -266,7 +266,7 @@ public:
|
|||
void invert_selection_in_track ();
|
||||
void invert_selection ();
|
||||
void deselect_all ();
|
||||
long select_range (framepos_t, framepos_t);
|
||||
long select_range (samplepos_t, samplepos_t);
|
||||
|
||||
void set_selected_regionview_from_region_list (boost::shared_ptr<ARDOUR::Region> region, Selection::Operation op = Selection::Set);
|
||||
|
||||
|
@ -297,7 +297,7 @@ public:
|
|||
|
||||
void set_zoom_focus (Editing::ZoomFocus);
|
||||
Editing::ZoomFocus get_zoom_focus () const { return zoom_focus; }
|
||||
framecnt_t get_current_zoom () const { return samples_per_pixel; }
|
||||
samplecnt_t get_current_zoom () const { return samples_per_pixel; }
|
||||
void cycle_zoom_focus ();
|
||||
void temporal_zoom_step (bool zoom_out);
|
||||
void temporal_zoom_step_scale (bool zoom_out, double scale);
|
||||
|
@ -331,10 +331,10 @@ public:
|
|||
|
||||
/* nudge is initiated by transport controls owned by ARDOUR_UI */
|
||||
|
||||
framecnt_t get_nudge_distance (framepos_t pos, framecnt_t& next);
|
||||
framecnt_t get_paste_offset (framepos_t pos, unsigned paste_count, framecnt_t duration);
|
||||
unsigned get_grid_beat_divisions(framepos_t position);
|
||||
Evoral::Beats get_grid_type_as_beats (bool& success, framepos_t position);
|
||||
samplecnt_t get_nudge_distance (samplepos_t pos, samplecnt_t& next);
|
||||
samplecnt_t get_paste_offset (samplepos_t pos, unsigned paste_count, samplecnt_t duration);
|
||||
unsigned get_grid_beat_divisions(samplepos_t position);
|
||||
Evoral::Beats get_grid_type_as_beats (bool& success, samplepos_t position);
|
||||
|
||||
int32_t get_grid_music_divisions (uint32_t event_state);
|
||||
|
||||
|
@ -365,7 +365,7 @@ public:
|
|||
void toggle_measure_visibility ();
|
||||
|
||||
/* returns the left-most and right-most time that the gui should allow the user to scroll to */
|
||||
std::pair <framepos_t,framepos_t> session_gui_extents( bool use_extra = true ) const;
|
||||
std::pair <samplepos_t,samplepos_t> session_gui_extents( bool use_extra = true ) const;
|
||||
|
||||
/* fades */
|
||||
|
||||
|
@ -401,13 +401,13 @@ public:
|
|||
void restore_editing_space();
|
||||
|
||||
double get_y_origin () const;
|
||||
void reset_x_origin (framepos_t);
|
||||
void reset_x_origin (samplepos_t);
|
||||
void reset_x_origin_to_follow_playhead ();
|
||||
void reset_y_origin (double);
|
||||
void reset_zoom (framecnt_t);
|
||||
void reposition_and_zoom (framepos_t, double);
|
||||
void reset_zoom (samplecnt_t);
|
||||
void reposition_and_zoom (samplepos_t, double);
|
||||
|
||||
framepos_t get_preferred_edit_position (Editing::EditIgnoreOption = Editing::EDIT_IGNORE_NONE,
|
||||
samplepos_t get_preferred_edit_position (Editing::EditIgnoreOption = Editing::EDIT_IGNORE_NONE,
|
||||
bool use_context_click = false,
|
||||
bool from_outside_canvas = false);
|
||||
|
||||
|
@ -439,13 +439,13 @@ public:
|
|||
ARDOUR::SrcQuality quality,
|
||||
ARDOUR::MidiTrackNameSource mts,
|
||||
ARDOUR::MidiTempoMapDisposition mtd,
|
||||
framepos_t& pos,
|
||||
samplepos_t& pos,
|
||||
boost::shared_ptr<ARDOUR::PluginInfo> instrument = boost::shared_ptr<ARDOUR::PluginInfo>());
|
||||
|
||||
void do_embed (std::vector<std::string> paths,
|
||||
Editing::ImportDisposition disposition,
|
||||
Editing::ImportMode mode,
|
||||
framepos_t& pos,
|
||||
samplepos_t& pos,
|
||||
boost::shared_ptr<ARDOUR::PluginInfo> instrument = boost::shared_ptr<ARDOUR::PluginInfo>());
|
||||
|
||||
void get_regions_corresponding_to (boost::shared_ptr<ARDOUR::Region> region, std::vector<RegionView*>& regions, bool src_comparison);
|
||||
|
@ -453,22 +453,22 @@ public:
|
|||
void get_regionviews_by_id (PBD::ID const id, RegionSelection & regions) const;
|
||||
void get_per_region_note_selection (std::list<std::pair<PBD::ID, std::set<boost::shared_ptr<Evoral::Note<Evoral::Beats> > > > >&) const;
|
||||
|
||||
void center_screen (framepos_t);
|
||||
void center_screen (samplepos_t);
|
||||
|
||||
TrackViewList axis_views_from_routes (boost::shared_ptr<ARDOUR::RouteList>) const;
|
||||
|
||||
void snap_to (ARDOUR::MusicFrame& first,
|
||||
void snap_to (ARDOUR::MusicSample& first,
|
||||
ARDOUR::RoundMode direction = ARDOUR::RoundNearest,
|
||||
bool for_mark = false,
|
||||
bool ensure_snap = false);
|
||||
|
||||
void snap_to_with_modifier (ARDOUR::MusicFrame& first,
|
||||
void snap_to_with_modifier (ARDOUR::MusicSample& first,
|
||||
GdkEvent const * ev,
|
||||
ARDOUR::RoundMode direction = ARDOUR::RoundNearest,
|
||||
bool for_mark = false);
|
||||
|
||||
void snap_to (ARDOUR::MusicFrame& first,
|
||||
ARDOUR::MusicFrame& last,
|
||||
void snap_to (ARDOUR::MusicSample& first,
|
||||
ARDOUR::MusicSample& last,
|
||||
ARDOUR::RoundMode direction = ARDOUR::RoundNearest,
|
||||
bool for_mark = false);
|
||||
|
||||
|
@ -546,19 +546,19 @@ public:
|
|||
void metric_get_minsec (std::vector<ArdourCanvas::Ruler::Mark>&, gdouble, gdouble, gint);
|
||||
|
||||
/* editing operations that need to be public */
|
||||
void mouse_add_new_marker (framepos_t where, bool is_cd=false);
|
||||
void split_regions_at (ARDOUR::MusicFrame, RegionSelection&, bool snap = true);
|
||||
void mouse_add_new_marker (samplepos_t where, bool is_cd=false);
|
||||
void split_regions_at (ARDOUR::MusicSample, RegionSelection&, bool snap = true);
|
||||
void split_region_at_points (boost::shared_ptr<ARDOUR::Region>, ARDOUR::AnalysisFeatureList&, bool can_ferret, bool select_new = false);
|
||||
RegionSelection get_regions_from_selection_and_mouse (framepos_t);
|
||||
RegionSelection get_regions_from_selection_and_mouse (samplepos_t);
|
||||
|
||||
void mouse_add_new_tempo_event (framepos_t where);
|
||||
void mouse_add_new_meter_event (framepos_t where);
|
||||
void mouse_add_new_tempo_event (samplepos_t where);
|
||||
void mouse_add_new_meter_event (samplepos_t where);
|
||||
void edit_tempo_section (ARDOUR::TempoSection*);
|
||||
void edit_meter_section (ARDOUR::MeterSection*);
|
||||
|
||||
protected:
|
||||
void map_transport_state ();
|
||||
void map_position_change (framepos_t);
|
||||
void map_position_change (samplepos_t);
|
||||
void transport_looped ();
|
||||
|
||||
void on_realize();
|
||||
|
@ -573,7 +573,7 @@ private:
|
|||
bool constructed;
|
||||
|
||||
// to keep track of the playhead position for control_scroll
|
||||
boost::optional<framepos_t> _control_scroll_target;
|
||||
boost::optional<samplepos_t> _control_scroll_target;
|
||||
|
||||
PlaylistSelector* _playlist_selector;
|
||||
|
||||
|
@ -585,8 +585,8 @@ private:
|
|||
VisualState (bool with_tracks);
|
||||
~VisualState ();
|
||||
double y_position;
|
||||
framecnt_t samples_per_pixel;
|
||||
framepos_t leftmost_frame;
|
||||
samplecnt_t samples_per_pixel;
|
||||
samplepos_t _leftmost_sample;
|
||||
Editing::ZoomFocus zoom_focus;
|
||||
GUIObjectState* gui_state;
|
||||
};
|
||||
|
@ -604,11 +604,11 @@ private:
|
|||
void start_visual_state_op (uint32_t n);
|
||||
void cancel_visual_state_op (uint32_t n);
|
||||
|
||||
framepos_t leftmost_frame;
|
||||
framecnt_t samples_per_pixel;
|
||||
samplepos_t _leftmost_sample;
|
||||
samplecnt_t samples_per_pixel;
|
||||
Editing::ZoomFocus zoom_focus;
|
||||
|
||||
void set_samples_per_pixel (framecnt_t);
|
||||
void set_samples_per_pixel (samplecnt_t);
|
||||
void on_samples_per_pixel_changed ();
|
||||
|
||||
Editing::MouseMode mouse_mode;
|
||||
|
@ -688,7 +688,7 @@ private:
|
|||
void setup_lines ();
|
||||
|
||||
void set_name (const std::string&);
|
||||
void set_position (framepos_t start, framepos_t end = 0);
|
||||
void set_position (samplepos_t start, samplepos_t end = 0);
|
||||
void set_color_rgba (uint32_t);
|
||||
};
|
||||
|
||||
|
@ -716,9 +716,9 @@ private:
|
|||
|
||||
void hide_marker (ArdourCanvas::Item*, GdkEvent*);
|
||||
void clear_marker_display ();
|
||||
void mouse_add_new_range (framepos_t);
|
||||
void mouse_add_new_loop (framepos_t);
|
||||
void mouse_add_new_punch (framepos_t);
|
||||
void mouse_add_new_range (samplepos_t);
|
||||
void mouse_add_new_loop (samplepos_t);
|
||||
void mouse_add_new_punch (samplepos_t);
|
||||
bool choose_new_marker_name(std::string &name);
|
||||
void update_cd_marker_display ();
|
||||
void ensure_cd_marker_updated (LocationMarkers * lam, ARDOUR::Location * location);
|
||||
|
@ -915,7 +915,7 @@ private:
|
|||
void compute_fixed_ruler_scale (); //calculates the RulerScale of the fixed rulers
|
||||
void update_fixed_rulers ();
|
||||
void update_tempo_based_rulers ();
|
||||
void popup_ruler_menu (framepos_t where = 0, ItemType type = RegionItem);
|
||||
void popup_ruler_menu (samplepos_t where = 0, ItemType type = RegionItem);
|
||||
void update_ruler_visibility ();
|
||||
void set_ruler_visible (RulerType, bool);
|
||||
void toggle_ruler_visibility (RulerType rt);
|
||||
|
@ -936,14 +936,14 @@ private:
|
|||
|
||||
MinsecRulerScale minsec_ruler_scale;
|
||||
|
||||
framecnt_t minsec_mark_interval;
|
||||
samplecnt_t minsec_mark_interval;
|
||||
gint minsec_mark_modulo;
|
||||
gint minsec_nmarks;
|
||||
void set_minsec_ruler_scale (framepos_t, framepos_t);
|
||||
void set_minsec_ruler_scale (samplepos_t, samplepos_t);
|
||||
|
||||
enum TimecodeRulerScale {
|
||||
timecode_show_bits,
|
||||
timecode_show_frames,
|
||||
timecode_show_samples,
|
||||
timecode_show_seconds,
|
||||
timecode_show_minutes,
|
||||
timecode_show_hours,
|
||||
|
@ -954,10 +954,10 @@ private:
|
|||
|
||||
gint timecode_mark_modulo;
|
||||
gint timecode_nmarks;
|
||||
void set_timecode_ruler_scale (framepos_t, framepos_t);
|
||||
void set_timecode_ruler_scale (samplepos_t, samplepos_t);
|
||||
|
||||
framecnt_t _samples_ruler_interval;
|
||||
void set_samples_ruler_scale (framepos_t, framepos_t);
|
||||
samplecnt_t _samples_ruler_interval;
|
||||
void set_samples_ruler_scale (samplepos_t, samplepos_t);
|
||||
|
||||
enum BBTRulerScale {
|
||||
bbt_show_many,
|
||||
|
@ -977,7 +977,7 @@ private:
|
|||
gint bbt_nmarks;
|
||||
uint32_t bbt_bar_helper_on;
|
||||
uint32_t bbt_accent_modulo;
|
||||
void compute_bbt_ruler_scale (framepos_t lower, framepos_t upper);
|
||||
void compute_bbt_ruler_scale (samplepos_t lower, samplepos_t upper);
|
||||
|
||||
ArdourCanvas::Ruler* timecode_ruler;
|
||||
ArdourCanvas::Ruler* bbt_ruler;
|
||||
|
@ -1013,7 +1013,7 @@ private:
|
|||
Glib::RefPtr<Gtk::ToggleAction> xjadeo_proc_action;
|
||||
Glib::RefPtr<Gtk::ToggleAction> xjadeo_ontop_action;
|
||||
Glib::RefPtr<Gtk::ToggleAction> xjadeo_timecode_action;
|
||||
Glib::RefPtr<Gtk::ToggleAction> xjadeo_frame_action;
|
||||
Glib::RefPtr<Gtk::ToggleAction> xjadeo_sample_action;
|
||||
Glib::RefPtr<Gtk::ToggleAction> xjadeo_osdbg_action;
|
||||
Glib::RefPtr<Gtk::ToggleAction> xjadeo_fullscreen_action;
|
||||
Glib::RefPtr<Gtk::ToggleAction> xjadeo_letterbox_action;
|
||||
|
@ -1032,9 +1032,9 @@ private:
|
|||
friend class EditorCursor;
|
||||
|
||||
EditorCursor* playhead_cursor;
|
||||
framepos_t playhead_cursor_sample () const;
|
||||
samplepos_t playhead_cursor_sample () const;
|
||||
|
||||
framepos_t get_region_boundary (framepos_t pos, int32_t dir, bool with_selection, bool only_onscreen);
|
||||
samplepos_t get_region_boundary (samplepos_t pos, int32_t dir, bool with_selection, bool only_onscreen);
|
||||
|
||||
void cursor_to_region_boundary (bool with_selection, int32_t dir);
|
||||
void cursor_to_next_region_boundary (bool with_selection);
|
||||
|
@ -1059,10 +1059,10 @@ private:
|
|||
void select_all_selectables_between (bool within);
|
||||
void select_range_between ();
|
||||
|
||||
boost::shared_ptr<ARDOUR::Region> find_next_region (ARDOUR::framepos_t, ARDOUR::RegionPoint, int32_t dir, TrackViewList&, TimeAxisView ** = 0);
|
||||
ARDOUR::framepos_t find_next_region_boundary (ARDOUR::framepos_t, int32_t dir, const TrackViewList&);
|
||||
boost::shared_ptr<ARDOUR::Region> find_next_region (ARDOUR::samplepos_t, ARDOUR::RegionPoint, int32_t dir, TrackViewList&, TimeAxisView ** = 0);
|
||||
ARDOUR::samplepos_t find_next_region_boundary (ARDOUR::samplepos_t, int32_t dir, const TrackViewList&);
|
||||
|
||||
std::vector<ARDOUR::framepos_t> region_boundary_cache;
|
||||
std::vector<ARDOUR::samplepos_t> region_boundary_cache;
|
||||
void build_region_boundary_cache ();
|
||||
|
||||
Gtk::HBox toplevel_hpacker;
|
||||
|
@ -1119,7 +1119,7 @@ private:
|
|||
void control_unselect ();
|
||||
void access_action (const std::string&, const std::string&);
|
||||
void set_toggleaction (const std::string&, const std::string&, bool);
|
||||
bool deferred_control_scroll (framepos_t);
|
||||
bool deferred_control_scroll (samplepos_t);
|
||||
sigc::connection control_scroll_connection;
|
||||
|
||||
void tie_vertical_scrolling ();
|
||||
|
@ -1135,8 +1135,8 @@ private:
|
|||
};
|
||||
|
||||
Type pending;
|
||||
framepos_t time_origin;
|
||||
framecnt_t samples_per_pixel;
|
||||
samplepos_t time_origin;
|
||||
samplecnt_t samples_per_pixel;
|
||||
double y_origin;
|
||||
|
||||
int idle_handler_id;
|
||||
|
@ -1173,7 +1173,7 @@ private:
|
|||
TrackViewList get_tracks_for_range_action () const;
|
||||
|
||||
sigc::connection super_rapid_screen_update_connection;
|
||||
void center_screen_internal (framepos_t, float);
|
||||
void center_screen_internal (samplepos_t, float);
|
||||
|
||||
void super_rapid_screen_update ();
|
||||
|
||||
|
@ -1182,8 +1182,8 @@ private:
|
|||
|
||||
void session_going_away ();
|
||||
|
||||
framepos_t cut_buffer_start;
|
||||
framecnt_t cut_buffer_length;
|
||||
samplepos_t cut_buffer_start;
|
||||
samplecnt_t cut_buffer_length;
|
||||
|
||||
boost::shared_ptr<CursorContext> _press_cursor_ctx; ///< Button press cursor context
|
||||
|
||||
|
@ -1216,7 +1216,7 @@ private:
|
|||
|
||||
/* CUT/COPY/PASTE */
|
||||
|
||||
framepos_t last_paste_pos;
|
||||
samplepos_t last_paste_pos;
|
||||
unsigned paste_count;
|
||||
|
||||
void cut_copy (Editing::CutCopyOp);
|
||||
|
@ -1227,7 +1227,7 @@ private:
|
|||
void cut_copy_midi (Editing::CutCopyOp);
|
||||
|
||||
void mouse_paste ();
|
||||
void paste_internal (framepos_t position, float times, const int32_t sub_num);
|
||||
void paste_internal (samplepos_t position, float times, const int32_t sub_num);
|
||||
|
||||
/* EDITING OPERATIONS */
|
||||
|
||||
|
@ -1255,14 +1255,14 @@ private:
|
|||
void lower_region_to_bottom ();
|
||||
void split_region_at_transients ();
|
||||
void crop_region_to_selection ();
|
||||
void crop_region_to (framepos_t start, framepos_t end);
|
||||
void set_sync_point (framepos_t, const RegionSelection&);
|
||||
void crop_region_to (samplepos_t start, samplepos_t end);
|
||||
void set_sync_point (samplepos_t, const RegionSelection&);
|
||||
void set_region_sync_position ();
|
||||
void remove_region_sync();
|
||||
void align_regions (ARDOUR::RegionPoint);
|
||||
void align_regions_relative (ARDOUR::RegionPoint point);
|
||||
void align_region (boost::shared_ptr<ARDOUR::Region>, ARDOUR::RegionPoint point, framepos_t position);
|
||||
void align_region_internal (boost::shared_ptr<ARDOUR::Region>, ARDOUR::RegionPoint point, framepos_t position);
|
||||
void align_region (boost::shared_ptr<ARDOUR::Region>, ARDOUR::RegionPoint point, samplepos_t position);
|
||||
void align_region_internal (boost::shared_ptr<ARDOUR::Region>, ARDOUR::RegionPoint point, samplepos_t position);
|
||||
void remove_selected_regions ();
|
||||
void remove_clicked_region ();
|
||||
void show_region_properties ();
|
||||
|
@ -1295,10 +1295,10 @@ private:
|
|||
void fork_region ();
|
||||
|
||||
void do_insert_time ();
|
||||
void insert_time (framepos_t, framecnt_t, Editing::InsertTimeOption, bool, bool, bool, bool, bool, bool);
|
||||
void insert_time (samplepos_t, samplecnt_t, Editing::InsertTimeOption, bool, bool, bool, bool, bool, bool);
|
||||
|
||||
void do_remove_time ();
|
||||
void remove_time (framepos_t pos, framecnt_t distance, Editing::InsertTimeOption opt, bool ignore_music_glue, bool markers_too,
|
||||
void remove_time (samplepos_t pos, samplecnt_t distance, Editing::InsertTimeOption opt, bool ignore_music_glue, bool markers_too,
|
||||
bool glued_markers_too, bool locked_markers_too, bool tempo_too);
|
||||
|
||||
void tab_to_transient (bool forward);
|
||||
|
@ -1306,7 +1306,7 @@ private:
|
|||
void set_tempo_from_region ();
|
||||
void use_range_as_bar ();
|
||||
|
||||
void define_one_bar (framepos_t start, framepos_t end);
|
||||
void define_one_bar (samplepos_t start, samplepos_t end);
|
||||
|
||||
void audition_region_from_region_list ();
|
||||
void hide_region_from_region_list ();
|
||||
|
@ -1339,13 +1339,13 @@ private:
|
|||
void play_location (ARDOUR::Location&);
|
||||
void loop_location (ARDOUR::Location&);
|
||||
|
||||
void calc_extra_zoom_edges(framepos_t &start, framepos_t &end);
|
||||
void calc_extra_zoom_edges(samplepos_t &start, samplepos_t &end);
|
||||
void temporal_zoom_selection (Editing::ZoomAxis);
|
||||
void temporal_zoom_session ();
|
||||
void temporal_zoom_extents ();
|
||||
void temporal_zoom (framecnt_t samples_per_pixel);
|
||||
void temporal_zoom_by_frame (framepos_t start, framepos_t end);
|
||||
void temporal_zoom_to_frame (bool coarser, framepos_t frame);
|
||||
void temporal_zoom (samplecnt_t samples_per_pixel);
|
||||
void temporal_zoom_by_sample (samplepos_t start, samplepos_t end);
|
||||
void temporal_zoom_to_sample (bool coarser, samplepos_t sample);
|
||||
|
||||
void insert_region_list_selection (float times);
|
||||
|
||||
|
@ -1370,16 +1370,16 @@ private:
|
|||
|
||||
SoundFileOmega* sfbrowser;
|
||||
|
||||
void bring_in_external_audio (Editing::ImportMode mode, framepos_t& pos);
|
||||
void bring_in_external_audio (Editing::ImportMode mode, samplepos_t& pos);
|
||||
|
||||
bool idle_drop_paths (std::vector<std::string> paths, framepos_t frame, double ypos, bool copy);
|
||||
void drop_paths_part_two (const std::vector<std::string>& paths, framepos_t frame, double ypos, bool copy);
|
||||
bool idle_drop_paths (std::vector<std::string> paths, samplepos_t sample, double ypos, bool copy);
|
||||
void drop_paths_part_two (const std::vector<std::string>& paths, samplepos_t sample, double ypos, bool copy);
|
||||
|
||||
int import_sndfiles (std::vector<std::string> paths,
|
||||
Editing::ImportDisposition disposition,
|
||||
Editing::ImportMode mode,
|
||||
ARDOUR::SrcQuality quality,
|
||||
framepos_t& pos,
|
||||
samplepos_t& pos,
|
||||
int target_regions,
|
||||
int target_tracks,
|
||||
boost::shared_ptr<ARDOUR::Track>& track,
|
||||
|
@ -1391,7 +1391,7 @@ private:
|
|||
bool& check_sample_rate,
|
||||
Editing::ImportDisposition disposition,
|
||||
Editing::ImportMode mode,
|
||||
framepos_t& pos,
|
||||
samplepos_t& pos,
|
||||
int target_regions,
|
||||
int target_tracks,
|
||||
boost::shared_ptr<ARDOUR::Track>& track,
|
||||
|
@ -1399,7 +1399,7 @@ private:
|
|||
|
||||
int add_sources (std::vector<std::string> paths,
|
||||
ARDOUR::SourceList& sources,
|
||||
framepos_t& pos,
|
||||
samplepos_t& pos,
|
||||
Editing::ImportDisposition disposition,
|
||||
Editing::ImportMode mode,
|
||||
int target_regions,
|
||||
|
@ -1411,7 +1411,7 @@ private:
|
|||
int finish_bringing_in_material (boost::shared_ptr<ARDOUR::Region> region,
|
||||
uint32_t in_chans,
|
||||
uint32_t out_chans,
|
||||
framepos_t& pos,
|
||||
samplepos_t& pos,
|
||||
Editing::ImportMode mode,
|
||||
boost::shared_ptr<ARDOUR::Track>& existing_track,
|
||||
const std::string& new_track_name,
|
||||
|
@ -1434,7 +1434,7 @@ private:
|
|||
|
||||
struct EditorImportStatus : public ARDOUR::ImportStatus {
|
||||
Editing::ImportMode mode;
|
||||
framepos_t pos;
|
||||
samplepos_t pos;
|
||||
int target_tracks;
|
||||
int target_regions;
|
||||
boost::shared_ptr<ARDOUR::Track> track;
|
||||
|
@ -1450,7 +1450,7 @@ private:
|
|||
|
||||
void import_audio (bool as_tracks);
|
||||
void do_import (std::vector<std::string> paths, bool split, bool as_tracks);
|
||||
void import_smf_tempo_map (Evoral::SMF const &, framepos_t pos);
|
||||
void import_smf_tempo_map (Evoral::SMF const &, samplepos_t pos);
|
||||
void move_to_start ();
|
||||
void move_to_end ();
|
||||
void center_playhead ();
|
||||
|
@ -1480,7 +1480,7 @@ private:
|
|||
void set_selection_from_loop ();
|
||||
void set_selection_from_region ();
|
||||
|
||||
void add_location_mark (framepos_t where);
|
||||
void add_location_mark (samplepos_t where);
|
||||
void add_location_from_region ();
|
||||
void add_locations_from_region ();
|
||||
void add_location_from_selection ();
|
||||
|
@ -1495,8 +1495,8 @@ private:
|
|||
|
||||
void set_loop_from_region (bool play);
|
||||
|
||||
void set_loop_range (framepos_t start, framepos_t end, std::string cmd);
|
||||
void set_punch_range (framepos_t start, framepos_t end, std::string cmd);
|
||||
void set_loop_range (samplepos_t start, samplepos_t end, std::string cmd);
|
||||
void set_punch_range (samplepos_t start, samplepos_t end, std::string cmd);
|
||||
|
||||
void toggle_location_at_playhead_cursor ();
|
||||
void add_location_from_playhead_cursor ();
|
||||
|
@ -1511,7 +1511,7 @@ private:
|
|||
int scrubbing_direction;
|
||||
int scrub_reversals;
|
||||
int scrub_reverse_distance;
|
||||
void scrub (framepos_t, double);
|
||||
void scrub (samplepos_t, double);
|
||||
|
||||
void set_punch_start_from_edit_point ();
|
||||
void set_punch_end_from_edit_point ();
|
||||
|
@ -1521,7 +1521,7 @@ private:
|
|||
void keyboard_selection_begin ( Editing::EditIgnoreOption = Editing::EDIT_IGNORE_NONE );
|
||||
void keyboard_selection_finish (bool add, Editing::EditIgnoreOption = Editing::EDIT_IGNORE_NONE);
|
||||
bool have_pending_keyboard_selection;
|
||||
framepos_t pending_keyboard_selection_start;
|
||||
samplepos_t pending_keyboard_selection_start;
|
||||
|
||||
void move_range_selection_start_or_end_to_region_boundary (bool, bool);
|
||||
|
||||
|
@ -1583,7 +1583,7 @@ private:
|
|||
bool can_remove_control_point (ArdourCanvas::Item *);
|
||||
void remove_control_point (ArdourCanvas::Item *);
|
||||
|
||||
void mouse_brush_insert_region (RegionView*, framepos_t pos);
|
||||
void mouse_brush_insert_region (RegionView*, samplepos_t pos);
|
||||
|
||||
/* Canvas event handlers */
|
||||
|
||||
|
@ -1601,7 +1601,7 @@ private:
|
|||
bool canvas_fade_out_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*, bool trim = false);
|
||||
bool canvas_region_view_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
|
||||
bool canvas_wave_view_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
|
||||
bool canvas_frame_handle_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
|
||||
bool canvas_sample_handle_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
|
||||
bool canvas_region_view_name_highlight_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
|
||||
bool canvas_region_view_name_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
|
||||
bool canvas_feature_line_event (GdkEvent* event, ArdourCanvas::Item*, RegionView*);
|
||||
|
@ -1628,7 +1628,7 @@ private:
|
|||
void toggle_video_timeline_locked ();
|
||||
void set_video_timeline_locked (const bool);
|
||||
void queue_visual_videotimeline_update ();
|
||||
void embed_audio_from_video (std::string, framepos_t n = 0, bool lock_position_to_video = true);
|
||||
void embed_audio_from_video (std::string, samplepos_t n = 0, bool lock_position_to_video = true);
|
||||
|
||||
bool track_selection_change_without_scroll () const {
|
||||
return _track_selection_change_without_scroll;
|
||||
|
@ -1754,7 +1754,7 @@ private:
|
|||
void remove_metric_marks ();
|
||||
void draw_metric_marks (const ARDOUR::Metrics& metrics);
|
||||
|
||||
void compute_current_bbt_points (std::vector<ARDOUR::TempoMap::BBTPoint>& grid, framepos_t left, framepos_t right);
|
||||
void compute_current_bbt_points (std::vector<ARDOUR::TempoMap::BBTPoint>& grid, samplepos_t left, samplepos_t right);
|
||||
|
||||
void tempo_map_changed (const PBD::PropertyChange&);
|
||||
void tempometric_position_changed (const PBD::PropertyChange&);
|
||||
|
@ -1889,7 +1889,7 @@ private:
|
|||
|
||||
bool get_smart_mode() const;
|
||||
|
||||
bool audio_region_selection_covers (framepos_t where);
|
||||
bool audio_region_selection_covers (samplepos_t where);
|
||||
|
||||
/* transport range select process */
|
||||
|
||||
|
@ -1913,7 +1913,7 @@ private:
|
|||
|
||||
/* object rubberband select process */
|
||||
|
||||
void select_all_within (framepos_t, framepos_t, double, double, TrackViewList const &, Selection::Operation, bool);
|
||||
void select_all_within (samplepos_t, samplepos_t, double, double, TrackViewList const &, Selection::Operation, bool);
|
||||
|
||||
ArdourCanvas::Rectangle* rubberband_rect;
|
||||
|
||||
|
@ -1947,7 +1947,7 @@ private:
|
|||
void stop_canvas_autoscroll ();
|
||||
|
||||
/* trimming */
|
||||
void point_trim (GdkEvent *, framepos_t);
|
||||
void point_trim (GdkEvent *, samplepos_t);
|
||||
|
||||
void trim_region_front();
|
||||
void trim_region_back();
|
||||
|
@ -2047,19 +2047,19 @@ private:
|
|||
void duplicate_range (bool with_dialog);
|
||||
void duplicate_regions (float times);
|
||||
|
||||
/** computes the timeline frame (sample) of an event whose coordinates
|
||||
/** computes the timeline sample (sample) of an event whose coordinates
|
||||
* are in canvas units (pixels, scroll offset included).
|
||||
*/
|
||||
framepos_t canvas_event_sample (GdkEvent const *, double* px = 0, double* py = 0) const;
|
||||
samplepos_t canvas_event_sample (GdkEvent const *, double* px = 0, double* py = 0) const;
|
||||
|
||||
/** computes the timeline frame (sample) of an event whose coordinates
|
||||
/** computes the timeline sample (sample) of an event whose coordinates
|
||||
* are in window units (pixels, no scroll offset).
|
||||
*/
|
||||
framepos_t window_event_sample (GdkEvent const *, double* px = 0, double* py = 0) const;
|
||||
samplepos_t window_event_sample (GdkEvent const *, double* px = 0, double* py = 0) const;
|
||||
|
||||
/* returns false if mouse pointer is not in track or marker canvas
|
||||
*/
|
||||
bool mouse_frame (framepos_t&, bool& in_track_canvas) const;
|
||||
bool mouse_sample (samplepos_t&, bool& in_track_canvas) const;
|
||||
|
||||
TimeFXDialog* current_timefx;
|
||||
static void* timefx_thread (void *arg);
|
||||
|
@ -2166,10 +2166,10 @@ private:
|
|||
|
||||
void selected_marker_moved (ARDOUR::Location*);
|
||||
|
||||
bool get_edit_op_range (framepos_t& start, framepos_t& end) const;
|
||||
bool get_edit_op_range (samplepos_t& start, samplepos_t& end) const;
|
||||
|
||||
void get_regions_at (RegionSelection&, framepos_t where, const TrackViewList& ts) const;
|
||||
void get_regions_after (RegionSelection&, framepos_t where, const TrackViewList& ts) const;
|
||||
void get_regions_at (RegionSelection&, samplepos_t where, const TrackViewList& ts) const;
|
||||
void get_regions_after (RegionSelection&, samplepos_t where, const TrackViewList& ts) const;
|
||||
|
||||
RegionSelection get_regions_from_selection_and_edit_point (Editing::EditIgnoreOption = Editing::EDIT_IGNORE_NONE,
|
||||
bool use_context_click = false,
|
||||
|
@ -2183,12 +2183,12 @@ private:
|
|||
void select_next_stripable (bool routes_only = true);
|
||||
void select_prev_stripable (bool routes_only = true);
|
||||
|
||||
void snap_to_internal (ARDOUR::MusicFrame& first,
|
||||
void snap_to_internal (ARDOUR::MusicSample& first,
|
||||
ARDOUR::RoundMode direction = ARDOUR::RoundNearest,
|
||||
bool for_mark = false,
|
||||
bool ensure_snap = false);
|
||||
|
||||
void timecode_snap_to_internal (ARDOUR::MusicFrame& first,
|
||||
void timecode_snap_to_internal (ARDOUR::MusicSample& first,
|
||||
ARDOUR::RoundMode direction = ARDOUR::RoundNearest,
|
||||
bool for_mark = false);
|
||||
|
||||
|
|
|
@ -613,7 +613,7 @@ Editor::register_actions ()
|
|||
|
||||
xjadeo_ontop_action = Glib::RefPtr<ToggleAction>::cast_static (myactions.register_toggle_action (editor_actions, X_("toggle-vmon-ontop"), _("Always on Top"), sigc::bind (sigc::mem_fun (*this, &Editor::set_xjadeo_viewoption), (int) 1)));
|
||||
xjadeo_timecode_action = Glib::RefPtr<ToggleAction>::cast_static (myactions.register_toggle_action (editor_actions, X_("toggle-vmon-timecode"), _("Timecode"), sigc::bind (sigc::mem_fun (*this, &Editor::set_xjadeo_viewoption), (int) 2)));
|
||||
xjadeo_frame_action = Glib::RefPtr<ToggleAction>::cast_static (myactions.register_toggle_action (editor_actions, X_("toggle-vmon-frame"), _("Frame number"), sigc::bind (sigc::mem_fun (*this, &Editor::set_xjadeo_viewoption), (int) 3)));
|
||||
xjadeo_sample_action = Glib::RefPtr<ToggleAction>::cast_static (myactions.register_toggle_action (editor_actions, X_("toggle-vmon-frame"), _("Frame number"), sigc::bind (sigc::mem_fun (*this, &Editor::set_xjadeo_viewoption), (int) 3)));
|
||||
xjadeo_osdbg_action = Glib::RefPtr<ToggleAction>::cast_static (myactions.register_toggle_action (editor_actions, X_("toggle-vmon-osdbg"), _("Timecode Background"), sigc::bind (sigc::mem_fun (*this, &Editor::set_xjadeo_viewoption), (int) 4)));
|
||||
xjadeo_fullscreen_action = Glib::RefPtr<ToggleAction>::cast_static (myactions.register_toggle_action (editor_actions, X_("toggle-vmon-fullscreen"), _("Fullscreen"), sigc::bind (sigc::mem_fun (*this, &Editor::set_xjadeo_viewoption), (int) 5)));
|
||||
xjadeo_letterbox_action = Glib::RefPtr<ToggleAction>::cast_static (myactions.register_toggle_action (editor_actions, X_("toggle-vmon-letterbox"), _("Letterbox"), sigc::bind (sigc::mem_fun (*this, &Editor::set_xjadeo_viewoption), (int) 6)));
|
||||
|
@ -654,8 +654,8 @@ Editor::register_actions ()
|
|||
xjadeo_ontop_action->set_sensitive (false);
|
||||
xjadeo_timecode_action->set_active (false);
|
||||
xjadeo_timecode_action->set_sensitive (false);
|
||||
xjadeo_frame_action->set_active (false);
|
||||
xjadeo_frame_action->set_sensitive (false);
|
||||
xjadeo_sample_action->set_active (false);
|
||||
xjadeo_sample_action->set_sensitive (false);
|
||||
xjadeo_osdbg_action->set_active (false);
|
||||
xjadeo_osdbg_action->set_sensitive (false);
|
||||
xjadeo_fullscreen_action->set_active (false);
|
||||
|
@ -873,7 +873,7 @@ Editor::toggle_xjadeo_proc (int state)
|
|||
bool onoff = xjadeo_proc_action->get_active();
|
||||
xjadeo_ontop_action->set_sensitive(onoff);
|
||||
xjadeo_timecode_action->set_sensitive(onoff);
|
||||
xjadeo_frame_action->set_sensitive(onoff);
|
||||
xjadeo_sample_action->set_sensitive(onoff);
|
||||
xjadeo_osdbg_action->set_sensitive(onoff);
|
||||
xjadeo_fullscreen_action->set_sensitive(onoff);
|
||||
xjadeo_letterbox_action->set_sensitive(onoff);
|
||||
|
@ -902,7 +902,7 @@ Editor::toggle_xjadeo_viewoption (int what, int state)
|
|||
action = xjadeo_timecode_action;
|
||||
break;
|
||||
case 3:
|
||||
action = xjadeo_frame_action;
|
||||
action = xjadeo_sample_action;
|
||||
break;
|
||||
case 4:
|
||||
action = xjadeo_osdbg_action;
|
||||
|
@ -944,7 +944,7 @@ Editor::set_xjadeo_viewoption (int what)
|
|||
action = xjadeo_timecode_action;
|
||||
break;
|
||||
case 3:
|
||||
action = xjadeo_frame_action;
|
||||
action = xjadeo_sample_action;
|
||||
break;
|
||||
case 4:
|
||||
action = xjadeo_osdbg_action;
|
||||
|
@ -981,14 +981,14 @@ Editor::toggle_measure_visibility ()
|
|||
void
|
||||
Editor::edit_current_meter ()
|
||||
{
|
||||
ARDOUR::MeterSection* ms = const_cast<ARDOUR::MeterSection*>(&_session->tempo_map().meter_section_at_frame (ARDOUR_UI::instance()->primary_clock->absolute_time()));
|
||||
ARDOUR::MeterSection* ms = const_cast<ARDOUR::MeterSection*>(&_session->tempo_map().meter_section_at_sample (ARDOUR_UI::instance()->primary_clock->absolute_time()));
|
||||
edit_meter_section (ms);
|
||||
}
|
||||
|
||||
void
|
||||
Editor::edit_current_tempo ()
|
||||
{
|
||||
ARDOUR::TempoSection* ts = const_cast<ARDOUR::TempoSection*>(&_session->tempo_map().tempo_section_at_frame (ARDOUR_UI::instance()->primary_clock->absolute_time()));
|
||||
ARDOUR::TempoSection* ts = const_cast<ARDOUR::TempoSection*>(&_session->tempo_map().tempo_section_at_sample (ARDOUR_UI::instance()->primary_clock->absolute_time()));
|
||||
edit_tempo_section (ts);
|
||||
}
|
||||
|
||||
|
|
|
@ -263,7 +263,7 @@ Editor::get_nth_selected_midi_track (int nth) const
|
|||
}
|
||||
|
||||
void
|
||||
Editor::import_smf_tempo_map (Evoral::SMF const & smf, framepos_t pos)
|
||||
Editor::import_smf_tempo_map (Evoral::SMF const & smf, samplepos_t pos)
|
||||
{
|
||||
if (!_session) {
|
||||
return;
|
||||
|
@ -275,7 +275,7 @@ Editor::import_smf_tempo_map (Evoral::SMF const & smf, framepos_t pos)
|
|||
return;
|
||||
}
|
||||
|
||||
const framecnt_t sample_rate = _session->frame_rate ();
|
||||
const samplecnt_t sample_rate = _session->sample_rate ();
|
||||
TempoMap new_map (sample_rate);
|
||||
Meter last_meter (4.0, 4.0);
|
||||
bool have_initial_meter = false;
|
||||
|
@ -297,8 +297,8 @@ Editor::import_smf_tempo_map (Evoral::SMF const & smf, framepos_t pos)
|
|||
}
|
||||
|
||||
} else {
|
||||
new_map.replace_meter (new_map.meter_section_at_frame (0), meter, bbt, pos, AudioTime);
|
||||
new_map.replace_tempo (new_map.tempo_section_at_frame (0), tempo, 0.0, pos, AudioTime);
|
||||
new_map.replace_meter (new_map.meter_section_at_sample (0), meter, bbt, pos, AudioTime);
|
||||
new_map.replace_tempo (new_map.tempo_section_at_sample (0), tempo, 0.0, pos, AudioTime);
|
||||
have_initial_meter = true;
|
||||
|
||||
}
|
||||
|
@ -322,7 +322,7 @@ Editor::do_import (vector<string> paths,
|
|||
SrcQuality quality,
|
||||
MidiTrackNameSource midi_track_name_source,
|
||||
MidiTempoMapDisposition smf_tempo_disposition,
|
||||
framepos_t& pos,
|
||||
samplepos_t& pos,
|
||||
ARDOUR::PluginInfoPtr instrument)
|
||||
{
|
||||
boost::shared_ptr<Track> track;
|
||||
|
@ -461,7 +461,7 @@ Editor::do_import (vector<string> paths,
|
|||
}
|
||||
|
||||
void
|
||||
Editor::do_embed (vector<string> paths, ImportDisposition import_as, ImportMode mode, framepos_t& pos, ARDOUR::PluginInfoPtr instrument)
|
||||
Editor::do_embed (vector<string> paths, ImportDisposition import_as, ImportMode mode, samplepos_t& pos, ARDOUR::PluginInfoPtr instrument)
|
||||
{
|
||||
boost::shared_ptr<Track> track;
|
||||
bool check_sample_rate = true;
|
||||
|
@ -547,7 +547,7 @@ Editor::import_sndfiles (vector<string> paths,
|
|||
ImportDisposition disposition,
|
||||
ImportMode mode,
|
||||
SrcQuality quality,
|
||||
framepos_t& pos,
|
||||
samplepos_t& pos,
|
||||
int target_regions,
|
||||
int target_tracks,
|
||||
boost::shared_ptr<Track>& track,
|
||||
|
@ -617,7 +617,7 @@ Editor::embed_sndfiles (vector<string> paths,
|
|||
bool& check_sample_rate,
|
||||
ImportDisposition disposition,
|
||||
ImportMode mode,
|
||||
framepos_t& pos,
|
||||
samplepos_t& pos,
|
||||
int target_regions,
|
||||
int target_tracks,
|
||||
boost::shared_ptr<Track>& track,
|
||||
|
@ -643,7 +643,7 @@ Editor::embed_sndfiles (vector<string> paths,
|
|||
return -3;
|
||||
}
|
||||
|
||||
if (check_sample_rate && (finfo.samplerate != (int) _session->frame_rate())) {
|
||||
if (check_sample_rate && (finfo.samplerate != (int) _session->sample_rate())) {
|
||||
vector<string> choices;
|
||||
|
||||
if (multifile) {
|
||||
|
@ -739,7 +739,7 @@ Editor::embed_sndfiles (vector<string> paths,
|
|||
int
|
||||
Editor::add_sources (vector<string> paths,
|
||||
SourceList& sources,
|
||||
framepos_t& pos,
|
||||
samplepos_t& pos,
|
||||
ImportDisposition disposition,
|
||||
ImportMode mode,
|
||||
int target_regions,
|
||||
|
@ -857,12 +857,12 @@ Editor::add_sources (vector<string> paths,
|
|||
|
||||
/* Fudge region length to ensure it is non-zero; make it 1 beat at 120bpm
|
||||
for want of a better idea. It can't be too small, otherwise if this
|
||||
is a MIDI region the conversion from frames -> beats -> frames will
|
||||
is a MIDI region the conversion from samples -> beats -> samples will
|
||||
round it back down to 0 again.
|
||||
*/
|
||||
framecnt_t len = (*x)->length (pos);
|
||||
samplecnt_t len = (*x)->length (pos);
|
||||
if (len == 0) {
|
||||
len = (60.0 / 120.0) * _session->frame_rate ();
|
||||
len = (60.0 / 120.0) * _session->sample_rate ();
|
||||
}
|
||||
|
||||
plist.add (ARDOUR::Properties::start, 0);
|
||||
|
@ -899,7 +899,7 @@ Editor::add_sources (vector<string> paths,
|
|||
}
|
||||
|
||||
int n = 0;
|
||||
framepos_t rlen = 0;
|
||||
samplepos_t rlen = 0;
|
||||
|
||||
begin_reversible_command (Operations::insert_file);
|
||||
|
||||
|
@ -970,7 +970,7 @@ int
|
|||
Editor::finish_bringing_in_material (boost::shared_ptr<Region> region,
|
||||
uint32_t in_chans,
|
||||
uint32_t out_chans,
|
||||
framepos_t& pos,
|
||||
samplepos_t& pos,
|
||||
ImportMode mode,
|
||||
boost::shared_ptr<Track>& existing_track,
|
||||
const string& new_track_name,
|
||||
|
|
|
@ -379,14 +379,14 @@ Editor::track_canvas_drag_data_received (const RefPtr<Gdk::DragContext>& context
|
|||
}
|
||||
|
||||
bool
|
||||
Editor::idle_drop_paths (vector<string> paths, framepos_t frame, double ypos, bool copy)
|
||||
Editor::idle_drop_paths (vector<string> paths, samplepos_t sample, double ypos, bool copy)
|
||||
{
|
||||
drop_paths_part_two (paths, frame, ypos, copy);
|
||||
drop_paths_part_two (paths, sample, ypos, copy);
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
Editor::drop_paths_part_two (const vector<string>& paths, framepos_t frame, double ypos, bool copy)
|
||||
Editor::drop_paths_part_two (const vector<string>& paths, samplepos_t sample, double ypos, bool copy)
|
||||
{
|
||||
RouteTimeAxisView* tv;
|
||||
|
||||
|
@ -412,15 +412,15 @@ Editor::drop_paths_part_two (const vector<string>& paths, framepos_t frame, doub
|
|||
|
||||
/* drop onto canvas background: create new tracks */
|
||||
|
||||
frame = 0;
|
||||
sample = 0;
|
||||
InstrumentSelector is; // instantiation builds instrument-list and sets default.
|
||||
do_import (midi_paths, Editing::ImportDistinctFiles, ImportAsTrack, SrcBest, SMFTrackName, SMFTempoIgnore, frame, is.selected_instrument());
|
||||
do_import (midi_paths, Editing::ImportDistinctFiles, ImportAsTrack, SrcBest, SMFTrackName, SMFTempoIgnore, sample, is.selected_instrument());
|
||||
|
||||
if (UIConfiguration::instance().get_only_copy_imported_files() || copy) {
|
||||
do_import (audio_paths, Editing::ImportDistinctFiles, Editing::ImportAsTrack,
|
||||
SrcBest, SMFTrackName, SMFTempoIgnore, frame);
|
||||
SrcBest, SMFTrackName, SMFTempoIgnore, sample);
|
||||
} else {
|
||||
do_embed (audio_paths, Editing::ImportDistinctFiles, ImportAsTrack, frame);
|
||||
do_embed (audio_paths, Editing::ImportDistinctFiles, ImportAsTrack, sample);
|
||||
}
|
||||
|
||||
} else if ((tv = dynamic_cast<RouteTimeAxisView*> (tvp.first)) != 0) {
|
||||
|
@ -432,13 +432,13 @@ Editor::drop_paths_part_two (const vector<string>& paths, framepos_t frame, doub
|
|||
selection->set (tv);
|
||||
|
||||
do_import (midi_paths, Editing::ImportSerializeFiles, ImportToTrack,
|
||||
SrcBest, SMFTrackName, SMFTempoIgnore, frame);
|
||||
SrcBest, SMFTrackName, SMFTempoIgnore, sample);
|
||||
|
||||
if (UIConfiguration::instance().get_only_copy_imported_files() || copy) {
|
||||
do_import (audio_paths, Editing::ImportSerializeFiles, Editing::ImportToTrack,
|
||||
SrcBest, SMFTrackName, SMFTempoIgnore, frame);
|
||||
SrcBest, SMFTrackName, SMFTempoIgnore, sample);
|
||||
} else {
|
||||
do_embed (audio_paths, Editing::ImportSerializeFiles, ImportToTrack, frame);
|
||||
do_embed (audio_paths, Editing::ImportSerializeFiles, ImportToTrack, sample);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -463,7 +463,7 @@ Editor::drop_paths (const RefPtr<Gdk::DragContext>& context,
|
|||
ev.button.x = x;
|
||||
ev.button.y = y;
|
||||
|
||||
MusicFrame when (window_event_sample (&ev, 0, &cy), 0);
|
||||
MusicSample when (window_event_sample (&ev, 0, &cy), 0);
|
||||
snap_to (when);
|
||||
|
||||
bool copy = ((context->get_actions() & (Gdk::ACTION_COPY | Gdk::ACTION_LINK | Gdk::ACTION_MOVE)) == Gdk::ACTION_COPY);
|
||||
|
@ -472,9 +472,9 @@ Editor::drop_paths (const RefPtr<Gdk::DragContext>& context,
|
|||
the main event loop with GTK/Quartz. Since import/embed wants
|
||||
to push up a progress dialog, defer all this till we go idle.
|
||||
*/
|
||||
Glib::signal_idle().connect (sigc::bind (sigc::mem_fun (*this, &Editor::idle_drop_paths), paths, when.frame, cy, copy));
|
||||
Glib::signal_idle().connect (sigc::bind (sigc::mem_fun (*this, &Editor::idle_drop_paths), paths, when.sample, cy, copy));
|
||||
#else
|
||||
drop_paths_part_two (paths, when.frame, cy, copy);
|
||||
drop_paths_part_two (paths, when.sample, cy, copy);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -569,7 +569,7 @@ Editor::maybe_autoscroll (bool allow_horiz, bool allow_vert, bool from_headers)
|
|||
|
||||
toplevel->get_window()->get_pointer (x, y, mask);
|
||||
|
||||
if ((allow_horiz && ((x < scrolling_boundary.x0 && leftmost_frame > 0) || x >= scrolling_boundary.x1)) ||
|
||||
if ((allow_horiz && ((x < scrolling_boundary.x0 && _leftmost_sample > 0) || x >= scrolling_boundary.x1)) ||
|
||||
(allow_vert && ((y < scrolling_boundary.y0 && vertical_adjustment.get_value() > 0)|| y >= scrolling_boundary.y1))) {
|
||||
start_canvas_autoscroll (allow_horiz, allow_vert, scrolling_boundary);
|
||||
}
|
||||
|
@ -581,15 +581,15 @@ Editor::autoscroll_active () const
|
|||
return autoscroll_connection.connected ();
|
||||
}
|
||||
|
||||
std::pair <framepos_t,framepos_t>
|
||||
std::pair <samplepos_t,samplepos_t>
|
||||
Editor::session_gui_extents ( bool use_extra ) const
|
||||
{
|
||||
if (!_session) {
|
||||
return std::pair <framepos_t,framepos_t>(max_framepos,0);
|
||||
return std::pair <samplepos_t,samplepos_t>(max_samplepos,0);
|
||||
}
|
||||
|
||||
framecnt_t session_extent_start = _session->current_start_frame();
|
||||
framecnt_t session_extent_end = _session->current_end_frame();
|
||||
samplecnt_t session_extent_start = _session->current_start_sample();
|
||||
samplecnt_t session_extent_end = _session->current_end_sample();
|
||||
|
||||
//calculate the extents of all regions in every playlist
|
||||
//NOTE: we should listen to playlists, and cache these values so we don't calculate them every time.
|
||||
|
@ -600,7 +600,7 @@ Editor::session_gui_extents ( bool use_extra ) const
|
|||
if (tr) {
|
||||
boost::shared_ptr<Playlist> pl = tr->playlist();
|
||||
if ( pl && !pl->all_regions_empty() ) {
|
||||
pair<framepos_t, framepos_t> e;
|
||||
pair<samplepos_t, samplepos_t> e;
|
||||
e = pl->get_extent();
|
||||
if (e.first < session_extent_start) {
|
||||
session_extent_start = e.first;
|
||||
|
@ -617,20 +617,20 @@ Editor::session_gui_extents ( bool use_extra ) const
|
|||
|
||||
//add additional time to the ui extents ( user-defined in config )
|
||||
if (use_extra) {
|
||||
framecnt_t const extra = UIConfiguration::instance().get_extra_ui_extents_time() * 60 * _session->nominal_frame_rate();
|
||||
samplecnt_t const extra = UIConfiguration::instance().get_extra_ui_extents_time() * 60 * _session->nominal_sample_rate();
|
||||
session_extent_end += extra;
|
||||
session_extent_start -= extra;
|
||||
}
|
||||
|
||||
//range-check
|
||||
if (session_extent_end > max_framepos) {
|
||||
session_extent_end = max_framepos;
|
||||
if (session_extent_end > max_samplepos) {
|
||||
session_extent_end = max_samplepos;
|
||||
}
|
||||
if (session_extent_start < 0) {
|
||||
session_extent_start = 0;
|
||||
}
|
||||
|
||||
std::pair <framepos_t,framepos_t> ret (session_extent_start, session_extent_end);
|
||||
std::pair <samplepos_t,samplepos_t> ret (session_extent_start, session_extent_end);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -639,7 +639,7 @@ Editor::autoscroll_canvas ()
|
|||
{
|
||||
int x, y;
|
||||
Gdk::ModifierType mask;
|
||||
frameoffset_t dx = 0;
|
||||
sampleoffset_t dx = 0;
|
||||
bool no_stop = false;
|
||||
Gtk::Window* toplevel = dynamic_cast<Gtk::Window*>(contents().get_toplevel());
|
||||
|
||||
|
@ -654,7 +654,7 @@ Editor::autoscroll_canvas ()
|
|||
|
||||
if (autoscroll_horizontal_allowed) {
|
||||
|
||||
framepos_t new_frame = leftmost_frame;
|
||||
samplepos_t new_sample = _leftmost_sample;
|
||||
|
||||
/* horizontal */
|
||||
|
||||
|
@ -668,10 +668,10 @@ Editor::autoscroll_canvas ()
|
|||
|
||||
dx *= UIConfiguration::instance().get_draggable_playhead_speed();
|
||||
|
||||
if (leftmost_frame < max_framepos - dx) {
|
||||
new_frame = leftmost_frame + dx;
|
||||
if (_leftmost_sample < max_samplepos - dx) {
|
||||
new_sample = _leftmost_sample + dx;
|
||||
} else {
|
||||
new_frame = max_framepos;
|
||||
new_sample = max_samplepos;
|
||||
}
|
||||
|
||||
no_stop = true;
|
||||
|
@ -685,17 +685,17 @@ Editor::autoscroll_canvas ()
|
|||
|
||||
dx *= UIConfiguration::instance().get_draggable_playhead_speed();
|
||||
|
||||
if (leftmost_frame >= dx) {
|
||||
new_frame = leftmost_frame - dx;
|
||||
if (_leftmost_sample >= dx) {
|
||||
new_sample = _leftmost_sample - dx;
|
||||
} else {
|
||||
new_frame = 0;
|
||||
new_sample = 0;
|
||||
}
|
||||
|
||||
no_stop = true;
|
||||
}
|
||||
|
||||
if (new_frame != leftmost_frame) {
|
||||
vc.time_origin = new_frame;
|
||||
if (new_sample != _leftmost_sample) {
|
||||
vc.time_origin = new_sample;
|
||||
vc.add (VisualChange::TimeOrigin);
|
||||
}
|
||||
}
|
||||
|
@ -969,7 +969,7 @@ Editor::set_horizontal_position (double p)
|
|||
{
|
||||
horizontal_adjustment.set_value (p);
|
||||
|
||||
leftmost_frame = (framepos_t) floor (p * samples_per_pixel);
|
||||
_leftmost_sample = (samplepos_t) floor (p * samples_per_pixel);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1052,7 +1052,7 @@ Editor::color_handler()
|
|||
double
|
||||
Editor::horizontal_position () const
|
||||
{
|
||||
return sample_to_pixel (leftmost_frame);
|
||||
return sample_to_pixel (_leftmost_sample);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
@ -797,11 +797,11 @@ Editor::canvas_selection_end_trim_event (GdkEvent *event, ArdourCanvas::Item* it
|
|||
}
|
||||
|
||||
bool
|
||||
Editor::canvas_frame_handle_event (GdkEvent* event, ArdourCanvas::Item* item, RegionView* rv)
|
||||
Editor::canvas_sample_handle_event (GdkEvent* event, ArdourCanvas::Item* item, RegionView* rv)
|
||||
{
|
||||
bool ret = false;
|
||||
|
||||
/* frame handles are not active when in internal edit mode, because actual notes
|
||||
/* sample handles are not active when in internal edit mode, because actual notes
|
||||
might be in the area occupied by the handle - we want them to be editable as normal.
|
||||
*/
|
||||
|
||||
|
@ -809,7 +809,7 @@ Editor::canvas_frame_handle_event (GdkEvent* event, ArdourCanvas::Item* item, Re
|
|||
return false;
|
||||
}
|
||||
|
||||
/* NOTE: frame handles pretend to be the colored trim bar from an event handling
|
||||
/* NOTE: sample handles pretend to be the colored trim bar from an event handling
|
||||
perspective. XXX change this ??
|
||||
*/
|
||||
|
||||
|
@ -1264,7 +1264,7 @@ Editor::drop_regions (const Glib::RefPtr<Gdk::DragContext>& /*context*/,
|
|||
event.button.y = y;
|
||||
/* assume we're dragging with button 1 */
|
||||
event.motion.state = Gdk::BUTTON1_MASK;
|
||||
framepos_t const pos = window_event_sample (&event, &px, &py);
|
||||
samplepos_t const pos = window_event_sample (&event, &px, &py);
|
||||
|
||||
boost::shared_ptr<Region> region = _regions->get_dragged_region ();
|
||||
if (!region) { return; }
|
||||
|
|
|
@ -50,7 +50,7 @@ EditorCursor::EditorCursor (Editor& ed, bool (Editor::*callbck)(GdkEvent*,Ardour
|
|||
|
||||
_track_canvas_item->set_x (0);
|
||||
|
||||
_current_frame = 1; /* force redraw at 0 */
|
||||
_current_sample = 1; /* force redraw at 0 */
|
||||
}
|
||||
|
||||
EditorCursor::EditorCursor (Editor& ed)
|
||||
|
@ -66,7 +66,7 @@ EditorCursor::EditorCursor (Editor& ed)
|
|||
|
||||
_track_canvas_item->set_x (0);
|
||||
|
||||
_current_frame = 1; /* force redraw at 0 */
|
||||
_current_sample = 1; /* force redraw at 0 */
|
||||
}
|
||||
|
||||
EditorCursor::~EditorCursor ()
|
||||
|
@ -75,17 +75,17 @@ EditorCursor::~EditorCursor ()
|
|||
}
|
||||
|
||||
void
|
||||
EditorCursor::set_position (framepos_t frame)
|
||||
EditorCursor::set_position (samplepos_t sample)
|
||||
{
|
||||
if (_current_frame != frame) { PositionChanged (frame); }
|
||||
if (_current_sample != sample) { PositionChanged (sample); }
|
||||
|
||||
double const new_pos = _editor.sample_to_pixel_unrounded (frame);
|
||||
double const new_pos = _editor.sample_to_pixel_unrounded (sample);
|
||||
|
||||
if (rint(new_pos) != rint(_track_canvas_item->x ())) {
|
||||
_track_canvas_item->set_x (new_pos);
|
||||
}
|
||||
|
||||
_current_frame = frame;
|
||||
_current_sample = sample;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -36,7 +36,7 @@ public:
|
|||
EditorCursor (Editor&);
|
||||
~EditorCursor ();
|
||||
|
||||
void set_position (framepos_t);
|
||||
void set_position (samplepos_t);
|
||||
|
||||
|
||||
void show ();
|
||||
|
@ -44,20 +44,20 @@ public:
|
|||
void set_color (Gtkmm2ext::Color);
|
||||
void set_sensitive (bool);
|
||||
|
||||
framepos_t current_frame () const {
|
||||
return _current_frame;
|
||||
samplepos_t current_sample () const {
|
||||
return _current_sample;
|
||||
}
|
||||
|
||||
ArdourCanvas::Arrow& track_canvas_item () {
|
||||
return *_track_canvas_item;
|
||||
}
|
||||
|
||||
PBD::Signal1<void, framepos_t> PositionChanged;
|
||||
PBD::Signal1<void, samplepos_t> PositionChanged;
|
||||
|
||||
private:
|
||||
Editor& _editor;
|
||||
ArdourCanvas::Arrow* _track_canvas_item;
|
||||
framepos_t _current_frame;
|
||||
samplepos_t _current_sample;
|
||||
};
|
||||
|
||||
#endif // __gtk_ardour_editor_cursors_h__
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -109,9 +109,9 @@ public:
|
|||
return _current_pointer_y;
|
||||
}
|
||||
|
||||
/** @return current pointer frame */
|
||||
ARDOUR::framepos_t current_pointer_frame () const {
|
||||
return _current_pointer_frame;
|
||||
/** @return current pointer sample */
|
||||
ARDOUR::samplepos_t current_pointer_sample () const {
|
||||
return _current_pointer_sample;
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -120,7 +120,7 @@ private:
|
|||
bool _ending; ///< true if end_grab or abort is in progress, otherwise false
|
||||
double _current_pointer_x; ///< canvas-coordinate space x of the current pointer
|
||||
double _current_pointer_y; ///< canvas-coordinate space y of the current pointer
|
||||
ARDOUR::framepos_t _current_pointer_frame; ///< frame that the pointer is now at
|
||||
ARDOUR::samplepos_t _current_pointer_sample; ///< sample that the pointer is now at
|
||||
bool _old_follow_playhead; ///< state of Editor::follow_playhead() before the drags started
|
||||
};
|
||||
|
||||
|
@ -144,8 +144,8 @@ public:
|
|||
bool motion_handler (GdkEvent*, bool);
|
||||
void abort ();
|
||||
|
||||
ARDOUR::MusicFrame adjusted_frame (ARDOUR::framepos_t, GdkEvent const *, bool snap = true) const;
|
||||
ARDOUR::framepos_t adjusted_current_frame (GdkEvent const *, bool snap = true) const;
|
||||
ARDOUR::MusicSample adjusted_sample (ARDOUR::samplepos_t, GdkEvent const *, bool snap = true) const;
|
||||
ARDOUR::samplepos_t adjusted_current_sample (GdkEvent const *, bool snap = true) const;
|
||||
|
||||
bool was_double_click() const { return _was_double_click; }
|
||||
void set_double_click (bool yn) { _was_double_click = yn; }
|
||||
|
@ -183,8 +183,8 @@ public:
|
|||
return true;
|
||||
}
|
||||
|
||||
/** @return minimum number of frames (in x) and pixels (in y) that should be considered a movement */
|
||||
virtual std::pair<ARDOUR::framecnt_t, int> move_threshold () const {
|
||||
/** @return minimum number of samples (in x) and pixels (in y) that should be considered a movement */
|
||||
virtual std::pair<ARDOUR::samplecnt_t, int> move_threshold () const {
|
||||
return std::make_pair (1, 1);
|
||||
}
|
||||
|
||||
|
@ -206,9 +206,9 @@ public:
|
|||
return _initially_vertical;
|
||||
}
|
||||
|
||||
/** Set up the _pointer_frame_offset */
|
||||
virtual void setup_pointer_frame_offset () {
|
||||
_pointer_frame_offset = 0;
|
||||
/** Set up the _pointer_sample_offset */
|
||||
virtual void setup_pointer_sample_offset () {
|
||||
_pointer_sample_offset = 0;
|
||||
}
|
||||
|
||||
protected:
|
||||
|
@ -221,12 +221,12 @@ protected:
|
|||
return _grab_y;
|
||||
}
|
||||
|
||||
ARDOUR::framepos_t raw_grab_frame () const {
|
||||
return _raw_grab_frame;
|
||||
ARDOUR::samplepos_t raw_grab_sample () const {
|
||||
return _raw_grab_sample;
|
||||
}
|
||||
|
||||
ARDOUR::framepos_t grab_frame () const {
|
||||
return _grab_frame;
|
||||
ARDOUR::samplepos_t grab_sample () const {
|
||||
return _grab_sample;
|
||||
}
|
||||
|
||||
double last_pointer_x () const {
|
||||
|
@ -237,30 +237,30 @@ protected:
|
|||
return _last_pointer_y;
|
||||
}
|
||||
|
||||
ARDOUR::framepos_t last_pointer_frame () const {
|
||||
return _last_pointer_frame;
|
||||
ARDOUR::samplepos_t last_pointer_sample () const {
|
||||
return _last_pointer_sample;
|
||||
}
|
||||
|
||||
ARDOUR::frameoffset_t snap_delta (guint const) const;
|
||||
ARDOUR::sampleoffset_t snap_delta (guint const) const;
|
||||
double snap_delta_music (guint const) const;
|
||||
|
||||
double current_pointer_x () const;
|
||||
double current_pointer_y () const;
|
||||
|
||||
/* sets snap delta from unsnapped pos */
|
||||
void setup_snap_delta (ARDOUR::MusicFrame pos);
|
||||
void setup_snap_delta (ARDOUR::MusicSample pos);
|
||||
|
||||
boost::shared_ptr<ARDOUR::Region> add_midi_region (MidiTimeAxisView*, bool commit);
|
||||
|
||||
void show_verbose_cursor_time (framepos_t);
|
||||
void show_verbose_cursor_duration (framepos_t, framepos_t, double xoffset = 0);
|
||||
void show_verbose_cursor_time (samplepos_t);
|
||||
void show_verbose_cursor_duration (samplepos_t, samplepos_t, double xoffset = 0);
|
||||
void show_verbose_cursor_text (std::string const &);
|
||||
|
||||
Editor* _editor; ///< our editor
|
||||
DragManager* _drags;
|
||||
ArdourCanvas::Item* _item; ///< our item
|
||||
/** Offset from the mouse's position for the drag to the start of the thing that is being dragged */
|
||||
ARDOUR::framecnt_t _pointer_frame_offset;
|
||||
ARDOUR::samplecnt_t _pointer_sample_offset;
|
||||
bool _x_constrained; ///< true if x motion is constrained, otherwise false
|
||||
bool _y_constrained; ///< true if y motion is constrained, otherwise false
|
||||
bool _was_rolling; ///< true if the session was rolling before the drag started, otherwise false
|
||||
|
@ -275,14 +275,14 @@ private:
|
|||
double _grab_y; ///< y of the grab start position, possibly adjusted if _trackview_only is true
|
||||
double _last_pointer_x; ///< trackview x of the pointer last time a motion occurred
|
||||
double _last_pointer_y; ///< trackview y of the pointer last time a motion occurred
|
||||
ARDOUR::framepos_t _raw_grab_frame; ///< unsnapped frame that the mouse was at when start_grab was called, or 0
|
||||
ARDOUR::framepos_t _grab_frame; ///< adjusted_frame that the mouse was at when start_grab was called, or 0
|
||||
ARDOUR::framepos_t _last_pointer_frame; ///< adjusted_frame the last time a motion occurred
|
||||
ARDOUR::samplepos_t _raw_grab_sample; ///< unsnapped sample that the mouse was at when start_grab was called, or 0
|
||||
ARDOUR::samplepos_t _grab_sample; ///< adjusted_sample that the mouse was at when start_grab was called, or 0
|
||||
ARDOUR::samplepos_t _last_pointer_sample; ///< adjusted_sample the last time a motion occurred
|
||||
|
||||
/* difference between some key position's snapped and unsnapped
|
||||
* framepos. used for relative snap.
|
||||
* samplepos. used for relative snap.
|
||||
*/
|
||||
framepos_t _snap_delta;
|
||||
samplepos_t _snap_delta;
|
||||
double _snap_delta_music;
|
||||
CursorContext::Handle _cursor_ctx; ///< cursor change context
|
||||
bool _constraint_pressed; ///< if the keyboard indicated constraint modifier was pressed on start_grab()
|
||||
|
@ -307,9 +307,9 @@ public:
|
|||
*/
|
||||
double layer;
|
||||
double initial_y; ///< the initial y position of the view before any reparenting
|
||||
framepos_t initial_position; ///< initial position of the region
|
||||
framepos_t initial_end; ///< initial end position of the region
|
||||
framepos_t anchored_fade_length; ///< fade_length when anchored during drag
|
||||
samplepos_t initial_position; ///< initial position of the region
|
||||
samplepos_t initial_end; ///< initial end position of the region
|
||||
samplepos_t anchored_fade_length; ///< fade_length when anchored during drag
|
||||
boost::shared_ptr<ARDOUR::Playlist> initial_playlist;
|
||||
TimeAxisView* initial_time_axis_view;
|
||||
};
|
||||
|
@ -364,12 +364,12 @@ public:
|
|||
|
||||
protected:
|
||||
|
||||
double compute_x_delta (GdkEvent const *, ARDOUR::MusicFrame *);
|
||||
double compute_x_delta (GdkEvent const *, ARDOUR::MusicSample *);
|
||||
virtual bool y_movement_allowed (int, double, int skip_invisible = 0) const;
|
||||
|
||||
bool _brushing;
|
||||
bool _ignore_video_lock;
|
||||
ARDOUR::MusicFrame _last_position; ///< last position of the thing being dragged
|
||||
ARDOUR::MusicSample _last_position; ///< last position of the thing being dragged
|
||||
double _total_x_delta;
|
||||
int _last_pointer_time_axis_view;
|
||||
double _last_pointer_layer;
|
||||
|
@ -397,11 +397,11 @@ public:
|
|||
return true;
|
||||
}
|
||||
|
||||
std::pair<ARDOUR::framecnt_t, int> move_threshold () const {
|
||||
std::pair<ARDOUR::samplecnt_t, int> move_threshold () const {
|
||||
return std::make_pair (4, 4);
|
||||
}
|
||||
|
||||
void setup_pointer_frame_offset ();
|
||||
void setup_pointer_sample_offset ();
|
||||
|
||||
protected:
|
||||
typedef std::set<boost::shared_ptr<ARDOUR::Playlist> > PlaylistSet;
|
||||
|
@ -411,14 +411,14 @@ private:
|
|||
void finished_no_copy (
|
||||
bool const,
|
||||
bool const,
|
||||
ARDOUR::MusicFrame,
|
||||
ARDOUR::MusicSample,
|
||||
int32_t const ev_state
|
||||
);
|
||||
|
||||
void finished_copy (
|
||||
bool const,
|
||||
bool const,
|
||||
ARDOUR::MusicFrame,
|
||||
ARDOUR::MusicSample,
|
||||
int32_t const ev_state
|
||||
);
|
||||
|
||||
|
@ -426,7 +426,7 @@ private:
|
|||
boost::shared_ptr<ARDOUR::Region>,
|
||||
RouteTimeAxisView*,
|
||||
ARDOUR::layer_t,
|
||||
ARDOUR::MusicFrame,
|
||||
ARDOUR::MusicSample,
|
||||
double quarter_note,
|
||||
PlaylistSet&,
|
||||
bool for_music = false
|
||||
|
@ -450,7 +450,7 @@ private:
|
|||
class RegionInsertDrag : public RegionMotionDrag
|
||||
{
|
||||
public:
|
||||
RegionInsertDrag (Editor *, boost::shared_ptr<ARDOUR::Region>, RouteTimeAxisView*, ARDOUR::framepos_t);
|
||||
RegionInsertDrag (Editor *, boost::shared_ptr<ARDOUR::Region>, RouteTimeAxisView*, ARDOUR::samplepos_t);
|
||||
|
||||
void finished (GdkEvent *, bool);
|
||||
void aborted (bool);
|
||||
|
@ -488,13 +488,13 @@ protected:
|
|||
private:
|
||||
TimeAxisView *prev_tav; // where regions were most recently dragged from
|
||||
TimeAxisView *orig_tav; // where drag started
|
||||
ARDOUR::framecnt_t prev_amount;
|
||||
ARDOUR::framepos_t prev_position;
|
||||
ARDOUR::framecnt_t selection_length;
|
||||
ARDOUR::samplecnt_t prev_amount;
|
||||
ARDOUR::samplepos_t prev_position;
|
||||
ARDOUR::samplecnt_t selection_length;
|
||||
bool allow_moves_across_tracks; // only if all selected regions are on one track
|
||||
ARDOUR::RegionList *exclude;
|
||||
void add_all_after_to_views (TimeAxisView *tav, ARDOUR::framepos_t where, const RegionSelection &exclude, bool drag_in_progress);
|
||||
void remove_unselected_from_views (ARDOUR::framecnt_t amount, bool move_regions);
|
||||
void add_all_after_to_views (TimeAxisView *tav, ARDOUR::samplepos_t where, const RegionSelection &exclude, bool drag_in_progress);
|
||||
void remove_unselected_from_views (ARDOUR::samplecnt_t amount, bool move_regions);
|
||||
|
||||
};
|
||||
|
||||
|
@ -502,7 +502,7 @@ private:
|
|||
class RegionCutDrag : public Drag
|
||||
{
|
||||
public:
|
||||
RegionCutDrag (Editor*, ArdourCanvas::Item*, framepos_t);
|
||||
RegionCutDrag (Editor*, ArdourCanvas::Item*, samplepos_t);
|
||||
~RegionCutDrag ();
|
||||
|
||||
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
||||
|
@ -559,7 +559,7 @@ public:
|
|||
void finished (GdkEvent *, bool);
|
||||
void aborted (bool);
|
||||
|
||||
void setup_pointer_frame_offset ();
|
||||
void setup_pointer_sample_offset ();
|
||||
private:
|
||||
|
||||
double total_dx (GdkEvent * event) const; // total movement in quarter notes
|
||||
|
@ -596,16 +596,16 @@ public:
|
|||
|
||||
private:
|
||||
double y_to_region (double) const;
|
||||
ARDOUR::framecnt_t grid_frames (framepos_t) const;
|
||||
ARDOUR::samplecnt_t grid_samples (samplepos_t) const;
|
||||
|
||||
/** @return minimum number of frames (in x) and pixels (in y) that should be considered a movement */
|
||||
virtual std::pair<ARDOUR::framecnt_t, int> move_threshold () const {
|
||||
/** @return minimum number of samples (in x) and pixels (in y) that should be considered a movement */
|
||||
virtual std::pair<ARDOUR::samplecnt_t, int> move_threshold () const {
|
||||
return std::make_pair (0, 0);
|
||||
}
|
||||
|
||||
MidiRegionView* _region_view;
|
||||
ArdourCanvas::Rectangle* _drag_rect;
|
||||
framepos_t _note[2];
|
||||
samplepos_t _note[2];
|
||||
};
|
||||
|
||||
class HitCreateDrag : public Drag
|
||||
|
@ -629,15 +629,15 @@ public:
|
|||
|
||||
private:
|
||||
double y_to_region (double) const;
|
||||
ARDOUR::framecnt_t grid_frames (framepos_t) const;
|
||||
ARDOUR::samplecnt_t grid_samples (samplepos_t) const;
|
||||
|
||||
/** @return minimum number of frames (in x) and pixels (in y) that should be considered a movement */
|
||||
virtual std::pair<ARDOUR::framecnt_t, int> move_threshold () const {
|
||||
/** @return minimum number of samples (in x) and pixels (in y) that should be considered a movement */
|
||||
virtual std::pair<ARDOUR::samplecnt_t, int> move_threshold () const {
|
||||
return std::make_pair (0, 0);
|
||||
}
|
||||
|
||||
MidiRegionView* _region_view;
|
||||
framepos_t _last_pos;
|
||||
samplepos_t _last_pos;
|
||||
double _y;
|
||||
|
||||
};
|
||||
|
@ -656,7 +656,7 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
void setup_pointer_frame_offset ();
|
||||
void setup_pointer_sample_offset ();
|
||||
|
||||
private:
|
||||
MidiRegionView* _region_view;
|
||||
|
@ -671,7 +671,7 @@ public:
|
|||
AVDraggingView (RegionView *);
|
||||
|
||||
RegionView* view; ///< the view
|
||||
framepos_t initial_position; ///< initial position of the region
|
||||
samplepos_t initial_position; ///< initial position of the region
|
||||
};
|
||||
|
||||
/** Drag of video offset */
|
||||
|
@ -698,8 +698,8 @@ protected:
|
|||
std::list<AVDraggingView> _views; ///< information about all audio that are being dragged along
|
||||
|
||||
private:
|
||||
ARDOUR::frameoffset_t _startdrag_video_offset;
|
||||
ARDOUR::frameoffset_t _max_backwards_drag;
|
||||
ARDOUR::sampleoffset_t _startdrag_video_offset;
|
||||
ARDOUR::sampleoffset_t _max_backwards_drag;
|
||||
bool _stuck;
|
||||
};
|
||||
|
||||
|
@ -724,7 +724,7 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
void setup_pointer_frame_offset ();
|
||||
void setup_pointer_sample_offset ();
|
||||
|
||||
private:
|
||||
|
||||
|
@ -753,7 +753,7 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
void setup_pointer_frame_offset ();
|
||||
void setup_pointer_sample_offset ();
|
||||
|
||||
private:
|
||||
MeterMarker* _marker;
|
||||
|
@ -784,7 +784,7 @@ public:
|
|||
return true;
|
||||
}
|
||||
|
||||
void setup_pointer_frame_offset ();
|
||||
void setup_pointer_sample_offset ();
|
||||
|
||||
private:
|
||||
TempoMarker* _marker;
|
||||
|
@ -816,7 +816,7 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
void setup_pointer_frame_offset ();
|
||||
void setup_pointer_sample_offset ();
|
||||
|
||||
private:
|
||||
double _grab_qn;
|
||||
|
@ -844,7 +844,7 @@ public:
|
|||
return true;
|
||||
}
|
||||
|
||||
void setup_pointer_frame_offset ();
|
||||
void setup_pointer_sample_offset ();
|
||||
|
||||
private:
|
||||
double _grab_qn;
|
||||
|
@ -875,7 +875,7 @@ public:
|
|||
return true;
|
||||
}
|
||||
|
||||
void setup_pointer_frame_offset ();
|
||||
void setup_pointer_sample_offset ();
|
||||
|
||||
private:
|
||||
double _grab_qn;
|
||||
|
@ -904,11 +904,11 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
void fake_locate (framepos_t);
|
||||
void fake_locate (samplepos_t);
|
||||
|
||||
EditorCursor& _cursor;
|
||||
bool _stop; ///< true to stop the transport on starting the drag, otherwise false
|
||||
double _grab_zoom; ///< editor frames per unit when our grab started
|
||||
double _grab_zoom; ///< editor samples per unit when our grab started
|
||||
|
||||
//used for zooming
|
||||
int _last_mx;
|
||||
|
@ -932,7 +932,7 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
void setup_pointer_frame_offset ();
|
||||
void setup_pointer_sample_offset ();
|
||||
};
|
||||
|
||||
/** Region fade-out drag */
|
||||
|
@ -950,7 +950,7 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
void setup_pointer_frame_offset ();
|
||||
void setup_pointer_sample_offset ();
|
||||
};
|
||||
|
||||
/** Marker drag */
|
||||
|
@ -973,7 +973,7 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
void setup_pointer_frame_offset ();
|
||||
void setup_pointer_sample_offset ();
|
||||
|
||||
private:
|
||||
void update_item (ARDOUR::Location *);
|
||||
|
@ -1072,7 +1072,7 @@ public:
|
|||
void finished (GdkEvent *, bool);
|
||||
void aborted (bool);
|
||||
|
||||
std::pair<ARDOUR::framecnt_t, int> move_threshold () const {
|
||||
std::pair<ARDOUR::samplecnt_t, int> move_threshold () const {
|
||||
return std::make_pair (8, 1);
|
||||
}
|
||||
|
||||
|
@ -1080,13 +1080,13 @@ public:
|
|||
|
||||
/** Select some things within a rectangle.
|
||||
* @param button_state The button state from the GdkEvent.
|
||||
* @param x1 The left-hand side of the rectangle in session frames.
|
||||
* @param x2 The right-hand side of the rectangle in session frames.
|
||||
* @param x1 The left-hand side of the rectangle in session samples.
|
||||
* @param x2 The right-hand side of the rectangle in session samples.
|
||||
* @param y1 The top of the rectangle in trackview coordinates.
|
||||
* @param y2 The bottom of the rectangle in trackview coordinates.
|
||||
* @param drag_in_progress true if the drag is currently happening.
|
||||
*/
|
||||
virtual void select_things (int button_state, framepos_t x1, framepos_t x2, double y1, double y2, bool drag_in_progress) = 0;
|
||||
virtual void select_things (int button_state, samplepos_t x1, samplepos_t x2, double y1, double y2, bool drag_in_progress) = 0;
|
||||
|
||||
virtual void deselect_things () = 0;
|
||||
|
||||
|
@ -1100,7 +1100,7 @@ class EditorRubberbandSelectDrag : public RubberbandSelectDrag
|
|||
public:
|
||||
EditorRubberbandSelectDrag (Editor *, ArdourCanvas::Item *);
|
||||
|
||||
void select_things (int, framepos_t, framepos_t, double, double, bool);
|
||||
void select_things (int, samplepos_t, samplepos_t, double, double, bool);
|
||||
void deselect_things ();
|
||||
};
|
||||
|
||||
|
@ -1110,7 +1110,7 @@ class MidiRubberbandSelectDrag : public RubberbandSelectDrag
|
|||
public:
|
||||
MidiRubberbandSelectDrag (Editor *, MidiRegionView *);
|
||||
|
||||
void select_things (int, framepos_t, framepos_t, double, double, bool);
|
||||
void select_things (int, samplepos_t, samplepos_t, double, double, bool);
|
||||
void deselect_things ();
|
||||
|
||||
private:
|
||||
|
@ -1123,7 +1123,7 @@ class MidiVerticalSelectDrag : public RubberbandSelectDrag
|
|||
public:
|
||||
MidiVerticalSelectDrag (Editor *, MidiRegionView *);
|
||||
|
||||
void select_things (int, framepos_t, framepos_t, double, double, bool);
|
||||
void select_things (int, samplepos_t, samplepos_t, double, double, bool);
|
||||
void deselect_things ();
|
||||
|
||||
private:
|
||||
|
@ -1173,15 +1173,15 @@ public:
|
|||
void finished (GdkEvent *, bool);
|
||||
void aborted (bool);
|
||||
|
||||
void setup_pointer_frame_offset ();
|
||||
void setup_pointer_sample_offset ();
|
||||
|
||||
private:
|
||||
Operation _operation;
|
||||
bool _add;
|
||||
TrackSelection _track_selection_at_start;
|
||||
bool _time_selection_at_start;
|
||||
framepos_t start_at_start;
|
||||
framepos_t end_at_start;
|
||||
samplepos_t start_at_start;
|
||||
samplepos_t end_at_start;
|
||||
};
|
||||
|
||||
/** Range marker drag */
|
||||
|
@ -1230,7 +1230,7 @@ public:
|
|||
void finished (GdkEvent *, bool);
|
||||
void aborted (bool);
|
||||
|
||||
std::pair<ARDOUR::framecnt_t, int> move_threshold () const {
|
||||
std::pair<ARDOUR::samplecnt_t, int> move_threshold () const {
|
||||
return std::make_pair (4, 4);
|
||||
}
|
||||
|
||||
|
@ -1267,7 +1267,7 @@ private:
|
|||
struct Line {
|
||||
boost::shared_ptr<AutomationLine> line; ///< the line
|
||||
std::list<ControlPoint*> points; ///< points to drag on the line
|
||||
std::pair<ARDOUR::framepos_t, ARDOUR::framepos_t> range; ///< the range of all points on the line, in session frames
|
||||
std::pair<ARDOUR::samplepos_t, ARDOUR::samplepos_t> range; ///< the range of all points on the line, in session samples
|
||||
XMLNode* state; ///< the XML state node before the drag
|
||||
double original_fraction; ///< initial y-fraction before the drag
|
||||
};
|
||||
|
@ -1294,7 +1294,7 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
virtual std::pair<ARDOUR::framecnt_t, int> move_threshold () const {
|
||||
virtual std::pair<ARDOUR::samplecnt_t, int> move_threshold () const {
|
||||
return std::make_pair (4, 4);
|
||||
}
|
||||
|
||||
|
|
|
@ -213,11 +213,11 @@ bool
|
|||
Editor::write_region (string path, boost::shared_ptr<AudioRegion> region)
|
||||
{
|
||||
boost::shared_ptr<AudioFileSource> fs;
|
||||
const framepos_t chunk_size = 4096;
|
||||
framepos_t to_read;
|
||||
const samplepos_t chunk_size = 4096;
|
||||
samplepos_t to_read;
|
||||
Sample buf[chunk_size];
|
||||
gain_t gain_buffer[chunk_size];
|
||||
framepos_t pos;
|
||||
samplepos_t pos;
|
||||
char s[PATH_MAX+1];
|
||||
uint32_t cnt;
|
||||
vector<boost::shared_ptr<AudioFileSource> > sources;
|
||||
|
@ -266,7 +266,7 @@ Editor::write_region (string path, boost::shared_ptr<AudioRegion> region)
|
|||
fs = boost::dynamic_pointer_cast<AudioFileSource> (
|
||||
SourceFactory::createWritable (DataType::AUDIO, *_session,
|
||||
path, true,
|
||||
false, _session->frame_rate()));
|
||||
false, _session->sample_rate()));
|
||||
}
|
||||
|
||||
catch (failed_constructor& err) {
|
||||
|
@ -285,7 +285,7 @@ Editor::write_region (string path, boost::shared_ptr<AudioRegion> region)
|
|||
pos = region->position();
|
||||
|
||||
while (to_read) {
|
||||
framepos_t this_time;
|
||||
samplepos_t this_time;
|
||||
|
||||
this_time = min (to_read, chunk_size);
|
||||
|
||||
|
@ -363,11 +363,11 @@ bool
|
|||
Editor::write_audio_range (AudioPlaylist& playlist, const ChanCount& count, list<AudioRange>& range)
|
||||
{
|
||||
boost::shared_ptr<AudioFileSource> fs;
|
||||
const framepos_t chunk_size = 4096;
|
||||
framepos_t nframes;
|
||||
const samplepos_t chunk_size = 4096;
|
||||
samplepos_t nframes;
|
||||
Sample buf[chunk_size];
|
||||
gain_t gain_buffer[chunk_size];
|
||||
framepos_t pos;
|
||||
samplepos_t pos;
|
||||
char s[PATH_MAX+1];
|
||||
uint32_t cnt;
|
||||
string path;
|
||||
|
@ -405,7 +405,7 @@ Editor::write_audio_range (AudioPlaylist& playlist, const ChanCount& count, list
|
|||
fs = boost::dynamic_pointer_cast<AudioFileSource> (
|
||||
SourceFactory::createWritable (DataType::AUDIO, *_session,
|
||||
path, true,
|
||||
false, _session->frame_rate()));
|
||||
false, _session->sample_rate()));
|
||||
}
|
||||
|
||||
catch (failed_constructor& err) {
|
||||
|
@ -423,7 +423,7 @@ Editor::write_audio_range (AudioPlaylist& playlist, const ChanCount& count, list
|
|||
pos = (*i).start;
|
||||
|
||||
while (nframes) {
|
||||
framepos_t this_time;
|
||||
samplepos_t this_time;
|
||||
|
||||
this_time = min (nframes, chunk_size);
|
||||
|
||||
|
@ -455,7 +455,7 @@ Editor::write_audio_range (AudioPlaylist& playlist, const ChanCount& count, list
|
|||
|
||||
while (nframes) {
|
||||
|
||||
framepos_t this_time = min (nframes, chunk_size);
|
||||
samplepos_t this_time = min (nframes, chunk_size);
|
||||
memset (buf, 0, sizeof (Sample) * this_time);
|
||||
|
||||
for (uint32_t n=0; n < channels; ++n) {
|
||||
|
|
|
@ -43,10 +43,10 @@ Editor::keyboard_selection_finish (bool /*add*/, Editing::EditIgnoreOption ign)
|
|||
{
|
||||
if (_session) {
|
||||
|
||||
MusicFrame start (selection->time.start(), 0);
|
||||
framepos_t end;
|
||||
MusicSample start (selection->time.start(), 0);
|
||||
samplepos_t end;
|
||||
if ((_edit_point == EditAtPlayhead) && _session->transport_rolling()) {
|
||||
end = _session->audible_frame();
|
||||
end = _session->audible_sample();
|
||||
} else {
|
||||
end = get_preferred_edit_position(ign);
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ Editor::keyboard_selection_finish (bool /*add*/, Editing::EditIgnoreOption ign)
|
|||
if ( (_edit_point == EditAtPlayhead) && selection->tracks.empty() )
|
||||
select_all_tracks();
|
||||
|
||||
selection->set (start.frame, end);
|
||||
selection->set (start.sample, end);
|
||||
|
||||
//if session is playing a range, cancel that
|
||||
if (_session->get_play_range())
|
||||
|
@ -72,25 +72,25 @@ Editor::keyboard_selection_begin (Editing::EditIgnoreOption ign)
|
|||
{
|
||||
if (_session) {
|
||||
|
||||
MusicFrame start (0, 0);
|
||||
MusicFrame end (selection->time.end_frame(), 0);
|
||||
MusicSample start (0, 0);
|
||||
MusicSample end (selection->time.end_sample(), 0);
|
||||
if ((_edit_point == EditAtPlayhead) && _session->transport_rolling()) {
|
||||
start.frame = _session->audible_frame();
|
||||
start.sample = _session->audible_sample();
|
||||
} else {
|
||||
start.frame = get_preferred_edit_position(ign);
|
||||
start.sample = get_preferred_edit_position(ign);
|
||||
}
|
||||
|
||||
//snap the selection start/end
|
||||
snap_to(start);
|
||||
|
||||
//if there's not already a sensible selection endpoint, go "forever"
|
||||
if (start.frame > end.frame) {
|
||||
if (start.sample > end.sample) {
|
||||
#ifdef MIXBUS
|
||||
// 4hours at most.
|
||||
// This works around a visual glitch in red-bordered selection rect.
|
||||
end.frame = start.frame + _session->nominal_frame_rate() * 60 * 60 * 4;
|
||||
end.sample = start.sample + _session->nominal_sample_rate() * 60 * 60 * 4;
|
||||
#else
|
||||
end.frame = max_framepos;
|
||||
end.sample = max_samplepos;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,7 @@ Editor::keyboard_selection_begin (Editing::EditIgnoreOption ign)
|
|||
if ( selection->tracks.empty() )
|
||||
select_all_tracks();
|
||||
|
||||
selection->set (start.frame, end.frame);
|
||||
selection->set (start.sample, end.sample);
|
||||
|
||||
//if session is playing a range, cancel that
|
||||
if (_session->get_play_range())
|
||||
|
|
|
@ -597,8 +597,8 @@ Editor::LocationMarkers::set_name (const string& str)
|
|||
}
|
||||
|
||||
void
|
||||
Editor::LocationMarkers::set_position (framepos_t startf,
|
||||
framepos_t endf)
|
||||
Editor::LocationMarkers::set_position (samplepos_t startf,
|
||||
samplepos_t endf)
|
||||
{
|
||||
start->set_position (startf);
|
||||
if (end) {
|
||||
|
@ -643,7 +643,7 @@ Editor::LocationMarkers::setup_lines ()
|
|||
}
|
||||
|
||||
void
|
||||
Editor::mouse_add_new_marker (framepos_t where, bool is_cd)
|
||||
Editor::mouse_add_new_marker (samplepos_t where, bool is_cd)
|
||||
{
|
||||
string markername;
|
||||
int flags = (is_cd ? Location::IsCDMarker|Location::IsMark : Location::IsMark);
|
||||
|
@ -674,7 +674,7 @@ Editor::mouse_add_new_marker (framepos_t where, bool is_cd)
|
|||
}
|
||||
|
||||
void
|
||||
Editor::mouse_add_new_loop (framepos_t where)
|
||||
Editor::mouse_add_new_loop (samplepos_t where)
|
||||
{
|
||||
if (!_session) {
|
||||
return;
|
||||
|
@ -684,13 +684,13 @@ Editor::mouse_add_new_loop (framepos_t where)
|
|||
it's reasonably easy to manipulate after creation.
|
||||
*/
|
||||
|
||||
framepos_t const end = where + current_page_samples() / 8;
|
||||
samplepos_t const end = where + current_page_samples() / 8;
|
||||
|
||||
set_loop_range (where, end, _("set loop range"));
|
||||
}
|
||||
|
||||
void
|
||||
Editor::mouse_add_new_punch (framepos_t where)
|
||||
Editor::mouse_add_new_punch (samplepos_t where)
|
||||
{
|
||||
if (!_session) {
|
||||
return;
|
||||
|
@ -700,13 +700,13 @@ Editor::mouse_add_new_punch (framepos_t where)
|
|||
it's reasonably easy to manipulate after creation.
|
||||
*/
|
||||
|
||||
framepos_t const end = where + current_page_samples() / 8;
|
||||
samplepos_t const end = where + current_page_samples() / 8;
|
||||
|
||||
set_punch_range (where, end, _("set punch range"));
|
||||
}
|
||||
|
||||
void
|
||||
Editor::mouse_add_new_range (framepos_t where)
|
||||
Editor::mouse_add_new_range (samplepos_t where)
|
||||
{
|
||||
if (!_session) {
|
||||
return;
|
||||
|
@ -716,7 +716,7 @@ Editor::mouse_add_new_range (framepos_t where)
|
|||
it's reasonably easy to manipulate after creation.
|
||||
*/
|
||||
|
||||
framepos_t const end = where + current_page_samples() / 8;
|
||||
samplepos_t const end = where + current_page_samples() / 8;
|
||||
|
||||
string name;
|
||||
_session->locations()->next_available_name (name, _("range"));
|
||||
|
@ -1220,11 +1220,11 @@ Editor::marker_menu_range_to_next ()
|
|||
return;
|
||||
}
|
||||
|
||||
framepos_t start;
|
||||
framepos_t end;
|
||||
samplepos_t start;
|
||||
samplepos_t end;
|
||||
_session->locations()->marks_either_side (marker->position(), start, end);
|
||||
|
||||
if (end != max_framepos) {
|
||||
if (end != max_samplepos) {
|
||||
string range_name = l->name();
|
||||
range_name += "-range";
|
||||
|
||||
|
@ -1250,13 +1250,13 @@ Editor::marker_menu_set_from_playhead ()
|
|||
if ((l = find_location_from_marker (marker, is_start)) != 0) {
|
||||
|
||||
if (l->is_mark()) {
|
||||
l->set_start (_session->audible_frame (), false, true, divisions);
|
||||
l->set_start (_session->audible_sample (), false, true, divisions);
|
||||
}
|
||||
else {
|
||||
if (is_start) {
|
||||
l->set_start (_session->audible_frame (), false, true, divisions);
|
||||
l->set_start (_session->audible_sample (), false, true, divisions);
|
||||
} else {
|
||||
l->set_end (_session->audible_frame (), false, true, divisions);
|
||||
l->set_end (_session->audible_sample (), false, true, divisions);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1284,9 +1284,9 @@ Editor::marker_menu_set_from_selection (bool /*force_regions*/)
|
|||
} else {
|
||||
|
||||
if (!selection->time.empty()) {
|
||||
l->set (selection->time.start(), selection->time.end_frame());
|
||||
l->set (selection->time.start(), selection->time.end_sample());
|
||||
} else if (!selection->regions.empty()) {
|
||||
l->set (selection->regions.start(), selection->regions.end_frame());
|
||||
l->set (selection->regions.start(), selection->regions.end_sample());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1353,18 +1353,18 @@ Editor::marker_menu_zoom_to_range ()
|
|||
return;
|
||||
}
|
||||
|
||||
framecnt_t const extra = l->length() * 0.05;
|
||||
framepos_t a = l->start ();
|
||||
samplecnt_t const extra = l->length() * 0.05;
|
||||
samplepos_t a = l->start ();
|
||||
if (a >= extra) {
|
||||
a -= extra;
|
||||
}
|
||||
|
||||
framepos_t b = l->end ();
|
||||
if (b < (max_framepos - extra)) {
|
||||
samplepos_t b = l->end ();
|
||||
if (b < (max_samplepos - extra)) {
|
||||
b += extra;
|
||||
}
|
||||
|
||||
temporal_zoom_by_frame (a, b);
|
||||
temporal_zoom_by_sample (a, b);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1426,7 +1426,7 @@ Editor::toggle_marker_lock_style ()
|
|||
const Timecode::BBT_Time bbt (msp->bbt());
|
||||
const PositionLockStyle pls = (msp->position_lock_style() == AudioTime) ? MusicTime : AudioTime;
|
||||
|
||||
_session->tempo_map().replace_meter (*msp, meter, bbt, msp->frame(), pls);
|
||||
_session->tempo_map().replace_meter (*msp, meter, bbt, msp->sample(), pls);
|
||||
|
||||
XMLNode &after = _session->tempo_map().get_state();
|
||||
_session->add_command(new MementoCommand<TempoMap>(_session->tempo_map(), &before, &after));
|
||||
|
@ -1435,14 +1435,14 @@ Editor::toggle_marker_lock_style ()
|
|||
TempoSection* tsp = &tm->tempo();
|
||||
|
||||
const double pulse = tsp->pulse();
|
||||
const framepos_t frame = tsp->frame();
|
||||
const samplepos_t sample = tsp->sample();
|
||||
const PositionLockStyle pls = (tsp->position_lock_style() == AudioTime) ? MusicTime : AudioTime;
|
||||
const Tempo tempo (tsp->note_types_per_minute(), tsp->note_type(), tsp->end_note_types_per_minute());
|
||||
|
||||
begin_reversible_command (_("change tempo lock style"));
|
||||
XMLNode &before = _session->tempo_map().get_state();
|
||||
|
||||
_session->tempo_map().replace_tempo (*tsp, tempo, pulse, frame, pls);
|
||||
_session->tempo_map().replace_tempo (*tsp, tempo, pulse, sample, pls);
|
||||
|
||||
XMLNode &after = _session->tempo_map().get_state();
|
||||
_session->add_command(new MementoCommand<TempoMap>(_session->tempo_map(), &before, &after));
|
||||
|
@ -1462,13 +1462,13 @@ Editor::toggle_tempo_type ()
|
|||
|
||||
const Tempo tempo (tsp->note_types_per_minute(), tsp->note_type());
|
||||
const double pulse = tsp->pulse();
|
||||
const framepos_t frame = tsp->frame();
|
||||
const samplepos_t sample = tsp->sample();
|
||||
const PositionLockStyle pls = tsp->position_lock_style();
|
||||
|
||||
begin_reversible_command (_("set tempo to constant"));
|
||||
XMLNode &before = _session->tempo_map().get_state();
|
||||
|
||||
_session->tempo_map().replace_tempo (*tsp, tempo, pulse, frame, pls);
|
||||
_session->tempo_map().replace_tempo (*tsp, tempo, pulse, sample, pls);
|
||||
|
||||
XMLNode &after = _session->tempo_map().get_state();
|
||||
_session->add_command(new MementoCommand<TempoMap>(_session->tempo_map(), &before, &after));
|
||||
|
@ -1518,13 +1518,13 @@ Editor::ramp_to_next_tempo ()
|
|||
if (next_ts) {
|
||||
const Tempo tempo (tsp->note_types_per_minute(), tsp->note_type(), next_ts->note_types_per_minute());
|
||||
const double pulse = tsp->pulse();
|
||||
const framepos_t frame = tsp->frame();
|
||||
const samplepos_t sample = tsp->sample();
|
||||
const PositionLockStyle pls = tsp->position_lock_style();
|
||||
|
||||
begin_reversible_command (_("ramp to next tempo"));
|
||||
XMLNode &before = _session->tempo_map().get_state();
|
||||
|
||||
tmap.replace_tempo (*tsp, tempo, pulse, frame, pls);
|
||||
tmap.replace_tempo (*tsp, tempo, pulse, sample, pls);
|
||||
|
||||
XMLNode &after = _session->tempo_map().get_state();
|
||||
_session->add_command(new MementoCommand<TempoMap>(_session->tempo_map(), &before, &after));
|
||||
|
@ -1696,7 +1696,7 @@ Editor::update_punch_range_view ()
|
|||
if (_session->config.get_punch_out()) {
|
||||
pixel_end = sample_to_pixel (tpl->end());
|
||||
} else {
|
||||
pixel_end = sample_to_pixel (max_framepos);
|
||||
pixel_end = sample_to_pixel (max_samplepos);
|
||||
}
|
||||
|
||||
transport_punch_range_rect->set_x0 (pixel_start);
|
||||
|
|
|
@ -83,7 +83,7 @@ using namespace Editing;
|
|||
using Gtkmm2ext::Keyboard;
|
||||
|
||||
bool
|
||||
Editor::mouse_frame (framepos_t& where, bool& in_track_canvas) const
|
||||
Editor::mouse_sample (samplepos_t& where, bool& in_track_canvas) const
|
||||
{
|
||||
/* gdk_window_get_pointer() has X11's XQueryPointer semantics in that it only
|
||||
pays attentions to subwindows. this means that menu windows are ignored, and
|
||||
|
@ -130,7 +130,7 @@ Editor::mouse_frame (framepos_t& where, bool& in_track_canvas) const
|
|||
return true;
|
||||
}
|
||||
|
||||
framepos_t
|
||||
samplepos_t
|
||||
Editor::window_event_sample (GdkEvent const * event, double* pcx, double* pcy) const
|
||||
{
|
||||
ArdourCanvas::Duple d;
|
||||
|
@ -155,7 +155,7 @@ Editor::window_event_sample (GdkEvent const * event, double* pcx, double* pcy) c
|
|||
return pixel_to_sample (d.x);
|
||||
}
|
||||
|
||||
framepos_t
|
||||
samplepos_t
|
||||
Editor::canvas_event_sample (GdkEvent const * event, double* pcx, double* pcy) const
|
||||
{
|
||||
double x;
|
||||
|
@ -178,7 +178,7 @@ Editor::canvas_event_sample (GdkEvent const * event, double* pcx, double* pcy) c
|
|||
|
||||
/* note that pixel_to_sample_from_event() never returns less than zero, so even if the pixel
|
||||
position is negative (as can be the case with motion events in particular),
|
||||
the frame location is always positive.
|
||||
the sample location is always positive.
|
||||
*/
|
||||
|
||||
return pixel_to_sample_from_event (x);
|
||||
|
@ -535,7 +535,7 @@ Editor::button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType it
|
|||
|
||||
std::list<Selectable*> selectables;
|
||||
uint32_t before, after;
|
||||
framecnt_t const where = (framecnt_t) floor (event->button.x * samples_per_pixel) - clicked_regionview->region ()->position ();
|
||||
samplecnt_t const where = (samplecnt_t) floor (event->button.x * samples_per_pixel) - clicked_regionview->region ()->position ();
|
||||
|
||||
if (!argl || !argl->control_points_adjacent (where, before, after)) {
|
||||
break;
|
||||
|
@ -581,7 +581,7 @@ Editor::button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType it
|
|||
al->grab_item().canvas_to_item (mx, my);
|
||||
|
||||
uint32_t before, after;
|
||||
framecnt_t const where = (framecnt_t) floor (mx * samples_per_pixel);
|
||||
samplecnt_t const where = (samplecnt_t) floor (mx * samples_per_pixel);
|
||||
|
||||
if (!al || !al->control_points_adjacent (where, before, after)) {
|
||||
break;
|
||||
|
@ -1052,7 +1052,7 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
|||
_drags->set (new RegionCreateDrag (this, item, parent), event);
|
||||
} else {
|
||||
/* See if there's a region before the click that we can extend, and extend it if so */
|
||||
framepos_t const t = canvas_event_sample (event);
|
||||
samplepos_t const t = canvas_event_sample (event);
|
||||
boost::shared_ptr<Region> prev = pl->find_next_region (t, End, -1);
|
||||
if (!prev) {
|
||||
_drags->set (new RegionCreateDrag (this, item, parent), event);
|
||||
|
@ -1283,9 +1283,9 @@ Editor::button_press_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemTyp
|
|||
UIConfiguration::instance().get_follow_edits() &&
|
||||
!_session->config.get_external_sync()) {
|
||||
|
||||
MusicFrame where (canvas_event_sample (event), 0);
|
||||
MusicSample where (canvas_event_sample (event), 0);
|
||||
snap_to (where);
|
||||
_session->request_locate (where.frame, false);
|
||||
_session->request_locate (where.sample, false);
|
||||
}
|
||||
|
||||
switch (event->button.button) {
|
||||
|
@ -1332,7 +1332,7 @@ Editor::button_release_dispatch (GdkEventButton* ev)
|
|||
bool
|
||||
Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_type)
|
||||
{
|
||||
MusicFrame where (canvas_event_sample (event), 0);
|
||||
MusicSample where (canvas_event_sample (event), 0);
|
||||
AutomationTimeAxisView* atv = 0;
|
||||
|
||||
_press_cursor_ctx.reset();
|
||||
|
@ -1480,7 +1480,7 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
|||
case SamplesRulerItem:
|
||||
case MinsecRulerItem:
|
||||
case BBTRulerItem:
|
||||
popup_ruler_menu (where.frame, item_type);
|
||||
popup_ruler_menu (where.sample, item_type);
|
||||
break;
|
||||
|
||||
case MarkerItem:
|
||||
|
@ -1572,7 +1572,7 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
|||
case MarkerBarItem:
|
||||
if (!_dragging_playhead) {
|
||||
snap_to_with_modifier (where, event, RoundNearest, true);
|
||||
mouse_add_new_marker (where.frame);
|
||||
mouse_add_new_marker (where.sample);
|
||||
}
|
||||
return true;
|
||||
|
||||
|
@ -1580,14 +1580,14 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
|||
if (!_dragging_playhead) {
|
||||
// if we get here then a dragged range wasn't done
|
||||
snap_to_with_modifier (where, event, RoundNearest, true);
|
||||
mouse_add_new_marker (where.frame, true);
|
||||
mouse_add_new_marker (where.sample, true);
|
||||
}
|
||||
return true;
|
||||
case TempoBarItem:
|
||||
case TempoCurveItem:
|
||||
if (!_dragging_playhead && Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier)) {
|
||||
snap_to_with_modifier (where, event);
|
||||
mouse_add_new_tempo_event (where.frame);
|
||||
mouse_add_new_tempo_event (where.sample);
|
||||
}
|
||||
return true;
|
||||
|
||||
|
@ -1631,7 +1631,7 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
|||
bool with_guard_points = Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier);
|
||||
atv = dynamic_cast<AutomationTimeAxisView*>(clicked_axisview);
|
||||
if (atv) {
|
||||
atv->add_automation_event (event, where.frame, event->button.y, with_guard_points);
|
||||
atv->add_automation_event (event, where.sample, event->button.y, with_guard_points);
|
||||
}
|
||||
return true;
|
||||
break;
|
||||
|
@ -1967,13 +1967,13 @@ Editor::leave_handler (ArdourCanvas::Item* item, GdkEvent*, ItemType item_type)
|
|||
}
|
||||
|
||||
void
|
||||
Editor::scrub (framepos_t frame, double current_x)
|
||||
Editor::scrub (samplepos_t sample, double current_x)
|
||||
{
|
||||
double delta;
|
||||
|
||||
if (scrubbing_direction == 0) {
|
||||
/* first move */
|
||||
_session->request_locate (frame, false);
|
||||
_session->request_locate (sample, false);
|
||||
_session->request_transport_speed (0.1);
|
||||
scrubbing_direction = 1;
|
||||
|
||||
|
@ -2208,7 +2208,7 @@ Editor::region_view_item_click (AudioRegionView& rv, GdkEventButton* event)
|
|||
TimeAxisView* tv = &rv.get_time_axis_view();
|
||||
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*>(tv);
|
||||
|
||||
framepos_t where = get_preferred_edit_position();
|
||||
samplepos_t where = get_preferred_edit_position();
|
||||
|
||||
if (where >= 0) {
|
||||
|
||||
|
@ -2263,7 +2263,7 @@ Editor::cancel_time_selection ()
|
|||
}
|
||||
|
||||
void
|
||||
Editor::point_trim (GdkEvent* event, framepos_t new_bound)
|
||||
Editor::point_trim (GdkEvent* event, samplepos_t new_bound)
|
||||
{
|
||||
RegionView* rv = clicked_regionview;
|
||||
|
||||
|
@ -2366,7 +2366,7 @@ Editor::mouse_rename_region (ArdourCanvas::Item* /*item*/, GdkEvent* /*event*/)
|
|||
|
||||
|
||||
void
|
||||
Editor::mouse_brush_insert_region (RegionView* rv, framepos_t pos)
|
||||
Editor::mouse_brush_insert_region (RegionView* rv, samplepos_t pos)
|
||||
{
|
||||
/* no brushing without a useful snap setting */
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -122,12 +122,12 @@ Editor::do_ptimport (std::string ptpath,
|
|||
bool ok = false;
|
||||
bool onefailed = false;
|
||||
PTFFormat ptf;
|
||||
framepos_t pos = -1;
|
||||
samplepos_t pos = -1;
|
||||
|
||||
vector<ptflookup_t> ptfwavpair;
|
||||
vector<ptflookup_t> ptfregpair;
|
||||
|
||||
if (ptf.load(ptpath, _session->frame_rate()) == -1) {
|
||||
if (ptf.load(ptpath, _session->sample_rate()) == -1) {
|
||||
MessageDialog msg (_("Doesn't seem to be a valid PT session file"));
|
||||
msg.run ();
|
||||
return;
|
||||
|
@ -229,9 +229,9 @@ Editor::do_ptimport (std::string ptpath,
|
|||
/* Empty wave - assume MIDI region */
|
||||
boost::shared_ptr<MidiTrack> midi_track = mt.back();
|
||||
boost::shared_ptr<Playlist> playlist = midi_track->playlist();
|
||||
framepos_t f = (framepos_t)a->startpos;
|
||||
framecnt_t length = (framecnt_t)a->length;
|
||||
MusicFrame pos (f, 0);
|
||||
samplepos_t f = (samplepos_t)a->startpos;
|
||||
samplecnt_t length = (samplecnt_t)a->length;
|
||||
MusicSample pos (f, 0);
|
||||
boost::shared_ptr<Source> src = _session->create_midi_source_by_stealing_name (midi_track);
|
||||
PropertyList plist;
|
||||
plist.add (ARDOUR::Properties::start, 0);
|
||||
|
@ -239,8 +239,8 @@ Editor::do_ptimport (std::string ptpath,
|
|||
plist.add (ARDOUR::Properties::name, PBD::basename_nosuffix(src->name()));
|
||||
boost::shared_ptr<Region> region = (RegionFactory::create (src, plist));
|
||||
/* sets beat position */
|
||||
region->set_position (pos.frame, pos.division);
|
||||
midi_track->playlist()->add_region (region, pos.frame, 1.0, false, pos.division);
|
||||
region->set_position (pos.sample, pos.division);
|
||||
midi_track->playlist()->add_region (region, pos.sample, 1.0, false, pos.division);
|
||||
|
||||
boost::shared_ptr<MidiRegion> mr = boost::dynamic_pointer_cast<MidiRegion>(region);
|
||||
boost::shared_ptr<MidiModel> mm = mr->midi_source(0)->model();
|
||||
|
|
|
@ -727,7 +727,7 @@ EditorRegions::update_all_rows ()
|
|||
}
|
||||
|
||||
void
|
||||
EditorRegions::format_position (framepos_t pos, char* buf, size_t bufsize, bool onoff)
|
||||
EditorRegions::format_position (samplepos_t pos, char* buf, size_t bufsize, bool onoff)
|
||||
{
|
||||
Timecode::BBT_Time bbt;
|
||||
Timecode::Time timecode;
|
||||
|
@ -740,7 +740,7 @@ EditorRegions::format_position (framepos_t pos, char* buf, size_t bufsize, bool
|
|||
|
||||
switch (ARDOUR_UI::instance()->secondary_clock->mode ()) {
|
||||
case AudioClock::BBT:
|
||||
bbt = _session->tempo_map().bbt_at_frame (pos);
|
||||
bbt = _session->tempo_map().bbt_at_sample (pos);
|
||||
if (onoff) {
|
||||
snprintf (buf, bufsize, "%03d|%02d|%04d" , bbt.bars, bbt.beats, bbt.ticks);
|
||||
} else {
|
||||
|
@ -749,17 +749,17 @@ EditorRegions::format_position (framepos_t pos, char* buf, size_t bufsize, bool
|
|||
break;
|
||||
|
||||
case AudioClock::MinSec:
|
||||
framepos_t left;
|
||||
samplepos_t left;
|
||||
int hrs;
|
||||
int mins;
|
||||
float secs;
|
||||
|
||||
left = pos;
|
||||
hrs = (int) floor (left / (_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 -= (framecnt_t) floor (mins * _session->frame_rate() * 60.0f);
|
||||
secs = left / (float) _session->frame_rate();
|
||||
hrs = (int) floor (left / (_session->sample_rate() * 60.0f * 60.0f));
|
||||
left -= (samplecnt_t) floor (hrs * _session->sample_rate() * 60.0f * 60.0f);
|
||||
mins = (int) floor (left / (_session->sample_rate() * 60.0f));
|
||||
left -= (samplecnt_t) floor (mins * _session->sample_rate() * 60.0f);
|
||||
secs = left / (float) _session->sample_rate();
|
||||
if (onoff) {
|
||||
snprintf (buf, bufsize, "%02d:%02d:%06.3f", hrs, mins, secs);
|
||||
} else {
|
||||
|
@ -767,7 +767,7 @@ EditorRegions::format_position (framepos_t pos, char* buf, size_t bufsize, bool
|
|||
}
|
||||
break;
|
||||
|
||||
case AudioClock::Frames:
|
||||
case AudioClock::Samples:
|
||||
if (onoff) {
|
||||
snprintf (buf, bufsize, "%" PRId64, pos);
|
||||
} else {
|
||||
|
@ -840,27 +840,27 @@ EditorRegions::populate_row (boost::shared_ptr<Region> region, TreeModel::Row co
|
|||
#if 0
|
||||
if (audioRegion && fades_in_seconds) {
|
||||
|
||||
framepos_t left;
|
||||
samplepos_t left;
|
||||
int mins;
|
||||
int millisecs;
|
||||
|
||||
left = audioRegion->fade_in()->back()->when;
|
||||
mins = (int) floor (left / (_session->frame_rate() * 60.0f));
|
||||
left -= (framepos_t) floor (mins * _session->frame_rate() * 60.0f);
|
||||
millisecs = (int) floor ((left * 1000.0f) / _session->frame_rate());
|
||||
mins = (int) floor (left / (_session->sample_rate() * 60.0f));
|
||||
left -= (samplepos_t) floor (mins * _session->sample_rate() * 60.0f);
|
||||
millisecs = (int) floor ((left * 1000.0f) / _session->sample_rate());
|
||||
|
||||
if (audioRegion->fade_in()->back()->when >= _session->frame_rate()) {
|
||||
if (audioRegion->fade_in()->back()->when >= _session->sample_rate()) {
|
||||
sprintf (fadein_str, "%01dM %01dmS", mins, millisecs);
|
||||
} else {
|
||||
sprintf (fadein_str, "%01dmS", millisecs);
|
||||
}
|
||||
|
||||
left = audioRegion->fade_out()->back()->when;
|
||||
mins = (int) floor (left / (_session->frame_rate() * 60.0f));
|
||||
left -= (framepos_t) floor (mins * _session->frame_rate() * 60.0f);
|
||||
millisecs = (int) floor ((left * 1000.0f) / _session->frame_rate());
|
||||
mins = (int) floor (left / (_session->sample_rate() * 60.0f));
|
||||
left -= (samplepos_t) floor (mins * _session->sample_rate() * 60.0f);
|
||||
millisecs = (int) floor ((left * 1000.0f) / _session->sample_rate());
|
||||
|
||||
if (audioRegion->fade_out()->back()->when >= _session->frame_rate()) {
|
||||
if (audioRegion->fade_out()->back()->when >= _session->sample_rate()) {
|
||||
sprintf (fadeout_str, "%01dM %01dmS", mins, millisecs);
|
||||
} else {
|
||||
sprintf (fadeout_str, "%01dmS", millisecs);
|
||||
|
@ -883,7 +883,7 @@ EditorRegions::populate_row_length (boost::shared_ptr<Region> region, TreeModel:
|
|||
|
||||
if (ARDOUR_UI::instance()->secondary_clock->mode () == AudioClock::BBT) {
|
||||
TempoMap& map (_session->tempo_map());
|
||||
Timecode::BBT_Time bbt = map.bbt_at_beat (map.beat_at_frame (region->last_frame()) - map.beat_at_frame (region->first_frame()));
|
||||
Timecode::BBT_Time bbt = map.bbt_at_beat (map.beat_at_sample (region->last_sample()) - map.beat_at_sample (region->first_sample()));
|
||||
snprintf (buf, sizeof (buf), "%03d|%02d|%04d" , bbt.bars, bbt.beats, bbt.ticks);
|
||||
} else {
|
||||
format_position (region->length(), buf, sizeof (buf));
|
||||
|
@ -899,9 +899,9 @@ EditorRegions::populate_row_end (boost::shared_ptr<Region> region, TreeModel::Ro
|
|||
row[_columns.end] = "";
|
||||
} else if (used > 1) {
|
||||
row[_columns.end] = _("Mult.");
|
||||
} else if (region->last_frame() >= region->first_frame()) {
|
||||
} else if (region->last_sample() >= region->first_sample()) {
|
||||
char buf[16];
|
||||
format_position (region->last_frame(), buf, sizeof (buf));
|
||||
format_position (region->last_sample(), buf, sizeof (buf));
|
||||
row[_columns.end] = buf;
|
||||
} else {
|
||||
row[_columns.end] = "empty";
|
||||
|
@ -932,7 +932,7 @@ EditorRegions::populate_row_sync (boost::shared_ptr<Region> region, TreeModel::R
|
|||
} else {
|
||||
if (region->sync_position() == region->position()) {
|
||||
row[_columns.sync] = _("Start");
|
||||
} else if (region->sync_position() == (region->last_frame())) {
|
||||
} else if (region->sync_position() == (region->last_sample())) {
|
||||
row[_columns.sync] = _("End");
|
||||
} else {
|
||||
char buf[16];
|
||||
|
@ -1319,7 +1319,7 @@ EditorRegions::drag_data_received (const RefPtr<Gdk::DragContext>& context,
|
|||
}
|
||||
|
||||
if (_editor->convert_drop_to_paths (paths, context, x, y, data, info, time) == 0) {
|
||||
framepos_t pos = 0;
|
||||
samplepos_t pos = 0;
|
||||
bool copy = ((context->get_actions() & (Gdk::ACTION_COPY | Gdk::ACTION_LINK | Gdk::ACTION_MOVE)) == Gdk::ACTION_COPY);
|
||||
|
||||
if (UIConfiguration::instance().get_only_copy_imported_files() || copy) {
|
||||
|
|
|
@ -155,7 +155,7 @@ private:
|
|||
|
||||
int sorter (Gtk::TreeModel::iterator, Gtk::TreeModel::iterator);
|
||||
|
||||
void format_position (ARDOUR::framepos_t pos, char* buf, size_t bufsize, bool onoff = true);
|
||||
void format_position (ARDOUR::samplepos_t pos, char* buf, size_t bufsize, bool onoff = true);
|
||||
|
||||
void add_region (boost::shared_ptr<ARDOUR::Region>);
|
||||
|
||||
|
@ -194,7 +194,7 @@ private:
|
|||
|
||||
Gtk::Menu* _menu;
|
||||
Gtk::ScrolledWindow _scroller;
|
||||
Gtk::Frame _frame;
|
||||
Gtk::Frame _sample;
|
||||
|
||||
Gtkmm2ext::DnDTreeView<boost::shared_ptr<ARDOUR::Region> > _display;
|
||||
|
||||
|
|
|
@ -1782,7 +1782,7 @@ EditorRoutes::solo_changed_so_update_mute ()
|
|||
void
|
||||
EditorRoutes::show_tracks_with_regions_at_playhead ()
|
||||
{
|
||||
boost::shared_ptr<RouteList> const r = _session->get_routes_with_regions_at (_session->transport_frame ());
|
||||
boost::shared_ptr<RouteList> const r = _session->get_routes_with_regions_at (_session->transport_sample ());
|
||||
|
||||
set<TimeAxisView*> show;
|
||||
for (RouteList::const_iterator i = r->begin(); i != r->end(); ++i) {
|
||||
|
|
|
@ -193,7 +193,7 @@ Editor::ruler_label_button_release (GdkEventButton* ev)
|
|||
}
|
||||
|
||||
void
|
||||
Editor::popup_ruler_menu (framepos_t where, ItemType t)
|
||||
Editor::popup_ruler_menu (samplepos_t where, ItemType t)
|
||||
{
|
||||
using namespace Menu_Helpers;
|
||||
|
||||
|
@ -602,10 +602,10 @@ Editor::update_just_timecode ()
|
|||
return;
|
||||
}
|
||||
|
||||
framepos_t rightmost_frame = leftmost_frame + current_page_samples();
|
||||
samplepos_t rightmost_sample = _leftmost_sample + current_page_samples();
|
||||
|
||||
if (ruler_timecode_action->get_active()) {
|
||||
timecode_ruler->set_range (leftmost_frame, rightmost_frame);
|
||||
timecode_ruler->set_range (_leftmost_sample, rightmost_sample);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -617,22 +617,22 @@ Editor::compute_fixed_ruler_scale ()
|
|||
}
|
||||
|
||||
if (ruler_timecode_action->get_active()) {
|
||||
set_timecode_ruler_scale (leftmost_frame, leftmost_frame + current_page_samples());
|
||||
set_timecode_ruler_scale (_leftmost_sample, _leftmost_sample + current_page_samples());
|
||||
}
|
||||
|
||||
if (ruler_minsec_action->get_active()) {
|
||||
set_minsec_ruler_scale (leftmost_frame, leftmost_frame + current_page_samples());
|
||||
set_minsec_ruler_scale (_leftmost_sample, _leftmost_sample + current_page_samples());
|
||||
}
|
||||
|
||||
if (ruler_samples_action->get_active()) {
|
||||
set_samples_ruler_scale (leftmost_frame, leftmost_frame + current_page_samples());
|
||||
set_samples_ruler_scale (_leftmost_sample, _leftmost_sample + current_page_samples());
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Editor::update_fixed_rulers ()
|
||||
{
|
||||
framepos_t rightmost_frame;
|
||||
samplepos_t rightmost_sample;
|
||||
|
||||
if (_session == 0) {
|
||||
return;
|
||||
|
@ -644,22 +644,22 @@ Editor::update_fixed_rulers ()
|
|||
_samples_metric->units_per_pixel = samples_per_pixel;
|
||||
_minsec_metric->units_per_pixel = samples_per_pixel;
|
||||
|
||||
rightmost_frame = leftmost_frame + current_page_samples();
|
||||
rightmost_sample = _leftmost_sample + current_page_samples();
|
||||
|
||||
/* these force a redraw, which in turn will force execution of the metric callbacks
|
||||
to compute the relevant ticks to display.
|
||||
*/
|
||||
|
||||
if (ruler_timecode_action->get_active()) {
|
||||
timecode_ruler->set_range (leftmost_frame, rightmost_frame);
|
||||
timecode_ruler->set_range (_leftmost_sample, rightmost_sample);
|
||||
}
|
||||
|
||||
if (ruler_samples_action->get_active()) {
|
||||
samples_ruler->set_range (leftmost_frame, rightmost_frame);
|
||||
samples_ruler->set_range (_leftmost_sample, rightmost_sample);
|
||||
}
|
||||
|
||||
if (ruler_minsec_action->get_active()) {
|
||||
minsec_ruler->set_range (leftmost_frame, rightmost_frame);
|
||||
minsec_ruler->set_range (_leftmost_sample, rightmost_sample);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -673,54 +673,54 @@ Editor::update_tempo_based_rulers ()
|
|||
_bbt_metric->units_per_pixel = samples_per_pixel;
|
||||
|
||||
if (ruler_bbt_action->get_active()) {
|
||||
bbt_ruler->set_range (leftmost_frame, leftmost_frame+current_page_samples());
|
||||
bbt_ruler->set_range (_leftmost_sample, _leftmost_sample+current_page_samples());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Editor::set_timecode_ruler_scale (framepos_t lower, framepos_t upper)
|
||||
Editor::set_timecode_ruler_scale (samplepos_t lower, samplepos_t upper)
|
||||
{
|
||||
using namespace std;
|
||||
|
||||
framepos_t spacer;
|
||||
framepos_t fr;
|
||||
samplepos_t spacer;
|
||||
samplepos_t fr;
|
||||
|
||||
if (_session == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
fr = _session->frame_rate();
|
||||
fr = _session->sample_rate();
|
||||
|
||||
if (lower > (spacer = (framepos_t) (128 * Editor::get_current_zoom ()))) {
|
||||
if (lower > (spacer = (samplepos_t) (128 * Editor::get_current_zoom ()))) {
|
||||
lower = lower - spacer;
|
||||
} else {
|
||||
lower = 0;
|
||||
}
|
||||
|
||||
upper = upper + spacer;
|
||||
framecnt_t const range = upper - lower;
|
||||
samplecnt_t const range = upper - lower;
|
||||
|
||||
if (range < (2 * _session->samples_per_timecode_frame())) { /* 0 - 2 frames */
|
||||
if (range < (2 * _session->samples_per_timecode_frame())) { /* 0 - 2 samples */
|
||||
timecode_ruler_scale = timecode_show_bits;
|
||||
timecode_mark_modulo = 20;
|
||||
timecode_nmarks = 2 + (2 * _session->config.get_subframes_per_frame());
|
||||
} else if (range <= (fr / 4)) { /* 2 frames - 0.250 second */
|
||||
timecode_ruler_scale = timecode_show_frames;
|
||||
} else if (range <= (fr / 4)) { /* 2 samples - 0.250 second */
|
||||
timecode_ruler_scale = timecode_show_samples;
|
||||
timecode_mark_modulo = 1;
|
||||
timecode_nmarks = 2 + (range / (framepos_t)_session->samples_per_timecode_frame());
|
||||
timecode_nmarks = 2 + (range / (samplepos_t)_session->samples_per_timecode_frame());
|
||||
} else if (range <= (fr / 2)) { /* 0.25-0.5 second */
|
||||
timecode_ruler_scale = timecode_show_frames;
|
||||
timecode_ruler_scale = timecode_show_samples;
|
||||
timecode_mark_modulo = 2;
|
||||
timecode_nmarks = 2 + (range / (framepos_t)_session->samples_per_timecode_frame());
|
||||
timecode_nmarks = 2 + (range / (samplepos_t)_session->samples_per_timecode_frame());
|
||||
} else if (range <= fr) { /* 0.5-1 second */
|
||||
timecode_ruler_scale = timecode_show_frames;
|
||||
timecode_ruler_scale = timecode_show_samples;
|
||||
timecode_mark_modulo = 5;
|
||||
timecode_nmarks = 2 + (range / (framepos_t)_session->samples_per_timecode_frame());
|
||||
timecode_nmarks = 2 + (range / (samplepos_t)_session->samples_per_timecode_frame());
|
||||
} else if (range <= 2 * fr) { /* 1-2 seconds */
|
||||
timecode_ruler_scale = timecode_show_frames;
|
||||
timecode_ruler_scale = timecode_show_samples;
|
||||
timecode_mark_modulo = 10;
|
||||
timecode_nmarks = 2 + (range / (framepos_t)_session->samples_per_timecode_frame());
|
||||
timecode_nmarks = 2 + (range / (samplepos_t)_session->samples_per_timecode_frame());
|
||||
} else if (range <= 8 * fr) { /* 2-8 seconds */
|
||||
timecode_ruler_scale = timecode_show_seconds;
|
||||
timecode_mark_modulo = 1;
|
||||
|
@ -771,7 +771,7 @@ Editor::set_timecode_ruler_scale (framepos_t lower, framepos_t upper)
|
|||
timecode_nmarks = 2 + 24;
|
||||
} else {
|
||||
|
||||
const framecnt_t hours_in_range = range / (60 * 60 * fr);
|
||||
const samplecnt_t hours_in_range = range / (60 * 60 * fr);
|
||||
const int text_width_rough_guess = 120; /* pixels, very very approximate guess at how wide the tick mark text is */
|
||||
|
||||
/* Normally we do not need to know anything about the width of the canvas
|
||||
|
@ -786,15 +786,15 @@ Editor::set_timecode_ruler_scale (framepos_t lower, framepos_t upper)
|
|||
|
||||
timecode_nmarks = _track_canvas->width() / text_width_rough_guess;
|
||||
timecode_ruler_scale = timecode_show_many_hours;
|
||||
timecode_mark_modulo = max ((framecnt_t) 1, 1 + (hours_in_range / timecode_nmarks));
|
||||
timecode_mark_modulo = max ((samplecnt_t) 1, 1 + (hours_in_range / timecode_nmarks));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Editor::metric_get_timecode (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdouble lower, gdouble /*upper*/, gint /*maxchars*/)
|
||||
{
|
||||
framepos_t pos;
|
||||
framecnt_t spacer;
|
||||
samplepos_t pos;
|
||||
samplecnt_t spacer;
|
||||
Timecode::Time timecode;
|
||||
gchar buf[16];
|
||||
gint n;
|
||||
|
@ -804,13 +804,13 @@ Editor::metric_get_timecode (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdou
|
|||
return;
|
||||
}
|
||||
|
||||
if (lower > (spacer = (framecnt_t)(128 * Editor::get_current_zoom ()))) {
|
||||
if (lower > (spacer = (samplecnt_t)(128 * Editor::get_current_zoom ()))) {
|
||||
lower = lower - spacer;
|
||||
} else {
|
||||
lower = 0;
|
||||
}
|
||||
|
||||
pos = (framecnt_t) floor (lower);
|
||||
pos = (samplecnt_t) floor (lower);
|
||||
|
||||
switch (timecode_ruler_scale) {
|
||||
case timecode_show_bits:
|
||||
|
@ -838,11 +838,11 @@ Editor::metric_get_timecode (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdou
|
|||
}
|
||||
break;
|
||||
|
||||
case timecode_show_frames:
|
||||
case timecode_show_samples:
|
||||
// Find timecode time of this sample (pos)
|
||||
_session->sample_to_timecode(pos, timecode, true /* use_offset */, false /* use_subframes */ );
|
||||
// Go to next whole frame down
|
||||
Timecode::frames_floor( timecode );
|
||||
// Go to next whole sample down
|
||||
Timecode::frames_floot( timecode );
|
||||
for (n = 0; n < timecode_nmarks; n++) {
|
||||
_session->timecode_to_sample(timecode, pos, true /* use_offset */, false /* use_subframes */ );
|
||||
if ((timecode.frames % timecode_mark_modulo) == 0) {
|
||||
|
@ -961,7 +961,7 @@ Editor::metric_get_timecode (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdou
|
|||
}
|
||||
|
||||
void
|
||||
Editor::compute_bbt_ruler_scale (framepos_t lower, framepos_t upper)
|
||||
Editor::compute_bbt_ruler_scale (samplepos_t lower, samplepos_t upper)
|
||||
{
|
||||
if (_session == 0) {
|
||||
return;
|
||||
|
@ -969,14 +969,14 @@ Editor::compute_bbt_ruler_scale (framepos_t lower, framepos_t upper)
|
|||
|
||||
std::vector<TempoMap::BBTPoint>::const_iterator i;
|
||||
Timecode::BBT_Time lower_beat, upper_beat; // the beats at each end of the ruler
|
||||
double floor_lower_beat = floor(max (0.0, _session->tempo_map().beat_at_frame (lower)));
|
||||
double floor_lower_beat = floor(max (0.0, _session->tempo_map().beat_at_sample (lower)));
|
||||
|
||||
if (floor_lower_beat < 0.0) {
|
||||
floor_lower_beat = 0.0;
|
||||
}
|
||||
|
||||
const framecnt_t beat_before_lower_pos = _session->tempo_map().frame_at_beat (floor_lower_beat);
|
||||
const framecnt_t beat_after_upper_pos = _session->tempo_map().frame_at_beat (floor (max (0.0, _session->tempo_map().beat_at_frame (upper))) + 1.0);
|
||||
const samplecnt_t beat_before_lower_pos = _session->tempo_map().sample_at_beat (floor_lower_beat);
|
||||
const samplecnt_t beat_after_upper_pos = _session->tempo_map().sample_at_beat (floor (max (0.0, _session->tempo_map().beat_at_sample (upper))) + 1.0);
|
||||
|
||||
_session->bbt_time (beat_before_lower_pos, lower_beat);
|
||||
_session->bbt_time (beat_after_upper_pos, upper_beat);
|
||||
|
@ -1060,7 +1060,7 @@ Editor::compute_bbt_ruler_scale (framepos_t lower, framepos_t upper)
|
|||
break;
|
||||
}
|
||||
|
||||
const double ceil_upper_beat = floor (max (0.0, _session->tempo_map().beat_at_frame (upper))) + 1.0;
|
||||
const double ceil_upper_beat = floor (max (0.0, _session->tempo_map().beat_at_sample (upper))) + 1.0;
|
||||
if (ceil_upper_beat == floor_lower_beat) {
|
||||
return;
|
||||
}
|
||||
|
@ -1118,7 +1118,7 @@ Editor::metric_get_bbt (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdouble l
|
|||
|
||||
char buf[64];
|
||||
gint n = 0;
|
||||
framepos_t pos;
|
||||
samplepos_t pos;
|
||||
Timecode::BBT_Time next_beat;
|
||||
uint32_t beats = 0;
|
||||
uint32_t tick = 0;
|
||||
|
@ -1151,7 +1151,7 @@ Editor::metric_get_bbt (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdouble l
|
|||
|
||||
for (n = 1, i = grid.begin(); n < bbt_nmarks && i != grid.end(); ++i) {
|
||||
|
||||
if ((*i).frame < lower && (bbt_bar_helper_on)) {
|
||||
if ((*i).sample < lower && (bbt_bar_helper_on)) {
|
||||
snprintf (buf, sizeof(buf), "<%" PRIu32 "|%" PRIu32, (*i).bar, (*i).beat);
|
||||
edit_last_mark_label (marks, buf);
|
||||
} else {
|
||||
|
@ -1167,7 +1167,7 @@ Editor::metric_get_bbt (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdouble l
|
|||
buf[0] = '\0';
|
||||
}
|
||||
mark.label = buf;
|
||||
mark.position = (*i).frame;
|
||||
mark.position = (*i).sample;
|
||||
marks.push_back (mark);
|
||||
n++;
|
||||
}
|
||||
|
@ -1190,7 +1190,7 @@ Editor::metric_get_bbt (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdouble l
|
|||
|
||||
for (n = 1, i = grid.begin(); n < bbt_nmarks && i != grid.end(); ++i) {
|
||||
|
||||
if ((*i).frame < lower && (bbt_bar_helper_on)) {
|
||||
if ((*i).sample < lower && (bbt_bar_helper_on)) {
|
||||
snprintf (buf, sizeof(buf), "<%" PRIu32 "|%" PRIu32, (*i).bar, (*i).beat);
|
||||
edit_last_mark_label (marks, buf);
|
||||
helper_active = true;
|
||||
|
@ -1203,11 +1203,11 @@ Editor::metric_get_bbt (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdouble l
|
|||
mark.style = ArdourCanvas::Ruler::Mark::Minor;
|
||||
snprintf (buf, sizeof(buf), "%" PRIu32, (*i).beat);
|
||||
}
|
||||
if (((*i).frame < bbt_position_of_helper) && helper_active) {
|
||||
if (((*i).sample < bbt_position_of_helper) && helper_active) {
|
||||
buf[0] = '\0';
|
||||
}
|
||||
mark.label = buf;
|
||||
mark.position = (*i).frame;
|
||||
mark.position = (*i).sample;
|
||||
marks.push_back (mark);
|
||||
n++;
|
||||
}
|
||||
|
@ -1221,7 +1221,7 @@ Editor::metric_get_bbt (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdouble l
|
|||
next_beat.beats = (*i).beat;
|
||||
next_beat.bars = (*i).bar;
|
||||
next_beat.ticks = tick;
|
||||
pos = _session->tempo_map().frame_at_bbt (next_beat);
|
||||
pos = _session->tempo_map().sample_at_bbt (next_beat);
|
||||
|
||||
if (t % bbt_accent_modulo == (bbt_accent_modulo - 1)) {
|
||||
i_am_accented = true;
|
||||
|
@ -1259,7 +1259,7 @@ Editor::metric_get_bbt (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdouble l
|
|||
|
||||
for (n = 1, i = grid.begin(); n < bbt_nmarks && i != grid.end(); ++i) {
|
||||
|
||||
if ((*i).frame < lower && (bbt_bar_helper_on)) {
|
||||
if ((*i).sample < lower && (bbt_bar_helper_on)) {
|
||||
snprintf (buf, sizeof(buf), "<%" PRIu32 "|%" PRIu32, (*i).bar, (*i).beat);
|
||||
edit_last_mark_label (marks, buf);
|
||||
helper_active = true;
|
||||
|
@ -1272,11 +1272,11 @@ Editor::metric_get_bbt (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdouble l
|
|||
mark.style = ArdourCanvas::Ruler::Mark::Minor;
|
||||
snprintf (buf, sizeof(buf), "%" PRIu32, (*i).beat);
|
||||
}
|
||||
if (((*i).frame < bbt_position_of_helper) && helper_active) {
|
||||
if (((*i).sample < bbt_position_of_helper) && helper_active) {
|
||||
buf[0] = '\0';
|
||||
}
|
||||
mark.label = buf;
|
||||
mark.position = (*i).frame;
|
||||
mark.position = (*i).sample;
|
||||
marks.push_back (mark);
|
||||
n++;
|
||||
}
|
||||
|
@ -1291,7 +1291,7 @@ Editor::metric_get_bbt (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdouble l
|
|||
next_beat.beats = (*i).beat;
|
||||
next_beat.bars = (*i).bar;
|
||||
next_beat.ticks = tick;
|
||||
pos = _session->tempo_map().frame_at_bbt (next_beat);
|
||||
pos = _session->tempo_map().sample_at_bbt (next_beat);
|
||||
|
||||
if (t % bbt_accent_modulo == (bbt_accent_modulo - 1)) {
|
||||
i_am_accented = true;
|
||||
|
@ -1335,7 +1335,7 @@ Editor::metric_get_bbt (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdouble l
|
|||
|
||||
for (n = 1, i = grid.begin(); n < bbt_nmarks && i != grid.end(); ++i) {
|
||||
|
||||
if ((*i).frame < lower && (bbt_bar_helper_on)) {
|
||||
if ((*i).sample < lower && (bbt_bar_helper_on)) {
|
||||
snprintf (buf, sizeof(buf), "<%" PRIu32 "|%" PRIu32, (*i).bar, (*i).beat);
|
||||
edit_last_mark_label (marks, buf);
|
||||
helper_active = true;
|
||||
|
@ -1348,11 +1348,11 @@ Editor::metric_get_bbt (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdouble l
|
|||
mark.style = ArdourCanvas::Ruler::Mark::Minor;
|
||||
snprintf (buf, sizeof(buf), "%" PRIu32, (*i).beat);
|
||||
}
|
||||
if (((*i).frame < bbt_position_of_helper) && helper_active) {
|
||||
if (((*i).sample < bbt_position_of_helper) && helper_active) {
|
||||
buf[0] = '\0';
|
||||
}
|
||||
mark.label = buf;
|
||||
mark.position = (*i).frame;
|
||||
mark.position = (*i).sample;
|
||||
marks.push_back (mark);
|
||||
n++;
|
||||
}
|
||||
|
@ -1367,7 +1367,7 @@ Editor::metric_get_bbt (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdouble l
|
|||
while (tick < Timecode::BBT_Time::ticks_per_beat && (n < bbt_nmarks)) {
|
||||
|
||||
next_beat.ticks = tick;
|
||||
pos = _session->tempo_map().frame_at_bbt (next_beat);
|
||||
pos = _session->tempo_map().sample_at_bbt (next_beat);
|
||||
if (t % bbt_accent_modulo == (bbt_accent_modulo - 1)) {
|
||||
i_am_accented = true;
|
||||
}
|
||||
|
@ -1423,7 +1423,7 @@ Editor::metric_get_bbt (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdouble l
|
|||
}
|
||||
}
|
||||
mark.label = buf;
|
||||
mark.position = (*i).frame;
|
||||
mark.position = (*i).sample;
|
||||
marks.push_back (mark);
|
||||
++n;
|
||||
}
|
||||
|
@ -1448,7 +1448,7 @@ Editor::metric_get_bbt (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdouble l
|
|||
}
|
||||
}
|
||||
mark.label = buf;
|
||||
mark.position = (*i).frame;
|
||||
mark.position = (*i).sample;
|
||||
marks.push_back (mark);
|
||||
++n;
|
||||
}
|
||||
|
@ -1473,7 +1473,7 @@ Editor::metric_get_bbt (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdouble l
|
|||
}
|
||||
}
|
||||
mark.label = buf;
|
||||
mark.position = (*i).frame;
|
||||
mark.position = (*i).sample;
|
||||
marks.push_back (mark);
|
||||
++n;
|
||||
}
|
||||
|
@ -1498,7 +1498,7 @@ Editor::metric_get_bbt (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdouble l
|
|||
}
|
||||
}
|
||||
mark.label = buf;
|
||||
mark.position = (*i).frame;
|
||||
mark.position = (*i).sample;
|
||||
marks.push_back (mark);
|
||||
++n;
|
||||
}
|
||||
|
@ -1509,7 +1509,7 @@ Editor::metric_get_bbt (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdouble l
|
|||
}
|
||||
|
||||
void
|
||||
Editor::set_samples_ruler_scale (framepos_t lower, framepos_t upper)
|
||||
Editor::set_samples_ruler_scale (samplepos_t lower, samplepos_t upper)
|
||||
{
|
||||
_samples_ruler_interval = (upper - lower) / 5;
|
||||
}
|
||||
|
@ -1517,8 +1517,8 @@ Editor::set_samples_ruler_scale (framepos_t lower, framepos_t upper)
|
|||
void
|
||||
Editor::metric_get_samples (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdouble lower, gdouble /*upper*/, gint /*maxchars*/)
|
||||
{
|
||||
framepos_t pos;
|
||||
framepos_t const ilower = (framepos_t) floor (lower);
|
||||
samplepos_t pos;
|
||||
samplepos_t const ilower = (samplepos_t) floor (lower);
|
||||
gchar buf[16];
|
||||
gint nmarks;
|
||||
gint n;
|
||||
|
@ -1539,15 +1539,15 @@ Editor::metric_get_samples (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdoub
|
|||
}
|
||||
|
||||
static void
|
||||
sample_to_clock_parts ( framepos_t sample,
|
||||
framepos_t sample_rate,
|
||||
sample_to_clock_parts ( samplepos_t sample,
|
||||
samplepos_t sample_rate,
|
||||
long *hrs_p,
|
||||
long *mins_p,
|
||||
long *secs_p,
|
||||
long *millisecs_p)
|
||||
|
||||
{
|
||||
framepos_t left;
|
||||
samplepos_t left;
|
||||
long hrs;
|
||||
long mins;
|
||||
long secs;
|
||||
|
@ -1571,10 +1571,10 @@ sample_to_clock_parts ( framepos_t sample,
|
|||
}
|
||||
|
||||
void
|
||||
Editor::set_minsec_ruler_scale (framepos_t lower, framepos_t upper)
|
||||
Editor::set_minsec_ruler_scale (samplepos_t lower, samplepos_t upper)
|
||||
{
|
||||
framepos_t fr = _session->frame_rate() * 1000;
|
||||
framepos_t spacer;
|
||||
samplepos_t fr = _session->sample_rate() * 1000;
|
||||
samplepos_t spacer;
|
||||
|
||||
if (_session == 0) {
|
||||
return;
|
||||
|
@ -1582,13 +1582,13 @@ Editor::set_minsec_ruler_scale (framepos_t lower, framepos_t upper)
|
|||
|
||||
|
||||
/* to prevent 'flashing' */
|
||||
if (lower > (spacer = (framepos_t)(128 * Editor::get_current_zoom ()))) {
|
||||
if (lower > (spacer = (samplepos_t)(128 * Editor::get_current_zoom ()))) {
|
||||
lower -= spacer;
|
||||
} else {
|
||||
lower = 0;
|
||||
}
|
||||
upper += spacer;
|
||||
framecnt_t const range = (upper - lower) * 1000;
|
||||
samplecnt_t const range = (upper - lower) * 1000;
|
||||
|
||||
if (range <= (fr / 10)) { /* 0-0.1 second */
|
||||
minsec_mark_interval = fr / 1000; /* show 1/1000 seconds */
|
||||
|
@ -1672,7 +1672,7 @@ Editor::set_minsec_ruler_scale (framepos_t lower, framepos_t upper)
|
|||
minsec_nmarks = 2 + (range / minsec_mark_interval);
|
||||
} else {
|
||||
|
||||
const framecnt_t hours_in_range = range / (60 * 60 * fr);
|
||||
const samplecnt_t hours_in_range = range / (60 * 60 * fr);
|
||||
const int text_width_rough_guess = 70; /* pixels, very very approximate guess at how wide the tick mark text is */
|
||||
|
||||
/* Normally we do not need to know anything about the width of the canvas
|
||||
|
@ -1686,7 +1686,7 @@ Editor::set_minsec_ruler_scale (framepos_t lower, framepos_t upper)
|
|||
*/
|
||||
|
||||
minsec_nmarks = _track_canvas->width() / text_width_rough_guess;
|
||||
minsec_mark_modulo = max ((framecnt_t) 1, 1 + (hours_in_range / minsec_nmarks));
|
||||
minsec_mark_modulo = max ((samplecnt_t) 1, 1 + (hours_in_range / minsec_nmarks));
|
||||
minsec_mark_interval = minsec_mark_modulo * (60 * 60 * fr);
|
||||
minsec_ruler_scale = minsec_show_many_hours;
|
||||
}
|
||||
|
@ -1695,8 +1695,8 @@ Editor::set_minsec_ruler_scale (framepos_t lower, framepos_t upper)
|
|||
void
|
||||
Editor::metric_get_minsec (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdouble lower, gdouble upper, gint /*maxchars*/)
|
||||
{
|
||||
framepos_t pos;
|
||||
framepos_t spacer;
|
||||
samplepos_t pos;
|
||||
samplepos_t spacer;
|
||||
long hrs, mins, secs, millisecs;
|
||||
gchar buf[16];
|
||||
gint n;
|
||||
|
@ -1707,19 +1707,19 @@ Editor::metric_get_minsec (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdoubl
|
|||
}
|
||||
|
||||
/* to prevent 'flashing' */
|
||||
if (lower > (spacer = (framepos_t) (128 * Editor::get_current_zoom ()))) {
|
||||
if (lower > (spacer = (samplepos_t) (128 * Editor::get_current_zoom ()))) {
|
||||
lower = lower - spacer;
|
||||
} else {
|
||||
lower = 0;
|
||||
}
|
||||
|
||||
pos = (((1000 * (framepos_t) floor(lower)) + (minsec_mark_interval/2))/minsec_mark_interval) * minsec_mark_interval;
|
||||
pos = (((1000 * (samplepos_t) floor(lower)) + (minsec_mark_interval/2))/minsec_mark_interval) * minsec_mark_interval;
|
||||
|
||||
switch (minsec_ruler_scale) {
|
||||
|
||||
case minsec_show_msecs:
|
||||
for (n = 0; n < minsec_nmarks && n < upper; pos += minsec_mark_interval, ++n) {
|
||||
sample_to_clock_parts (pos, _session->frame_rate(), &hrs, &mins, &secs, &millisecs);
|
||||
sample_to_clock_parts (pos, _session->sample_rate(), &hrs, &mins, &secs, &millisecs);
|
||||
if (millisecs % minsec_mark_modulo == 0) {
|
||||
if (millisecs == 0) {
|
||||
mark.style = ArdourCanvas::Ruler::Mark::Major;
|
||||
|
@ -1739,7 +1739,7 @@ Editor::metric_get_minsec (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdoubl
|
|||
|
||||
case minsec_show_seconds:
|
||||
for (n = 0; n < minsec_nmarks; pos += minsec_mark_interval, ++n) {
|
||||
sample_to_clock_parts (pos, _session->frame_rate(), &hrs, &mins, &secs, &millisecs);
|
||||
sample_to_clock_parts (pos, _session->sample_rate(), &hrs, &mins, &secs, &millisecs);
|
||||
if (secs % minsec_mark_modulo == 0) {
|
||||
if (secs == 0) {
|
||||
mark.style = ArdourCanvas::Ruler::Mark::Major;
|
||||
|
@ -1759,7 +1759,7 @@ Editor::metric_get_minsec (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdoubl
|
|||
|
||||
case minsec_show_minutes:
|
||||
for (n = 0; n < minsec_nmarks; pos += minsec_mark_interval, ++n) {
|
||||
sample_to_clock_parts (pos, _session->frame_rate(), &hrs, &mins, &secs, &millisecs);
|
||||
sample_to_clock_parts (pos, _session->sample_rate(), &hrs, &mins, &secs, &millisecs);
|
||||
if (mins % minsec_mark_modulo == 0) {
|
||||
if (mins == 0) {
|
||||
mark.style = ArdourCanvas::Ruler::Mark::Major;
|
||||
|
@ -1779,7 +1779,7 @@ Editor::metric_get_minsec (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdoubl
|
|||
|
||||
case minsec_show_hours:
|
||||
for (n = 0; n < minsec_nmarks; pos += minsec_mark_interval, ++n) {
|
||||
sample_to_clock_parts (pos, _session->frame_rate(), &hrs, &mins, &secs, &millisecs);
|
||||
sample_to_clock_parts (pos, _session->sample_rate(), &hrs, &mins, &secs, &millisecs);
|
||||
if (hrs % minsec_mark_modulo == 0) {
|
||||
mark.style = ArdourCanvas::Ruler::Mark::Major;
|
||||
snprintf (buf, sizeof(buf), "%02ld:%02ld", hrs, mins);
|
||||
|
@ -1795,7 +1795,7 @@ Editor::metric_get_minsec (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdoubl
|
|||
|
||||
case minsec_show_many_hours:
|
||||
for (n = 0; n < minsec_nmarks; ) {
|
||||
sample_to_clock_parts (pos, _session->frame_rate(), &hrs, &mins, &secs, &millisecs);
|
||||
sample_to_clock_parts (pos, _session->sample_rate(), &hrs, &mins, &secs, &millisecs);
|
||||
if (hrs % minsec_mark_modulo == 0) {
|
||||
mark.style = ArdourCanvas::Ruler::Mark::Major;
|
||||
snprintf (buf, sizeof(buf), "%02ld:00", hrs);
|
||||
|
|
|
@ -667,24 +667,24 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op)
|
|||
} else if (op == Selection::Extend) {
|
||||
|
||||
list<Selectable*> results;
|
||||
framepos_t last_frame;
|
||||
framepos_t first_frame;
|
||||
samplepos_t last_sample;
|
||||
samplepos_t first_sample;
|
||||
bool same_track = false;
|
||||
|
||||
/* 1. find the last selected regionview in the track that was clicked in */
|
||||
|
||||
last_frame = 0;
|
||||
first_frame = max_framepos;
|
||||
last_sample = 0;
|
||||
first_sample = max_samplepos;
|
||||
|
||||
for (RegionSelection::iterator x = selection->regions.begin(); x != selection->regions.end(); ++x) {
|
||||
if (&(*x)->get_time_axis_view() == &clicked_regionview->get_time_axis_view()) {
|
||||
|
||||
if ((*x)->region()->last_frame() > last_frame) {
|
||||
last_frame = (*x)->region()->last_frame();
|
||||
if ((*x)->region()->last_sample() > last_sample) {
|
||||
last_sample = (*x)->region()->last_sample();
|
||||
}
|
||||
|
||||
if ((*x)->region()->first_frame() < first_frame) {
|
||||
first_frame = (*x)->region()->first_frame();
|
||||
if ((*x)->region()->first_sample() < first_sample) {
|
||||
first_sample = (*x)->region()->first_sample();
|
||||
}
|
||||
|
||||
same_track = true;
|
||||
|
@ -695,34 +695,34 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op)
|
|||
|
||||
/* 2. figure out the boundaries for our search for new objects */
|
||||
|
||||
switch (clicked_regionview->region()->coverage (first_frame, last_frame)) {
|
||||
switch (clicked_regionview->region()->coverage (first_sample, last_sample)) {
|
||||
case Evoral::OverlapNone:
|
||||
if (last_frame < clicked_regionview->region()->first_frame()) {
|
||||
first_frame = last_frame;
|
||||
last_frame = clicked_regionview->region()->last_frame();
|
||||
if (last_sample < clicked_regionview->region()->first_sample()) {
|
||||
first_sample = last_sample;
|
||||
last_sample = clicked_regionview->region()->last_sample();
|
||||
} else {
|
||||
last_frame = first_frame;
|
||||
first_frame = clicked_regionview->region()->first_frame();
|
||||
last_sample = first_sample;
|
||||
first_sample = clicked_regionview->region()->first_sample();
|
||||
}
|
||||
break;
|
||||
|
||||
case Evoral::OverlapExternal:
|
||||
if (last_frame < clicked_regionview->region()->first_frame()) {
|
||||
first_frame = last_frame;
|
||||
last_frame = clicked_regionview->region()->last_frame();
|
||||
if (last_sample < clicked_regionview->region()->first_sample()) {
|
||||
first_sample = last_sample;
|
||||
last_sample = clicked_regionview->region()->last_sample();
|
||||
} else {
|
||||
last_frame = first_frame;
|
||||
first_frame = clicked_regionview->region()->first_frame();
|
||||
last_sample = first_sample;
|
||||
first_sample = clicked_regionview->region()->first_sample();
|
||||
}
|
||||
break;
|
||||
|
||||
case Evoral::OverlapInternal:
|
||||
if (last_frame < clicked_regionview->region()->first_frame()) {
|
||||
first_frame = last_frame;
|
||||
last_frame = clicked_regionview->region()->last_frame();
|
||||
if (last_sample < clicked_regionview->region()->first_sample()) {
|
||||
first_sample = last_sample;
|
||||
last_sample = clicked_regionview->region()->last_sample();
|
||||
} else {
|
||||
last_frame = first_frame;
|
||||
first_frame = clicked_regionview->region()->first_frame();
|
||||
last_sample = first_sample;
|
||||
first_sample = clicked_regionview->region()->first_sample();
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -742,15 +742,15 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op)
|
|||
*/
|
||||
|
||||
|
||||
first_frame = clicked_regionview->region()->position();
|
||||
last_frame = clicked_regionview->region()->last_frame();
|
||||
first_sample = clicked_regionview->region()->position();
|
||||
last_sample = clicked_regionview->region()->last_sample();
|
||||
|
||||
for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) {
|
||||
if ((*i)->region()->position() < first_frame) {
|
||||
first_frame = (*i)->region()->position();
|
||||
if ((*i)->region()->position() < first_sample) {
|
||||
first_sample = (*i)->region()->position();
|
||||
}
|
||||
if ((*i)->region()->last_frame() + 1 > last_frame) {
|
||||
last_frame = (*i)->region()->last_frame();
|
||||
if ((*i)->region()->last_sample() + 1 > last_sample) {
|
||||
last_sample = (*i)->region()->last_sample();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -863,7 +863,7 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op)
|
|||
*/
|
||||
|
||||
for (set<RouteTimeAxisView*>::iterator t = relevant_tracks.begin(); t != relevant_tracks.end(); ++t) {
|
||||
(*t)->get_selectables (first_frame, last_frame, -1.0, -1.0, results);
|
||||
(*t)->get_selectables (first_sample, last_sample, -1.0, -1.0, results);
|
||||
}
|
||||
|
||||
/* 4. convert to a vector of regions */
|
||||
|
@ -1186,7 +1186,7 @@ Editor::time_selection_changed ()
|
|||
|
||||
if (_session && !_drags->active()) {
|
||||
if (selection->time.length() != 0) {
|
||||
_session->set_range_selection (selection->time.start(), selection->time.end_frame());
|
||||
_session->set_range_selection (selection->time.start(), selection->time.end_sample());
|
||||
} else {
|
||||
_session->clear_range_selection ();
|
||||
}
|
||||
|
@ -1251,7 +1251,7 @@ Editor::sensitize_the_right_region_actions (bool because_canvas_crossing)
|
|||
}
|
||||
} else {
|
||||
RegionSelection at_edit_point;
|
||||
framepos_t const where = get_preferred_edit_position (Editing::EDIT_IGNORE_NONE, false, !within_track_canvas);
|
||||
samplepos_t const where = get_preferred_edit_position (Editing::EDIT_IGNORE_NONE, false, !within_track_canvas);
|
||||
get_regions_at (at_edit_point, where, selection->tracks);
|
||||
if (!at_edit_point.empty()) {
|
||||
have_edit_point = true;
|
||||
|
@ -1569,7 +1569,7 @@ Editor::region_selection_changed ()
|
|||
|
||||
if (_session) {
|
||||
if (!selection->regions.empty()) {
|
||||
_session->set_object_selection (selection->regions.start(), selection->regions.end_frame());
|
||||
_session->set_object_selection (selection->regions.start(), selection->regions.end_sample());
|
||||
} else {
|
||||
_session->clear_object_selection ();
|
||||
}
|
||||
|
@ -1596,7 +1596,7 @@ Editor::select_all_in_track (Selection::Operation op)
|
|||
|
||||
begin_reversible_selection_op (X_("Select All in Track"));
|
||||
|
||||
clicked_routeview->get_selectables (0, max_framepos, 0, DBL_MAX, touched);
|
||||
clicked_routeview->get_selectables (0, max_samplepos, 0, DBL_MAX, touched);
|
||||
|
||||
switch (op) {
|
||||
case Selection::Toggle:
|
||||
|
@ -1659,7 +1659,7 @@ Editor::select_all_objects (Selection::Operation op)
|
|||
if ((*iter)->hidden()) {
|
||||
continue;
|
||||
}
|
||||
(*iter)->get_selectables (0, max_framepos, 0, DBL_MAX, touched);
|
||||
(*iter)->get_selectables (0, max_samplepos, 0, DBL_MAX, touched);
|
||||
}
|
||||
|
||||
begin_reversible_selection_op (X_("select all"));
|
||||
|
@ -1722,15 +1722,15 @@ Editor::invert_selection ()
|
|||
commit_reversible_selection_op ();
|
||||
}
|
||||
|
||||
/** @param start Start time in session frames.
|
||||
* @param end End time in session frames.
|
||||
/** @param start Start time in session samples.
|
||||
* @param end End time in session samples.
|
||||
* @param top Top (lower) y limit in trackview coordinates (ie 0 at the top of the track view)
|
||||
* @param bottom Bottom (higher) y limit in trackview coordinates (ie 0 at the top of the track view)
|
||||
* @param preserve_if_selected true to leave the current selection alone if we're adding to the selection and all of the selectables
|
||||
* within the region are already selected.
|
||||
*/
|
||||
void
|
||||
Editor::select_all_within (framepos_t start, framepos_t end, double top, double bot, const TrackViewList& tracklist, Selection::Operation op, bool preserve_if_selected)
|
||||
Editor::select_all_within (samplepos_t start, samplepos_t end, double top, double bot, const TrackViewList& tracklist, Selection::Operation op, bool preserve_if_selected)
|
||||
{
|
||||
list<Selectable*> found;
|
||||
|
||||
|
@ -1799,7 +1799,7 @@ Editor::set_selection_from_region ()
|
|||
|
||||
/* select range (this will clear the region selection) */
|
||||
|
||||
selection->set (selection->regions.start(), selection->regions.end_frame());
|
||||
selection->set (selection->regions.start(), selection->regions.end_sample());
|
||||
|
||||
/* and select the tracks */
|
||||
|
||||
|
@ -1854,8 +1854,8 @@ Editor::select_all_selectables_using_time_selection ()
|
|||
return;
|
||||
}
|
||||
|
||||
framepos_t start = selection->time[clicked_selection].start;
|
||||
framepos_t end = selection->time[clicked_selection].end;
|
||||
samplepos_t start = selection->time[clicked_selection].start;
|
||||
samplepos_t end = selection->time[clicked_selection].end;
|
||||
|
||||
if (end - start < 1) {
|
||||
return;
|
||||
|
@ -1947,17 +1947,17 @@ Editor::select_all_selectables_using_loop()
|
|||
void
|
||||
Editor::select_all_selectables_using_cursor (EditorCursor *cursor, bool after)
|
||||
{
|
||||
framepos_t start;
|
||||
framepos_t end;
|
||||
samplepos_t start;
|
||||
samplepos_t end;
|
||||
list<Selectable *> touched;
|
||||
|
||||
if (after) {
|
||||
start = cursor->current_frame();
|
||||
end = _session->current_end_frame();
|
||||
start = cursor->current_sample();
|
||||
end = _session->current_end_sample();
|
||||
} else {
|
||||
if (cursor->current_frame() > 0) {
|
||||
if (cursor->current_sample() > 0) {
|
||||
start = 0;
|
||||
end = cursor->current_frame() - 1;
|
||||
end = cursor->current_sample() - 1;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
@ -2000,13 +2000,13 @@ Editor::select_all_selectables_using_cursor (EditorCursor *cursor, bool after)
|
|||
void
|
||||
Editor::select_all_selectables_using_edit (bool after, bool from_context_menu)
|
||||
{
|
||||
framepos_t start;
|
||||
framepos_t end;
|
||||
samplepos_t start;
|
||||
samplepos_t end;
|
||||
list<Selectable *> touched;
|
||||
|
||||
if (after) {
|
||||
start = get_preferred_edit_position(EDIT_IGNORE_NONE, from_context_menu);
|
||||
end = _session->current_end_frame();
|
||||
end = _session->current_end_sample();
|
||||
} else {
|
||||
if ((end = get_preferred_edit_position(EDIT_IGNORE_NONE, from_context_menu)) > 1) {
|
||||
start = 0;
|
||||
|
@ -2051,8 +2051,8 @@ Editor::select_all_selectables_using_edit (bool after, bool from_context_menu)
|
|||
void
|
||||
Editor::select_all_selectables_between (bool within)
|
||||
{
|
||||
framepos_t start;
|
||||
framepos_t end;
|
||||
samplepos_t start;
|
||||
samplepos_t end;
|
||||
list<Selectable *> touched;
|
||||
|
||||
if (!get_edit_op_range (start, end)) {
|
||||
|
@ -2090,8 +2090,8 @@ Editor::select_all_selectables_between (bool within)
|
|||
void
|
||||
Editor::select_range_between ()
|
||||
{
|
||||
framepos_t start;
|
||||
framepos_t end;
|
||||
samplepos_t start;
|
||||
samplepos_t end;
|
||||
|
||||
if ( !selection->time.empty() ) {
|
||||
selection->clear_time ();
|
||||
|
@ -2111,9 +2111,9 @@ Editor::select_range_between ()
|
|||
}
|
||||
|
||||
bool
|
||||
Editor::get_edit_op_range (framepos_t& start, framepos_t& end) const
|
||||
Editor::get_edit_op_range (samplepos_t& start, samplepos_t& end) const
|
||||
{
|
||||
// framepos_t m;
|
||||
// samplepos_t m;
|
||||
// bool ignored;
|
||||
|
||||
/* if an explicit range exists, use it */
|
||||
|
@ -2121,7 +2121,7 @@ Editor::get_edit_op_range (framepos_t& start, framepos_t& end) const
|
|||
if ( (mouse_mode == MouseRange || get_smart_mode() ) && !selection->time.empty()) {
|
||||
/* we know that these are ordered */
|
||||
start = selection->time.start();
|
||||
end = selection->time.end_frame();
|
||||
end = selection->time.end_sample();
|
||||
return true;
|
||||
} else {
|
||||
start = 0;
|
||||
|
@ -2129,7 +2129,7 @@ Editor::get_edit_op_range (framepos_t& start, framepos_t& end) const
|
|||
return false;
|
||||
}
|
||||
|
||||
// if (!mouse_frame (m, ignored)) {
|
||||
// if (!mouse_sample (m, ignored)) {
|
||||
// /* mouse is not in a canvas, try playhead+selected marker.
|
||||
// this is probably most true when using menus.
|
||||
// */
|
||||
|
@ -2139,7 +2139,7 @@ Editor::get_edit_op_range (framepos_t& start, framepos_t& end) const
|
|||
// }
|
||||
|
||||
// start = selection->markers.front()->position();
|
||||
// end = _session->audible_frame();
|
||||
// end = _session->audible_sample();
|
||||
|
||||
// } else {
|
||||
|
||||
|
@ -2148,10 +2148,10 @@ Editor::get_edit_op_range (framepos_t& start, framepos_t& end) const
|
|||
// if (selection->markers.empty()) {
|
||||
// /* use mouse + playhead */
|
||||
// start = m;
|
||||
// end = _session->audible_frame();
|
||||
// end = _session->audible_sample();
|
||||
// } else {
|
||||
// /* use playhead + selected marker */
|
||||
// start = _session->audible_frame();
|
||||
// start = _session->audible_sample();
|
||||
// end = selection->markers.front()->position();
|
||||
// }
|
||||
// break;
|
||||
|
@ -2160,7 +2160,7 @@ Editor::get_edit_op_range (framepos_t& start, framepos_t& end) const
|
|||
// /* use mouse + selected marker */
|
||||
// if (selection->markers.empty()) {
|
||||
// start = m;
|
||||
// end = _session->audible_frame();
|
||||
// end = _session->audible_sample();
|
||||
// } else {
|
||||
// start = selection->markers.front()->position();
|
||||
// end = m;
|
||||
|
@ -2220,7 +2220,7 @@ Editor::deselect_all ()
|
|||
}
|
||||
|
||||
long
|
||||
Editor::select_range (framepos_t s, framepos_t e)
|
||||
Editor::select_range (samplepos_t s, samplepos_t e)
|
||||
{
|
||||
begin_reversible_selection_op (X_("Select Range"));
|
||||
selection->add (clicked_axisview);
|
||||
|
|
|
@ -118,7 +118,7 @@ EditorSummary::set_session (Session* s)
|
|||
_editor->selection->RegionsChanged.connect (sigc::mem_fun(*this, &EditorSummary::set_background_dirty));
|
||||
}
|
||||
|
||||
_leftmost = max_framepos;
|
||||
_leftmost = max_samplepos;
|
||||
_rightmost = 0;
|
||||
}
|
||||
|
||||
|
@ -138,7 +138,7 @@ EditorSummary::render_background_image ()
|
|||
|
||||
/* compute start and end points for the summary */
|
||||
|
||||
std::pair<framepos_t, framepos_t> ext = _editor->session_gui_extents();
|
||||
std::pair<samplepos_t, samplepos_t> ext = _editor->session_gui_extents();
|
||||
double theoretical_start = ext.first;
|
||||
double theoretical_end = ext.second;
|
||||
|
||||
|
@ -150,7 +150,7 @@ EditorSummary::render_background_image ()
|
|||
|
||||
/* range-check */
|
||||
_start = theoretical_start > 0 ? theoretical_start : 0;
|
||||
_end = theoretical_end < max_framepos ? theoretical_end : max_framepos;
|
||||
_end = theoretical_end < max_samplepos ? theoretical_end : max_samplepos;
|
||||
|
||||
/* calculate x scale */
|
||||
if (_end != _start) {
|
||||
|
@ -212,11 +212,11 @@ EditorSummary::render_background_image ()
|
|||
cairo_set_line_width (cr, 1);
|
||||
cairo_set_source_rgb (cr, 1, 1, 0);
|
||||
|
||||
const double p = (_session->current_start_frame() - _start) * _x_scale;
|
||||
const double p = (_session->current_start_sample() - _start) * _x_scale;
|
||||
cairo_move_to (cr, p, 0);
|
||||
cairo_line_to (cr, p, get_height());
|
||||
|
||||
double const q = (_session->current_end_frame() - _start) * _x_scale;
|
||||
double const q = (_session->current_end_sample() - _start) * _x_scale;
|
||||
cairo_move_to (cr, q, 0);
|
||||
cairo_line_to (cr, q, get_height());
|
||||
cairo_stroke (cr);
|
||||
|
@ -237,12 +237,12 @@ EditorSummary::render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangle
|
|||
}
|
||||
|
||||
/* maintain the leftmost and rightmost locations that we've ever reached */
|
||||
framecnt_t const leftmost = _editor->leftmost_sample ();
|
||||
samplecnt_t const leftmost = _editor->leftmost_sample ();
|
||||
if ( leftmost < _leftmost) {
|
||||
_leftmost = leftmost;
|
||||
_background_dirty = true;
|
||||
}
|
||||
framecnt_t const rightmost = leftmost + _editor->current_page_samples();
|
||||
samplecnt_t const rightmost = leftmost + _editor->current_page_samples();
|
||||
if ( rightmost > _rightmost) {
|
||||
_rightmost = rightmost;
|
||||
_background_dirty = true;
|
||||
|
@ -289,7 +289,7 @@ EditorSummary::render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangle
|
|||
/* XXX: colour should be set from configuration file */
|
||||
cairo_set_source_rgba (cr, 1, 0, 0, 1);
|
||||
|
||||
const double ph= playhead_frame_to_position (_editor->playhead_cursor->current_frame());
|
||||
const double ph= playhead_sample_to_position (_editor->playhead_cursor->current_sample());
|
||||
cairo_move_to (cr, ph, 0);
|
||||
cairo_line_to (cr, ph, get_height());
|
||||
cairo_stroke (cr);
|
||||
|
@ -407,7 +407,7 @@ EditorSummary::on_key_press_event (GdkEventKey* key)
|
|||
if (key->keyval == set_playhead_accel.accel_key && (int) key->state == set_playhead_accel.accel_mods) {
|
||||
if (_session) {
|
||||
get_pointer (x, y);
|
||||
_session->request_locate (_start + (framepos_t) x / _x_scale, _session->transport_rolling());
|
||||
_session->request_locate (_start + (samplepos_t) x / _x_scale, _session->transport_rolling());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -577,7 +577,7 @@ void
|
|||
EditorSummary::reset_to_extents()
|
||||
{
|
||||
//reset as if the user never went anywhere outside the extents
|
||||
_leftmost = max_framepos;
|
||||
_leftmost = max_samplepos;
|
||||
_rightmost = 0;
|
||||
|
||||
_editor->temporal_zoom_extents ();
|
||||
|
@ -890,10 +890,10 @@ EditorSummary::set_editor_x (pair<double, double> x)
|
|||
}
|
||||
|
||||
void
|
||||
EditorSummary::playhead_position_changed (framepos_t p)
|
||||
EditorSummary::playhead_position_changed (samplepos_t p)
|
||||
{
|
||||
int const o = int (_last_playhead);
|
||||
int const n = int (playhead_frame_to_position (p));
|
||||
int const n = int (playhead_sample_to_position (p));
|
||||
if (_session && o != n) {
|
||||
int a = max(2, min (o, n));
|
||||
int b = max (o, n);
|
||||
|
@ -948,13 +948,13 @@ EditorSummary::route_gui_changed (PBD::PropertyChange const& what_changed)
|
|||
}
|
||||
|
||||
double
|
||||
EditorSummary::playhead_frame_to_position (framepos_t t) const
|
||||
EditorSummary::playhead_sample_to_position (samplepos_t t) const
|
||||
{
|
||||
return (t - _start) * _x_scale;
|
||||
}
|
||||
|
||||
framepos_t
|
||||
EditorSummary::position_to_playhead_frame_to_position (double pos) const
|
||||
samplepos_t
|
||||
EditorSummary::position_to_playhead_sample_to_position (double pos) const
|
||||
{
|
||||
return _start + (pos * _x_scale);
|
||||
}
|
||||
|
|
|
@ -75,28 +75,28 @@ private:
|
|||
void set_editor (std::pair<double, double>);
|
||||
void set_editor_x (double);
|
||||
void set_editor_x (std::pair<double, double>);
|
||||
void playhead_position_changed (framepos_t);
|
||||
void playhead_position_changed (samplepos_t);
|
||||
double editor_y_to_summary (double) const;
|
||||
Position get_position (double, double) const;
|
||||
void set_cursor (Position);
|
||||
void route_gui_changed (PBD::PropertyChange const&);
|
||||
bool suspending_editor_updates () const;
|
||||
double playhead_frame_to_position (framepos_t) const;
|
||||
framepos_t position_to_playhead_frame_to_position (double pos) const;
|
||||
double playhead_sample_to_position (samplepos_t) const;
|
||||
samplepos_t position_to_playhead_sample_to_position (double pos) const;
|
||||
void set_overlays_dirty_rect (int, int, int, int);
|
||||
|
||||
void summary_zoom_step ( int steps );
|
||||
|
||||
framepos_t _start; ///< start frame of the overview
|
||||
framepos_t _end; ///< end frame of the overview
|
||||
samplepos_t _start; ///< start sample of the overview
|
||||
samplepos_t _end; ///< end sample of the overview
|
||||
|
||||
framepos_t _leftmost; ///< the earliest frame we ever viewed
|
||||
framepos_t _rightmost; ///< the latest frame we ever viewed
|
||||
samplepos_t _leftmost; ///< the earliest sample we ever viewed
|
||||
samplepos_t _rightmost; ///< the latest sample we ever viewed
|
||||
|
||||
/** fraction of the session length by which the overview size should extend past the start and end markers */
|
||||
double _overhang_fraction;
|
||||
|
||||
double _x_scale; ///< pixels per frame for the x axis of the pixmap
|
||||
double _x_scale; ///< pixels per sample for the x axis of the pixmap
|
||||
double _track_height;
|
||||
double _last_playhead;
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ Editor::remove_metric_marks ()
|
|||
}
|
||||
struct CurveComparator {
|
||||
bool operator() (TempoCurve const * a, TempoCurve const * b) {
|
||||
return a->tempo().frame() < b->tempo().frame();
|
||||
return a->tempo().sample() < b->tempo().sample();
|
||||
}
|
||||
};
|
||||
void
|
||||
|
@ -112,7 +112,7 @@ Editor::draw_metric_marks (const Metrics& metrics)
|
|||
uint32_t const tc_color = UIConfiguration::instance().color ("tempo curve");
|
||||
|
||||
tempo_curves.push_back (new TempoCurve (*this, *tempo_group, tc_color,
|
||||
*(const_cast<TempoSection*>(ts)), ts->frame(), false));
|
||||
*(const_cast<TempoSection*>(ts)), ts->sample(), false));
|
||||
|
||||
const std::string tname (X_(""));
|
||||
if (ts->position_lock_style() == MusicTime) {
|
||||
|
@ -147,9 +147,9 @@ Editor::draw_metric_marks (const Metrics& metrics)
|
|||
(*x)->set_min_tempo (min_tempo);
|
||||
++tmp;
|
||||
if (tmp != tempo_curves.end()) {
|
||||
(*x)->set_position ((*x)->tempo().frame(), (*tmp)->tempo().frame());
|
||||
(*x)->set_position ((*x)->tempo().sample(), (*tmp)->tempo().sample());
|
||||
} else {
|
||||
(*x)->set_position ((*x)->tempo().frame(), UINT32_MAX);
|
||||
(*x)->set_position ((*x)->tempo().sample(), UINT32_MAX);
|
||||
}
|
||||
|
||||
if (!(*x)->tempo().active()) {
|
||||
|
@ -184,10 +184,10 @@ Editor::tempo_map_changed (const PropertyChange& /*ignored*/)
|
|||
tempo_lines->tempo_map_changed(_session->tempo_map().music_origin());
|
||||
}
|
||||
|
||||
compute_bbt_ruler_scale (leftmost_frame, leftmost_frame + current_page_samples());
|
||||
compute_bbt_ruler_scale (_leftmost_sample, _leftmost_sample + current_page_samples());
|
||||
std::vector<TempoMap::BBTPoint> grid;
|
||||
if (bbt_ruler_scale != bbt_show_many) {
|
||||
compute_current_bbt_points (grid, leftmost_frame, leftmost_frame + current_page_samples());
|
||||
compute_current_bbt_points (grid, _leftmost_sample, _leftmost_sample + current_page_samples());
|
||||
}
|
||||
_session->tempo_map().apply_with_metrics (*this, &Editor::draw_metric_marks); // redraw metric markers
|
||||
draw_measures (grid);
|
||||
|
@ -220,7 +220,7 @@ Editor::tempometric_position_changed (const PropertyChange& /*ignored*/)
|
|||
if ((tempo_marker = dynamic_cast<TempoMarker*> (*x)) != 0) {
|
||||
if ((ts = &tempo_marker->tempo()) != 0) {
|
||||
|
||||
tempo_marker->set_position (ts->frame ());
|
||||
tempo_marker->set_position (ts->sample ());
|
||||
|
||||
if (prev_ts && abs (prev_ts->end_note_types_per_minute() - ts->note_types_per_minute()) < 1.0) {
|
||||
tempo_marker->set_points_color (UIConfiguration::instance().color ("tempo marker music"));
|
||||
|
@ -238,7 +238,7 @@ Editor::tempometric_position_changed (const PropertyChange& /*ignored*/)
|
|||
}
|
||||
if ((meter_marker = dynamic_cast<MeterMarker*> (*x)) != 0) {
|
||||
if ((ms = &meter_marker->meter()) != 0) {
|
||||
meter_marker->set_position (ms->frame ());
|
||||
meter_marker->set_position (ms->sample ());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -259,9 +259,9 @@ Editor::tempometric_position_changed (const PropertyChange& /*ignored*/)
|
|||
(*x)->set_min_tempo (min_tempo);
|
||||
++tmp;
|
||||
if (tmp != tempo_curves.end()) {
|
||||
(*x)->set_position ((*x)->tempo().frame(), (*tmp)->tempo().frame());
|
||||
(*x)->set_position ((*x)->tempo().sample(), (*tmp)->tempo().sample());
|
||||
} else {
|
||||
(*x)->set_position ((*x)->tempo().frame(), UINT32_MAX);
|
||||
(*x)->set_position ((*x)->tempo().sample(), UINT32_MAX);
|
||||
}
|
||||
|
||||
if (!(*x)->tempo().active()) {
|
||||
|
@ -280,11 +280,11 @@ Editor::tempometric_position_changed (const PropertyChange& /*ignored*/)
|
|||
}
|
||||
}
|
||||
|
||||
compute_bbt_ruler_scale (leftmost_frame, leftmost_frame + current_page_samples());
|
||||
compute_bbt_ruler_scale (_leftmost_sample, _leftmost_sample + current_page_samples());
|
||||
std::vector<TempoMap::BBTPoint> grid;
|
||||
|
||||
if (bbt_ruler_scale != bbt_show_many) {
|
||||
compute_current_bbt_points (grid, leftmost_frame, leftmost_frame + current_page_samples());
|
||||
compute_current_bbt_points (grid, _leftmost_sample, _leftmost_sample + current_page_samples());
|
||||
}
|
||||
|
||||
draw_measures (grid);
|
||||
|
@ -301,12 +301,12 @@ Editor::redisplay_tempo (bool immediate_redraw)
|
|||
if (immediate_redraw) {
|
||||
|
||||
//only recalculate bbt_ruler_scale on a zoom or snap-change; not every redraw; if a case is found where this is necessary, uncomment this line.
|
||||
// compute_bbt_ruler_scale (leftmost_frame, leftmost_frame + current_page_samples());
|
||||
// compute_bbt_ruler_scale (_leftmost_sample, _leftmost_sample + current_page_samples());
|
||||
|
||||
std::vector<TempoMap::BBTPoint> grid;
|
||||
|
||||
if (bbt_ruler_scale != bbt_show_many) {
|
||||
compute_current_bbt_points (grid, leftmost_frame, leftmost_frame + current_page_samples());
|
||||
compute_current_bbt_points (grid, _leftmost_sample, _leftmost_sample + current_page_samples());
|
||||
}
|
||||
|
||||
draw_measures (grid);
|
||||
|
@ -337,7 +337,7 @@ Editor::tempo_curve_selected (TempoSection* ts, bool yn)
|
|||
|
||||
/* computes a grid starting a beat before and ending a beat after leftmost and rightmost respectively */
|
||||
void
|
||||
Editor::compute_current_bbt_points (std::vector<TempoMap::BBTPoint>& grid, framepos_t leftmost, framepos_t rightmost)
|
||||
Editor::compute_current_bbt_points (std::vector<TempoMap::BBTPoint>& grid, samplepos_t leftmost, samplepos_t rightmost)
|
||||
{
|
||||
if (!_session) {
|
||||
return;
|
||||
|
@ -345,35 +345,35 @@ Editor::compute_current_bbt_points (std::vector<TempoMap::BBTPoint>& grid, frame
|
|||
|
||||
/* prevent negative values of leftmost from creeping into tempomap
|
||||
*/
|
||||
const double lower_beat = floor (max (0.0, _session->tempo_map().beat_at_frame (leftmost))) - 1.0;
|
||||
const double lower_beat = floor (max (0.0, _session->tempo_map().beat_at_sample (leftmost))) - 1.0;
|
||||
switch (bbt_ruler_scale) {
|
||||
|
||||
case bbt_show_beats:
|
||||
case bbt_show_ticks:
|
||||
case bbt_show_ticks_detail:
|
||||
case bbt_show_ticks_super_detail:
|
||||
_session->tempo_map().get_grid (grid, max (_session->tempo_map().frame_at_beat (lower_beat), (framepos_t) 0), rightmost);
|
||||
_session->tempo_map().get_grid (grid, max (_session->tempo_map().sample_at_beat (lower_beat), (samplepos_t) 0), rightmost);
|
||||
break;
|
||||
|
||||
case bbt_show_1:
|
||||
_session->tempo_map().get_grid (grid, max (_session->tempo_map().frame_at_beat (lower_beat), (framepos_t) 0), rightmost, 1);
|
||||
_session->tempo_map().get_grid (grid, max (_session->tempo_map().sample_at_beat (lower_beat), (samplepos_t) 0), rightmost, 1);
|
||||
break;
|
||||
|
||||
case bbt_show_4:
|
||||
_session->tempo_map().get_grid (grid, max (_session->tempo_map().frame_at_beat (lower_beat), (framepos_t) 0), rightmost, 4);
|
||||
_session->tempo_map().get_grid (grid, max (_session->tempo_map().sample_at_beat (lower_beat), (samplepos_t) 0), rightmost, 4);
|
||||
break;
|
||||
|
||||
case bbt_show_16:
|
||||
_session->tempo_map().get_grid (grid, max (_session->tempo_map().frame_at_beat (lower_beat), (framepos_t) 0), rightmost, 16);
|
||||
_session->tempo_map().get_grid (grid, max (_session->tempo_map().sample_at_beat (lower_beat), (samplepos_t) 0), rightmost, 16);
|
||||
break;
|
||||
|
||||
case bbt_show_64:
|
||||
_session->tempo_map().get_grid (grid, max (_session->tempo_map().frame_at_beat (lower_beat), (framepos_t) 0), rightmost, 64);
|
||||
_session->tempo_map().get_grid (grid, max (_session->tempo_map().sample_at_beat (lower_beat), (samplepos_t) 0), rightmost, 64);
|
||||
break;
|
||||
|
||||
default:
|
||||
/* bbt_show_many */
|
||||
_session->tempo_map().get_grid (grid, max (_session->tempo_map().frame_at_beat (lower_beat), (framepos_t) 0), rightmost, 128);
|
||||
_session->tempo_map().get_grid (grid, max (_session->tempo_map().sample_at_beat (lower_beat), (samplepos_t) 0), rightmost, 128);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -394,15 +394,15 @@ Editor::draw_measures (std::vector<ARDOUR::TempoMap::BBTPoint>& grid)
|
|||
}
|
||||
|
||||
if (tempo_lines == 0) {
|
||||
tempo_lines = new TempoLines (time_line_group, ArdourCanvas::LineSet::Vertical, new BeatsFramesConverter (_session->tempo_map(), _session->tempo_map().music_origin()));
|
||||
tempo_lines = new TempoLines (time_line_group, ArdourCanvas::LineSet::Vertical, new BeatsSamplesConverter (_session->tempo_map(), _session->tempo_map().music_origin()));
|
||||
}
|
||||
|
||||
const unsigned divisions = get_grid_beat_divisions(leftmost_frame);
|
||||
tempo_lines->draw (grid, divisions, leftmost_frame, _session->frame_rate());
|
||||
const unsigned divisions = get_grid_beat_divisions(_leftmost_sample);
|
||||
tempo_lines->draw (grid, divisions, _leftmost_sample, _session->sample_rate());
|
||||
}
|
||||
|
||||
void
|
||||
Editor::mouse_add_new_tempo_event (framepos_t frame)
|
||||
Editor::mouse_add_new_tempo_event (samplepos_t sample)
|
||||
{
|
||||
if (_session == 0) {
|
||||
return;
|
||||
|
@ -411,12 +411,12 @@ Editor::mouse_add_new_tempo_event (framepos_t frame)
|
|||
TempoMap& map(_session->tempo_map());
|
||||
|
||||
begin_reversible_command (_("add tempo mark"));
|
||||
const double pulse = map.exact_qn_at_frame (frame, get_grid_music_divisions (0)) / 4.0;
|
||||
const double pulse = map.exact_qn_at_sample (sample, get_grid_music_divisions (0)) / 4.0;
|
||||
|
||||
if (pulse > 0.0) {
|
||||
XMLNode &before = map.get_state();
|
||||
/* add music-locked ramped (?) tempo using the bpm/note type at frame*/
|
||||
map.add_tempo (map.tempo_at_frame (frame), pulse, 0, MusicTime);
|
||||
/* add music-locked ramped (?) tempo using the bpm/note type at sample*/
|
||||
map.add_tempo (map.tempo_at_sample (sample), pulse, 0, MusicTime);
|
||||
|
||||
XMLNode &after = map.get_state();
|
||||
_session->add_command(new MementoCommand<TempoMap>(map, &before, &after));
|
||||
|
@ -427,7 +427,7 @@ Editor::mouse_add_new_tempo_event (framepos_t frame)
|
|||
}
|
||||
|
||||
void
|
||||
Editor::mouse_add_new_meter_event (framepos_t frame)
|
||||
Editor::mouse_add_new_meter_event (samplepos_t sample)
|
||||
{
|
||||
if (_session == 0) {
|
||||
return;
|
||||
|
@ -435,7 +435,7 @@ Editor::mouse_add_new_meter_event (framepos_t frame)
|
|||
|
||||
|
||||
TempoMap& map(_session->tempo_map());
|
||||
MeterDialog meter_dialog (map, frame, _("add"));
|
||||
MeterDialog meter_dialog (map, sample, _("add"));
|
||||
|
||||
switch (meter_dialog.run ()) {
|
||||
case RESPONSE_ACCEPT:
|
||||
|
@ -452,14 +452,14 @@ Editor::mouse_add_new_meter_event (framepos_t frame)
|
|||
Timecode::BBT_Time requested;
|
||||
meter_dialog.get_bbt_time (requested);
|
||||
|
||||
const double al_frame = map.frame_at_bbt (requested);
|
||||
const double al_sample = map.sample_at_bbt (requested);
|
||||
begin_reversible_command (_("add meter mark"));
|
||||
XMLNode &before = map.get_state();
|
||||
|
||||
if (meter_dialog.get_lock_style() == MusicTime) {
|
||||
map.add_meter (Meter (bpb, note_type), requested, 0, MusicTime);
|
||||
} else {
|
||||
map.add_meter (Meter (bpb, note_type), requested, al_frame, AudioTime);
|
||||
map.add_meter (Meter (bpb, note_type), requested, al_sample, AudioTime);
|
||||
}
|
||||
|
||||
_session->add_command(new MementoCommand<TempoMap>(map, &before, &map.get_state()));
|
||||
|
@ -509,13 +509,13 @@ Editor::edit_meter_section (MeterSection* section)
|
|||
|
||||
Timecode::BBT_Time when;
|
||||
meter_dialog.get_bbt_time (when);
|
||||
const framepos_t frame = _session->tempo_map().frame_at_bbt (when);
|
||||
const samplepos_t sample = _session->tempo_map().sample_at_bbt (when);
|
||||
const PositionLockStyle pls = (meter_dialog.get_lock_style() == AudioTime) ? AudioTime : MusicTime;
|
||||
|
||||
begin_reversible_command (_("replace meter mark"));
|
||||
XMLNode &before = _session->tempo_map().get_state();
|
||||
|
||||
_session->tempo_map().replace_meter (*section, meter, when, frame, pls);
|
||||
_session->tempo_map().replace_meter (*section, meter, when, sample, pls);
|
||||
|
||||
XMLNode &after = _session->tempo_map().get_state();
|
||||
_session->add_command(new MementoCommand<TempoMap>(_session->tempo_map(), &before, &after));
|
||||
|
@ -547,7 +547,7 @@ Editor::edit_tempo_section (TempoSection* section)
|
|||
XMLNode &before = _session->tempo_map().get_state();
|
||||
|
||||
if (tempo_dialog.get_lock_style() == AudioTime) {
|
||||
framepos_t const f = _session->tempo_map().predict_tempo_position (section, when).second;
|
||||
samplepos_t const f = _session->tempo_map().predict_tempo_position (section, when).second;
|
||||
_session->tempo_map().replace_tempo (*section, tempo, 0.0, f, AudioTime);
|
||||
} else {
|
||||
double const p = _session->tempo_map().predict_tempo_position (section, when).first;
|
||||
|
|
|
@ -150,9 +150,9 @@ Editor::time_fx (RegionList& regions, float val, bool pitching)
|
|||
return 0;
|
||||
}
|
||||
|
||||
const framecnt_t oldlen = (framecnt_t) (regions.front()->length());
|
||||
const framecnt_t newlen = (framecnt_t) (regions.front()->length() * val);
|
||||
const framecnt_t pos = regions.front()->position ();
|
||||
const samplecnt_t oldlen = (samplecnt_t) (regions.front()->length());
|
||||
const samplecnt_t newlen = (samplecnt_t) (regions.front()->length() * val);
|
||||
const samplecnt_t pos = regions.front()->position ();
|
||||
|
||||
delete current_timefx;
|
||||
current_timefx = new TimeFXDialog (*this, pitching, oldlen, newlen, pos);
|
||||
|
|
|
@ -82,7 +82,7 @@ Editor::toggle_video_timeline_locked ()
|
|||
}
|
||||
|
||||
void
|
||||
Editor::embed_audio_from_video (std::string path, framepos_t n, bool lock_position_to_video)
|
||||
Editor::embed_audio_from_video (std::string path, samplepos_t n, bool lock_position_to_video)
|
||||
{
|
||||
vector<std::string> paths;
|
||||
paths.push_back(path);
|
||||
|
|
|
@ -2833,7 +2833,7 @@ EngineControl::check_audio_latency_measurement ()
|
|||
}
|
||||
|
||||
char buf[256];
|
||||
ARDOUR::framecnt_t const sample_rate = ARDOUR::AudioEngine::instance()->sample_rate();
|
||||
ARDOUR::samplecnt_t const sample_rate = ARDOUR::AudioEngine::instance()->sample_rate();
|
||||
|
||||
if (sample_rate == 0) {
|
||||
lm_results.set_markup (string_compose (results_markup, _("Disconnected from audio engine")));
|
||||
|
@ -2841,12 +2841,12 @@ EngineControl::check_audio_latency_measurement ()
|
|||
return false;
|
||||
}
|
||||
|
||||
int frames_total = mtdm->del();
|
||||
int extra = frames_total - ARDOUR::AudioEngine::instance()->latency_signal_delay();
|
||||
int samples_total = mtdm->del();
|
||||
int extra = samples_total - ARDOUR::AudioEngine::instance()->latency_signal_delay();
|
||||
|
||||
snprintf (buf, sizeof (buf), "%s%d samples (%.3lf ms)\n%s%d samples (%.3lf ms)",
|
||||
_("Detected roundtrip latency: "),
|
||||
frames_total, frames_total * 1000.0f/sample_rate,
|
||||
samples_total, samples_total * 1000.0f/sample_rate,
|
||||
_("Systemic latency: "),
|
||||
extra, extra * 1000.0f/sample_rate);
|
||||
|
||||
|
@ -2887,7 +2887,7 @@ EngineControl::check_midi_latency_measurement ()
|
|||
}
|
||||
|
||||
char buf[256];
|
||||
ARDOUR::framecnt_t const sample_rate = ARDOUR::AudioEngine::instance()->sample_rate();
|
||||
ARDOUR::samplecnt_t const sample_rate = ARDOUR::AudioEngine::instance()->sample_rate();
|
||||
|
||||
if (sample_rate == 0) {
|
||||
lm_results.set_markup (string_compose (results_markup, _("Disconnected from audio engine")));
|
||||
|
@ -2895,11 +2895,11 @@ EngineControl::check_midi_latency_measurement ()
|
|||
return false;
|
||||
}
|
||||
|
||||
ARDOUR::framecnt_t frames_total = mididm->latency();
|
||||
ARDOUR::framecnt_t extra = frames_total - ARDOUR::AudioEngine::instance()->latency_signal_delay();
|
||||
ARDOUR::samplecnt_t samples_total = mididm->latency();
|
||||
ARDOUR::samplecnt_t extra = samples_total - ARDOUR::AudioEngine::instance()->latency_signal_delay();
|
||||
snprintf (buf, sizeof (buf), "%s%" PRId64" samples (%.1lf ms) dev: %.2f[spl]\n%s%" PRId64" samples (%.1lf ms)",
|
||||
_("Detected roundtrip latency: "),
|
||||
frames_total, frames_total * 1000.0f / sample_rate, mididm->deviation (),
|
||||
samples_total, samples_total * 1000.0f / sample_rate, mididm->deviation (),
|
||||
_("Systemic latency: "),
|
||||
extra, extra * 1000.0f / sample_rate);
|
||||
|
||||
|
@ -3000,9 +3000,9 @@ EngineControl::use_latency_button_clicked ()
|
|||
if (!mididm) {
|
||||
return;
|
||||
}
|
||||
ARDOUR::framecnt_t frames_total = mididm->latency();
|
||||
ARDOUR::framecnt_t extra = frames_total - ARDOUR::AudioEngine::instance()->latency_signal_delay();
|
||||
uint32_t one_way = max ((ARDOUR::framecnt_t) 0, extra / 2);
|
||||
ARDOUR::samplecnt_t samples_total = mididm->latency();
|
||||
ARDOUR::samplecnt_t extra = samples_total - ARDOUR::AudioEngine::instance()->latency_signal_delay();
|
||||
uint32_t one_way = max ((ARDOUR::samplecnt_t) 0, extra / 2);
|
||||
_measure_midi->input_latency = one_way;
|
||||
_measure_midi->output_latency = one_way;
|
||||
if (backend->can_change_systemic_latency_when_running ()) {
|
||||
|
|
|
@ -59,7 +59,7 @@ setup_gtk_ardour_enums ()
|
|||
REGISTER_CLASS_ENUM (AudioClock, Timecode);
|
||||
REGISTER_CLASS_ENUM (AudioClock, BBT);
|
||||
REGISTER_CLASS_ENUM (AudioClock, MinSec);
|
||||
REGISTER_CLASS_ENUM (AudioClock, Frames);
|
||||
REGISTER_CLASS_ENUM (AudioClock, Samples);
|
||||
REGISTER (clock_mode);
|
||||
|
||||
REGISTER_ENUM (Wide);
|
||||
|
|
|
@ -402,7 +402,7 @@ ExportDialog::progress_timeout ()
|
|||
case ExportStatus::Exporting:
|
||||
status_text = string_compose (_("Exporting '%3' (timespan %1 of %2)"),
|
||||
status->timespan, status->total_timespans, status->timespan_name);
|
||||
progress = ((float) status->processed_frames_current_timespan) / status->total_frames_current_timespan;
|
||||
progress = ((float) status->processed_samples_current_timespan) / status->total_samples_current_timespan;
|
||||
break;
|
||||
case ExportStatus::Normalizing:
|
||||
status_text = string_compose (_("Normalizing '%3' (timespan %1 of %2)"),
|
||||
|
|
|
@ -300,7 +300,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 ((framecnt_t) (*it)->get_value (sample_rate_cols.ptr)->rate == _session->nominal_frame_rate()) {
|
||||
if ((samplecnt_t) (*it)->get_value (sample_rate_cols.ptr)->rate == _session->nominal_sample_rate()) {
|
||||
sample_rate_view.get_selection()->select (it);
|
||||
break;
|
||||
}
|
||||
|
@ -691,7 +691,7 @@ ExportFormatDialog::change_sample_rate_selection (bool select, WeakSampleRatePtr
|
|||
if (select) {
|
||||
ExportFormatManager::SampleRatePtr ptr = rate.lock();
|
||||
if (ptr && _session) {
|
||||
src_quality_combo.set_sensitive ((uint32_t) ptr->rate != _session->frame_rate());
|
||||
src_quality_combo.set_sensitive ((uint32_t) ptr->rate != _session->sample_rate());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -877,7 +877,7 @@ void
|
|||
ExportFormatDialog::update_clock (AudioClock & clock, ARDOUR::AnyTime const & time)
|
||||
{
|
||||
// TODO position
|
||||
clock.set (_session->convert_to_frames (time), true);
|
||||
clock.set (_session->convert_to_samples (time), true);
|
||||
|
||||
AudioClock::Mode mode(AudioClock::Timecode);
|
||||
|
||||
|
@ -888,8 +888,8 @@ ExportFormatDialog::update_clock (AudioClock & clock, ARDOUR::AnyTime const & ti
|
|||
case AnyTime::BBT:
|
||||
mode = AudioClock::BBT;
|
||||
break;
|
||||
case AnyTime::Frames:
|
||||
mode = AudioClock::Frames;
|
||||
case AnyTime::Samples:
|
||||
mode = AudioClock::Samples;
|
||||
break;
|
||||
case AnyTime::Seconds:
|
||||
mode = AudioClock::MinSec;
|
||||
|
@ -906,24 +906,24 @@ ExportFormatDialog::update_time (AnyTime & time, AudioClock const & clock)
|
|||
return;
|
||||
}
|
||||
|
||||
framecnt_t frames = clock.current_duration();
|
||||
samplecnt_t samples = clock.current_duration();
|
||||
|
||||
switch (clock.mode()) {
|
||||
case AudioClock::Timecode:
|
||||
time.type = AnyTime::Timecode;
|
||||
_session->timecode_time (frames, time.timecode);
|
||||
_session->timecode_time (samples, time.timecode);
|
||||
break;
|
||||
case AudioClock::BBT:
|
||||
time.type = AnyTime::BBT;
|
||||
_session->bbt_time (frames, time.bbt);
|
||||
_session->bbt_time (samples, time.bbt);
|
||||
break;
|
||||
case AudioClock::MinSec:
|
||||
time.type = AnyTime::Seconds;
|
||||
time.seconds = (double) frames / _session->frame_rate();
|
||||
time.seconds = (double) samples / _session->sample_rate();
|
||||
break;
|
||||
case AudioClock::Frames:
|
||||
time.type = AnyTime::Frames;
|
||||
time.frames = frames;
|
||||
case AudioClock::Samples:
|
||||
time.type = AnyTime::Samples;
|
||||
time.samples = samples;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -123,9 +123,9 @@ ExportReport::init (const AnalysisResults & ar, bool with_file)
|
|||
SoundFileInfo info;
|
||||
std::string errmsg;
|
||||
|
||||
framecnt_t file_length = 0;
|
||||
framecnt_t sample_rate = 0;
|
||||
framecnt_t start_off = 0;
|
||||
samplecnt_t file_length = 0;
|
||||
samplecnt_t sample_rate = 0;
|
||||
samplecnt_t start_off = 0;
|
||||
unsigned int channels = 0;
|
||||
std::string file_fmt;
|
||||
|
||||
|
@ -141,7 +141,7 @@ ExportReport::init (const AnalysisResults & ar, bool with_file)
|
|||
|
||||
/* File Info Table */
|
||||
|
||||
framecnt_t const nfr = _session ? _session->nominal_frame_rate () : 25;
|
||||
samplecnt_t const nfr = _session ? _session->nominal_sample_rate () : 25;
|
||||
double src_coef = (double) nfr / info.samplerate;
|
||||
|
||||
l = manage (new Label (_("Format:"), ALIGN_END));
|
||||
|
@ -961,7 +961,7 @@ ExportReport::audition (std::string path, unsigned n_chn, int page)
|
|||
SourceFactory::createExternal (DataType::AUDIO, *_session,
|
||||
path, n,
|
||||
Source::Flag (ARDOUR::AudioFileSource::NoPeakFile), false));
|
||||
if (afs->sample_rate() != _session->nominal_frame_rate()) {
|
||||
if (afs->sample_rate() != _session->nominal_sample_rate()) {
|
||||
boost::shared_ptr<SrcFileSource> sfs (new SrcFileSource(*_session, afs, ARDOUR::SrcGood));
|
||||
srclist.push_back(sfs);
|
||||
} else {
|
||||
|
@ -1034,7 +1034,7 @@ ExportReport::on_switch_page (GtkNotebookPage*, guint page_num)
|
|||
}
|
||||
|
||||
void
|
||||
ExportReport::audition_progress (framecnt_t pos, framecnt_t len)
|
||||
ExportReport::audition_progress (samplecnt_t pos, samplecnt_t len)
|
||||
{
|
||||
if (_audition_num == _page_num && timeline.find (_audition_num) != timeline.end ()) {
|
||||
const float p = (float)pos / len;
|
||||
|
@ -1169,7 +1169,7 @@ ExportReport::draw_waveform (Cairo::RefPtr<Cairo::ImageSurface>& wave, ExportAna
|
|||
|
||||
// >= -1dBTP (coeff >= .89125, libs/vamp-plugins/TruePeak.cpp)
|
||||
cr->set_source_rgba (1.0, 0.7, 0, 0.7);
|
||||
for (std::set<framepos_t>::const_iterator i = p->truepeakpos[c].begin (); i != p->truepeakpos[c].end (); ++i) {
|
||||
for (std::set<samplepos_t>::const_iterator i = p->truepeakpos[c].begin (); i != p->truepeakpos[c].end (); ++i) {
|
||||
cr->move_to (m_l + (*i) - .5, clip_top);
|
||||
cr->line_to (m_l + (*i) - .5, clip_bot);
|
||||
cr->stroke ();
|
||||
|
|
|
@ -204,7 +204,7 @@ private:
|
|||
void play_audition ();
|
||||
void audition_active (bool);
|
||||
void audition_seek (int, float);
|
||||
void audition_progress (ARDOUR::framecnt_t, ARDOUR::framecnt_t);
|
||||
void audition_progress (ARDOUR::samplecnt_t, ARDOUR::samplecnt_t);
|
||||
void on_switch_page (GtkNotebookPage*, guint page_num);
|
||||
void on_logscale_toggled (Gtk::ToggleButton*);
|
||||
void on_rectivied_toggled (Gtk::ToggleButton*);
|
||||
|
|
|
@ -221,28 +221,28 @@ ExportTimespanSelector::construct_label (ARDOUR::Location const * location) cons
|
|||
std::string start;
|
||||
std::string end;
|
||||
|
||||
framepos_t start_frame = location->start();
|
||||
framepos_t end_frame = location->end();
|
||||
samplepos_t start_sample = location->start();
|
||||
samplepos_t end_sample = location->end();
|
||||
|
||||
switch (state->time_format) {
|
||||
case AudioClock::BBT:
|
||||
start = bbt_str (start_frame);
|
||||
end = bbt_str (end_frame);
|
||||
start = bbt_str (start_sample);
|
||||
end = bbt_str (end_sample);
|
||||
break;
|
||||
|
||||
case AudioClock::Timecode:
|
||||
start = timecode_str (start_frame);
|
||||
end = timecode_str (end_frame);
|
||||
start = timecode_str (start_sample);
|
||||
end = timecode_str (end_sample);
|
||||
break;
|
||||
|
||||
case AudioClock::MinSec:
|
||||
start = ms_str (start_frame);
|
||||
end = ms_str (end_frame);
|
||||
start = ms_str (start_sample);
|
||||
end = ms_str (end_sample);
|
||||
break;
|
||||
|
||||
case AudioClock::Frames:
|
||||
start = to_string (start_frame);
|
||||
end = to_string (end_frame);
|
||||
case AudioClock::Samples:
|
||||
start = to_string (start_sample);
|
||||
end = to_string (end_sample);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -287,7 +287,7 @@ ExportTimespanSelector::construct_length (ARDOUR::Location const * location) con
|
|||
s << ms_str (location->length ());
|
||||
break;
|
||||
|
||||
case AudioClock::Frames:
|
||||
case AudioClock::Samples:
|
||||
s << location->length ();
|
||||
break;
|
||||
}
|
||||
|
@ -297,7 +297,7 @@ ExportTimespanSelector::construct_length (ARDOUR::Location const * location) con
|
|||
|
||||
|
||||
std::string
|
||||
ExportTimespanSelector::bbt_str (framepos_t frames) const
|
||||
ExportTimespanSelector::bbt_str (samplepos_t samples) const
|
||||
{
|
||||
if (!_session) {
|
||||
return "Error!";
|
||||
|
@ -305,14 +305,14 @@ ExportTimespanSelector::bbt_str (framepos_t frames) const
|
|||
|
||||
std::ostringstream oss;
|
||||
Timecode::BBT_Time time;
|
||||
_session->bbt_time (frames, time);
|
||||
_session->bbt_time (samples, time);
|
||||
|
||||
print_padded (oss, time);
|
||||
return oss.str ();
|
||||
}
|
||||
|
||||
std::string
|
||||
ExportTimespanSelector::timecode_str (framecnt_t frames) const
|
||||
ExportTimespanSelector::timecode_str (samplecnt_t samples) const
|
||||
{
|
||||
if (!_session) {
|
||||
return "Error!";
|
||||
|
@ -321,7 +321,7 @@ ExportTimespanSelector::timecode_str (framecnt_t frames) const
|
|||
std::ostringstream oss;
|
||||
Timecode::Time time;
|
||||
|
||||
_session->timecode_time (frames, time);
|
||||
_session->timecode_time (samples, time);
|
||||
|
||||
oss << std::setfill('0') << std::right <<
|
||||
std::setw(2) <<
|
||||
|
@ -337,27 +337,27 @@ ExportTimespanSelector::timecode_str (framecnt_t frames) const
|
|||
}
|
||||
|
||||
std::string
|
||||
ExportTimespanSelector::ms_str (framecnt_t frames) const
|
||||
ExportTimespanSelector::ms_str (samplecnt_t samples) const
|
||||
{
|
||||
if (!_session) {
|
||||
return "Error!";
|
||||
}
|
||||
|
||||
std::ostringstream oss;
|
||||
framecnt_t left;
|
||||
samplecnt_t left;
|
||||
int hrs;
|
||||
int mins;
|
||||
int secs;
|
||||
int sec_promilles;
|
||||
|
||||
left = frames;
|
||||
hrs = (int) floor (left / (_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 -= (framecnt_t) floor (mins * _session->frame_rate() * 60.0f);
|
||||
secs = (int) floor (left / (float) _session->frame_rate());
|
||||
left -= (framecnt_t) floor ((double)(secs * _session->frame_rate()));
|
||||
sec_promilles = (int) (left * 1000 / (float) _session->frame_rate() + 0.5);
|
||||
left = samples;
|
||||
hrs = (int) floor (left / (_session->sample_rate() * 60.0f * 60.0f));
|
||||
left -= (samplecnt_t) floor (hrs * _session->sample_rate() * 60.0f * 60.0f);
|
||||
mins = (int) floor (left / (_session->sample_rate() * 60.0f));
|
||||
left -= (samplecnt_t) floor (mins * _session->sample_rate() * 60.0f);
|
||||
secs = (int) floor (left / (float) _session->sample_rate());
|
||||
left -= (samplecnt_t) floor ((double)(secs * _session->sample_rate()));
|
||||
sec_promilles = (int) (left * 1000 / (float) _session->sample_rate() + 0.5);
|
||||
|
||||
oss << std::setfill('0') << std::right <<
|
||||
std::setw(2) <<
|
||||
|
|
|
@ -52,7 +52,7 @@ namespace ARDOUR {
|
|||
}
|
||||
|
||||
using ARDOUR::CDMarkerFormat;
|
||||
using ARDOUR::framecnt_t;
|
||||
using ARDOUR::samplecnt_t;
|
||||
|
||||
/// Timespan Selector base
|
||||
class ExportTimespanSelector : public Gtk::VBox, public ARDOUR::SessionHandlePtr
|
||||
|
@ -94,9 +94,9 @@ protected:
|
|||
|
||||
std::string construct_label (ARDOUR::Location const * location) const;
|
||||
std::string construct_length (ARDOUR::Location const * location) const;
|
||||
std::string bbt_str (framepos_t frames) const;
|
||||
std::string timecode_str (framecnt_t frames) const;
|
||||
std::string ms_str (framecnt_t frames) const;
|
||||
std::string bbt_str (samplepos_t samples) const;
|
||||
std::string timecode_str (samplecnt_t samples) const;
|
||||
std::string ms_str (samplecnt_t samples) const;
|
||||
|
||||
void update_range_name (std::string const & path, std::string const & new_text);
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ ExportVideoDialog::ExportVideoDialog ()
|
|||
, optimizations_checkbox (_("Codec Optimizations:"))
|
||||
, optimizations_label ("-")
|
||||
, deinterlace_checkbox (_("Deinterlace"))
|
||||
, bframes_checkbox (_("Use [2] B-frames (MPEG 2 or 4 only)"))
|
||||
, bframes_checkbox (_("Use [2] B-samples (MPEG 2 or 4 only)"))
|
||||
, fps_checkbox (_("Override FPS (Default is to retain FPS from the input video file):"))
|
||||
, meta_checkbox (_("Include Session Metadata"))
|
||||
#if 1 /* tentative debug mode */
|
||||
|
@ -334,14 +334,14 @@ ExportVideoDialog::apply_state (TimeSelection &tme, bool range)
|
|||
outfn_path_entry.set_text (_session->session_directory().export_path() + G_DIR_SEPARATOR +"export.avi");
|
||||
|
||||
// TODO remember setting for export-range.. somehow, (let explicit range override)
|
||||
frameoffset_t av_offset = ARDOUR_UI::instance()->video_timeline->get_offset();
|
||||
sampleoffset_t av_offset = ARDOUR_UI::instance()->video_timeline->get_offset();
|
||||
if (av_offset < 0 ) {
|
||||
insnd_combo.append_text (_("from 00:00:00:00 to the video's end"));
|
||||
} else {
|
||||
insnd_combo.append_text (_("from the video's start to the video's end"));
|
||||
}
|
||||
if (!export_range.empty()) {
|
||||
insnd_combo.append_text (_("Selected range")); // TODO show export_range.start() -> export_range.end_frame()
|
||||
insnd_combo.append_text (_("Selected range")); // TODO show export_range.start() -> export_range.end_sample()
|
||||
}
|
||||
if (range) {
|
||||
insnd_combo.set_active(2);
|
||||
|
@ -424,7 +424,7 @@ ExportVideoDialog::apply_state (TimeSelection &tme, bool range)
|
|||
if (node->get_property (X_("Deinterlace"), yn)) {
|
||||
deinterlace_checkbox.set_active (yn);
|
||||
}
|
||||
if (node->get_property (X_("BFrames"), yn)) {
|
||||
if (node->get_property (X_("BSamples"), yn)) {
|
||||
bframes_checkbox.set_active (yn);
|
||||
}
|
||||
if (node->get_property (X_("ChangeFPS"), yn)) {
|
||||
|
@ -513,7 +513,7 @@ ExportVideoDialog::get_state ()
|
|||
node->set_property (X_("TwoPassEncode"), twopass_checkbox.get_active());
|
||||
node->set_property (X_("CodecOptimzations"), optimizations_checkbox.get_active());
|
||||
node->set_property (X_("Deinterlace"), deinterlace_checkbox.get_active());
|
||||
node->set_property (X_("BFrames"), bframes_checkbox.get_active());
|
||||
node->set_property (X_("BSamples"), bframes_checkbox.get_active());
|
||||
node->set_property (X_("ChangeFPS"), fps_checkbox.get_active());
|
||||
node->set_property (X_("Metadata"), meta_checkbox.get_active());
|
||||
|
||||
|
@ -555,7 +555,7 @@ ExportVideoDialog::abort_clicked ()
|
|||
}
|
||||
|
||||
void
|
||||
ExportVideoDialog::update_progress (framecnt_t c, framecnt_t a)
|
||||
ExportVideoDialog::update_progress (samplecnt_t c, samplecnt_t a)
|
||||
{
|
||||
if (a == 0 || c > a) {
|
||||
pbar.set_pulse_step(.1);
|
||||
|
@ -586,7 +586,7 @@ ExportVideoDialog::audio_progress_display ()
|
|||
break;
|
||||
case ExportStatus::Exporting:
|
||||
pbar.set_text (_("Exporting audio"));
|
||||
progress = ((float) status->processed_frames_current_timespan) / status->total_frames_current_timespan;
|
||||
progress = ((float) status->processed_samples_current_timespan) / status->total_samples_current_timespan;
|
||||
progress = progress / ((_twopass ? 2.0 : 1.0) + (_normalize ? 2.0 : 1.0));
|
||||
break;
|
||||
default:
|
||||
|
@ -685,13 +685,13 @@ ExportVideoDialog::launch_export ()
|
|||
" <Start>"
|
||||
" <Trim enabled=\"false\"/>"
|
||||
" <Add enabled=\"false\">"
|
||||
" <Duration format=\"Timecode\" hours=\"0\" minutes=\"0\" seconds=\"0\" frames=\"0\"/>"
|
||||
" <Duration format=\"Timecode\" hours=\"0\" minutes=\"0\" seconds=\"0\" samples=\"0\"/>"
|
||||
" </Add>"
|
||||
" </Start>"
|
||||
" <End>"
|
||||
" <Trim enabled=\"false\"/>"
|
||||
" <Add enabled=\"false\">"
|
||||
" <Duration format=\"Timecode\" hours=\"0\" minutes=\"0\" seconds=\"0\" frames=\"0\"/>"
|
||||
" <Duration format=\"Timecode\" hours=\"0\" minutes=\"0\" seconds=\"0\" samples=\"0\"/>"
|
||||
" </Add>"
|
||||
" </End>"
|
||||
" </Silence>"
|
||||
|
@ -701,19 +701,19 @@ ExportVideoDialog::launch_export ()
|
|||
boost::shared_ptr<ExportFormatSpecification> fmp = _session->get_export_handler()->add_format(*tree.root());
|
||||
|
||||
/* set up range */
|
||||
framepos_t start, end;
|
||||
samplepos_t start, end;
|
||||
start = end = 0;
|
||||
if (insnd_combo.get_active_row_number() == 1) {
|
||||
_transcoder = new TranscodeFfmpeg(invid_path_entry.get_text());
|
||||
if (_transcoder->probe_ok() && _transcoder->get_fps() > 0) {
|
||||
end = _transcoder->get_duration() * _session->nominal_frame_rate() / _transcoder->get_fps();
|
||||
end = _transcoder->get_duration() * _session->nominal_sample_rate() / _transcoder->get_fps();
|
||||
} else {
|
||||
warning << _("Export Video: Cannot query duration of video-file, using duration from timeline instead.") << endmsg;
|
||||
end = ARDOUR_UI::instance()->video_timeline->get_duration();
|
||||
}
|
||||
if (_transcoder) {delete _transcoder; _transcoder = 0;}
|
||||
|
||||
frameoffset_t av_offset = ARDOUR_UI::instance()->video_timeline->get_offset();
|
||||
sampleoffset_t av_offset = ARDOUR_UI::instance()->video_timeline->get_offset();
|
||||
#if 0 /* DEBUG */
|
||||
printf("audio-range -- AV offset: %lld\n", av_offset);
|
||||
#endif
|
||||
|
@ -723,19 +723,19 @@ ExportVideoDialog::launch_export ()
|
|||
end += av_offset;
|
||||
}
|
||||
else if (insnd_combo.get_active_row_number() == 2) {
|
||||
start = ARDOUR_UI::instance()->video_timeline->quantify_frames_to_apv(export_range.start());
|
||||
end = ARDOUR_UI::instance()->video_timeline->quantify_frames_to_apv(export_range.end_frame());
|
||||
start = ARDOUR_UI::instance()->video_timeline->quantify_samples_to_apv(export_range.start());
|
||||
end = ARDOUR_UI::instance()->video_timeline->quantify_samples_to_apv(export_range.end_sample());
|
||||
}
|
||||
if (end <= 0) {
|
||||
start = _session->current_start_frame();
|
||||
end = _session->current_end_frame();
|
||||
start = _session->current_start_sample();
|
||||
end = _session->current_end_sample();
|
||||
}
|
||||
#if 0 /* DEBUG */
|
||||
printf("audio export-range %lld -> %lld\n", start, end);
|
||||
#endif
|
||||
|
||||
const frameoffset_t vstart = ARDOUR_UI::instance()->video_timeline->get_offset();
|
||||
const frameoffset_t vend = vstart + ARDOUR_UI::instance()->video_timeline->get_duration();
|
||||
const sampleoffset_t vstart = ARDOUR_UI::instance()->video_timeline->get_offset();
|
||||
const sampleoffset_t vend = vstart + ARDOUR_UI::instance()->video_timeline->get_duration();
|
||||
|
||||
if ( (start >= end) || (end < vstart) || (start > vend)) {
|
||||
warning << _("Export Video: export-range does not include video.") << endmsg;
|
||||
|
@ -936,23 +936,23 @@ ExportVideoDialog::encode_pass (int pass)
|
|||
ffs["-passlogfile"] = Glib::path_get_dirname (outfn) + G_DIR_SEPARATOR + "ffmpeg2pass";
|
||||
}
|
||||
|
||||
frameoffset_t av_offset = ARDOUR_UI::instance()->video_timeline->get_offset();
|
||||
sampleoffset_t av_offset = ARDOUR_UI::instance()->video_timeline->get_offset();
|
||||
double duration_s = 0;
|
||||
|
||||
if (insnd_combo.get_active_row_number() == 0) {
|
||||
/* session start to session end */
|
||||
framecnt_t duration_f = _session->current_end_frame() - _session->current_start_frame();
|
||||
duration_s = (double)duration_f / (double)_session->nominal_frame_rate();
|
||||
samplecnt_t duration_f = _session->current_end_sample() - _session->current_start_sample();
|
||||
duration_s = (double)duration_f / (double)_session->nominal_sample_rate();
|
||||
} else if (insnd_combo.get_active_row_number() == 2) {
|
||||
/* selected range */
|
||||
duration_s = export_range.length() / (double)_session->nominal_frame_rate();
|
||||
duration_s = export_range.length() / (double)_session->nominal_sample_rate();
|
||||
} else {
|
||||
/* video start to end */
|
||||
framecnt_t duration_f = ARDOUR_UI::instance()->video_timeline->get_duration();
|
||||
samplecnt_t duration_f = ARDOUR_UI::instance()->video_timeline->get_duration();
|
||||
if (av_offset < 0 ) {
|
||||
duration_f += av_offset;
|
||||
}
|
||||
duration_s = (double)duration_f / (double)_session->nominal_frame_rate();
|
||||
duration_s = (double)duration_f / (double)_session->nominal_sample_rate();
|
||||
}
|
||||
|
||||
std::ostringstream osstream; osstream << duration_s;
|
||||
|
@ -960,14 +960,14 @@ ExportVideoDialog::encode_pass (int pass)
|
|||
_transcoder->set_duration(duration_s * _transcoder->get_fps());
|
||||
|
||||
if (insnd_combo.get_active_row_number() == 0 || insnd_combo.get_active_row_number() == 2) {
|
||||
framepos_t start, snend;
|
||||
const frameoffset_t vid_duration = ARDOUR_UI::instance()->video_timeline->get_duration();
|
||||
samplepos_t start, snend;
|
||||
const sampleoffset_t vid_duration = ARDOUR_UI::instance()->video_timeline->get_duration();
|
||||
if (insnd_combo.get_active_row_number() == 0) {
|
||||
start = _session->current_start_frame();
|
||||
snend = _session->current_end_frame();
|
||||
start = _session->current_start_sample();
|
||||
snend = _session->current_end_sample();
|
||||
} else {
|
||||
start = export_range.start();
|
||||
snend = export_range.end_frame();
|
||||
snend = export_range.end_sample();
|
||||
}
|
||||
|
||||
#if 0 /* DEBUG */
|
||||
|
@ -976,27 +976,27 @@ ExportVideoDialog::encode_pass (int pass)
|
|||
#endif
|
||||
|
||||
if (av_offset > start && av_offset + vid_duration < snend) {
|
||||
_transcoder->set_leadinout((av_offset - start) / (double)_session->nominal_frame_rate(),
|
||||
(snend - (av_offset + vid_duration)) / (double)_session->nominal_frame_rate());
|
||||
_transcoder->set_leadinout((av_offset - start) / (double)_session->nominal_sample_rate(),
|
||||
(snend - (av_offset + vid_duration)) / (double)_session->nominal_sample_rate());
|
||||
} else if (av_offset > start) {
|
||||
_transcoder->set_leadinout((av_offset - start) / (double)_session->nominal_frame_rate(), 0);
|
||||
_transcoder->set_leadinout((av_offset - start) / (double)_session->nominal_sample_rate(), 0);
|
||||
} else if (av_offset + vid_duration < snend) {
|
||||
_transcoder->set_leadinout(0, (snend - (av_offset + vid_duration)) / (double)_session->nominal_frame_rate());
|
||||
_transcoder->set_avoffset((av_offset - start) / (double)_session->nominal_frame_rate());
|
||||
_transcoder->set_leadinout(0, (snend - (av_offset + vid_duration)) / (double)_session->nominal_sample_rate());
|
||||
_transcoder->set_avoffset((av_offset - start) / (double)_session->nominal_sample_rate());
|
||||
}
|
||||
#if 0
|
||||
else if (start > av_offset) {
|
||||
std::ostringstream osstream; osstream << ((start - av_offset) / (double)_session->nominal_frame_rate());
|
||||
std::ostringstream osstream; osstream << ((start - av_offset) / (double)_session->nominal_sample_rate());
|
||||
ffs["-ss"] = osstream.str();
|
||||
}
|
||||
#endif
|
||||
else {
|
||||
_transcoder->set_avoffset((av_offset - start) / (double)_session->nominal_frame_rate());
|
||||
_transcoder->set_avoffset((av_offset - start) / (double)_session->nominal_sample_rate());
|
||||
}
|
||||
|
||||
} else if (av_offset < 0) {
|
||||
/* from 00:00:00:00 to video-end */
|
||||
_transcoder->set_avoffset(av_offset / (double)_session->nominal_frame_rate());
|
||||
_transcoder->set_avoffset(av_offset / (double)_session->nominal_sample_rate());
|
||||
}
|
||||
|
||||
TranscodeFfmpeg::FFSettings meta = _transcoder->default_meta_data();
|
||||
|
@ -1157,7 +1157,7 @@ ExportVideoDialog::preset_combo_changed ()
|
|||
video_codec_combo.set_active(6);
|
||||
audio_bitrate_combo.set_active(2);
|
||||
video_bitrate_combo.set_active(4);
|
||||
if (_session->nominal_frame_rate() == 48000 || _session->nominal_frame_rate() == 96000) {
|
||||
if (_session->nominal_sample_rate() == 48000 || _session->nominal_sample_rate() == 96000) {
|
||||
audio_samplerate_combo.set_active(2);
|
||||
} else {
|
||||
audio_samplerate_combo.set_active(1);
|
||||
|
@ -1169,7 +1169,7 @@ ExportVideoDialog::preset_combo_changed ()
|
|||
video_codec_combo.set_active(2);
|
||||
audio_bitrate_combo.set_active(3);
|
||||
video_bitrate_combo.set_active(4);
|
||||
if (_session->nominal_frame_rate() == 48000 || _session->nominal_frame_rate() == 96000) {
|
||||
if (_session->nominal_sample_rate() == 48000 || _session->nominal_sample_rate() == 96000) {
|
||||
audio_samplerate_combo.set_active(2);
|
||||
} else {
|
||||
audio_samplerate_combo.set_active(1);
|
||||
|
@ -1181,7 +1181,7 @@ ExportVideoDialog::preset_combo_changed ()
|
|||
video_codec_combo.set_active(7);
|
||||
audio_bitrate_combo.set_active(3);
|
||||
video_bitrate_combo.set_active(4);
|
||||
if (_session->nominal_frame_rate() == 48000 || _session->nominal_frame_rate() == 96000) {
|
||||
if (_session->nominal_sample_rate() == 48000 || _session->nominal_sample_rate() == 96000) {
|
||||
audio_samplerate_combo.set_active(2);
|
||||
} else {
|
||||
audio_samplerate_combo.set_active(1);
|
||||
|
@ -1212,7 +1212,7 @@ ExportVideoDialog::preset_combo_changed ()
|
|||
video_codec_combo.set_active(5);
|
||||
audio_bitrate_combo.set_active(4);
|
||||
video_bitrate_combo.set_active(5);
|
||||
if (_session->nominal_frame_rate() == 48000 || _session->nominal_frame_rate() == 96000) {
|
||||
if (_session->nominal_sample_rate() == 48000 || _session->nominal_sample_rate() == 96000) {
|
||||
audio_samplerate_combo.set_active(2);
|
||||
} else {
|
||||
audio_samplerate_combo.set_active(1);
|
||||
|
@ -1224,7 +1224,7 @@ ExportVideoDialog::preset_combo_changed ()
|
|||
video_codec_combo.set_active(6);
|
||||
audio_bitrate_combo.set_active(0);
|
||||
video_bitrate_combo.set_active(0);
|
||||
if (_session->nominal_frame_rate() == 48000 || _session->nominal_frame_rate() == 96000) {
|
||||
if (_session->nominal_sample_rate() == 48000 || _session->nominal_sample_rate() == 96000) {
|
||||
audio_samplerate_combo.set_active(2);
|
||||
} else {
|
||||
audio_samplerate_combo.set_active(1);
|
||||
|
|
|
@ -88,7 +88,7 @@ private:
|
|||
bool _normalize;
|
||||
|
||||
void finished ();
|
||||
void update_progress (ARDOUR::framecnt_t, ARDOUR::framecnt_t);
|
||||
void update_progress (ARDOUR::samplecnt_t, ARDOUR::samplecnt_t);
|
||||
|
||||
boost::shared_ptr<ARDOUR::ExportStatus> status;
|
||||
sigc::connection audio_progress_connection;
|
||||
|
|
|
@ -651,7 +651,7 @@ FFTGraph::on_size_allocate (Gtk::Allocation & alloc)
|
|||
void
|
||||
FFTGraph::update_size ()
|
||||
{
|
||||
framecnt_t SR = PublicEditor::instance ().session ()->nominal_frame_rate ();
|
||||
samplecnt_t SR = PublicEditor::instance ().session ()->nominal_sample_rate ();
|
||||
_fft_start = SR / (double)_dataSize;
|
||||
_fft_end = .5 * SR;
|
||||
_fft_log_base = logf (.5 * _dataSize);
|
||||
|
|
|
@ -733,13 +733,13 @@ GainMeterBase::meter_point_clicked (MeterPoint mp)
|
|||
void
|
||||
GainMeterBase::amp_start_touch ()
|
||||
{
|
||||
_control->start_touch (_control->session().transport_frame());
|
||||
_control->start_touch (_control->session().transport_sample());
|
||||
}
|
||||
|
||||
void
|
||||
GainMeterBase::amp_stop_touch ()
|
||||
{
|
||||
_control->stop_touch (_control->session().transport_frame());
|
||||
_control->stop_touch (_control->session().transport_sample());
|
||||
effective_gain_display ();
|
||||
}
|
||||
|
||||
|
|
|
@ -429,8 +429,8 @@ GenericPluginUI::automatic_layout (const std::vector<ControlUI*>& control_uis)
|
|||
Gtk::Table* button_table = manage (new Gtk::Table (initial_button_rows, initial_button_cols));
|
||||
Gtk::Table* output_table = manage (new Gtk::Table (initial_output_rows, initial_output_cols));
|
||||
|
||||
Frame* frame;
|
||||
Frame* bt_frame;
|
||||
Frame* sample;
|
||||
Frame* bt_sample;
|
||||
VBox* box;
|
||||
int output_row, output_col;
|
||||
int button_row, button_col;
|
||||
|
@ -460,21 +460,21 @@ GenericPluginUI::automatic_layout (const std::vector<ControlUI*>& control_uis)
|
|||
output_table->set_border_width (5);
|
||||
|
||||
|
||||
bt_frame = manage (new Frame);
|
||||
bt_frame->set_name ("BaseFrame");
|
||||
bt_frame->set_label (_("Switches"));
|
||||
bt_frame->add (*button_table);
|
||||
hpacker.pack_start(*bt_frame, true, true);
|
||||
bt_sample = manage (new Frame);
|
||||
bt_sample->set_name ("BaseFrame");
|
||||
bt_sample->set_label (_("Switches"));
|
||||
bt_sample->add (*button_table);
|
||||
hpacker.pack_start(*bt_sample, true, true);
|
||||
|
||||
box = manage (new VBox);
|
||||
box->set_border_width (5);
|
||||
box->set_spacing (1);
|
||||
|
||||
frame = manage (new Frame);
|
||||
frame->set_name ("BaseFrame");
|
||||
frame->set_label (_("Controls"));
|
||||
frame->add (*box);
|
||||
hpacker.pack_start(*frame, true, true);
|
||||
sample = manage (new Frame);
|
||||
sample->set_name ("BaseFrame");
|
||||
sample->set_label (_("Controls"));
|
||||
sample->add (*box);
|
||||
hpacker.pack_start(*sample, true, true);
|
||||
|
||||
// Add special controls to UI, and build list of normal controls to be layed out later
|
||||
std::vector<ControlUI *> cui_controls_list;
|
||||
|
@ -576,14 +576,14 @@ GenericPluginUI::automatic_layout (const std::vector<ControlUI*>& control_uis)
|
|||
|
||||
if (x > max_controls_per_column || similarity_scores[i] <= similarity_threshold) {
|
||||
if (x > min_controls_per_column) {
|
||||
frame = manage (new Frame);
|
||||
frame->set_name ("BaseFrame");
|
||||
frame->set_label (_("Controls"));
|
||||
sample = manage (new Frame);
|
||||
sample->set_name ("BaseFrame");
|
||||
sample->set_label (_("Controls"));
|
||||
box = manage (new VBox);
|
||||
box->set_border_width (5);
|
||||
box->set_spacing (1);
|
||||
frame->add (*box);
|
||||
hpacker.pack_start(*frame, true, true);
|
||||
sample->add (*box);
|
||||
hpacker.pack_start(*sample, true, true);
|
||||
x = 0;
|
||||
} else {
|
||||
HSeparator *split = new HSeparator();
|
||||
|
@ -600,22 +600,22 @@ GenericPluginUI::automatic_layout (const std::vector<ControlUI*>& control_uis)
|
|||
}
|
||||
|
||||
if (box->children().empty()) {
|
||||
hpacker.remove (*frame);
|
||||
hpacker.remove (*sample);
|
||||
}
|
||||
|
||||
if (button_table->children().empty()) {
|
||||
hpacker.remove (*bt_frame);
|
||||
hpacker.remove (*bt_sample);
|
||||
delete button_table;
|
||||
} else {
|
||||
button_table->show_all ();
|
||||
}
|
||||
|
||||
if (!output_table->children().empty()) {
|
||||
frame = manage (new Frame);
|
||||
frame->set_name ("BaseFrame");
|
||||
frame->set_label(_("Meters"));
|
||||
frame->add (*output_table);
|
||||
hpacker.pack_end (*frame, true, true);
|
||||
sample = manage (new Frame);
|
||||
sample->set_name ("BaseFrame");
|
||||
sample->set_label(_("Meters"));
|
||||
sample->add (*output_table);
|
||||
hpacker.pack_end (*sample, true, true);
|
||||
output_table->show_all ();
|
||||
} else {
|
||||
delete output_table;
|
||||
|
@ -660,15 +660,15 @@ GenericPluginUI::build_midi_table ()
|
|||
pgm_table->set_border_width (5);
|
||||
pgm_table->set_col_spacing (2, 10);
|
||||
|
||||
Frame* frame = manage (new Frame);
|
||||
frame->set_name ("BaseFrame");
|
||||
Frame* sample = manage (new Frame);
|
||||
sample->set_name ("BaseFrame");
|
||||
if (dynamic_cast<MidiTrack*> (insert->owner())) {
|
||||
frame->set_label (_("MIDI Progams (sent to track)"));
|
||||
sample->set_label (_("MIDI Progams (sent to track)"));
|
||||
} else {
|
||||
frame->set_label (_("MIDI Progams (volatile)"));
|
||||
sample->set_label (_("MIDI Progams (volatile)"));
|
||||
}
|
||||
frame->add (*pgm_table);
|
||||
hpacker.pack_start (*frame, false, false);
|
||||
sample->add (*pgm_table);
|
||||
hpacker.pack_start (*sample, false, false);
|
||||
|
||||
for (uint8_t chn = 0; chn < 16; ++chn) {
|
||||
int col = 3 * (chn / 8);
|
||||
|
|
|
@ -74,10 +74,10 @@ InsertRemoveTimeDialog::InsertRemoveTimeDialog (PublicEditor& e, bool remove)
|
|||
//if a Range is selected, assume the user wants to insert/remove the length of the range
|
||||
if ( _editor.get_selection().time.length() != 0 ) {
|
||||
position_clock.set ( _editor.get_selection().time.start(), true );
|
||||
duration_clock.set ( _editor.get_selection().time.end_frame(), true, _editor.get_selection().time.start() );
|
||||
duration_clock.set ( _editor.get_selection().time.end_sample(), true, _editor.get_selection().time.start() );
|
||||
duration_clock.set_bbt_reference (_editor.get_selection().time.start());
|
||||
} else {
|
||||
framepos_t const pos = _editor.get_preferred_edit_position (EDIT_IGNORE_MOUSE);
|
||||
samplepos_t const pos = _editor.get_preferred_edit_position (EDIT_IGNORE_MOUSE);
|
||||
position_clock.set ( pos, true );
|
||||
duration_clock.set_bbt_reference (pos);
|
||||
duration_clock.set (0);
|
||||
|
@ -189,13 +189,13 @@ InsertRemoveTimeDialog::move_locked_markers () const
|
|||
return _move_locked_markers.get_active ();
|
||||
}
|
||||
|
||||
framepos_t
|
||||
samplepos_t
|
||||
InsertRemoveTimeDialog::position () const
|
||||
{
|
||||
return position_clock.current_time();
|
||||
}
|
||||
|
||||
framepos_t
|
||||
samplepos_t
|
||||
InsertRemoveTimeDialog::distance () const
|
||||
{
|
||||
return duration_clock.current_duration ( position_clock.current_time() );
|
||||
|
|
|
@ -34,8 +34,8 @@ public:
|
|||
bool move_glued_markers () const;
|
||||
bool move_locked_markers () const;
|
||||
bool move_tempos () const;
|
||||
framepos_t position () const;
|
||||
framepos_t distance () const;
|
||||
samplepos_t position () const;
|
||||
samplepos_t distance () const;
|
||||
|
||||
private:
|
||||
void move_markers_toggled ();
|
||||
|
|
|
@ -54,7 +54,7 @@ LatencyBarController::get_label (double&)
|
|||
std::stringstream s;
|
||||
|
||||
if (nframes < (_latency_gui->sample_rate / 1000.0)) {
|
||||
const framepos_t nf = (framepos_t) rint (nframes);
|
||||
const samplepos_t nf = (samplepos_t) rint (nframes);
|
||||
s << string_compose (P_("%1 sample", "%1 samples", nf), nf);
|
||||
} else {
|
||||
s << std::fixed << std::setprecision (2) << (nframes / (_latency_gui->sample_rate / 1000.0)) << " ms";
|
||||
|
@ -63,13 +63,13 @@ LatencyBarController::get_label (double&)
|
|||
return s.str ();
|
||||
}
|
||||
|
||||
LatencyGUI::LatencyGUI (Latent& l, framepos_t sr, framepos_t psz)
|
||||
LatencyGUI::LatencyGUI (Latent& l, samplepos_t sr, samplepos_t psz)
|
||||
: _latent (l),
|
||||
initial_value (_latent.user_latency()),
|
||||
sample_rate (sr),
|
||||
period_size (psz),
|
||||
ignored (new PBD::IgnorableControllable()),
|
||||
/* max 1 second, step by frames, page by msecs */
|
||||
/* max 1 second, step by samples, page by msecs */
|
||||
adjustment (initial_value, 0.0, sample_rate, 1.0, sample_rate / 1000.0f),
|
||||
bc (adjustment, this),
|
||||
reset_button (_("Reset"))
|
||||
|
@ -116,7 +116,7 @@ LatencyGUI::LatencyGUI (Latent& l, framepos_t sr, framepos_t psz)
|
|||
void
|
||||
LatencyGUI::finish ()
|
||||
{
|
||||
framepos_t new_value = (framepos_t) adjustment.get_value();
|
||||
samplepos_t new_value = (samplepos_t) adjustment.get_value();
|
||||
if (new_value != initial_value) {
|
||||
_latent.set_user_latency (new_value);
|
||||
}
|
||||
|
@ -161,7 +161,7 @@ LatencyGUI::change_latency_from_button (int dir)
|
|||
}
|
||||
}
|
||||
|
||||
LatencyDialog::LatencyDialog (const std::string& title, Latent& l, framepos_t sr, framepos_t psz)
|
||||
LatencyDialog::LatencyDialog (const std::string& title, Latent& l, samplepos_t sr, samplepos_t psz)
|
||||
: ArdourDialog (title, false, true),
|
||||
lwidget (l, sr, psz)
|
||||
{
|
||||
|
|
|
@ -57,7 +57,7 @@ private:
|
|||
class LatencyGUI : public Gtk::VBox
|
||||
{
|
||||
public:
|
||||
LatencyGUI (ARDOUR::Latent&, framepos_t sample_rate, framepos_t period_size);
|
||||
LatencyGUI (ARDOUR::Latent&, samplepos_t sample_rate, samplepos_t period_size);
|
||||
~LatencyGUI() { }
|
||||
|
||||
void finish ();
|
||||
|
@ -66,9 +66,9 @@ public:
|
|||
|
||||
private:
|
||||
ARDOUR::Latent& _latent;
|
||||
framepos_t initial_value;
|
||||
framepos_t sample_rate;
|
||||
framepos_t period_size;
|
||||
samplepos_t initial_value;
|
||||
samplepos_t sample_rate;
|
||||
samplepos_t period_size;
|
||||
boost::shared_ptr<PBD::IgnorableControllable> ignored;
|
||||
|
||||
Gtk::Adjustment adjustment;
|
||||
|
@ -91,7 +91,7 @@ private:
|
|||
class LatencyDialog : public ArdourDialog
|
||||
{
|
||||
public:
|
||||
LatencyDialog (const std::string& title, ARDOUR::Latent&, framepos_t sample_rate, framepos_t period_size);
|
||||
LatencyDialog (const std::string& title, ARDOUR::Latent&, samplepos_t sample_rate, samplepos_t period_size);
|
||||
~LatencyDialog() {}
|
||||
|
||||
private:
|
||||
|
|
|
@ -284,7 +284,7 @@ LocationEditRow::set_location (Location *loc)
|
|||
cd_check_button.set_active (location->is_cd_marker());
|
||||
cd_check_button.show();
|
||||
|
||||
if (location->start() == _session->current_start_frame()) {
|
||||
if (location->start() == _session->current_start_sample()) {
|
||||
cd_check_button.set_sensitive (false);
|
||||
} else {
|
||||
cd_check_button.set_sensitive (true);
|
||||
|
@ -418,10 +418,10 @@ LocationEditRow::to_playhead_button_pressed (LocationPart part)
|
|||
|
||||
switch (part) {
|
||||
case LocStart:
|
||||
location->set_start (_session->transport_frame (), false, true, divisions);
|
||||
location->set_start (_session->transport_sample (), false, true, divisions);
|
||||
break;
|
||||
case LocEnd:
|
||||
location->set_end (_session->transport_frame (), false, true,divisions);
|
||||
location->set_end (_session->transport_sample (), false, true,divisions);
|
||||
if (location->is_session_range()) {
|
||||
_session->set_end_is_free (false);
|
||||
}
|
||||
|
@ -524,7 +524,7 @@ LocationEditRow::cd_toggled ()
|
|||
//}
|
||||
|
||||
if (cd_check_button.get_active()) {
|
||||
if (location->start() <= _session->current_start_frame()) {
|
||||
if (location->start() <= _session->current_start_sample()) {
|
||||
error << _("You cannot put a CD marker at the start of the session") << endmsg;
|
||||
cd_check_button.set_active (false);
|
||||
return;
|
||||
|
@ -646,7 +646,7 @@ LocationEditRow::start_changed ()
|
|||
|
||||
start_clock.set (location->start());
|
||||
|
||||
if (location->start() == _session->current_start_frame()) {
|
||||
if (location->start() == _session->current_start_sample()) {
|
||||
cd_check_button.set_sensitive (false);
|
||||
} else {
|
||||
cd_check_button.set_sensitive (true);
|
||||
|
@ -753,7 +753,7 @@ LocationEditRow::set_clock_editable_status ()
|
|||
LocationUI::LocationUI (std::string state_node_name)
|
||||
: add_location_button (_("New Marker"))
|
||||
, add_range_button (_("New Range"))
|
||||
, _mode (AudioClock::Frames)
|
||||
, _mode (AudioClock::Samples)
|
||||
, _mode_set (false)
|
||||
, _state_node_name (state_node_name)
|
||||
{
|
||||
|
@ -808,15 +808,15 @@ LocationUI::LocationUI (std::string state_node_name)
|
|||
|
||||
newest_location = 0;
|
||||
|
||||
loc_frame_box.set_spacing (5);
|
||||
loc_frame_box.set_border_width (5);
|
||||
loc_frame_box.set_name("LocationFrameBox");
|
||||
loc_sample_box.set_spacing (5);
|
||||
loc_sample_box.set_border_width (5);
|
||||
loc_sample_box.set_name("LocationFrameBox");
|
||||
|
||||
loc_frame_box.pack_start (location_rows_scroller, true, true);
|
||||
loc_sample_box.pack_start (location_rows_scroller, true, true);
|
||||
|
||||
add_location_button.set_name ("LocationAddLocationButton");
|
||||
|
||||
table->attach (loc_frame_box, 0, 2, table_row, table_row + 1);
|
||||
table->attach (loc_sample_box, 0, 2, table_row, table_row + 1);
|
||||
++table_row;
|
||||
|
||||
loc_range_panes.add (*table);
|
||||
|
@ -841,14 +841,14 @@ LocationUI::LocationUI (std::string state_node_name)
|
|||
range_rows_scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
|
||||
range_rows_scroller.set_size_request (-1, 130);
|
||||
|
||||
range_frame_box.set_spacing (5);
|
||||
range_frame_box.set_name("LocationFrameBox");
|
||||
range_frame_box.set_border_width (5);
|
||||
range_frame_box.pack_start (range_rows_scroller, true, true);
|
||||
range_sample_box.set_spacing (5);
|
||||
range_sample_box.set_name("LocationFrameBox");
|
||||
range_sample_box.set_border_width (5);
|
||||
range_sample_box.pack_start (range_rows_scroller, true, true);
|
||||
|
||||
add_range_button.set_name ("LocationAddRangeButton");
|
||||
|
||||
table->attach (range_frame_box, 0, 2, table_row, table_row + 1);
|
||||
table->attach (range_sample_box, 0, 2, table_row, table_row + 1);
|
||||
++table_row;
|
||||
|
||||
loc_range_panes.add (*table);
|
||||
|
@ -1047,7 +1047,7 @@ LocationUI::add_new_location()
|
|||
string markername;
|
||||
|
||||
if (_session) {
|
||||
framepos_t where = _session->audible_frame();
|
||||
samplepos_t where = _session->audible_sample();
|
||||
_session->locations()->next_available_name(markername,"mark");
|
||||
Location *location = new Location (*_session, where, where, markername, Location::IsMark);
|
||||
if (UIConfiguration::instance().get_name_new_markers()) {
|
||||
|
@ -1069,7 +1069,7 @@ LocationUI::add_new_range()
|
|||
string rangename;
|
||||
|
||||
if (_session) {
|
||||
framepos_t where = _session->audible_frame();
|
||||
samplepos_t where = _session->audible_sample();
|
||||
_session->locations()->next_available_name(rangename,"unnamed");
|
||||
Location *location = new Location (*_session, where, where, rangename, Location::IsRangeMarker);
|
||||
PublicEditor::instance().begin_reversible_command (_("add range marker"));
|
||||
|
|
|
@ -182,12 +182,12 @@ private:
|
|||
|
||||
ArdourWidgets::VPane loc_range_panes;
|
||||
|
||||
Gtk::VBox loc_frame_box;
|
||||
Gtk::VBox loc_sample_box;
|
||||
Gtk::Button add_location_button;
|
||||
Gtk::ScrolledWindow location_rows_scroller;
|
||||
Gtk::VBox location_rows;
|
||||
|
||||
Gtk::VBox range_frame_box;
|
||||
Gtk::VBox range_sample_box;
|
||||
Gtk::Button add_range_button;
|
||||
Gtk::ScrolledWindow range_rows_scroller;
|
||||
Gtk::VBox range_rows;
|
||||
|
|
|
@ -728,14 +728,14 @@ LuaInstance::register_classes (lua_State* L)
|
|||
|
||||
.beginClass <RegionSelection> ("RegionSelection")
|
||||
.addFunction ("start", &RegionSelection::start)
|
||||
.addFunction ("end_frame", &RegionSelection::end_frame)
|
||||
.addFunction ("end_frame", &RegionSelection::end_sample)
|
||||
.addFunction ("n_midi_regions", &RegionSelection::n_midi_regions)
|
||||
.addFunction ("regionlist", &RegionSelection::regionlist) // XXX check windows binding (libardour)
|
||||
.endClass ()
|
||||
|
||||
.deriveClass <TimeSelection, std::list<ARDOUR::AudioRange> > ("TimeSelection")
|
||||
.addFunction ("start", &TimeSelection::start)
|
||||
.addFunction ("end_frame", &TimeSelection::end_frame)
|
||||
.addFunction ("end_frame", &TimeSelection::end_sample)
|
||||
.addFunction ("length", &TimeSelection::length)
|
||||
.endClass ()
|
||||
|
||||
|
|
|
@ -103,9 +103,9 @@ LV2PluginUI::touch(void* controller,
|
|||
|
||||
ControllableRef control = me->_controllables[port_index];
|
||||
if (grabbed) {
|
||||
control->start_touch(control->session().transport_frame());
|
||||
control->start_touch(control->session().transport_sample());
|
||||
} else {
|
||||
control->stop_touch(control->session().transport_frame());
|
||||
control->stop_touch(control->session().transport_sample());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -137,7 +137,7 @@ static void ardour_g_log (const gchar *log_domain, GLogLevelFlags log_level, con
|
|||
static gboolean
|
||||
tell_about_backend_death (void* /* ignored */)
|
||||
{
|
||||
if (AudioEngine::instance()->processed_frames() == 0) {
|
||||
if (AudioEngine::instance()->processed_samples() == 0) {
|
||||
/* died during startup */
|
||||
MessageDialog msg (string_compose (_("The audio backend (%1) has failed, or terminated"), AudioEngine::instance()->current_backend_name()), false);
|
||||
msg.set_position (Gtk::WIN_POS_CENTER);
|
||||
|
|
|
@ -76,7 +76,7 @@ MainClock::build_ops_menu ()
|
|||
ops_items.push_back (MenuElem (_("Insert Meter Change"), sigc::mem_fun(*this, &MainClock::insert_new_meter)));
|
||||
}
|
||||
|
||||
framepos_t
|
||||
samplepos_t
|
||||
MainClock::absolute_time () const
|
||||
{
|
||||
if (get_is_duration ()) {
|
||||
|
@ -101,7 +101,7 @@ void
|
|||
MainClock::edit_current_tempo ()
|
||||
{
|
||||
if (!PublicEditor::instance().session()) return;
|
||||
ARDOUR::TempoSection* ts = const_cast<ARDOUR::TempoSection*>(&PublicEditor::instance().session()->tempo_map().tempo_section_at_frame (absolute_time()));
|
||||
ARDOUR::TempoSection* ts = const_cast<ARDOUR::TempoSection*>(&PublicEditor::instance().session()->tempo_map().tempo_section_at_sample (absolute_time()));
|
||||
PublicEditor::instance().edit_tempo_section (ts);
|
||||
}
|
||||
|
||||
|
@ -109,7 +109,7 @@ void
|
|||
MainClock::edit_current_meter ()
|
||||
{
|
||||
if (!PublicEditor::instance().session()) return;
|
||||
ARDOUR::MeterSection* ms = const_cast<ARDOUR::MeterSection*>(&PublicEditor::instance().session()->tempo_map().meter_section_at_frame (absolute_time()));
|
||||
ARDOUR::MeterSection* ms = const_cast<ARDOUR::MeterSection*>(&PublicEditor::instance().session()->tempo_map().meter_section_at_sample (absolute_time()));
|
||||
PublicEditor::instance().edit_meter_section (ms);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ class MainClock : public AudioClock
|
|||
{
|
||||
public:
|
||||
MainClock (const std::string& clock_name, const std::string& widget_name, bool primary);
|
||||
framepos_t absolute_time () const;
|
||||
samplepos_t absolute_time () const;
|
||||
void set_session (ARDOUR::Session *s);
|
||||
|
||||
private:
|
||||
|
|
|
@ -64,7 +64,7 @@ void ArdourMarker::setup_sizes(const double timebar_height)
|
|||
}
|
||||
|
||||
ArdourMarker::ArdourMarker (PublicEditor& ed, ArdourCanvas::Container& parent, guint32 rgba, const string& annotation,
|
||||
Type type, framepos_t frame, bool handle_events)
|
||||
Type type, samplepos_t sample, bool handle_events)
|
||||
|
||||
: editor (ed)
|
||||
, _parent (&parent)
|
||||
|
@ -255,8 +255,8 @@ ArdourMarker::ArdourMarker (PublicEditor& ed, ArdourCanvas::Container& parent, g
|
|||
|
||||
}
|
||||
|
||||
frame_position = frame;
|
||||
unit_position = editor.sample_to_pixel (frame);
|
||||
sample_position = sample;
|
||||
unit_position = editor.sample_to_pixel (sample);
|
||||
unit_position -= _shift;
|
||||
|
||||
group = new ArdourCanvas::Container (&parent, ArdourCanvas::Duple (unit_position, 1));
|
||||
|
@ -460,18 +460,18 @@ ArdourMarker::setup_name_display ()
|
|||
}
|
||||
|
||||
void
|
||||
ArdourMarker::set_position (framepos_t frame)
|
||||
ArdourMarker::set_position (samplepos_t sample)
|
||||
{
|
||||
unit_position = editor.sample_to_pixel (frame) - _shift;
|
||||
unit_position = editor.sample_to_pixel (sample) - _shift;
|
||||
group->set_x_position (unit_position);
|
||||
setup_line ();
|
||||
frame_position = frame;
|
||||
sample_position = sample;
|
||||
}
|
||||
|
||||
void
|
||||
ArdourMarker::reposition ()
|
||||
{
|
||||
set_position (frame_position);
|
||||
set_position (sample_position);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -550,7 +550,7 @@ ArdourMarker::set_right_label_limit (double p)
|
|||
|
||||
TempoMarker::TempoMarker (PublicEditor& editor, ArdourCanvas::Container& parent, guint32 rgba, const string& text,
|
||||
ARDOUR::TempoSection& temp)
|
||||
: ArdourMarker (editor, parent, rgba, text, Tempo, temp.frame(), false),
|
||||
: ArdourMarker (editor, parent, rgba, text, Tempo, temp.sample(), false),
|
||||
_tempo (temp)
|
||||
{
|
||||
group->Event.connect (sigc::bind (sigc::mem_fun (editor, &PublicEditor::canvas_tempo_marker_event), group, this));
|
||||
|
@ -584,7 +584,7 @@ TempoMarker::update_height_mark (const double ratio)
|
|||
|
||||
MeterMarker::MeterMarker (PublicEditor& editor, ArdourCanvas::Container& parent, guint32 rgba, const string& text,
|
||||
ARDOUR::MeterSection& m)
|
||||
: ArdourMarker (editor, parent, rgba, text, Meter, m.frame(), false),
|
||||
: ArdourMarker (editor, parent, rgba, text, Meter, m.sample(), false),
|
||||
_meter (m)
|
||||
{
|
||||
group->Event.connect (sigc::bind (sigc::mem_fun (editor, &PublicEditor::canvas_meter_marker_event), group, this));
|
||||
|
|
|
@ -61,7 +61,7 @@ public:
|
|||
|
||||
|
||||
ArdourMarker (PublicEditor& editor, ArdourCanvas::Container &, guint32 rgba, const std::string& text, Type,
|
||||
framepos_t frame = 0, bool handle_events = true);
|
||||
samplepos_t sample = 0, bool handle_events = true);
|
||||
|
||||
virtual ~ArdourMarker ();
|
||||
|
||||
|
@ -75,13 +75,13 @@ public:
|
|||
void set_show_line (bool);
|
||||
void canvas_height_set (double);
|
||||
|
||||
void set_position (framepos_t);
|
||||
void set_position (samplepos_t);
|
||||
void set_name (const std::string&);
|
||||
void set_points_color (uint32_t rgba);
|
||||
void set_color_rgba (uint32_t rgba);
|
||||
void setup_line ();
|
||||
|
||||
framepos_t position() const { return frame_position; }
|
||||
samplepos_t position() const { return sample_position; }
|
||||
|
||||
ArdourCanvas::Container * get_parent() { return _parent; }
|
||||
void reparent (ArdourCanvas::Container & parent);
|
||||
|
@ -115,7 +115,7 @@ protected:
|
|||
|
||||
std::string _name;
|
||||
double unit_position;
|
||||
framepos_t frame_position;
|
||||
samplepos_t sample_position;
|
||||
double _shift;
|
||||
Type _type;
|
||||
int name_height;
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
class MarkerSelection : public std::list<ArdourMarker*>
|
||||
{
|
||||
public:
|
||||
void range (ARDOUR::framepos_t& start, ARDOUR::framepos_t& end);
|
||||
void range (ARDOUR::samplepos_t& start, ARDOUR::samplepos_t& end);
|
||||
};
|
||||
|
||||
#endif /* __ardour_gtk_marker_selection_h__ */
|
||||
|
|
|
@ -36,7 +36,7 @@ MidiAutomationLine::MidiAutomationLine (
|
|||
boost::shared_ptr<ARDOUR::AutomationList> list,
|
||||
boost::shared_ptr<ARDOUR::MidiRegion> region,
|
||||
Evoral::Parameter parameter,
|
||||
Evoral::TimeConverter<double, ARDOUR::framepos_t>* converter)
|
||||
Evoral::TimeConverter<double, ARDOUR::samplepos_t>* converter)
|
||||
: AutomationLine (name, tav, parent, list, parameter, converter)
|
||||
, _region (region)
|
||||
, _parameter (parameter)
|
||||
|
|
|
@ -33,7 +33,7 @@ public:
|
|||
boost::shared_ptr<ARDOUR::AutomationList>,
|
||||
boost::shared_ptr<ARDOUR::MidiRegion>,
|
||||
Evoral::Parameter,
|
||||
Evoral::TimeConverter<double, ARDOUR::framepos_t>* converter = 0);
|
||||
Evoral::TimeConverter<double, ARDOUR::samplepos_t>* converter = 0);
|
||||
|
||||
MementoCommandBinder<ARDOUR::AutomationList>* memento_command_binder ();
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include "evoral/midi_util.h"
|
||||
#include "evoral/Note.hpp"
|
||||
|
||||
#include "ardour/beats_frames_converter.h"
|
||||
#include "ardour/beats_samples_converter.h"
|
||||
#include "ardour/midi_model.h"
|
||||
#include "ardour/midi_region.h"
|
||||
#include "ardour/midi_source.h"
|
||||
|
@ -759,7 +759,7 @@ MidiListEditor::redisplay_model ()
|
|||
|
||||
if (_session) {
|
||||
|
||||
BeatsFramesConverter conv (_session->tempo_map(), region->position());
|
||||
BeatsSamplesConverter conv (_session->tempo_map(), region->position());
|
||||
MidiModel::Notes notes = region->midi_source(0)->model()->notes();
|
||||
TreeModel::Row row;
|
||||
stringstream ss;
|
||||
|
@ -771,7 +771,7 @@ MidiListEditor::redisplay_model ()
|
|||
row[columns.note] = (*i)->note();
|
||||
row[columns.velocity] = (*i)->velocity();
|
||||
|
||||
Timecode::BBT_Time bbt (_session->tempo_map().bbt_at_frame (region->position() + conv.to ((*i)->time())));
|
||||
Timecode::BBT_Time bbt (_session->tempo_map().bbt_at_sample (region->position() + conv.to ((*i)->time())));
|
||||
|
||||
ss.str ("");
|
||||
ss << bbt;
|
||||
|
|
|
@ -269,7 +269,7 @@ MidiRegionView::init (bool wfd)
|
|||
|
||||
_model = midi_region()->midi_source(0)->model();
|
||||
_enable_display = false;
|
||||
fill_color_name = "midi frame base";
|
||||
fill_color_name = "midi sample base";
|
||||
|
||||
RegionView::init (false);
|
||||
|
||||
|
@ -416,8 +416,8 @@ MidiRegionView::leave_notify (GdkEventCrossing*)
|
|||
void
|
||||
MidiRegionView::mouse_mode_changed ()
|
||||
{
|
||||
// Adjust frame colour (become more transparent for internal tools)
|
||||
set_frame_color();
|
||||
// Adjust sample colour (become more transparent for internal tools)
|
||||
set_sample_color();
|
||||
|
||||
if (_entered) {
|
||||
if (!trackview.editor().internal_editing()) {
|
||||
|
@ -457,12 +457,12 @@ MidiRegionView::enter_internal (uint32_t state)
|
|||
_grabbed_keyboard = true;
|
||||
}
|
||||
|
||||
// Lower frame handles below notes so they don't steal events
|
||||
if (frame_handle_start) {
|
||||
frame_handle_start->lower_to_bottom();
|
||||
// Lower sample handles below notes so they don't steal events
|
||||
if (sample_handle_start) {
|
||||
sample_handle_start->lower_to_bottom();
|
||||
}
|
||||
if (frame_handle_end) {
|
||||
frame_handle_end->lower_to_bottom();
|
||||
if (sample_handle_end) {
|
||||
sample_handle_end->lower_to_bottom();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -478,12 +478,12 @@ MidiRegionView::leave_internal()
|
|||
_grabbed_keyboard = false;
|
||||
}
|
||||
|
||||
// Raise frame handles above notes so they catch events
|
||||
if (frame_handle_start) {
|
||||
frame_handle_start->raise_to_top();
|
||||
// Raise sample handles above notes so they catch events
|
||||
if (sample_handle_start) {
|
||||
sample_handle_start->raise_to_top();
|
||||
}
|
||||
if (frame_handle_end) {
|
||||
frame_handle_end->raise_to_top();
|
||||
if (sample_handle_end) {
|
||||
sample_handle_end->raise_to_top();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -917,13 +917,13 @@ MidiRegionView::show_list_editor ()
|
|||
}
|
||||
|
||||
/** Add a note to the model, and the view, at a canvas (click) coordinate.
|
||||
* \param t time in frames relative to the position of the region
|
||||
* \param t time in samples relative to the position of the region
|
||||
* \param y vertical position in pixels
|
||||
* \param length duration of the note in beats
|
||||
* \param snap_t true to snap t to the grid, otherwise false.
|
||||
*/
|
||||
void
|
||||
MidiRegionView::create_note_at (framepos_t t, double y, Evoral::Beats length, uint32_t state, bool shift_snap)
|
||||
MidiRegionView::create_note_at (samplepos_t t, double y, Evoral::Beats length, uint32_t state, bool shift_snap)
|
||||
{
|
||||
if (length < 2 * DBL_EPSILON) {
|
||||
return;
|
||||
|
@ -937,9 +937,9 @@ MidiRegionView::create_note_at (framepos_t t, double y, Evoral::Beats length, ui
|
|||
return;
|
||||
}
|
||||
|
||||
// Start of note in frames relative to region start
|
||||
// Start of note in samples relative to region start
|
||||
const int32_t divisions = trackview.editor().get_grid_music_divisions (state);
|
||||
Evoral::Beats beat_time = snap_frame_to_grid_underneath (t, divisions, shift_snap);
|
||||
Evoral::Beats beat_time = snap_sample_to_grid_underneath (t, divisions, shift_snap);
|
||||
|
||||
const double note = view->y_to_note(y);
|
||||
const uint8_t chan = mtv->get_channel_for_add();
|
||||
|
@ -1175,7 +1175,7 @@ MidiRegionView::redisplay_model()
|
|||
{
|
||||
if (_active_notes) {
|
||||
// Currently recording
|
||||
const framecnt_t zoom = trackview.editor().get_current_zoom();
|
||||
const samplecnt_t zoom = trackview.editor().get_current_zoom();
|
||||
if (zoom != _last_display_zoom) {
|
||||
/* Update resolved canvas notes to reflect changes in zoom without
|
||||
touching model. Leave active notes (with length 0) alone since
|
||||
|
@ -1331,12 +1331,12 @@ MidiRegionView::display_patch_changes_on_channel (uint8_t channel, bool active_c
|
|||
|
||||
if ((p = find_canvas_patch_change (*i)) != 0) {
|
||||
|
||||
const framecnt_t region_frames = source_beats_to_region_frames ((*i)->time());
|
||||
const samplecnt_t region_samples = source_beats_to_region_samples ((*i)->time());
|
||||
|
||||
if (region_frames < 0 || region_frames >= _region->length()) {
|
||||
if (region_samples < 0 || region_samples >= _region->length()) {
|
||||
p->hide();
|
||||
} else {
|
||||
const double x = trackview.editor().sample_to_pixel (region_frames);
|
||||
const double x = trackview.editor().sample_to_pixel (region_samples);
|
||||
const string patch_name = instrument_info().get_patch_name ((*i)->bank(), (*i)->program(), channel);
|
||||
p->canvas_item()->set_position (ArdourCanvas::Duple (x, 1.0));
|
||||
p->set_text (patch_name);
|
||||
|
@ -1367,14 +1367,14 @@ MidiRegionView::display_sysexes()
|
|||
}
|
||||
|
||||
if (have_periodic_system_messages) {
|
||||
double zoom = trackview.editor().get_current_zoom (); // frames per pixel
|
||||
double zoom = trackview.editor().get_current_zoom (); // samples per pixel
|
||||
|
||||
/* get an approximate value for the number of samples per video frame */
|
||||
|
||||
double video_frame = trackview.session()->frame_rate() * (1.0/30);
|
||||
double video_frame = trackview.session()->sample_rate() * (1.0/30);
|
||||
|
||||
/* if we are zoomed out beyond than the cutoff (i.e. more
|
||||
* frames per pixel than frames per 4 video frames), don't
|
||||
* samples per pixel than samples per 4 video frames), don't
|
||||
* show periodic sysex messages.
|
||||
*/
|
||||
|
||||
|
@ -1406,7 +1406,7 @@ MidiRegionView::display_sysexes()
|
|||
}
|
||||
string text = str.str();
|
||||
|
||||
const double x = trackview.editor().sample_to_pixel(source_beats_to_region_frames(time));
|
||||
const double x = trackview.editor().sample_to_pixel(source_beats_to_region_samples(time));
|
||||
|
||||
double height = midi_stream_view()->contents_height();
|
||||
|
||||
|
@ -1424,7 +1424,7 @@ MidiRegionView::display_sysexes()
|
|||
}
|
||||
|
||||
// Show unless message is beyond the region bounds
|
||||
// XXX REQUIRES APPROPRIATE OPERATORS FOR Evoral::Beats and framepos? say what?
|
||||
// XXX REQUIRES APPROPRIATE OPERATORS FOR Evoral::Beats and samplepos? say what?
|
||||
#warning paul fix this
|
||||
// if (time - _region->start() >= _region->length() || time < _region->start()) {
|
||||
// sysex->hide();
|
||||
|
@ -1623,9 +1623,9 @@ MidiRegionView::resolve_note(uint8_t note, Evoral::Beats end_time)
|
|||
end_time - _active_notes[note]->note()->time());
|
||||
|
||||
/* End time is relative to the region being recorded. */
|
||||
const framepos_t end_time_frames = region_beats_to_region_frames(end_time);
|
||||
const samplepos_t end_time_samples = region_beats_to_region_samples(end_time);
|
||||
|
||||
_active_notes[note]->set_x1 (trackview.editor().sample_to_pixel(end_time_frames));
|
||||
_active_notes[note]->set_x1 (trackview.editor().sample_to_pixel(end_time_samples));
|
||||
_active_notes[note]->set_outline_all ();
|
||||
_active_notes[note] = 0;
|
||||
}
|
||||
|
@ -1738,9 +1738,9 @@ MidiRegionView::update_sustained (Note* ev, bool update_ghost_regions)
|
|||
boost::shared_ptr<NoteType> note = ev->note();
|
||||
|
||||
const double session_source_start = _region->quarter_note() - mr->start_beats();
|
||||
const framepos_t note_start_frames = map.frame_at_quarter_note (note->time().to_double() + session_source_start) - _region->position();
|
||||
const samplepos_t note_start_samples = map.sample_at_quarter_note (note->time().to_double() + session_source_start) - _region->position();
|
||||
|
||||
const double x0 = trackview.editor().sample_to_pixel (note_start_frames);
|
||||
const double x0 = trackview.editor().sample_to_pixel (note_start_samples);
|
||||
double x1;
|
||||
const double y0 = 1 + floor(note_to_y(note->note()));
|
||||
double y1;
|
||||
|
@ -1753,9 +1753,9 @@ MidiRegionView::update_sustained (Note* ev, bool update_ghost_regions)
|
|||
note_end_time = mr->start_beats() + mr->length_beats();
|
||||
}
|
||||
|
||||
const framepos_t note_end_frames = map.frame_at_quarter_note (session_source_start + note_end_time) - _region->position();
|
||||
const samplepos_t note_end_samples = map.sample_at_quarter_note (session_source_start + note_end_time) - _region->position();
|
||||
|
||||
x1 = std::max(1., trackview.editor().sample_to_pixel (note_end_frames)) - 1;
|
||||
x1 = std::max(1., trackview.editor().sample_to_pixel (note_end_samples)) - 1;
|
||||
} else {
|
||||
x1 = std::max(1., trackview.editor().sample_to_pixel (_region->length())) - 1;
|
||||
}
|
||||
|
@ -1798,9 +1798,9 @@ MidiRegionView::update_hit (Hit* ev, bool update_ghost_regions)
|
|||
boost::shared_ptr<NoteType> note = ev->note();
|
||||
|
||||
const double note_time_qn = note->time().to_double() + (_region->quarter_note() - midi_region()->start_beats());
|
||||
const framepos_t note_start_frames = trackview.session()->tempo_map().frame_at_quarter_note (note_time_qn) - _region->position();
|
||||
const samplepos_t note_start_samples = trackview.session()->tempo_map().sample_at_quarter_note (note_time_qn) - _region->position();
|
||||
|
||||
const double x = trackview.editor().sample_to_pixel(note_start_frames);
|
||||
const double x = trackview.editor().sample_to_pixel(note_start_samples);
|
||||
const double diamond_size = std::max(1., floor(note_height()) - 2.);
|
||||
const double y = 1.5 + floor(note_to_y(note->note())) + diamond_size * .5;
|
||||
|
||||
|
@ -1896,12 +1896,12 @@ MidiRegionView::step_add_note (uint8_t channel, uint8_t number, uint8_t velocity
|
|||
|
||||
/* potentially extend region to hold new note */
|
||||
|
||||
framepos_t end_frame = source_beats_to_absolute_frames (new_note->end_time());
|
||||
framepos_t region_end = _region->last_frame();
|
||||
samplepos_t end_sample = source_beats_to_absolute_samples (new_note->end_time());
|
||||
samplepos_t region_end = _region->last_sample();
|
||||
|
||||
if (end_frame > region_end) {
|
||||
if (end_sample > region_end) {
|
||||
/* XX sets length in beats from audio space. make musical */
|
||||
_region->set_length (end_frame - _region->position(), 0);
|
||||
_region->set_length (end_sample - _region->position(), 0);
|
||||
}
|
||||
|
||||
MidiTimeAxisView* const mtv = dynamic_cast<MidiTimeAxisView*>(&trackview);
|
||||
|
@ -1935,8 +1935,8 @@ MidiRegionView::step_sustain (Evoral::Beats beats)
|
|||
void
|
||||
MidiRegionView::add_canvas_patch_change (MidiModel::PatchChangePtr patch, const string& displaytext, bool /*active_channel*/)
|
||||
{
|
||||
framecnt_t region_frames = source_beats_to_region_frames (patch->time());
|
||||
const double x = trackview.editor().sample_to_pixel (region_frames);
|
||||
samplecnt_t region_samples = source_beats_to_region_samples (patch->time());
|
||||
const double x = trackview.editor().sample_to_pixel (region_samples);
|
||||
|
||||
double const height = midi_stream_view()->contents_height();
|
||||
|
||||
|
@ -1957,7 +1957,7 @@ MidiRegionView::add_canvas_patch_change (MidiModel::PatchChangePtr patch, const
|
|||
|
||||
if (patch_change->item().width() < _pixel_width) {
|
||||
// Show unless patch change is beyond the region bounds
|
||||
if (region_frames < 0 || region_frames >= _region->length()) {
|
||||
if (region_samples < 0 || region_samples >= _region->length()) {
|
||||
patch_change->hide();
|
||||
} else {
|
||||
patch_change->show();
|
||||
|
@ -2077,12 +2077,12 @@ MidiRegionView::change_patch_change (MidiModel::PatchChangePtr old_change, const
|
|||
}
|
||||
|
||||
/** Add a patch change to the region.
|
||||
* @param t Time in frames relative to region position
|
||||
* @param t Time in samples relative to region position
|
||||
* @param patch Patch to add; time and channel are ignored (time is converted from t, and channel comes from
|
||||
* MidiTimeAxisView::get_channel_for_add())
|
||||
*/
|
||||
void
|
||||
MidiRegionView::add_patch_change (framecnt_t t, Evoral::PatchChange<Evoral::Beats> const & patch)
|
||||
MidiRegionView::add_patch_change (samplecnt_t t, Evoral::PatchChange<Evoral::Beats> const & patch)
|
||||
{
|
||||
string name = _("add patch change");
|
||||
|
||||
|
@ -2090,7 +2090,7 @@ MidiRegionView::add_patch_change (framecnt_t t, Evoral::PatchChange<Evoral::Beat
|
|||
MidiModel::PatchChangeDiffCommand* c = _model->new_patch_change_diff_command (name);
|
||||
c->add (MidiModel::PatchChangePtr (
|
||||
new Evoral::PatchChange<Evoral::Beats> (
|
||||
absolute_frames_to_source_beats (_region->position() + t),
|
||||
absolute_samples_to_source_beats (_region->position() + t),
|
||||
patch.channel(), patch.program(), patch.bank()
|
||||
)
|
||||
)
|
||||
|
@ -2242,12 +2242,12 @@ MidiRegionView::select_all_notes ()
|
|||
}
|
||||
|
||||
void
|
||||
MidiRegionView::select_range (framepos_t start, framepos_t end)
|
||||
MidiRegionView::select_range (samplepos_t start, samplepos_t end)
|
||||
{
|
||||
clear_editor_note_selection ();
|
||||
|
||||
for (Events::iterator i = _events.begin(); i != _events.end(); ++i) {
|
||||
framepos_t t = source_beats_to_absolute_frames(i->first->time());
|
||||
samplepos_t t = source_beats_to_absolute_samples(i->first->time());
|
||||
if (t >= start && t <= end) {
|
||||
add_to_selection (i->second);
|
||||
}
|
||||
|
@ -2436,15 +2436,15 @@ MidiRegionView::note_deselected(NoteBase* ev)
|
|||
}
|
||||
|
||||
void
|
||||
MidiRegionView::update_drag_selection(framepos_t start, framepos_t end, double gy0, double gy1, bool extend)
|
||||
MidiRegionView::update_drag_selection(samplepos_t start, samplepos_t end, double gy0, double gy1, bool extend)
|
||||
{
|
||||
PublicEditor& editor = trackview.editor();
|
||||
|
||||
// Convert to local coordinates
|
||||
const framepos_t p = _region->position();
|
||||
const samplepos_t p = _region->position();
|
||||
const double y = midi_view()->y_position();
|
||||
const double x0 = editor.sample_to_pixel(max((framepos_t)0, start - p));
|
||||
const double x1 = editor.sample_to_pixel(max((framepos_t)0, end - p));
|
||||
const double x0 = editor.sample_to_pixel(max((samplepos_t)0, start - p));
|
||||
const double x1 = editor.sample_to_pixel(max((samplepos_t)0, end - p));
|
||||
const double y0 = max(0.0, gy0 - y);
|
||||
const double y1 = max(0.0, gy1 - y);
|
||||
|
||||
|
@ -2581,13 +2581,13 @@ MidiRegionView::move_selection(double dx_qn, double dy, double cumulative_dy)
|
|||
double const note_time_qn = session_relative_qn (n->note()->time().to_double());
|
||||
double dx = 0.0;
|
||||
if (midi_view()->note_mode() == Sustained) {
|
||||
dx = editor->sample_to_pixel_unrounded (tmap.frame_at_quarter_note (note_time_qn + dx_qn))
|
||||
dx = editor->sample_to_pixel_unrounded (tmap.sample_at_quarter_note (note_time_qn + dx_qn))
|
||||
- n->item()->item_to_canvas (ArdourCanvas::Duple (n->x0(), 0)).x;
|
||||
} else {
|
||||
/* Hit::x0() is offset by _position.x, unlike Note::x0() */
|
||||
Hit* hit = dynamic_cast<Hit*>(n);
|
||||
if (hit) {
|
||||
dx = editor->sample_to_pixel_unrounded (tmap.frame_at_quarter_note (note_time_qn + dx_qn))
|
||||
dx = editor->sample_to_pixel_unrounded (tmap.sample_at_quarter_note (note_time_qn + dx_qn))
|
||||
- n->item()->item_to_canvas (ArdourCanvas::Duple (((hit->x0() + hit->x1()) / 2.0) - hit->position().x, 0)).x;
|
||||
}
|
||||
}
|
||||
|
@ -2598,7 +2598,7 @@ MidiRegionView::move_selection(double dx_qn, double dy, double cumulative_dy)
|
|||
if (midi_view()->note_mode() == Sustained) {
|
||||
Note* sus = dynamic_cast<Note*> (*i);
|
||||
double const len_dx = editor->sample_to_pixel_unrounded (
|
||||
tmap.frame_at_quarter_note (note_time_qn + dx_qn + n->note()->length().to_double()));
|
||||
tmap.sample_at_quarter_note (note_time_qn + dx_qn + n->note()->length().to_double()));
|
||||
|
||||
sus->set_x1 (n->item()->canvas_to_item (ArdourCanvas::Duple (len_dx, 0)).x);
|
||||
}
|
||||
|
@ -2678,12 +2678,12 @@ MidiRegionView::move_copies (double dx_qn, double dy, double cumulative_dy)
|
|||
double const note_time_qn = session_relative_qn (n->note()->time().to_double());
|
||||
double dx = 0.0;
|
||||
if (midi_view()->note_mode() == Sustained) {
|
||||
dx = editor->sample_to_pixel_unrounded (tmap.frame_at_quarter_note (note_time_qn + dx_qn))
|
||||
dx = editor->sample_to_pixel_unrounded (tmap.sample_at_quarter_note (note_time_qn + dx_qn))
|
||||
- n->item()->item_to_canvas (ArdourCanvas::Duple (n->x0(), 0)).x;
|
||||
} else {
|
||||
Hit* hit = dynamic_cast<Hit*>(n);
|
||||
if (hit) {
|
||||
dx = editor->sample_to_pixel_unrounded (tmap.frame_at_quarter_note (note_time_qn + dx_qn))
|
||||
dx = editor->sample_to_pixel_unrounded (tmap.sample_at_quarter_note (note_time_qn + dx_qn))
|
||||
- n->item()->item_to_canvas (ArdourCanvas::Duple (((hit->x0() + hit->x1()) / 2.0) - hit->position().x, 0)).x;
|
||||
}
|
||||
}
|
||||
|
@ -2693,7 +2693,7 @@ MidiRegionView::move_copies (double dx_qn, double dy, double cumulative_dy)
|
|||
if (midi_view()->note_mode() == Sustained) {
|
||||
Note* sus = dynamic_cast<Note*> (*i);
|
||||
double const len_dx = editor->sample_to_pixel_unrounded (
|
||||
tmap.frame_at_quarter_note (note_time_qn + dx_qn + n->note()->length().to_double()));
|
||||
tmap.sample_at_quarter_note (note_time_qn + dx_qn + n->note()->length().to_double()));
|
||||
|
||||
sus->set_x1 (n->item()->canvas_to_item (ArdourCanvas::Duple (len_dx, 0)).x);
|
||||
}
|
||||
|
@ -2837,13 +2837,13 @@ MidiRegionView::note_dropped(NoteBase *, double d_qn, int8_t dnote, bool copy)
|
|||
/** @param x Pixel relative to the region position.
|
||||
* @param ensure_snap defaults to false. true = snap always, ignoring snap mode and magnetic snap.
|
||||
* Used for inverting the snap logic with key modifiers and snap delta calculation.
|
||||
* @return Snapped frame relative to the region position.
|
||||
* @return Snapped sample relative to the region position.
|
||||
*/
|
||||
framepos_t
|
||||
samplepos_t
|
||||
MidiRegionView::snap_pixel_to_sample(double x, bool ensure_snap)
|
||||
{
|
||||
PublicEditor& editor (trackview.editor());
|
||||
return snap_frame_to_frame (editor.pixel_to_sample (x), ensure_snap).frame;
|
||||
return snap_sample_to_sample (editor.pixel_to_sample (x), ensure_snap).sample;
|
||||
}
|
||||
|
||||
/** @param x Pixel relative to the region position.
|
||||
|
@ -2859,55 +2859,55 @@ MidiRegionView::snap_to_pixel(double x, bool ensure_snap)
|
|||
double
|
||||
MidiRegionView::get_position_pixels()
|
||||
{
|
||||
framepos_t region_frame = get_position();
|
||||
return trackview.editor().sample_to_pixel(region_frame);
|
||||
samplepos_t region_sample = get_position();
|
||||
return trackview.editor().sample_to_pixel(region_sample);
|
||||
}
|
||||
|
||||
double
|
||||
MidiRegionView::get_end_position_pixels()
|
||||
{
|
||||
framepos_t frame = get_position() + get_duration ();
|
||||
return trackview.editor().sample_to_pixel(frame);
|
||||
samplepos_t sample = get_position() + get_duration ();
|
||||
return trackview.editor().sample_to_pixel(sample);
|
||||
}
|
||||
|
||||
framepos_t
|
||||
MidiRegionView::source_beats_to_absolute_frames(Evoral::Beats beats) const
|
||||
samplepos_t
|
||||
MidiRegionView::source_beats_to_absolute_samples(Evoral::Beats beats) const
|
||||
{
|
||||
/* the time converter will return the frame corresponding to `beats'
|
||||
/* the time converter will return the sample corresponding to `beats'
|
||||
relative to the start of the source. The start of the source
|
||||
is an implied position given by region->position - region->start
|
||||
*/
|
||||
const framepos_t source_start = _region->position() - _region->start();
|
||||
const samplepos_t source_start = _region->position() - _region->start();
|
||||
return source_start + _source_relative_time_converter.to (beats);
|
||||
}
|
||||
|
||||
Evoral::Beats
|
||||
MidiRegionView::absolute_frames_to_source_beats(framepos_t frames) const
|
||||
MidiRegionView::absolute_samples_to_source_beats(samplepos_t samples) const
|
||||
{
|
||||
/* the `frames' argument needs to be converted into a frame count
|
||||
/* the `samples' argument needs to be converted into a sample count
|
||||
relative to the start of the source before being passed in to the
|
||||
converter.
|
||||
*/
|
||||
const framepos_t source_start = _region->position() - _region->start();
|
||||
return _source_relative_time_converter.from (frames - source_start);
|
||||
const samplepos_t source_start = _region->position() - _region->start();
|
||||
return _source_relative_time_converter.from (samples - source_start);
|
||||
}
|
||||
|
||||
framepos_t
|
||||
MidiRegionView::region_beats_to_region_frames(Evoral::Beats beats) const
|
||||
samplepos_t
|
||||
MidiRegionView::region_beats_to_region_samples(Evoral::Beats beats) const
|
||||
{
|
||||
return _region_relative_time_converter.to(beats);
|
||||
}
|
||||
|
||||
Evoral::Beats
|
||||
MidiRegionView::region_frames_to_region_beats(framepos_t frames) const
|
||||
MidiRegionView::region_samples_to_region_beats(samplepos_t samples) const
|
||||
{
|
||||
return _region_relative_time_converter.from(frames);
|
||||
return _region_relative_time_converter.from(samples);
|
||||
}
|
||||
|
||||
double
|
||||
MidiRegionView::region_frames_to_region_beats_double (framepos_t frames) const
|
||||
MidiRegionView::region_samples_to_region_beats_double (samplepos_t samples) const
|
||||
{
|
||||
return _region_relative_time_converter_double.from(frames);
|
||||
return _region_relative_time_converter_double.from(samples);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -2988,7 +2988,7 @@ MidiRegionView::update_resizing (NoteBase* primary, bool at_front, double delta_
|
|||
}
|
||||
|
||||
if (current_x < 0) {
|
||||
// This works even with snapping because RegionView::snap_frame_to_frame()
|
||||
// This works even with snapping because RegionView::snap_sample_to_sample()
|
||||
// snaps forward if the snapped sample is before the beginning of the region
|
||||
current_x = 0;
|
||||
}
|
||||
|
@ -3014,15 +3014,15 @@ MidiRegionView::update_resizing (NoteBase* primary, bool at_front, double delta_
|
|||
|
||||
if (!cursor_set) {
|
||||
/* Convert snap delta from pixels to beats. */
|
||||
framepos_t snap_delta_samps = trackview.editor().pixel_to_sample (snap_delta);
|
||||
samplepos_t snap_delta_samps = trackview.editor().pixel_to_sample (snap_delta);
|
||||
double snap_delta_beats = 0.0;
|
||||
int sign = 1;
|
||||
|
||||
/* negative beat offsets aren't allowed */
|
||||
if (snap_delta_samps > 0) {
|
||||
snap_delta_beats = region_frames_to_region_beats_double (snap_delta_samps);
|
||||
snap_delta_beats = region_samples_to_region_beats_double (snap_delta_samps);
|
||||
} else if (snap_delta_samps < 0) {
|
||||
snap_delta_beats = region_frames_to_region_beats_double ( - snap_delta_samps);
|
||||
snap_delta_beats = region_samples_to_region_beats_double ( - snap_delta_samps);
|
||||
sign = -1;
|
||||
}
|
||||
|
||||
|
@ -3035,7 +3035,7 @@ MidiRegionView::update_resizing (NoteBase* primary, bool at_front, double delta_
|
|||
} else {
|
||||
snapped_x = trackview.editor ().pixel_to_sample (current_x);
|
||||
}
|
||||
const Evoral::Beats beats = Evoral::Beats (tmap.exact_beat_at_frame (snapped_x + midi_region()->position(), divisions)
|
||||
const Evoral::Beats beats = Evoral::Beats (tmap.exact_beat_at_sample (snapped_x + midi_region()->position(), divisions)
|
||||
- midi_region()->beat()) + midi_region()->start_beats();
|
||||
|
||||
Evoral::Beats len = Evoral::Beats();
|
||||
|
@ -3108,20 +3108,20 @@ MidiRegionView::commit_resizing (NoteBase* primary, bool at_front, double delta_
|
|||
}
|
||||
|
||||
/* Convert snap delta from pixels to beats with sign. */
|
||||
framepos_t snap_delta_samps = trackview.editor().pixel_to_sample (snap_delta);
|
||||
samplepos_t snap_delta_samps = trackview.editor().pixel_to_sample (snap_delta);
|
||||
double snap_delta_beats = 0.0;
|
||||
int sign = 1;
|
||||
|
||||
if (snap_delta_samps > 0) {
|
||||
snap_delta_beats = region_frames_to_region_beats_double (snap_delta_samps);
|
||||
snap_delta_beats = region_samples_to_region_beats_double (snap_delta_samps);
|
||||
} else if (snap_delta_samps < 0) {
|
||||
snap_delta_beats = region_frames_to_region_beats_double ( - snap_delta_samps);
|
||||
snap_delta_beats = region_samples_to_region_beats_double ( - snap_delta_samps);
|
||||
sign = -1;
|
||||
}
|
||||
|
||||
uint32_t divisions = 0;
|
||||
/* Convert the new x position to a frame within the source */
|
||||
framepos_t current_fr;
|
||||
/* Convert the new x position to a sample within the source */
|
||||
samplepos_t current_fr;
|
||||
if (with_snap) {
|
||||
current_fr = snap_pixel_to_sample (current_x, ensure_snap);
|
||||
divisions = trackview.editor().get_grid_music_divisions (0);
|
||||
|
@ -3130,7 +3130,7 @@ MidiRegionView::commit_resizing (NoteBase* primary, bool at_front, double delta_
|
|||
}
|
||||
|
||||
/* and then to beats */
|
||||
const double e_qaf = tmap.exact_qn_at_frame (current_fr + midi_region()->position(), divisions);
|
||||
const double e_qaf = tmap.exact_qn_at_sample (current_fr + midi_region()->position(), divisions);
|
||||
const double quarter_note_start = _region->quarter_note() - midi_region()->start_beats();
|
||||
const Evoral::Beats x_beats = Evoral::Beats (e_qaf - quarter_note_start);
|
||||
|
||||
|
@ -3475,41 +3475,41 @@ MidiRegionView::nudge_notes (bool forward, bool fine)
|
|||
into a vector and sort before using the first one.
|
||||
*/
|
||||
|
||||
const framepos_t ref_point = source_beats_to_absolute_frames ((*(_selection.begin()))->note()->time());
|
||||
const samplepos_t ref_point = source_beats_to_absolute_samples ((*(_selection.begin()))->note()->time());
|
||||
Evoral::Beats delta;
|
||||
|
||||
if (!fine) {
|
||||
|
||||
/* non-fine, move by 1 bar regardless of snap */
|
||||
delta = Evoral::Beats(trackview.session()->tempo_map().meter_at_frame (ref_point).divisions_per_bar());
|
||||
delta = Evoral::Beats(trackview.session()->tempo_map().meter_at_sample (ref_point).divisions_per_bar());
|
||||
|
||||
} else if (trackview.editor().snap_mode() == Editing::SnapOff) {
|
||||
|
||||
/* grid is off - use nudge distance */
|
||||
|
||||
framepos_t unused;
|
||||
const framecnt_t distance = trackview.editor().get_nudge_distance (ref_point, unused);
|
||||
delta = region_frames_to_region_beats (fabs ((double)distance));
|
||||
samplepos_t unused;
|
||||
const samplecnt_t distance = trackview.editor().get_nudge_distance (ref_point, unused);
|
||||
delta = region_samples_to_region_beats (fabs ((double)distance));
|
||||
|
||||
} else {
|
||||
|
||||
/* use grid */
|
||||
|
||||
MusicFrame next_pos (ref_point, 0);
|
||||
MusicSample next_pos (ref_point, 0);
|
||||
if (forward) {
|
||||
if (max_framepos - 1 < next_pos.frame) {
|
||||
next_pos.frame += 1;
|
||||
if (max_samplepos - 1 < next_pos.sample) {
|
||||
next_pos.sample += 1;
|
||||
}
|
||||
} else {
|
||||
if (next_pos.frame == 0) {
|
||||
if (next_pos.sample == 0) {
|
||||
return;
|
||||
}
|
||||
next_pos.frame -= 1;
|
||||
next_pos.sample -= 1;
|
||||
}
|
||||
|
||||
trackview.editor().snap_to (next_pos, (forward ? RoundUpAlways : RoundDownAlways), false);
|
||||
const framecnt_t distance = ref_point - next_pos.frame;
|
||||
delta = region_frames_to_region_beats (fabs ((double)distance));
|
||||
const samplecnt_t distance = ref_point - next_pos.sample;
|
||||
delta = region_samples_to_region_beats (fabs ((double)distance));
|
||||
}
|
||||
|
||||
if (!delta) {
|
||||
|
@ -3643,12 +3643,12 @@ MidiRegionView::get_fill_color() const
|
|||
{
|
||||
const std::string mod_name = (_dragging ? "dragging region" :
|
||||
trackview.editor().internal_editing() ? "editable region" :
|
||||
"midi frame base");
|
||||
"midi sample base");
|
||||
if (_selected) {
|
||||
return UIConfiguration::instance().color_mod ("selected region base", mod_name);
|
||||
} else if ((!UIConfiguration::instance().get_show_name_highlight() || high_enough_for_name) &&
|
||||
!UIConfiguration::instance().get_color_regions_using_track_color()) {
|
||||
return UIConfiguration::instance().color_mod ("midi frame base", mod_name);
|
||||
return UIConfiguration::instance().color_mod ("midi sample base", mod_name);
|
||||
}
|
||||
return UIConfiguration::instance().color_mod (fill_color, mod_name);
|
||||
}
|
||||
|
@ -3738,7 +3738,7 @@ MidiRegionView::selection_as_cut_buffer () const
|
|||
|
||||
/** This method handles undo */
|
||||
bool
|
||||
MidiRegionView::paste (framepos_t pos, const ::Selection& selection, PasteContext& ctx, const int32_t sub_num)
|
||||
MidiRegionView::paste (samplepos_t pos, const ::Selection& selection, PasteContext& ctx, const int32_t sub_num)
|
||||
{
|
||||
bool commit = false;
|
||||
// Paste notes, if available
|
||||
|
@ -3771,7 +3771,7 @@ MidiRegionView::paste (framepos_t pos, const ::Selection& selection, PasteContex
|
|||
|
||||
/** This method handles undo */
|
||||
void
|
||||
MidiRegionView::paste_internal (framepos_t pos, unsigned paste_count, float times, const MidiCutBuffer& mcb)
|
||||
MidiRegionView::paste_internal (samplepos_t pos, unsigned paste_count, float times, const MidiCutBuffer& mcb)
|
||||
{
|
||||
if (mcb.empty()) {
|
||||
return;
|
||||
|
@ -3785,7 +3785,7 @@ MidiRegionView::paste_internal (framepos_t pos, unsigned paste_count, float time
|
|||
const Evoral::Beats duration = last_time - first_time;
|
||||
const Evoral::Beats snap_duration = duration.snap_to(snap_beats);
|
||||
const Evoral::Beats paste_offset = snap_duration * paste_count;
|
||||
const Evoral::Beats quarter_note = absolute_frames_to_source_beats(pos) + paste_offset;
|
||||
const Evoral::Beats quarter_note = absolute_samples_to_source_beats(pos) + paste_offset;
|
||||
Evoral::Beats end_point = Evoral::Beats();
|
||||
|
||||
DEBUG_TRACE (DEBUG::CutNPaste, string_compose ("Paste data spans from %1 to %2 (%3) ; paste pos beats = %4 (based on %5 - %6)\n",
|
||||
|
@ -3813,16 +3813,16 @@ MidiRegionView::paste_internal (framepos_t pos, unsigned paste_count, float time
|
|||
|
||||
/* if we pasted past the current end of the region, extend the region */
|
||||
|
||||
framepos_t end_frame = source_beats_to_absolute_frames (end_point);
|
||||
framepos_t region_end = _region->position() + _region->length() - 1;
|
||||
samplepos_t end_sample = source_beats_to_absolute_samples (end_point);
|
||||
samplepos_t region_end = _region->position() + _region->length() - 1;
|
||||
|
||||
if (end_frame > region_end) {
|
||||
if (end_sample > region_end) {
|
||||
|
||||
DEBUG_TRACE (DEBUG::CutNPaste, string_compose ("Paste extended region from %1 to %2\n", region_end, end_frame));
|
||||
DEBUG_TRACE (DEBUG::CutNPaste, string_compose ("Paste extended region from %1 to %2\n", region_end, end_sample));
|
||||
|
||||
_region->clear_changes ();
|
||||
/* we probably need to get the snap modifier somehow to make this correct for non-musical use */
|
||||
_region->set_length (end_frame - _region->position(), trackview.editor().get_grid_music_divisions (0));
|
||||
_region->set_length (end_sample - _region->position(), trackview.editor().get_grid_music_divisions (0));
|
||||
trackview.session()->add_command (new StatefulDiffCommand (_region));
|
||||
}
|
||||
|
||||
|
@ -3959,11 +3959,11 @@ MidiRegionView::update_ghost_note (double x, double y, uint32_t state)
|
|||
|
||||
PublicEditor& editor = trackview.editor ();
|
||||
|
||||
framepos_t const unsnapped_frame = editor.pixel_to_sample (x);
|
||||
samplepos_t const unsnapped_sample = editor.pixel_to_sample (x);
|
||||
|
||||
const int32_t divisions = editor.get_grid_music_divisions (state);
|
||||
const bool shift_snap = midi_view()->note_mode() != Percussive;
|
||||
const Evoral::Beats snapped_beats = snap_frame_to_grid_underneath (unsnapped_frame, divisions, shift_snap);
|
||||
const Evoral::Beats snapped_beats = snap_sample_to_grid_underneath (unsnapped_sample, divisions, shift_snap);
|
||||
|
||||
/* prevent Percussive mode from displaying a ghost hit at region end */
|
||||
if (!shift_snap && snapped_beats >= midi_region()->start_beats() + midi_region()->length_beats()) {
|
||||
|
@ -3982,7 +3982,7 @@ MidiRegionView::update_ghost_note (double x, double y, uint32_t state)
|
|||
}
|
||||
|
||||
/* calculate time in beats relative to start of source */
|
||||
const Evoral::Beats length = get_grid_beats(unsnapped_frame + _region->position());
|
||||
const Evoral::Beats length = get_grid_beats(unsnapped_sample + _region->position());
|
||||
|
||||
_ghost_note->note()->set_time (snapped_beats);
|
||||
_ghost_note->note()->set_length (length);
|
||||
|
@ -4128,7 +4128,7 @@ MidiRegionView::move_step_edit_cursor (Evoral::Beats pos)
|
|||
_step_edit_cursor_position = pos;
|
||||
|
||||
if (_step_edit_cursor) {
|
||||
double pixel = trackview.editor().sample_to_pixel (region_beats_to_region_frames (pos));
|
||||
double pixel = trackview.editor().sample_to_pixel (region_beats_to_region_samples (pos));
|
||||
_step_edit_cursor->set_x0 (pixel);
|
||||
set_step_edit_cursor_width (_step_edit_cursor_width);
|
||||
}
|
||||
|
@ -4149,8 +4149,8 @@ MidiRegionView::set_step_edit_cursor_width (Evoral::Beats beats)
|
|||
|
||||
if (_step_edit_cursor) {
|
||||
_step_edit_cursor->set_x1 (_step_edit_cursor->x0() + trackview.editor().sample_to_pixel (
|
||||
region_beats_to_region_frames (_step_edit_cursor_position + beats)
|
||||
- region_beats_to_region_frames (_step_edit_cursor_position)));
|
||||
region_beats_to_region_samples (_step_edit_cursor_position + beats)
|
||||
- region_beats_to_region_samples (_step_edit_cursor_position)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4175,7 +4175,7 @@ MidiRegionView::data_recorded (boost::weak_ptr<MidiSource> w)
|
|||
|
||||
boost::shared_ptr<MidiBuffer> buf = mtv->midi_track()->get_gui_feed_buffer ();
|
||||
|
||||
framepos_t back = max_framepos;
|
||||
samplepos_t back = max_samplepos;
|
||||
|
||||
for (MidiBuffer::iterator i = buf->begin(); i != buf->end(); ++i) {
|
||||
const Evoral::Event<MidiBuffer::TimeType>& ev = *i;
|
||||
|
@ -4188,7 +4188,7 @@ MidiRegionView::data_recorded (boost::weak_ptr<MidiSource> w)
|
|||
}
|
||||
}
|
||||
|
||||
/* convert from session frames to source beats */
|
||||
/* convert from session samples to source beats */
|
||||
Evoral::Beats const time_beats = _source_relative_time_converter.from(
|
||||
ev.time() - src->timeline_position() + _region->start());
|
||||
|
||||
|
@ -4348,19 +4348,19 @@ MidiRegionView::get_velocity_for_add (MidiModel::TimeType time) const
|
|||
return (*n)->velocity() + (frac * ((*m)->velocity() - (*n)->velocity()));
|
||||
}
|
||||
|
||||
/** @param p A session framepos.
|
||||
/** @param p A session samplepos.
|
||||
* @param divisions beat division to snap given by Editor::get_grid_music_divisions() where
|
||||
* bar is -1, 0 is audio samples and a positive integer is beat subdivisions.
|
||||
* @return beat duration of p snapped to the grid subdivision underneath it.
|
||||
*/
|
||||
Evoral::Beats
|
||||
MidiRegionView::snap_frame_to_grid_underneath (framepos_t p, int32_t divisions, bool shift_snap) const
|
||||
MidiRegionView::snap_sample_to_grid_underneath (samplepos_t p, int32_t divisions, bool shift_snap) const
|
||||
{
|
||||
TempoMap& map (trackview.session()->tempo_map());
|
||||
double eqaf = map.exact_qn_at_frame (p + _region->position(), divisions);
|
||||
double eqaf = map.exact_qn_at_sample (p + _region->position(), divisions);
|
||||
|
||||
if (divisions != 0 && shift_snap) {
|
||||
const double qaf = map.quarter_note_at_frame (p + _region->position());
|
||||
const double qaf = map.quarter_note_at_sample (p + _region->position());
|
||||
/* Hack so that we always snap to the note that we are over, instead of snapping
|
||||
to the next one if we're more than halfway through the one we're over.
|
||||
*/
|
||||
|
@ -4391,7 +4391,7 @@ MidiRegionView::get_selected_channels () const
|
|||
|
||||
|
||||
Evoral::Beats
|
||||
MidiRegionView::get_grid_beats(framepos_t pos) const
|
||||
MidiRegionView::get_grid_beats(samplepos_t pos) const
|
||||
{
|
||||
PublicEditor& editor = trackview.editor();
|
||||
bool success = false;
|
||||
|
|
|
@ -122,8 +122,8 @@ public:
|
|||
void resolve_note(uint8_t note_num, Evoral::Beats end_time);
|
||||
|
||||
void cut_copy_clear (Editing::CutCopyOp);
|
||||
bool paste (framepos_t pos, const ::Selection& selection, PasteContext& ctx, const int32_t sub_num);
|
||||
void paste_internal (framepos_t pos, unsigned paste_count, float times, const MidiCutBuffer&);
|
||||
bool paste (samplepos_t pos, const ::Selection& selection, PasteContext& ctx, const int32_t sub_num);
|
||||
void paste_internal (samplepos_t pos, unsigned paste_count, float times, const MidiCutBuffer&);
|
||||
|
||||
void add_canvas_patch_change (ARDOUR::MidiModel::PatchChangePtr patch, const std::string& displaytext, bool);
|
||||
void remove_canvas_patch_change (PatchChange* pc);
|
||||
|
@ -147,7 +147,7 @@ public:
|
|||
void change_patch_change (PatchChange& old_patch, const MIDI::Name::PatchPrimaryKey& new_patch);
|
||||
void change_patch_change (ARDOUR::MidiModel::PatchChangePtr, Evoral::PatchChange<Evoral::Beats> const &);
|
||||
|
||||
void add_patch_change (framecnt_t, Evoral::PatchChange<Evoral::Beats> const &);
|
||||
void add_patch_change (samplecnt_t, Evoral::PatchChange<Evoral::Beats> const &);
|
||||
void move_patch_change (PatchChange &, Evoral::Beats);
|
||||
void delete_patch_change (PatchChange *);
|
||||
void edit_patch_change (PatchChange *);
|
||||
|
@ -197,7 +197,7 @@ public:
|
|||
void delete_note (boost::shared_ptr<NoteType>);
|
||||
size_t selection_size() { return _selection.size(); }
|
||||
void select_all_notes ();
|
||||
void select_range(framepos_t start, framepos_t end);
|
||||
void select_range(samplepos_t start, samplepos_t end);
|
||||
void invert_selection ();
|
||||
|
||||
Evoral::Beats earliest_in_selection ();
|
||||
|
@ -259,42 +259,42 @@ public:
|
|||
*/
|
||||
double snap_to_pixel(double x, bool ensure_snap = false);
|
||||
|
||||
/** Snap a region relative pixel coordinate to frame units.
|
||||
/** Snap a region relative pixel coordinate to sample units.
|
||||
* @param x a pixel coordinate relative to region start
|
||||
* @param ensure_snap ignore SnapOff and magnetic snap.
|
||||
* Required for inverting snap logic with modifier keys and snap delta calculation.
|
||||
* @return the snapped framepos_t coordinate relative to region start
|
||||
* @return the snapped samplepos_t coordinate relative to region start
|
||||
*/
|
||||
framepos_t snap_pixel_to_sample(double x, bool ensure_snap = false);
|
||||
samplepos_t snap_pixel_to_sample(double x, bool ensure_snap = false);
|
||||
|
||||
/** Convert a timestamp in beats into frames (both relative to region position) */
|
||||
framepos_t region_beats_to_region_frames(Evoral::Beats beats) const;
|
||||
/** Convert a timestamp in beats into absolute frames */
|
||||
framepos_t region_beats_to_absolute_frames(Evoral::Beats beats) const {
|
||||
return _region->position() + region_beats_to_region_frames (beats);
|
||||
/** Convert a timestamp in beats into samples (both relative to region position) */
|
||||
samplepos_t region_beats_to_region_samples(Evoral::Beats beats) const;
|
||||
/** Convert a timestamp in beats into absolute samples */
|
||||
samplepos_t region_beats_to_absolute_samples(Evoral::Beats beats) const {
|
||||
return _region->position() + region_beats_to_region_samples (beats);
|
||||
}
|
||||
/** Convert a timestamp in frames to beats (both relative to region position) */
|
||||
Evoral::Beats region_frames_to_region_beats(framepos_t) const;
|
||||
double region_frames_to_region_beats_double(framepos_t) const;
|
||||
/** Convert a timestamp in samples to beats (both relative to region position) */
|
||||
Evoral::Beats region_samples_to_region_beats(samplepos_t) const;
|
||||
double region_samples_to_region_beats_double(samplepos_t) const;
|
||||
|
||||
/** Convert a timestamp in beats measured from source start into absolute frames */
|
||||
framepos_t source_beats_to_absolute_frames(Evoral::Beats beats) const;
|
||||
/** Convert a timestamp in beats measured from source start into region-relative frames */
|
||||
framepos_t source_beats_to_region_frames(Evoral::Beats beats) const {
|
||||
return source_beats_to_absolute_frames (beats) - _region->position();
|
||||
/** Convert a timestamp in beats measured from source start into absolute samples */
|
||||
samplepos_t source_beats_to_absolute_samples(Evoral::Beats beats) const;
|
||||
/** Convert a timestamp in beats measured from source start into region-relative samples */
|
||||
samplepos_t source_beats_to_region_samples(Evoral::Beats beats) const {
|
||||
return source_beats_to_absolute_samples (beats) - _region->position();
|
||||
}
|
||||
/** Convert a timestamp in absolute frames to beats measured from source start*/
|
||||
Evoral::Beats absolute_frames_to_source_beats(framepos_t) const;
|
||||
/** Convert a timestamp in absolute samples to beats measured from source start*/
|
||||
Evoral::Beats absolute_samples_to_source_beats(samplepos_t) const;
|
||||
|
||||
ARDOUR::BeatsFramesConverter const & region_relative_time_converter () const {
|
||||
ARDOUR::BeatsSamplesConverter const & region_relative_time_converter () const {
|
||||
return _region_relative_time_converter;
|
||||
}
|
||||
|
||||
ARDOUR::BeatsFramesConverter const & source_relative_time_converter () const {
|
||||
ARDOUR::BeatsSamplesConverter const & source_relative_time_converter () const {
|
||||
return _source_relative_time_converter;
|
||||
}
|
||||
|
||||
ARDOUR::DoubleBeatsFramesConverter const & region_relative_time_converter_double () const {
|
||||
ARDOUR::DoubleBeatsSamplesConverter const & region_relative_time_converter_double () const {
|
||||
return _region_relative_time_converter_double;
|
||||
}
|
||||
|
||||
|
@ -327,13 +327,13 @@ public:
|
|||
void trim_front_ending ();
|
||||
|
||||
/** Add a note to the model, and the view, at a canvas (click) coordinate.
|
||||
* \param t time in frames relative to the position of the region
|
||||
* \param t time in samples relative to the position of the region
|
||||
* \param y vertical position in pixels
|
||||
* \param length duration of the note in beats
|
||||
* \param state the keyboard modifier mask for the canvas event (click).
|
||||
* \param shift_snap true alters snap behavior to round down always (false if the gui has already done that).
|
||||
*/
|
||||
void create_note_at (framepos_t t, double y, Evoral::Beats length, uint32_t state, bool shift_snap);
|
||||
void create_note_at (samplepos_t t, double y, Evoral::Beats length, uint32_t state, bool shift_snap);
|
||||
|
||||
/** An external request to clear the note selection, remove MRV from editor
|
||||
* selection.
|
||||
|
@ -399,7 +399,7 @@ private:
|
|||
void trim_note(NoteBase* ev, ARDOUR::MidiModel::TimeType start_delta,
|
||||
ARDOUR::MidiModel::TimeType end_delta);
|
||||
|
||||
void update_drag_selection (framepos_t start, framepos_t end, double y0, double y1, bool extend);
|
||||
void update_drag_selection (samplepos_t start, samplepos_t end, double y0, double y1, bool extend);
|
||||
void update_vertical_drag_selection (double last_y, double y, bool extend);
|
||||
|
||||
void add_to_selection (NoteBase*);
|
||||
|
@ -420,9 +420,9 @@ private:
|
|||
typedef boost::unordered_map<ARDOUR::MidiModel::constSysExPtr, boost::shared_ptr<SysEx> > SysExes;
|
||||
typedef std::vector<NoteBase*> CopyDragEvents;
|
||||
|
||||
ARDOUR::BeatsFramesConverter _region_relative_time_converter;
|
||||
ARDOUR::BeatsFramesConverter _source_relative_time_converter;
|
||||
ARDOUR::DoubleBeatsFramesConverter _region_relative_time_converter_double;
|
||||
ARDOUR::BeatsSamplesConverter _region_relative_time_converter;
|
||||
ARDOUR::BeatsSamplesConverter _source_relative_time_converter;
|
||||
ARDOUR::DoubleBeatsSamplesConverter _region_relative_time_converter_double;
|
||||
|
||||
boost::shared_ptr<ARDOUR::MidiModel> _model;
|
||||
Events _events;
|
||||
|
@ -503,7 +503,7 @@ private:
|
|||
void data_recorded (boost::weak_ptr<ARDOUR::MidiSource>);
|
||||
|
||||
/** Get grid type as beats, or default to 1 if not snapped to beats. */
|
||||
Evoral::Beats get_grid_beats(framepos_t pos) const;
|
||||
Evoral::Beats get_grid_beats(samplepos_t pos) const;
|
||||
|
||||
void remove_ghost_note ();
|
||||
void mouse_mode_changed ();
|
||||
|
@ -511,7 +511,7 @@ private:
|
|||
void leave_internal ();
|
||||
void hide_verbose_cursor ();
|
||||
|
||||
framecnt_t _last_display_zoom;
|
||||
samplecnt_t _last_display_zoom;
|
||||
|
||||
double _last_event_x;
|
||||
double _last_event_y;
|
||||
|
@ -524,7 +524,7 @@ private:
|
|||
Gtkmm2ext::Color _patch_change_outline;
|
||||
Gtkmm2ext::Color _patch_change_fill;
|
||||
|
||||
Evoral::Beats snap_frame_to_grid_underneath (framepos_t p, int32_t divisions, bool shift_snap) const;
|
||||
Evoral::Beats snap_sample_to_grid_underneath (samplepos_t p, int32_t divisions, bool shift_snap) const;
|
||||
|
||||
PBD::ScopedConnection _mouse_mode_connection;
|
||||
|
||||
|
|
|
@ -467,10 +467,10 @@ MidiStreamView::setup_rec_box ()
|
|||
|
||||
// handle multi
|
||||
|
||||
framepos_t start = 0;
|
||||
samplepos_t start = 0;
|
||||
if (rec_regions.size() > 0) {
|
||||
start = rec_regions.back().first->start()
|
||||
+ _trackview.track()->get_captured_frames(rec_regions.size()-1);
|
||||
+ _trackview.track()->get_captured_samples(rec_regions.size()-1);
|
||||
}
|
||||
|
||||
if (!rec_regions.empty()) {
|
||||
|
@ -486,10 +486,10 @@ MidiStreamView::setup_rec_box ()
|
|||
is so that the RegionView gets created with a non-zero width, as apparently
|
||||
creating a RegionView with a zero width causes it never to be displayed
|
||||
(there is a warning in TimeAxisViewItem::init about this). However, we
|
||||
must also set length_beats to something non-zero, otherwise the frame length
|
||||
must also set length_beats to something non-zero, otherwise the sample length
|
||||
of 1 causes length_beats to be set to some small quantity << 1. Then
|
||||
when the position is set up below, this length_beats is used to recompute
|
||||
length using BeatsFramesConverter::to, which is slightly innacurate for small
|
||||
length using BeatsSamplesConverter::to, which is slightly innacurate for small
|
||||
beats values because it converts floating point beats to bars, beats and
|
||||
integer ticks. The upshot of which being that length gets set back to 0,
|
||||
meaning no region view is ever seen, meaning no MIDI notes during record (#3820).
|
||||
|
@ -502,8 +502,8 @@ MidiStreamView::setup_rec_box ()
|
|||
(RegionFactory::create (sources, plist, false)));
|
||||
if (region) {
|
||||
region->set_start (_trackview.track()->current_capture_start()
|
||||
- _trackview.track()->get_capture_start_frame (0));
|
||||
region->set_position (_trackview.session()->transport_frame());
|
||||
- _trackview.track()->get_capture_start_sample (0));
|
||||
region->set_position (_trackview.session()->transport_sample());
|
||||
|
||||
RegionView* rv = add_region_view_internal (region, false, true);
|
||||
MidiRegionView* mrv = dynamic_cast<MidiRegionView*> (rv);
|
||||
|
@ -675,7 +675,7 @@ struct RegionPositionSorter {
|
|||
};
|
||||
|
||||
bool
|
||||
MidiStreamView::paste (ARDOUR::framepos_t pos, const Selection& selection, PasteContext& ctx, const int32_t sub_num)
|
||||
MidiStreamView::paste (ARDOUR::samplepos_t pos, const Selection& selection, PasteContext& ctx, const int32_t sub_num)
|
||||
{
|
||||
/* Paste into the first region which starts on or before pos. Only called when
|
||||
using an internal editing tool. */
|
||||
|
|
|
@ -103,7 +103,7 @@ public:
|
|||
|
||||
RegionView* create_region_view (boost::shared_ptr<ARDOUR::Region>, bool, bool);
|
||||
|
||||
bool paste (ARDOUR::framepos_t pos, const Selection& selection, PasteContext& ctx, const int32_t sub_num);
|
||||
bool paste (ARDOUR::samplepos_t pos, const Selection& selection, PasteContext& ctx, const int32_t sub_num);
|
||||
|
||||
void apply_note_range(uint8_t lowest, uint8_t highest, bool to_region_views);
|
||||
|
||||
|
|
|
@ -1330,10 +1330,10 @@ MidiTimeAxisView::update_control_names ()
|
|||
|
||||
if (selected()) {
|
||||
controls_ebox.set_name (controls_base_selected_name);
|
||||
time_axis_frame.set_name (controls_base_selected_name);
|
||||
time_axis_sample.set_name (controls_base_selected_name);
|
||||
} else {
|
||||
controls_ebox.set_name (controls_base_unselected_name);
|
||||
time_axis_frame.set_name (controls_base_unselected_name);
|
||||
time_axis_sample.set_name (controls_base_unselected_name);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1535,10 +1535,10 @@ MidiTimeAxisView::automation_child_menu_item (Evoral::Parameter param)
|
|||
}
|
||||
|
||||
boost::shared_ptr<MidiRegion>
|
||||
MidiTimeAxisView::add_region (framepos_t f, framecnt_t length, bool commit)
|
||||
MidiTimeAxisView::add_region (samplepos_t f, samplecnt_t length, bool commit)
|
||||
{
|
||||
Editor* real_editor = dynamic_cast<Editor*> (&_editor);
|
||||
MusicFrame pos (f, 0);
|
||||
MusicSample pos (f, 0);
|
||||
|
||||
if (commit) {
|
||||
real_editor->begin_reversible_command (Operations::create_region);
|
||||
|
@ -1556,8 +1556,8 @@ MidiTimeAxisView::add_region (framepos_t f, framecnt_t length, bool commit)
|
|||
|
||||
boost::shared_ptr<Region> region = (RegionFactory::create (src, plist));
|
||||
/* sets beat position */
|
||||
region->set_position (pos.frame, pos.division);
|
||||
playlist()->add_region (region, pos.frame, 1.0, false, pos.division);
|
||||
region->set_position (pos.sample, pos.division);
|
||||
playlist()->add_region (region, pos.sample, 1.0, false, pos.division);
|
||||
_session->add_command (new StatefulDiffCommand (playlist()));
|
||||
|
||||
if (commit) {
|
||||
|
@ -1632,7 +1632,7 @@ MidiTimeAxisView::contents_height_changed ()
|
|||
}
|
||||
|
||||
bool
|
||||
MidiTimeAxisView::paste (framepos_t pos, const Selection& selection, PasteContext& ctx, const int32_t sub_num)
|
||||
MidiTimeAxisView::paste (samplepos_t pos, const Selection& selection, PasteContext& ctx, const int32_t sub_num)
|
||||
{
|
||||
if (!_editor.internal_editing()) {
|
||||
// Non-internal paste, paste regions like any other route
|
||||
|
|
|
@ -82,13 +82,13 @@ public:
|
|||
|
||||
void set_height (uint32_t, TrackHeightMode m = OnlySelf);
|
||||
|
||||
boost::shared_ptr<ARDOUR::MidiRegion> add_region (ARDOUR::framepos_t, ARDOUR::framecnt_t, bool);
|
||||
boost::shared_ptr<ARDOUR::MidiRegion> add_region (ARDOUR::samplepos_t, ARDOUR::samplecnt_t, bool);
|
||||
|
||||
void show_all_automation (bool apply_to_selection = false);
|
||||
void show_existing_automation (bool apply_to_selection = false);
|
||||
void create_automation_child (const Evoral::Parameter& param, bool show);
|
||||
|
||||
bool paste (ARDOUR::framepos_t, const Selection&, PasteContext& ctx, const int32_t sub_num);
|
||||
bool paste (ARDOUR::samplepos_t, const Selection&, PasteContext& ctx, const int32_t sub_num);
|
||||
|
||||
ARDOUR::NoteMode note_mode() const { return _note_mode; }
|
||||
ARDOUR::ColorMode color_mode() const { return _color_mode; }
|
||||
|
|
|
@ -342,9 +342,9 @@ MidiTracer::tracer (Parser&, byte* msg, size_t len)
|
|||
|
||||
} else if (len == 10 && msg[0] == 0xf0 && msg[1] == 0x7f && msg[9] == 0xf7) {
|
||||
|
||||
/* MTC full frame */
|
||||
/* MTC full sample */
|
||||
s += snprintf (
|
||||
&buf[s], bufsize, " MTC full frame to %02d:%02d:%02d:%02d\n", msg[5] & 0x1f, msg[6], msg[7], msg[8]
|
||||
&buf[s], bufsize, " MTC full sample to %02d:%02d:%02d:%02d\n", msg[5] & 0x1f, msg[6], msg[7], msg[8]
|
||||
);
|
||||
} else if (len == 3 && msg[0] == MIDI::position) {
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
using namespace ARDOUR;
|
||||
|
||||
MiniTimeline::MiniTimeline ()
|
||||
: _last_update_frame (-1)
|
||||
: _last_update_sample (-1)
|
||||
, _clock_mode (AudioClock::Timecode)
|
||||
, _time_width (0)
|
||||
, _time_height (0)
|
||||
|
@ -180,7 +180,7 @@ MiniTimeline::on_size_allocate (Gtk::Allocation& alloc)
|
|||
}
|
||||
|
||||
void
|
||||
MiniTimeline::set_span (framecnt_t ts)
|
||||
MiniTimeline::set_span (samplecnt_t ts)
|
||||
{
|
||||
assert (_session);
|
||||
if (_session->config.get_minitimeline_span () == ts) {
|
||||
|
@ -198,11 +198,11 @@ MiniTimeline::super_rapid_update ()
|
|||
if (!_session || !_session->engine().running() || !is_mapped ()) {
|
||||
return;
|
||||
}
|
||||
framepos_t const frame = PublicEditor::instance().playhead_cursor_sample ();
|
||||
samplepos_t const sample = PublicEditor::instance().playhead_cursor_sample ();
|
||||
AudioClock::Mode m = ARDOUR_UI::instance()->primary_clock->mode();
|
||||
|
||||
bool change = false;
|
||||
if (fabs ((_last_update_frame - frame) * _px_per_sample) >= 1.0) {
|
||||
if (fabs ((_last_update_sample - sample) * _px_per_sample) >= 1.0) {
|
||||
change = true;
|
||||
}
|
||||
|
||||
|
@ -218,7 +218,7 @@ MiniTimeline::super_rapid_update ()
|
|||
}
|
||||
|
||||
if (change) {
|
||||
_last_update_frame = frame;
|
||||
_last_update_sample = sample;
|
||||
update_minitimeline ();
|
||||
}
|
||||
}
|
||||
|
@ -242,7 +242,7 @@ MiniTimeline::calculate_time_width ()
|
|||
case AudioClock::MinSec:
|
||||
_layout->set_text ("88:88:88,88");
|
||||
break;
|
||||
case AudioClock::Frames:
|
||||
case AudioClock::Samples:
|
||||
_layout->set_text ("8888888888");
|
||||
break;
|
||||
}
|
||||
|
@ -258,15 +258,15 @@ MiniTimeline::calculate_time_spacing ()
|
|||
return;
|
||||
}
|
||||
|
||||
const framecnt_t time_span = _session->config.get_minitimeline_span () / 2;
|
||||
_time_span_samples = time_span * _session->nominal_frame_rate ();
|
||||
_time_granularity = _session->nominal_frame_rate () * ceil (2. * time_span / _n_labels);
|
||||
const samplecnt_t time_span = _session->config.get_minitimeline_span () / 2;
|
||||
_time_span_samples = time_span * _session->nominal_sample_rate ();
|
||||
_time_granularity = _session->nominal_sample_rate () * ceil (2. * time_span / _n_labels);
|
||||
_px_per_sample = get_width () / (2. * _time_span_samples);
|
||||
//_px_per_sample = 1.0 / round (1.0 / _px_per_sample);
|
||||
}
|
||||
|
||||
void
|
||||
MiniTimeline::format_time (framepos_t when)
|
||||
MiniTimeline::format_time (samplepos_t when)
|
||||
{
|
||||
switch (_clock_mode) {
|
||||
case AudioClock::Timecode:
|
||||
|
@ -280,7 +280,7 @@ MiniTimeline::format_time (framepos_t when)
|
|||
case AudioClock::BBT:
|
||||
{
|
||||
char buf[64];
|
||||
Timecode::BBT_Time BBT = _session->tempo_map().bbt_at_frame (when);
|
||||
Timecode::BBT_Time BBT = _session->tempo_map().bbt_at_sample (when);
|
||||
snprintf (buf, sizeof (buf), "%03" PRIu32 BBT_BAR_CHAR "%02" PRIu32 BBT_BAR_CHAR "%04" PRIu32,
|
||||
BBT.bars, BBT.beats, BBT.ticks);
|
||||
_layout->set_text (buf);
|
||||
|
@ -289,11 +289,11 @@ MiniTimeline::format_time (framepos_t when)
|
|||
case AudioClock::MinSec:
|
||||
{
|
||||
char buf[32];
|
||||
AudioClock::print_minsec (when, buf, sizeof (buf), _session->frame_rate());
|
||||
AudioClock::print_minsec (when, buf, sizeof (buf), _session->sample_rate());
|
||||
_layout->set_text (std::string(buf).substr(1));
|
||||
}
|
||||
break;
|
||||
case AudioClock::Frames:
|
||||
case AudioClock::Samples:
|
||||
{
|
||||
char buf[32];
|
||||
snprintf (buf, sizeof (buf), "%" PRId64, when);
|
||||
|
@ -475,10 +475,10 @@ MiniTimeline::draw_edge (cairo_t* cr, int x0, int x1, bool left, const std::stri
|
|||
|
||||
|
||||
struct LocationMarker {
|
||||
LocationMarker (const std::string& l, framepos_t w)
|
||||
LocationMarker (const std::string& l, samplepos_t w)
|
||||
: label (l), when (w) {}
|
||||
std::string label;
|
||||
framepos_t when;
|
||||
samplepos_t when;
|
||||
};
|
||||
|
||||
struct LocationMarkerSort {
|
||||
|
@ -514,12 +514,12 @@ MiniTimeline::render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangle_
|
|||
}
|
||||
|
||||
/* time */
|
||||
const framepos_t p = _last_update_frame;
|
||||
const framepos_t lower = (std::max ((framepos_t)0, (p - _time_span_samples)) / _time_granularity) * _time_granularity;
|
||||
const samplepos_t p = _last_update_sample;
|
||||
const samplepos_t lower = (std::max ((samplepos_t)0, (p - _time_span_samples)) / _time_granularity) * _time_granularity;
|
||||
|
||||
int dot_left = width * .5 + (lower - p) * _px_per_sample;
|
||||
for (int i = 0; i < 2 + _n_labels; ++i) {
|
||||
framepos_t when = lower + i * _time_granularity;
|
||||
samplepos_t when = lower + i * _time_granularity;
|
||||
double xpos = width * .5 + (when - p) * _px_per_sample;
|
||||
|
||||
// TODO round to nearest display TC in +/- 1px
|
||||
|
@ -542,8 +542,8 @@ MiniTimeline::render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangle_
|
|||
draw_dots (cr, dot_left, width, height - PADDING - _time_height * .5, text);
|
||||
|
||||
/* locations */
|
||||
framepos_t lmin = std::max ((framepos_t)0, (p - _time_span_samples));
|
||||
framepos_t lmax = p + _time_span_samples;
|
||||
samplepos_t lmin = std::max ((samplepos_t)0, (p - _time_span_samples));
|
||||
samplepos_t lmax = p + _time_span_samples;
|
||||
|
||||
int tw, th;
|
||||
_layout->set_text (X_("Marker@"));
|
||||
|
@ -585,7 +585,7 @@ MiniTimeline::render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangle_
|
|||
int id = 0;
|
||||
|
||||
for (std::vector<LocationMarker>::const_iterator l = lm.begin(); l != lm.end(); ++id) {
|
||||
framepos_t when = (*l).when;
|
||||
samplepos_t when = (*l).when;
|
||||
if (when < lmin) {
|
||||
outside_left = l;
|
||||
if (++l != lm.end()) {
|
||||
|
@ -660,13 +660,13 @@ MiniTimeline::build_minitl_context_menu ()
|
|||
|
||||
assert (_session);
|
||||
|
||||
const framecnt_t time_span = _session->config.get_minitimeline_span ();
|
||||
const samplecnt_t time_span = _session->config.get_minitimeline_span ();
|
||||
|
||||
_minitl_context_menu = new Gtk::Menu();
|
||||
MenuList& items = _minitl_context_menu->items();
|
||||
|
||||
// ideally this would have a heading (or rather be a sub-menu to "Visible Time")
|
||||
std::map<framecnt_t, std::string> spans;
|
||||
std::map<samplecnt_t, std::string> spans;
|
||||
spans[30] = _("30 sec");
|
||||
spans[60] = _("1 min");
|
||||
spans[120] = _("2 mins");
|
||||
|
@ -675,7 +675,7 @@ MiniTimeline::build_minitl_context_menu ()
|
|||
spans[1200] = _("20 mins");
|
||||
|
||||
RadioMenuItem::Group span_group;
|
||||
for (std::map<framecnt_t, std::string>::const_iterator i = spans.begin (); i != spans.end (); ++i) {
|
||||
for (std::map<samplecnt_t, std::string>::const_iterator i = spans.begin (); i != spans.end (); ++i) {
|
||||
items.push_back (RadioMenuElem (span_group, i->second, sigc::bind (sigc::mem_fun (*this, &MiniTimeline::set_span), i->first)));
|
||||
if (time_span == i->first) {
|
||||
static_cast<RadioMenuItem*>(&items.back())->set_active ();
|
||||
|
@ -717,8 +717,8 @@ MiniTimeline::on_button_release_event (GdkEventButton *ev)
|
|||
}
|
||||
|
||||
if (ev->button == 1) {
|
||||
framepos_t when = _last_update_frame + (ev->x - get_width() * .5) / _px_per_sample;
|
||||
_session->request_locate (std::max ((framepos_t)0, when), _session->transport_rolling ());
|
||||
samplepos_t when = _last_update_sample + (ev->x - get_width() * .5) / _px_per_sample;
|
||||
_session->request_locate (std::max ((samplepos_t)0, when), _session->transport_rolling ());
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -774,8 +774,8 @@ MiniTimeline::on_scroll_event (GdkEventScroll *ev)
|
|||
{
|
||||
if (!_session) { return true; }
|
||||
if (_session->actively_recording ()) { return true; }
|
||||
const framecnt_t time_span = _session->config.get_minitimeline_span ();
|
||||
framepos_t when = _session->audible_frame ();
|
||||
const samplecnt_t time_span = _session->config.get_minitimeline_span ();
|
||||
samplepos_t when = _session->audible_sample ();
|
||||
|
||||
double scale = time_span / 60.0;
|
||||
|
||||
|
@ -790,16 +790,16 @@ MiniTimeline::on_scroll_event (GdkEventScroll *ev)
|
|||
switch (ev->direction) {
|
||||
case GDK_SCROLL_UP:
|
||||
case GDK_SCROLL_RIGHT:
|
||||
when += scale * _session->nominal_frame_rate ();
|
||||
when += scale * _session->nominal_sample_rate ();
|
||||
break;
|
||||
case GDK_SCROLL_DOWN:
|
||||
case GDK_SCROLL_LEFT:
|
||||
when -= scale * _session->nominal_frame_rate ();
|
||||
when -= scale * _session->nominal_sample_rate ();
|
||||
break;
|
||||
default:
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
_session->request_locate (std::max ((framepos_t)0, when), _session->transport_rolling ());
|
||||
_session->request_locate (std::max ((samplepos_t)0, when), _session->transport_rolling ());
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ private:
|
|||
int draw_edge (cairo_t*, int x0, int x1, bool left, const std::string&, bool& prelight);
|
||||
|
||||
void render (Cairo::RefPtr<Cairo::Context> const&, cairo_rectangle_t*);
|
||||
void format_time (framepos_t when);
|
||||
void format_time (samplepos_t when);
|
||||
|
||||
bool on_button_press_event (GdkEventButton*);
|
||||
bool on_button_release_event (GdkEventButton*);
|
||||
|
@ -78,22 +78,22 @@ private:
|
|||
bool on_leave_notify_event (GdkEventCrossing*);
|
||||
|
||||
void build_minitl_context_menu ();
|
||||
void set_span (ARDOUR::framecnt_t);
|
||||
void set_span (ARDOUR::samplecnt_t);
|
||||
|
||||
Glib::RefPtr<Pango::Layout> _layout;
|
||||
sigc::connection super_rapid_connection;
|
||||
PBD::ScopedConnectionList marker_connection;
|
||||
PBD::ScopedConnectionList session_connection;
|
||||
|
||||
framepos_t _last_update_frame;
|
||||
samplepos_t _last_update_sample;
|
||||
AudioClock::Mode _clock_mode;
|
||||
int _time_width;
|
||||
int _time_height;
|
||||
|
||||
int _n_labels;
|
||||
double _px_per_sample;
|
||||
ARDOUR::framecnt_t _time_granularity;
|
||||
ARDOUR::framecnt_t _time_span_samples;
|
||||
ARDOUR::samplecnt_t _time_granularity;
|
||||
ARDOUR::samplecnt_t _time_span_samples;
|
||||
int _marker_height;
|
||||
|
||||
int _pointer_x;
|
||||
|
@ -102,11 +102,11 @@ private:
|
|||
Gtk::Menu* _minitl_context_menu;
|
||||
|
||||
struct JumpRange {
|
||||
JumpRange (int l, int r, framepos_t t, bool p = false)
|
||||
JumpRange (int l, int r, samplepos_t t, bool p = false)
|
||||
: left (l), right (r), to (t), prelight (p) {}
|
||||
int left;
|
||||
int right;
|
||||
framepos_t to;
|
||||
samplepos_t to;
|
||||
bool prelight;
|
||||
};
|
||||
|
||||
|
|
|
@ -335,11 +335,11 @@ MixerStrip::init ()
|
|||
global_vpacker.pack_end (spacer, false, false);
|
||||
#endif
|
||||
|
||||
global_frame.add (global_vpacker);
|
||||
global_frame.set_shadow_type (Gtk::SHADOW_IN);
|
||||
global_frame.set_name ("BaseFrame");
|
||||
global_sample.add (global_vpacker);
|
||||
global_sample.set_shadow_type (Gtk::SHADOW_IN);
|
||||
global_sample.set_name ("BaseFrame");
|
||||
|
||||
add (global_frame);
|
||||
add (global_sample);
|
||||
|
||||
/* force setting of visible selected status */
|
||||
|
||||
|
@ -504,7 +504,7 @@ MixerStrip::trim_start_touch ()
|
|||
{
|
||||
assert (_route && _session);
|
||||
if (route()->trim() && route()->trim()->active() && route()->n_inputs().n_audio() > 0) {
|
||||
route()->trim()->gain_control ()->start_touch (_session->transport_frame());
|
||||
route()->trim()->gain_control ()->start_touch (_session->transport_sample());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -513,7 +513,7 @@ MixerStrip::trim_end_touch ()
|
|||
{
|
||||
assert (_route && _session);
|
||||
if (route()->trim() && route()->trim()->active() && route()->n_inputs().n_audio() > 0) {
|
||||
route()->trim()->gain_control ()->stop_touch (_session->transport_frame());
|
||||
route()->trim()->gain_control ()->stop_touch (_session->transport_sample());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -734,7 +734,7 @@ MixerStrip::set_route (boost::shared_ptr<Route> rt)
|
|||
|
||||
width_button.show();
|
||||
width_hide_box.show();
|
||||
global_frame.show();
|
||||
global_sample.show();
|
||||
global_vpacker.show();
|
||||
mute_solo_table.show();
|
||||
bottom_button_table.show();
|
||||
|
@ -1835,14 +1835,14 @@ MixerStrip::set_selected (bool yn)
|
|||
AxisView::set_selected (yn);
|
||||
|
||||
if (selected()) {
|
||||
global_frame.set_shadow_type (Gtk::SHADOW_ETCHED_OUT);
|
||||
global_frame.set_name ("MixerStripSelectedFrame");
|
||||
global_sample.set_shadow_type (Gtk::SHADOW_ETCHED_OUT);
|
||||
global_sample.set_name ("MixerStripSelectedFrame");
|
||||
} else {
|
||||
global_frame.set_shadow_type (Gtk::SHADOW_IN);
|
||||
global_frame.set_name ("MixerStripFrame");
|
||||
global_sample.set_shadow_type (Gtk::SHADOW_IN);
|
||||
global_sample.set_name ("MixerStripFrame");
|
||||
}
|
||||
|
||||
global_frame.queue_draw ();
|
||||
global_sample.queue_draw ();
|
||||
|
||||
// if (!yn)
|
||||
// processor_box.deselect_all_processors();
|
||||
|
|
|
@ -168,7 +168,7 @@ private:
|
|||
void hide_clicked();
|
||||
bool width_button_pressed (GdkEventButton *);
|
||||
|
||||
Gtk::Frame global_frame;
|
||||
Gtk::Frame global_sample;
|
||||
Gtk::VBox global_vpacker;
|
||||
|
||||
ProcessorBox processor_box;
|
||||
|
|
|
@ -213,9 +213,9 @@ Mixer_UI::Mixer_UI ()
|
|||
group_display_vbox.pack_start (group_display_scroller, true, true);
|
||||
group_display_vbox.pack_start (*route_group_display_button_box, false, false);
|
||||
|
||||
group_display_frame.set_name ("BaseFrame");
|
||||
group_display_frame.set_shadow_type (Gtk::SHADOW_IN);
|
||||
group_display_frame.add (group_display_vbox);
|
||||
group_display_sample.set_name ("BaseFrame");
|
||||
group_display_sample.set_shadow_type (Gtk::SHADOW_IN);
|
||||
group_display_sample.add (group_display_vbox);
|
||||
|
||||
|
||||
list<TargetEntry> target_list;
|
||||
|
@ -244,15 +244,15 @@ Mixer_UI::Mixer_UI ()
|
|||
favorite_plugins_scroller.add (favorite_plugins_display);
|
||||
favorite_plugins_scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
|
||||
|
||||
favorite_plugins_frame.set_name ("BaseFrame");
|
||||
favorite_plugins_frame.set_shadow_type (Gtk::SHADOW_IN);
|
||||
favorite_plugins_frame.add (favorite_plugins_scroller);
|
||||
favorite_plugins_sample.set_name ("BaseFrame");
|
||||
favorite_plugins_sample.set_shadow_type (Gtk::SHADOW_IN);
|
||||
favorite_plugins_sample.add (favorite_plugins_scroller);
|
||||
|
||||
rhs_pane1.add (favorite_plugins_frame);
|
||||
rhs_pane1.add (track_display_frame);
|
||||
rhs_pane1.add (favorite_plugins_sample);
|
||||
rhs_pane1.add (track_display_sample);
|
||||
|
||||
rhs_pane2.add (rhs_pane1);
|
||||
rhs_pane2.add (group_display_frame);
|
||||
rhs_pane2.add (group_display_sample);
|
||||
|
||||
list_vpacker.pack_start (rhs_pane2, true, true);
|
||||
|
||||
|
@ -331,8 +331,8 @@ Mixer_UI::Mixer_UI ()
|
|||
group_display_scroller.show();
|
||||
favorite_plugins_scroller.show();
|
||||
group_display_vbox.show();
|
||||
group_display_frame.show();
|
||||
favorite_plugins_frame.show();
|
||||
group_display_sample.show();
|
||||
favorite_plugins_sample.show();
|
||||
rhs_pane1.show();
|
||||
rhs_pane2.show();
|
||||
strip_packer.show();
|
||||
|
@ -2358,12 +2358,12 @@ Mixer_UI::setup_track_display ()
|
|||
|
||||
v->pack_start (*b, false, false);
|
||||
|
||||
track_display_frame.set_name("BaseFrame");
|
||||
track_display_frame.set_shadow_type (Gtk::SHADOW_IN);
|
||||
track_display_frame.add (*v);
|
||||
track_display_sample.set_name("BaseFrame");
|
||||
track_display_sample.set_shadow_type (Gtk::SHADOW_IN);
|
||||
track_display_sample.add (*v);
|
||||
|
||||
track_display_scroller.show();
|
||||
track_display_frame.show();
|
||||
track_display_sample.show();
|
||||
track_display.show();
|
||||
}
|
||||
|
||||
|
|
|
@ -151,9 +151,9 @@ private:
|
|||
Gtk::ScrolledWindow group_display_scroller;
|
||||
Gtk::ScrolledWindow favorite_plugins_scroller;
|
||||
Gtk::VBox group_display_vbox;
|
||||
Gtk::Frame track_display_frame;
|
||||
Gtk::Frame group_display_frame;
|
||||
Gtk::Frame favorite_plugins_frame;
|
||||
Gtk::Frame track_display_sample;
|
||||
Gtk::Frame group_display_sample;
|
||||
Gtk::Frame favorite_plugins_sample;
|
||||
ArdourWidgets::VPane rhs_pane1;
|
||||
ArdourWidgets::VPane rhs_pane2;
|
||||
ArdourWidgets::HPane inner_pane;
|
||||
|
|
|
@ -441,9 +441,9 @@ MonitorSection::MonitorSection (Session* s)
|
|||
vpacker.pack_start (master_packer, false, false, PX_SCALE(10));
|
||||
vpacker.pack_end (*out_packer, false, false,
|
||||
#ifdef MIXBUS
|
||||
scrollbar_height - 2 /* no outer frame */
|
||||
scrollbar_height - 2 /* no outer sample */
|
||||
#else
|
||||
scrollbar_height + 2 /* frame borders */
|
||||
scrollbar_height + 2 /* sample borders */
|
||||
#endif
|
||||
);
|
||||
|
||||
|
|
|
@ -574,7 +574,7 @@ void
|
|||
ClockOption::set_state_from_config ()
|
||||
{
|
||||
Timecode::Time TC;
|
||||
framepos_t when;
|
||||
samplepos_t when;
|
||||
if (!Timecode::parse_timecode_format(_get(), TC)) {
|
||||
_clock.set (0, true);
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue