2005-09-25 14:42:24 -04:00
|
|
|
/*
|
2009-10-14 12:10:01 -04:00
|
|
|
Copyright (C) 2000 Paul Davis
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2010-11-13 00:14:48 -05:00
|
|
|
#ifdef WAF_BUILD
|
|
|
|
#include "gtk2ardour-config.h"
|
|
|
|
#endif
|
|
|
|
|
2009-10-14 12:10:01 -04:00
|
|
|
#include <cstdio> // for sprintf, grrr
|
2005-09-25 14:42:24 -04:00
|
|
|
#include <cmath>
|
2009-10-30 11:30:22 -04:00
|
|
|
#include <inttypes.h>
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
2008-03-17 16:54:03 -04:00
|
|
|
#include <gtk/gtkaction.h>
|
|
|
|
|
2014-06-22 11:41:05 -04:00
|
|
|
#include "canvas/container.h"
|
2013-04-18 15:14:48 -04:00
|
|
|
#include "canvas/canvas.h"
|
2014-06-11 23:54:04 -04:00
|
|
|
#include "canvas/ruler.h"
|
|
|
|
#include "canvas/debug.h"
|
2014-06-21 11:44:22 -04:00
|
|
|
#include "canvas/scroll_group.h"
|
2013-04-04 00:32:52 -04:00
|
|
|
|
2009-10-30 11:30:22 -04:00
|
|
|
#include "ardour/session.h"
|
2009-02-25 13:26:51 -05:00
|
|
|
#include "ardour/tempo.h"
|
|
|
|
#include "ardour/profile.h"
|
2012-01-19 17:23:28 -05:00
|
|
|
|
|
|
|
#include "gtkmm2ext/gtk_ui.h"
|
2014-06-12 16:18:38 -04:00
|
|
|
#include "gtkmm2ext/keyboard.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2014-06-13 12:22:32 -04:00
|
|
|
#include "ardour_ui.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
#include "editor.h"
|
|
|
|
#include "editing.h"
|
2008-03-17 16:54:03 -04:00
|
|
|
#include "actions.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
#include "gui_thread.h"
|
2014-06-25 15:23:25 -04:00
|
|
|
#include "ruler_dialog.h"
|
2008-12-12 09:43:24 -05:00
|
|
|
#include "time_axis_view.h"
|
2009-06-14 09:31:46 -04:00
|
|
|
#include "editor_drag.h"
|
2010-11-16 09:53:16 -05:00
|
|
|
#include "editor_cursors.h"
|
2015-01-02 09:44:54 -05:00
|
|
|
#include "ui_config.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
#include "i18n.h"
|
|
|
|
|
|
|
|
using namespace ARDOUR;
|
Large nasty commit in the form of a 5000 line patch chock-full of completely
unecessary changes. (Sorry, doing a "sprint" based thing, this is the end of the first one)
Achieved MIDI track and bus creation, associated Jack port and diskstream creation, and minimal GUI stuff for creating them. Should be set to start work on actually recording and playing midi to/from disk now.
Relevant (significant) changes:
- Creation of a Buffer class. Base class is type agnostic so things can point to a buffer but not care what kind it is (otherwise it'd be a template). Derived into AudioBuffer and MidiBuffer, with a type tag because checking type is necessary in parts of the code where dynamic_cast wouldn't be wise. Originally I considered this a hack, but passing around a type proved to be a very good solution to all the other problems (below). There is a 1:1 mapping between jack port data types and ardour Buffer types (with a conversion function), but that's easily removed if it ever becomes necessary. Having the type scoped in the Buffer class is maybe not the best spot for it, but whatever (this is proof of concept kinda stuff right now...)
- IO now has a "default" port type (passed to the constructor and stored as a member), used by ensure_io (and similar) to create n ports. IO::register_***_port has a type argument that defaults to the default type if not passed. Rationale: previous IO API is identical, no changes needed to existing code, but path is paved for multiple port types in one IO, which we will need for eg synth plugin inserts, among other things. This is not quite ideal (best would be to only have the two port register functions and have them take a type), but the alternative is a lot of work (namely destroying the 'ensure' functions and everything that uses them) for very little gain. (I am convinced after quite a few tries at the whiteboard that subclassing IO in any way is not a feasible option, look at it's inheritance diagram in Doxygen and you can see why)
- AudioEngine::register_audio_input_port is now register_input_port and takes a type argument. Ditto for output.
- (Most significant change) AudioDiskstream abstracted into Distream, and sibling MidiDiskstream created. Very much still a work in progress, but Diskstream is there to switch references over to (most already are), which is the important part. It is still unclear what the MIDI diskstream's relation to channels is, but I'm pretty sure they will be single channel only (so SMF Type 0) since noone can come up with a reason otherwise.
- MidiTrack creation. Same thing as AudioTrack but with a different default type basically. No big deal here.
- Random cleanups and variable renamings etc. because I have OCD and can't help myself. :)
Known broken: Loading of sessions containing MIDI tracks.
git-svn-id: svn://localhost/ardour2/branches/midi@641 d708f5d6-7413-0410-9779-e7cbd77b26cf
2006-06-26 12:01:34 -04:00
|
|
|
using namespace PBD;
|
2005-09-25 14:42:24 -04:00
|
|
|
using namespace Gtk;
|
|
|
|
using namespace Editing;
|
|
|
|
|
|
|
|
/* the order here must match the "metric" enums in editor.h */
|
|
|
|
|
2014-06-11 23:54:04 -04:00
|
|
|
class TimecodeMetric : public ArdourCanvas::Ruler::Metric
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
TimecodeMetric (Editor* e) : _editor (e) {}
|
|
|
|
|
|
|
|
void get_marks (std::vector<ArdourCanvas::Ruler::Mark>& marks, double lower, double upper, int maxchars) const {
|
|
|
|
_editor->metric_get_timecode (marks, lower, upper, maxchars);
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
Editor* _editor;
|
|
|
|
};
|
|
|
|
|
|
|
|
class SamplesMetric : public ArdourCanvas::Ruler::Metric
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SamplesMetric (Editor* e) : _editor (e) {}
|
|
|
|
|
|
|
|
void get_marks (std::vector<ArdourCanvas::Ruler::Mark>& marks, double lower, double upper, int maxchars) const {
|
|
|
|
_editor->metric_get_samples (marks, lower, upper, maxchars);
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
Editor* _editor;
|
|
|
|
};
|
|
|
|
|
|
|
|
class BBTMetric : public ArdourCanvas::Ruler::Metric
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
BBTMetric (Editor* e) : _editor (e) {}
|
|
|
|
|
|
|
|
void get_marks (std::vector<ArdourCanvas::Ruler::Mark>& marks, double lower, double upper, int maxchars) const {
|
|
|
|
_editor->metric_get_bbt (marks, lower, upper, maxchars);
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
Editor* _editor;
|
2005-09-25 14:42:24 -04:00
|
|
|
};
|
|
|
|
|
2014-06-11 23:54:04 -04:00
|
|
|
class MinsecMetric : public ArdourCanvas::Ruler::Metric
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MinsecMetric (Editor* e) : _editor (e) {}
|
|
|
|
|
|
|
|
void get_marks (std::vector<ArdourCanvas::Ruler::Mark>& marks, double lower, double upper, int maxchars) const {
|
|
|
|
_editor->metric_get_minsec (marks, lower, upper, maxchars);
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
Editor* _editor;
|
|
|
|
};
|
|
|
|
|
|
|
|
static ArdourCanvas::Ruler::Metric* _bbt_metric;
|
|
|
|
static ArdourCanvas::Ruler::Metric* _timecode_metric;
|
|
|
|
static ArdourCanvas::Ruler::Metric* _samples_metric;
|
|
|
|
static ArdourCanvas::Ruler::Metric* _minsec_metric;
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
void
|
|
|
|
Editor::initialize_rulers ()
|
|
|
|
{
|
|
|
|
ruler_grabbed_widget = 0;
|
2014-12-21 11:53:15 -05:00
|
|
|
|
2015-01-02 09:44:54 -05:00
|
|
|
Pango::FontDescription font (UIConfiguration::instance().get_SmallerFont());
|
2014-12-21 11:53:15 -05:00
|
|
|
|
2014-06-11 23:54:04 -04:00
|
|
|
_timecode_metric = new TimecodeMetric (this);
|
|
|
|
_bbt_metric = new BBTMetric (this);
|
|
|
|
_minsec_metric = new MinsecMetric (this);
|
|
|
|
_samples_metric = new SamplesMetric (this);
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2014-06-12 10:35:32 -04:00
|
|
|
timecode_ruler = new ArdourCanvas::Ruler (_time_markers_group, *_timecode_metric,
|
|
|
|
ArdourCanvas::Rect (0, 0, ArdourCanvas::COORD_MAX, timebar_height));
|
2014-06-11 23:54:04 -04:00
|
|
|
timecode_ruler->set_font_description (font);
|
|
|
|
CANVAS_DEBUG_NAME (timecode_ruler, "timecode ruler");
|
2009-10-26 10:38:58 -04:00
|
|
|
timecode_nmarks = 0;
|
2008-10-22 02:41:51 -04:00
|
|
|
|
2014-06-12 10:35:32 -04:00
|
|
|
samples_ruler = new ArdourCanvas::Ruler (_time_markers_group, *_samples_metric,
|
|
|
|
ArdourCanvas::Rect (0, 0, ArdourCanvas::COORD_MAX, timebar_height));
|
2014-06-11 23:54:04 -04:00
|
|
|
samples_ruler->set_font_description (font);
|
|
|
|
CANVAS_DEBUG_NAME (samples_ruler, "samples ruler");
|
|
|
|
|
2014-06-12 10:35:32 -04:00
|
|
|
minsec_ruler = new ArdourCanvas::Ruler (_time_markers_group, *_minsec_metric,
|
|
|
|
ArdourCanvas::Rect (0, 0, ArdourCanvas::COORD_MAX, timebar_height));
|
2014-06-11 23:54:04 -04:00
|
|
|
minsec_ruler->set_font_description (font);
|
|
|
|
CANVAS_DEBUG_NAME (minsec_ruler, "minsec ruler");
|
2008-10-22 02:41:51 -04:00
|
|
|
minsec_nmarks = 0;
|
|
|
|
|
2014-06-12 10:35:32 -04:00
|
|
|
bbt_ruler = new ArdourCanvas::Ruler (_time_markers_group, *_bbt_metric,
|
|
|
|
ArdourCanvas::Rect (0, 0, ArdourCanvas::COORD_MAX, timebar_height));
|
2014-06-11 23:54:04 -04:00
|
|
|
bbt_ruler->set_font_description (font);
|
|
|
|
CANVAS_DEBUG_NAME (bbt_ruler, "bbt ruler");
|
|
|
|
timecode_nmarks = 0;
|
|
|
|
|
2008-10-22 02:41:51 -04:00
|
|
|
using namespace Box_Helpers;
|
2013-04-04 00:32:52 -04:00
|
|
|
BoxList & lab_children = time_bars_vbox.children();
|
2008-10-22 02:41:51 -04:00
|
|
|
|
2014-06-11 23:54:04 -04:00
|
|
|
lab_children.push_back (Element(minsec_label, PACK_SHRINK, PACK_START));
|
|
|
|
lab_children.push_back (Element(timecode_label, PACK_SHRINK, PACK_START));
|
|
|
|
lab_children.push_back (Element(samples_label, PACK_SHRINK, PACK_START));
|
|
|
|
lab_children.push_back (Element(bbt_label, PACK_SHRINK, PACK_START));
|
2008-10-22 02:41:51 -04:00
|
|
|
lab_children.push_back (Element(meter_label, PACK_SHRINK, PACK_START));
|
|
|
|
lab_children.push_back (Element(tempo_label, PACK_SHRINK, PACK_START));
|
|
|
|
lab_children.push_back (Element(range_mark_label, PACK_SHRINK, PACK_START));
|
|
|
|
lab_children.push_back (Element(transport_mark_label, PACK_SHRINK, PACK_START));
|
|
|
|
lab_children.push_back (Element(cd_mark_label, PACK_SHRINK, PACK_START));
|
|
|
|
lab_children.push_back (Element(mark_label, PACK_SHRINK, PACK_START));
|
2013-03-12 17:00:09 -04:00
|
|
|
lab_children.push_back (Element(videotl_label, PACK_SHRINK, PACK_START));
|
2008-10-22 02:41:51 -04:00
|
|
|
|
2014-06-12 15:58:05 -04:00
|
|
|
/* 1 event handler to bind them all ... */
|
|
|
|
|
|
|
|
timecode_ruler->Event.connect (sigc::bind (sigc::mem_fun (*this, &Editor::canvas_ruler_event), timecode_ruler, TimecodeRulerItem));
|
|
|
|
minsec_ruler->Event.connect (sigc::bind (sigc::mem_fun (*this, &Editor::canvas_ruler_event), minsec_ruler, MinsecRulerItem));
|
|
|
|
bbt_ruler->Event.connect (sigc::bind (sigc::mem_fun (*this, &Editor::canvas_ruler_event), bbt_ruler, BBTRulerItem));
|
|
|
|
samples_ruler->Event.connect (sigc::bind (sigc::mem_fun (*this, &Editor::canvas_ruler_event), samples_ruler, SamplesRulerItem));
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2008-10-22 02:41:51 -04:00
|
|
|
visible_timebars = 0; /*this will be changed below */
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2011-04-19 06:43:43 -04:00
|
|
|
bool
|
2005-09-25 14:42:24 -04:00
|
|
|
Editor::ruler_label_button_release (GdkEventButton* ev)
|
|
|
|
{
|
2014-06-12 16:18:38 -04:00
|
|
|
if (Gtkmm2ext::Keyboard::is_context_menu_event (ev)) {
|
2014-06-25 15:23:25 -04:00
|
|
|
if (!ruler_dialog) {
|
|
|
|
ruler_dialog = new RulerDialog ();
|
2008-03-17 16:54:03 -04:00
|
|
|
}
|
2014-06-25 15:23:25 -04:00
|
|
|
ruler_dialog->present ();
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2011-04-19 06:43:43 -04:00
|
|
|
return true;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2010-09-17 14:20:37 -04:00
|
|
|
Editor::popup_ruler_menu (framepos_t where, ItemType t)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
|
|
|
using namespace Menu_Helpers;
|
|
|
|
|
|
|
|
if (editor_ruler_menu == 0) {
|
|
|
|
editor_ruler_menu = new Menu;
|
|
|
|
editor_ruler_menu->set_name ("ArdourContextMenu");
|
|
|
|
}
|
|
|
|
|
|
|
|
// always build from scratch
|
|
|
|
MenuList& ruler_items = editor_ruler_menu->items();
|
|
|
|
editor_ruler_menu->set_name ("ArdourContextMenu");
|
|
|
|
ruler_items.clear();
|
|
|
|
|
|
|
|
switch (t) {
|
|
|
|
case MarkerBarItem:
|
2015-02-06 18:56:34 -05:00
|
|
|
ruler_items.push_back (MenuElem (_("New location marker"), sigc::bind ( sigc::mem_fun(*this, &Editor::mouse_add_new_marker), where, false)));
|
2009-12-11 18:29:48 -05:00
|
|
|
ruler_items.push_back (MenuElem (_("Clear all locations"), sigc::mem_fun(*this, &Editor::clear_markers)));
|
|
|
|
ruler_items.push_back (MenuElem (_("Unhide locations"), sigc::mem_fun(*this, &Editor::unhide_markers)));
|
2005-09-25 14:42:24 -04:00
|
|
|
break;
|
2015-12-09 07:40:03 -05:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
case RangeMarkerBarItem:
|
2012-06-19 09:54:28 -04:00
|
|
|
ruler_items.push_back (MenuElem (_("New range"), sigc::bind (sigc::mem_fun (*this, &Editor::mouse_add_new_range), where)));
|
2009-12-11 18:29:48 -05:00
|
|
|
ruler_items.push_back (MenuElem (_("Clear all ranges"), sigc::mem_fun(*this, &Editor::clear_ranges)));
|
|
|
|
ruler_items.push_back (MenuElem (_("Unhide ranges"), sigc::mem_fun(*this, &Editor::unhide_ranges)));
|
2005-09-25 14:42:24 -04:00
|
|
|
break;
|
2015-12-09 07:40:03 -05:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
case TransportMarkerBarItem:
|
2015-04-17 18:17:15 -04:00
|
|
|
ruler_items.push_back (MenuElem (_("New Loop range"), sigc::bind (sigc::mem_fun (*this, &Editor::mouse_add_new_loop), where)));
|
|
|
|
ruler_items.push_back (MenuElem (_("New Punch range"), sigc::bind (sigc::mem_fun (*this, &Editor::mouse_add_new_punch), where)));
|
2005-09-25 14:42:24 -04:00
|
|
|
break;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-01-10 16:20:59 -05:00
|
|
|
case CdMarkerBarItem:
|
|
|
|
// TODO
|
2015-02-06 18:56:34 -05:00
|
|
|
ruler_items.push_back (MenuElem (_("New CD track marker"), sigc::bind ( sigc::mem_fun(*this, &Editor::mouse_add_new_marker), where, true)));
|
2008-01-10 16:20:59 -05:00
|
|
|
break;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
case TempoBarItem:
|
2009-12-11 18:29:48 -05:00
|
|
|
ruler_items.push_back (MenuElem (_("New Tempo"), sigc::bind ( sigc::mem_fun(*this, &Editor::mouse_add_new_tempo_event), where)));
|
2005-09-25 14:42:24 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case MeterBarItem:
|
2009-12-11 18:29:48 -05:00
|
|
|
ruler_items.push_back (MenuElem (_("New Meter"), sigc::bind ( sigc::mem_fun(*this, &Editor::mouse_add_new_meter_event), where)));
|
2005-09-25 14:42:24 -04:00
|
|
|
break;
|
|
|
|
|
2013-03-12 17:00:09 -04:00
|
|
|
case VideoBarItem:
|
2015-03-11 16:18:17 -04:00
|
|
|
/* proper headings would be nice
|
|
|
|
* but AFAICT the only way to get them will be to define a
|
|
|
|
* special GTK style for insensitive Elements or subclass MenuItem
|
|
|
|
*/
|
|
|
|
//ruler_items.push_back (MenuElem (_("Timeline height"))); // heading
|
|
|
|
//static_cast<MenuItem*>(&ruler_items.back())->set_sensitive(false);
|
2013-03-12 17:00:09 -04:00
|
|
|
ruler_items.push_back (CheckMenuElem (_("Large"), sigc::bind ( sigc::mem_fun(*this, &Editor::set_video_timeline_height), 6)));
|
2013-07-17 02:48:40 -04:00
|
|
|
if (videotl_bar_height == 6) { static_cast<Gtk::CheckMenuItem*>(&ruler_items.back())->set_active(true);}
|
2013-03-12 17:00:09 -04:00
|
|
|
ruler_items.push_back (CheckMenuElem (_("Normal"), sigc::bind ( sigc::mem_fun(*this, &Editor::set_video_timeline_height), 4)));
|
2013-07-17 02:48:40 -04:00
|
|
|
if (videotl_bar_height == 4) { static_cast<Gtk::CheckMenuItem*>(&ruler_items.back())->set_active(true);}
|
2013-03-12 17:00:09 -04:00
|
|
|
ruler_items.push_back (CheckMenuElem (_("Small"), sigc::bind ( sigc::mem_fun(*this, &Editor::set_video_timeline_height), 3)));
|
2013-07-17 02:48:40 -04:00
|
|
|
if (videotl_bar_height == 3) { static_cast<Gtk::CheckMenuItem*>(&ruler_items.back())->set_active(true);}
|
2013-03-12 17:00:09 -04:00
|
|
|
|
2015-03-11 16:18:17 -04:00
|
|
|
ruler_items.push_back (SeparatorElem ());
|
2013-03-12 17:00:09 -04:00
|
|
|
|
2015-03-11 16:18:17 -04:00
|
|
|
//ruler_items.push_back (MenuElem (_("Align Video Track"))); // heading
|
|
|
|
//static_cast<MenuItem*>(&ruler_items.back())->set_sensitive(false);
|
2013-03-12 17:00:09 -04:00
|
|
|
ruler_items.push_back (CheckMenuElem (_("Lock")));
|
|
|
|
{
|
2014-06-25 15:32:42 -04:00
|
|
|
Gtk::CheckMenuItem* vtl_lock = static_cast<Gtk::CheckMenuItem*>(&ruler_items.back());
|
|
|
|
vtl_lock->set_active(is_video_timeline_locked());
|
|
|
|
vtl_lock->signal_activate().connect (sigc::mem_fun(*this, &Editor::toggle_video_timeline_locked));
|
2013-03-12 17:00:09 -04:00
|
|
|
}
|
2015-03-11 16:18:17 -04:00
|
|
|
|
|
|
|
ruler_items.push_back (SeparatorElem ());
|
|
|
|
|
|
|
|
//ruler_items.push_back (MenuElem (_("Video Monitor"))); // heading
|
|
|
|
//static_cast<MenuItem*>(&ruler_items.back())->set_sensitive(false);
|
|
|
|
ruler_items.push_back (CheckMenuElem (_("Video Monitor")));
|
|
|
|
{
|
|
|
|
Gtk::CheckMenuItem* xjadeo_toggle = static_cast<Gtk::CheckMenuItem*>(&ruler_items.back());
|
|
|
|
if (!ARDOUR_UI::instance()->video_timeline->found_xjadeo()) {
|
|
|
|
xjadeo_toggle->set_sensitive(false);
|
|
|
|
}
|
|
|
|
xjadeo_toggle->set_active(xjadeo_proc_action->get_active());
|
|
|
|
xjadeo_toggle->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &Editor::toggle_xjadeo_proc), -1));
|
|
|
|
}
|
2013-03-12 17:00:09 -04:00
|
|
|
break;
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2014-06-25 15:32:42 -04:00
|
|
|
if (!ruler_items.empty()) {
|
|
|
|
editor_ruler_menu->popup (1, gtk_get_current_event_time());
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
no_ruler_shown_update = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Editor::store_ruler_visibility ()
|
|
|
|
{
|
|
|
|
XMLNode* node = new XMLNode(X_("RulerVisibility"));
|
|
|
|
|
2009-10-26 10:38:58 -04:00
|
|
|
node->add_property (X_("timecode"), ruler_timecode_action->get_active() ? "yes": "no");
|
2008-03-17 16:54:03 -04:00
|
|
|
node->add_property (X_("bbt"), ruler_bbt_action->get_active() ? "yes": "no");
|
2011-01-18 07:51:02 -05:00
|
|
|
node->add_property (X_("samples"), ruler_samples_action->get_active() ? "yes": "no");
|
2008-03-17 16:54:03 -04:00
|
|
|
node->add_property (X_("minsec"), ruler_minsec_action->get_active() ? "yes": "no");
|
|
|
|
node->add_property (X_("tempo"), ruler_tempo_action->get_active() ? "yes": "no");
|
|
|
|
node->add_property (X_("meter"), ruler_meter_action->get_active() ? "yes": "no");
|
|
|
|
node->add_property (X_("marker"), ruler_marker_action->get_active() ? "yes": "no");
|
|
|
|
node->add_property (X_("rangemarker"), ruler_range_action->get_active() ? "yes": "no");
|
|
|
|
node->add_property (X_("transportmarker"), ruler_loop_punch_action->get_active() ? "yes": "no");
|
|
|
|
node->add_property (X_("cdmarker"), ruler_cd_marker_action->get_active() ? "yes": "no");
|
2013-03-12 17:00:09 -04:00
|
|
|
node->add_property (X_("videotl"), ruler_video_action->get_active() ? "yes": "no");
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-12-17 13:24:23 -05:00
|
|
|
_session->add_extra_xml (*node);
|
|
|
|
_session->set_dirty ();
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2007-01-09 18:24:54 -05:00
|
|
|
|
2009-10-14 12:10:01 -04:00
|
|
|
void
|
2005-09-25 14:42:24 -04:00
|
|
|
Editor::restore_ruler_visibility ()
|
|
|
|
{
|
|
|
|
XMLProperty* prop;
|
2009-12-17 13:24:23 -05:00
|
|
|
XMLNode * node = _session->extra_xml (X_("RulerVisibility"));
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2008-03-17 16:54:03 -04:00
|
|
|
no_ruler_shown_update = true;
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
if (node) {
|
2009-10-26 10:38:58 -04:00
|
|
|
if ((prop = node->property ("timecode")) != 0) {
|
2009-10-02 16:53:31 -04:00
|
|
|
if (string_is_affirmative (prop->value())) {
|
2008-03-17 16:54:03 -04:00
|
|
|
ruler_timecode_action->set_active (true);
|
2008-12-12 09:43:24 -05:00
|
|
|
} else {
|
2008-03-17 16:54:03 -04:00
|
|
|
ruler_timecode_action->set_active (false);
|
2008-12-12 09:43:24 -05:00
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
if ((prop = node->property ("bbt")) != 0) {
|
2009-10-02 16:53:31 -04:00
|
|
|
if (string_is_affirmative (prop->value())) {
|
2008-03-17 16:54:03 -04:00
|
|
|
ruler_bbt_action->set_active (true);
|
2008-12-12 09:43:24 -05:00
|
|
|
} else {
|
2008-03-17 16:54:03 -04:00
|
|
|
ruler_bbt_action->set_active (false);
|
2008-12-12 09:43:24 -05:00
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2011-01-18 07:51:02 -05:00
|
|
|
if ((prop = node->property ("samples")) != 0) {
|
2009-10-02 16:53:31 -04:00
|
|
|
if (string_is_affirmative (prop->value())) {
|
2011-01-18 07:51:02 -05:00
|
|
|
ruler_samples_action->set_active (true);
|
2008-12-12 09:43:24 -05:00
|
|
|
} else {
|
2011-01-18 07:51:02 -05:00
|
|
|
ruler_samples_action->set_active (false);
|
2008-12-12 09:43:24 -05:00
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
if ((prop = node->property ("minsec")) != 0) {
|
2009-10-02 16:53:31 -04:00
|
|
|
if (string_is_affirmative (prop->value())) {
|
2008-03-17 16:54:03 -04:00
|
|
|
ruler_minsec_action->set_active (true);
|
2008-12-12 09:43:24 -05:00
|
|
|
} else {
|
2008-03-17 16:54:03 -04:00
|
|
|
ruler_minsec_action->set_active (false);
|
2008-12-12 09:43:24 -05:00
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
if ((prop = node->property ("tempo")) != 0) {
|
2009-10-02 16:53:31 -04:00
|
|
|
if (string_is_affirmative (prop->value())) {
|
2008-03-17 16:54:03 -04:00
|
|
|
ruler_tempo_action->set_active (true);
|
2008-12-12 09:43:24 -05:00
|
|
|
} else {
|
2008-03-17 16:54:03 -04:00
|
|
|
ruler_tempo_action->set_active (false);
|
2008-12-12 09:43:24 -05:00
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
if ((prop = node->property ("meter")) != 0) {
|
2009-10-02 16:53:31 -04:00
|
|
|
if (string_is_affirmative (prop->value())) {
|
2008-03-17 16:54:03 -04:00
|
|
|
ruler_meter_action->set_active (true);
|
2008-12-12 09:43:24 -05:00
|
|
|
} else {
|
2008-03-17 16:54:03 -04:00
|
|
|
ruler_meter_action->set_active (false);
|
2008-12-12 09:43:24 -05:00
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
if ((prop = node->property ("marker")) != 0) {
|
2009-10-02 16:53:31 -04:00
|
|
|
if (string_is_affirmative (prop->value())) {
|
2008-03-17 16:54:03 -04:00
|
|
|
ruler_marker_action->set_active (true);
|
2008-12-12 09:43:24 -05:00
|
|
|
} else {
|
2008-03-17 16:54:03 -04:00
|
|
|
ruler_marker_action->set_active (false);
|
2008-12-12 09:43:24 -05:00
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
if ((prop = node->property ("rangemarker")) != 0) {
|
2009-10-02 16:53:31 -04:00
|
|
|
if (string_is_affirmative (prop->value())) {
|
2008-03-17 16:54:03 -04:00
|
|
|
ruler_range_action->set_active (true);
|
2008-12-12 09:43:24 -05:00
|
|
|
} else {
|
2008-03-17 16:54:03 -04:00
|
|
|
ruler_range_action->set_active (false);
|
2008-12-12 09:43:24 -05:00
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2008-01-10 16:20:59 -05:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
if ((prop = node->property ("transportmarker")) != 0) {
|
2009-10-02 16:53:31 -04:00
|
|
|
if (string_is_affirmative (prop->value())) {
|
2008-03-17 16:54:03 -04:00
|
|
|
ruler_loop_punch_action->set_active (true);
|
2008-12-12 09:43:24 -05:00
|
|
|
} else {
|
2008-03-17 16:54:03 -04:00
|
|
|
ruler_loop_punch_action->set_active (false);
|
2008-12-12 09:43:24 -05:00
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2008-01-10 16:20:59 -05:00
|
|
|
if ((prop = node->property ("cdmarker")) != 0) {
|
2009-10-02 16:53:31 -04:00
|
|
|
if (string_is_affirmative (prop->value())) {
|
2008-03-17 16:54:03 -04:00
|
|
|
ruler_cd_marker_action->set_active (true);
|
2008-12-12 09:43:24 -05:00
|
|
|
} else {
|
2008-03-17 16:54:03 -04:00
|
|
|
ruler_cd_marker_action->set_active (false);
|
2008-12-12 09:43:24 -05:00
|
|
|
}
|
2008-01-10 16:20:59 -05:00
|
|
|
|
|
|
|
} else {
|
2009-12-17 13:24:23 -05:00
|
|
|
// this _session doesn't yet know about the cdmarker ruler
|
2009-10-14 12:10:01 -04:00
|
|
|
// as a benefit to the user who doesn't know the feature exists, show the ruler if
|
2008-01-10 16:20:59 -05:00
|
|
|
// any cd marks exist
|
2008-03-17 16:54:03 -04:00
|
|
|
ruler_cd_marker_action->set_active (false);
|
2009-12-17 13:24:23 -05:00
|
|
|
const Locations::LocationList & locs = _session->locations()->list();
|
2008-01-10 16:20:59 -05:00
|
|
|
for (Locations::LocationList::const_iterator i = locs.begin(); i != locs.end(); ++i) {
|
|
|
|
if ((*i)->is_cd_marker()) {
|
2008-03-17 16:54:03 -04:00
|
|
|
ruler_cd_marker_action->set_active (true);
|
2008-01-10 16:20:59 -05:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-03-12 17:00:09 -04:00
|
|
|
if ((prop = node->property ("videotl")) != 0) {
|
|
|
|
if (string_is_affirmative (prop->value())) {
|
|
|
|
ruler_video_action->set_active (true);
|
|
|
|
} else {
|
|
|
|
ruler_video_action->set_active (false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2008-03-17 16:54:03 -04:00
|
|
|
no_ruler_shown_update = false;
|
2005-09-25 14:42:24 -04:00
|
|
|
update_ruler_visibility ();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Editor::update_ruler_visibility ()
|
|
|
|
{
|
2014-06-11 23:54:04 -04:00
|
|
|
int visible_timebars = 0;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2008-03-17 16:54:03 -04:00
|
|
|
if (no_ruler_shown_update) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2014-06-11 23:54:04 -04:00
|
|
|
/* the order of the timebars is fixed, so we have to go through each one
|
|
|
|
* and adjust its position depending on what is shown.
|
|
|
|
*
|
|
|
|
* Order: minsec, timecode, samples, bbt, meter, tempo, ranges,
|
|
|
|
* loop/punch, cd markers, location markers
|
|
|
|
*/
|
|
|
|
|
|
|
|
double tbpos = 0.0;
|
|
|
|
double tbgpos = 0.0;
|
|
|
|
double old_unit_pos;
|
|
|
|
|
|
|
|
#ifdef GTKOSX
|
|
|
|
/* gtk update probs require this (damn) */
|
|
|
|
meter_label.hide();
|
|
|
|
tempo_label.hide();
|
|
|
|
range_mark_label.hide();
|
|
|
|
transport_mark_label.hide();
|
|
|
|
cd_mark_label.hide();
|
|
|
|
mark_label.hide();
|
|
|
|
videotl_label.hide();
|
|
|
|
#endif
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2008-03-17 16:54:03 -04:00
|
|
|
if (ruler_minsec_action->get_active()) {
|
2014-06-11 23:54:04 -04:00
|
|
|
old_unit_pos = minsec_ruler->position().y;
|
|
|
|
if (tbpos != old_unit_pos) {
|
|
|
|
minsec_ruler->move (ArdourCanvas::Duple (0.0, tbpos - old_unit_pos));
|
|
|
|
}
|
|
|
|
minsec_ruler->show();
|
|
|
|
minsec_label.show();
|
|
|
|
tbpos += timebar_height;
|
|
|
|
tbgpos += timebar_height;
|
|
|
|
visible_timebars++;
|
2008-10-22 02:41:51 -04:00
|
|
|
} else {
|
2014-06-11 23:54:04 -04:00
|
|
|
minsec_ruler->hide();
|
|
|
|
minsec_label.hide();
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2008-03-17 16:54:03 -04:00
|
|
|
if (ruler_timecode_action->get_active()) {
|
2014-06-11 23:54:04 -04:00
|
|
|
old_unit_pos = timecode_ruler->position().y;
|
|
|
|
if (tbpos != old_unit_pos) {
|
|
|
|
timecode_ruler->move (ArdourCanvas::Duple (0.0, tbpos - old_unit_pos));
|
|
|
|
}
|
|
|
|
timecode_ruler->show();
|
|
|
|
timecode_label.show();
|
|
|
|
tbpos += timebar_height;
|
|
|
|
tbgpos += timebar_height;
|
|
|
|
visible_timebars++;
|
2008-10-22 02:41:51 -04:00
|
|
|
} else {
|
2014-06-11 23:54:04 -04:00
|
|
|
timecode_ruler->hide();
|
|
|
|
timecode_label.hide();
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2011-01-18 07:51:02 -05:00
|
|
|
if (ruler_samples_action->get_active()) {
|
2014-06-11 23:54:04 -04:00
|
|
|
old_unit_pos = samples_ruler->position().y;
|
|
|
|
if (tbpos != old_unit_pos) {
|
|
|
|
samples_ruler->move (ArdourCanvas::Duple (0.0, tbpos - old_unit_pos));
|
|
|
|
}
|
|
|
|
samples_ruler->show();
|
|
|
|
samples_label.show();
|
|
|
|
tbpos += timebar_height;
|
|
|
|
tbgpos += timebar_height;
|
|
|
|
visible_timebars++;
|
2008-10-22 02:41:51 -04:00
|
|
|
} else {
|
2014-06-11 23:54:04 -04:00
|
|
|
samples_ruler->hide();
|
|
|
|
samples_label.hide();
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2008-03-17 16:54:03 -04:00
|
|
|
if (ruler_bbt_action->get_active()) {
|
2014-06-11 23:54:04 -04:00
|
|
|
old_unit_pos = bbt_ruler->position().y;
|
|
|
|
if (tbpos != old_unit_pos) {
|
|
|
|
bbt_ruler->move (ArdourCanvas::Duple (0.0, tbpos - old_unit_pos));
|
|
|
|
}
|
|
|
|
bbt_ruler->show();
|
|
|
|
bbt_label.show();
|
|
|
|
tbpos += timebar_height;
|
|
|
|
tbgpos += timebar_height;
|
|
|
|
visible_timebars++;
|
2008-10-22 02:41:51 -04:00
|
|
|
} else {
|
2014-06-11 23:54:04 -04:00
|
|
|
bbt_ruler->hide();
|
|
|
|
bbt_label.hide();
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2008-10-22 02:41:51 -04:00
|
|
|
if (ruler_meter_action->get_active()) {
|
2013-04-04 00:32:52 -04:00
|
|
|
old_unit_pos = meter_group->position().y;
|
2005-09-25 14:42:24 -04:00
|
|
|
if (tbpos != old_unit_pos) {
|
2013-04-04 00:32:52 -04:00
|
|
|
meter_group->move (ArdourCanvas::Duple (0.0, tbpos - old_unit_pos));
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2005-10-28 18:19:45 -04:00
|
|
|
meter_group->show();
|
2008-10-22 02:41:51 -04:00
|
|
|
meter_label.show();
|
2005-09-25 14:42:24 -04:00
|
|
|
tbpos += timebar_height;
|
2008-09-10 17:27:39 -04:00
|
|
|
tbgpos += timebar_height;
|
2005-09-25 14:42:24 -04:00
|
|
|
visible_timebars++;
|
2008-09-10 17:27:39 -04:00
|
|
|
} else {
|
2005-10-28 18:19:45 -04:00
|
|
|
meter_group->hide();
|
2008-10-22 02:41:51 -04:00
|
|
|
meter_label.hide();
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-03-17 16:54:03 -04:00
|
|
|
if (ruler_tempo_action->get_active()) {
|
2013-04-04 00:32:52 -04:00
|
|
|
old_unit_pos = tempo_group->position().y;
|
2005-09-25 14:42:24 -04:00
|
|
|
if (tbpos != old_unit_pos) {
|
2013-04-04 00:32:52 -04:00
|
|
|
tempo_group->move (ArdourCanvas::Duple (0.0, tbpos - old_unit_pos));
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2005-10-28 18:19:45 -04:00
|
|
|
tempo_group->show();
|
2008-10-22 02:41:51 -04:00
|
|
|
tempo_label.show();
|
2005-09-25 14:42:24 -04:00
|
|
|
tbpos += timebar_height;
|
2008-09-10 17:27:39 -04:00
|
|
|
tbgpos += timebar_height;
|
2005-09-25 14:42:24 -04:00
|
|
|
visible_timebars++;
|
2008-09-10 17:27:39 -04:00
|
|
|
} else {
|
2005-10-28 18:19:45 -04:00
|
|
|
tempo_group->hide();
|
2008-10-22 02:41:51 -04:00
|
|
|
tempo_label.hide();
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-03-17 16:54:03 -04:00
|
|
|
if (!Profile->get_sae() && ruler_range_action->get_active()) {
|
2013-04-04 00:32:52 -04:00
|
|
|
old_unit_pos = range_marker_group->position().y;
|
2005-09-25 14:42:24 -04:00
|
|
|
if (tbpos != old_unit_pos) {
|
2013-04-04 00:32:52 -04:00
|
|
|
range_marker_group->move (ArdourCanvas::Duple (0.0, tbpos - old_unit_pos));
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2005-10-28 18:19:45 -04:00
|
|
|
range_marker_group->show();
|
2008-10-22 02:41:51 -04:00
|
|
|
range_mark_label.show();
|
2008-12-08 12:09:57 -05:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
tbpos += timebar_height;
|
2008-09-10 17:27:39 -04:00
|
|
|
tbgpos += timebar_height;
|
2005-09-25 14:42:24 -04:00
|
|
|
visible_timebars++;
|
2008-01-10 16:20:59 -05:00
|
|
|
} else {
|
2005-10-28 18:19:45 -04:00
|
|
|
range_marker_group->hide();
|
2008-10-22 02:41:51 -04:00
|
|
|
range_mark_label.hide();
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2008-03-17 16:54:03 -04:00
|
|
|
if (ruler_loop_punch_action->get_active()) {
|
2013-04-04 00:32:52 -04:00
|
|
|
old_unit_pos = transport_marker_group->position().y;
|
2005-09-25 14:42:24 -04:00
|
|
|
if (tbpos != old_unit_pos) {
|
2013-04-04 00:32:52 -04:00
|
|
|
transport_marker_group->move (ArdourCanvas::Duple (0.0, tbpos - old_unit_pos));
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2005-10-28 18:19:45 -04:00
|
|
|
transport_marker_group->show();
|
2008-10-22 02:41:51 -04:00
|
|
|
transport_mark_label.show();
|
2005-09-25 14:42:24 -04:00
|
|
|
tbpos += timebar_height;
|
2008-09-10 17:27:39 -04:00
|
|
|
tbgpos += timebar_height;
|
2005-09-25 14:42:24 -04:00
|
|
|
visible_timebars++;
|
2008-09-10 17:27:39 -04:00
|
|
|
} else {
|
2005-10-28 18:19:45 -04:00
|
|
|
transport_marker_group->hide();
|
2008-10-22 02:41:51 -04:00
|
|
|
transport_mark_label.hide();
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2008-01-10 16:20:59 -05:00
|
|
|
|
2008-03-17 16:54:03 -04:00
|
|
|
if (ruler_cd_marker_action->get_active()) {
|
2013-04-04 00:32:52 -04:00
|
|
|
old_unit_pos = cd_marker_group->position().y;
|
2008-01-10 16:20:59 -05:00
|
|
|
if (tbpos != old_unit_pos) {
|
2013-04-04 00:32:52 -04:00
|
|
|
cd_marker_group->move (ArdourCanvas::Duple (0.0, tbpos - old_unit_pos));
|
2008-01-10 16:20:59 -05:00
|
|
|
}
|
|
|
|
cd_marker_group->show();
|
2008-10-22 02:41:51 -04:00
|
|
|
cd_mark_label.show();
|
2008-01-10 16:20:59 -05:00
|
|
|
tbpos += timebar_height;
|
2008-09-10 17:27:39 -04:00
|
|
|
tbgpos += timebar_height;
|
2008-01-10 16:20:59 -05:00
|
|
|
visible_timebars++;
|
|
|
|
// make sure all cd markers show up in their respective places
|
|
|
|
update_cd_marker_display();
|
2008-09-10 17:27:39 -04:00
|
|
|
} else {
|
2008-01-10 16:20:59 -05:00
|
|
|
cd_marker_group->hide();
|
2008-10-22 02:41:51 -04:00
|
|
|
cd_mark_label.hide();
|
2008-01-10 16:20:59 -05:00
|
|
|
// make sure all cd markers show up in their respective places
|
|
|
|
update_cd_marker_display();
|
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-03-17 16:54:03 -04:00
|
|
|
if (ruler_marker_action->get_active()) {
|
2013-04-04 00:32:52 -04:00
|
|
|
old_unit_pos = marker_group->position().y;
|
2007-11-12 17:23:01 -05:00
|
|
|
if (tbpos != old_unit_pos) {
|
2013-04-04 00:32:52 -04:00
|
|
|
marker_group->move (ArdourCanvas::Duple (0.0, tbpos - old_unit_pos));
|
2007-11-12 17:23:01 -05:00
|
|
|
}
|
|
|
|
marker_group->show();
|
2008-10-22 02:41:51 -04:00
|
|
|
mark_label.show();
|
2007-11-12 17:23:01 -05:00
|
|
|
tbpos += timebar_height;
|
2008-09-10 17:27:39 -04:00
|
|
|
tbgpos += timebar_height;
|
2007-11-12 17:23:01 -05:00
|
|
|
visible_timebars++;
|
2008-09-10 17:27:39 -04:00
|
|
|
} else {
|
2007-11-12 17:23:01 -05:00
|
|
|
marker_group->hide();
|
2008-10-22 02:41:51 -04:00
|
|
|
mark_label.hide();
|
2007-11-12 17:23:01 -05:00
|
|
|
}
|
2008-10-22 02:41:51 -04:00
|
|
|
|
2013-03-12 17:00:09 -04:00
|
|
|
if (ruler_video_action->get_active()) {
|
2013-04-05 22:09:58 -04:00
|
|
|
old_unit_pos = videotl_group->position().y;
|
2013-03-12 17:00:09 -04:00
|
|
|
if (tbpos != old_unit_pos) {
|
2013-04-05 22:09:58 -04:00
|
|
|
videotl_group->move (ArdourCanvas::Duple (0.0, tbpos - old_unit_pos));
|
2013-03-12 17:00:09 -04:00
|
|
|
}
|
|
|
|
videotl_group->show();
|
|
|
|
videotl_label.show();
|
|
|
|
tbpos += timebar_height * videotl_bar_height;
|
|
|
|
tbgpos += timebar_height * videotl_bar_height;
|
|
|
|
visible_timebars+=videotl_bar_height;
|
2014-02-25 11:55:37 -05:00
|
|
|
queue_visual_videotimeline_update();
|
2013-03-12 17:00:09 -04:00
|
|
|
} else {
|
|
|
|
videotl_group->hide();
|
|
|
|
videotl_label.hide();
|
2014-02-25 11:55:37 -05:00
|
|
|
update_video_timeline(true);
|
2013-03-12 17:00:09 -04:00
|
|
|
}
|
|
|
|
|
2014-06-11 23:54:04 -04:00
|
|
|
time_bars_vbox.set_size_request (-1, (int)(timebar_height * visible_timebars));
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
|
2014-06-11 23:54:04 -04:00
|
|
|
/* move hv_scroll_group (trackviews) to the end of the timebars
|
|
|
|
*/
|
2014-05-21 19:15:08 -04:00
|
|
|
|
|
|
|
hv_scroll_group->set_y_position (timebar_height * visible_timebars);
|
|
|
|
|
2011-01-14 19:59:58 -05:00
|
|
|
compute_fixed_ruler_scale ();
|
2008-10-22 02:41:51 -04:00
|
|
|
update_fixed_rulers();
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
redisplay_tempo (false);
|
2010-11-11 10:21:37 -05:00
|
|
|
|
|
|
|
/* Changing ruler visibility means that any lines on markers might need updating */
|
|
|
|
for (LocationMarkerMap::iterator i = location_markers.begin(); i != location_markers.end(); ++i) {
|
|
|
|
i->second->setup_lines ();
|
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2009-10-26 10:38:58 -04:00
|
|
|
Editor::update_just_timecode ()
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2009-12-11 18:29:48 -05:00
|
|
|
ENSURE_GUI_THREAD (*this, &Editor::update_just_timecode)
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2009-12-17 13:24:23 -05:00
|
|
|
if (_session == 0) {
|
2005-09-25 14:42:24 -04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-04-12 11:21:12 -04:00
|
|
|
framepos_t rightmost_frame = leftmost_frame + current_page_samples();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2008-03-17 16:54:03 -04:00
|
|
|
if (ruler_timecode_action->get_active()) {
|
2014-06-11 23:54:04 -04:00
|
|
|
timecode_ruler->set_range (leftmost_frame, rightmost_frame);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
void
|
|
|
|
Editor::compute_fixed_ruler_scale ()
|
|
|
|
{
|
2009-12-17 13:24:23 -05:00
|
|
|
if (_session == 0) {
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2008-03-17 16:54:03 -04:00
|
|
|
if (ruler_timecode_action->get_active()) {
|
2013-04-12 11:21:12 -04:00
|
|
|
set_timecode_ruler_scale (leftmost_frame, leftmost_frame + current_page_samples());
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-03-17 16:54:03 -04:00
|
|
|
if (ruler_minsec_action->get_active()) {
|
2013-04-12 11:21:12 -04:00
|
|
|
set_minsec_ruler_scale (leftmost_frame, leftmost_frame + current_page_samples());
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
}
|
2011-01-17 20:00:27 -05:00
|
|
|
|
2011-01-18 07:51:02 -05:00
|
|
|
if (ruler_samples_action->get_active()) {
|
2013-04-12 11:21:12 -04:00
|
|
|
set_samples_ruler_scale (leftmost_frame, leftmost_frame + current_page_samples());
|
2011-01-17 20:00:27 -05:00
|
|
|
}
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
}
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
void
|
|
|
|
Editor::update_fixed_rulers ()
|
|
|
|
{
|
2010-09-17 14:20:37 -04:00
|
|
|
framepos_t rightmost_frame;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-12-17 13:24:23 -05:00
|
|
|
if (_session == 0) {
|
2005-09-25 14:42:24 -04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2012-10-18 11:38:04 -04:00
|
|
|
compute_fixed_ruler_scale ();
|
|
|
|
|
2014-06-11 23:54:04 -04:00
|
|
|
_timecode_metric->units_per_pixel = samples_per_pixel;
|
|
|
|
_samples_metric->units_per_pixel = samples_per_pixel;
|
|
|
|
_minsec_metric->units_per_pixel = samples_per_pixel;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2013-04-12 11:21:12 -04:00
|
|
|
rightmost_frame = leftmost_frame + current_page_samples();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
/* these force a redraw, which in turn will force execution of the metric callbacks
|
|
|
|
to compute the relevant ticks to display.
|
|
|
|
*/
|
|
|
|
|
2008-03-17 16:54:03 -04:00
|
|
|
if (ruler_timecode_action->get_active()) {
|
2014-06-11 23:54:04 -04:00
|
|
|
timecode_ruler->set_range (leftmost_frame, rightmost_frame);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2011-01-18 07:51:02 -05:00
|
|
|
if (ruler_samples_action->get_active()) {
|
2014-06-11 23:54:04 -04:00
|
|
|
samples_ruler->set_range (leftmost_frame, rightmost_frame);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-03-17 16:54:03 -04:00
|
|
|
if (ruler_minsec_action->get_active()) {
|
2014-06-11 23:54:04 -04:00
|
|
|
minsec_ruler->set_range (leftmost_frame, rightmost_frame);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
void
|
2012-11-27 17:48:59 -05:00
|
|
|
Editor::update_tempo_based_rulers (ARDOUR::TempoMap::BBTPointList::const_iterator& begin,
|
|
|
|
ARDOUR::TempoMap::BBTPointList::const_iterator& end)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2009-12-17 13:24:23 -05:00
|
|
|
if (_session == 0) {
|
2005-09-25 14:42:24 -04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-04-12 11:21:12 -04:00
|
|
|
compute_bbt_ruler_scale (leftmost_frame, leftmost_frame+current_page_samples(),
|
2012-11-27 19:18:10 -05:00
|
|
|
begin, end);
|
|
|
|
|
2014-06-11 23:54:04 -04:00
|
|
|
_bbt_metric->units_per_pixel = samples_per_pixel;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-03-17 16:54:03 -04:00
|
|
|
if (ruler_bbt_action->get_active()) {
|
2014-06-11 23:54:04 -04:00
|
|
|
bbt_ruler->set_range (leftmost_frame, leftmost_frame+current_page_samples());
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-12-11 12:51:01 -05:00
|
|
|
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
void
|
2011-01-17 20:16:05 -05:00
|
|
|
Editor::set_timecode_ruler_scale (framepos_t lower, framepos_t upper)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2014-12-11 12:51:01 -05:00
|
|
|
using namespace std;
|
|
|
|
|
2010-09-17 14:20:37 -04:00
|
|
|
framepos_t spacer;
|
|
|
|
framepos_t fr;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-12-17 13:24:23 -05:00
|
|
|
if (_session == 0) {
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
return;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2015-10-04 14:51:05 -04:00
|
|
|
fr = _session->frame_rate();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2011-01-17 20:16:05 -05:00
|
|
|
if (lower > (spacer = (framepos_t) (128 * Editor::get_current_zoom ()))) {
|
2005-09-25 14:42:24 -04:00
|
|
|
lower = lower - spacer;
|
|
|
|
} else {
|
|
|
|
lower = 0;
|
|
|
|
}
|
2014-12-11 12:51:01 -05:00
|
|
|
|
2006-09-18 23:29:16 -04:00
|
|
|
upper = upper + spacer;
|
2011-01-17 20:16:05 -05:00
|
|
|
framecnt_t const range = upper - lower;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-12-17 13:24:23 -05:00
|
|
|
if (range < (2 * _session->frames_per_timecode_frame())) { /* 0 - 2 frames */
|
2009-10-26 10:38:58 -04:00
|
|
|
timecode_ruler_scale = timecode_show_bits;
|
|
|
|
timecode_mark_modulo = 20;
|
2009-12-17 13:24:23 -05:00
|
|
|
timecode_nmarks = 2 + (2 * _session->config.get_subframes_per_frame());
|
2005-09-25 14:42:24 -04:00
|
|
|
} else if (range <= (fr / 4)) { /* 2 frames - 0.250 second */
|
2009-10-26 10:38:58 -04:00
|
|
|
timecode_ruler_scale = timecode_show_frames;
|
|
|
|
timecode_mark_modulo = 1;
|
2010-09-17 14:20:37 -04:00
|
|
|
timecode_nmarks = 2 + (range / (framepos_t)_session->frames_per_timecode_frame());
|
2005-09-25 14:42:24 -04:00
|
|
|
} else if (range <= (fr / 2)) { /* 0.25-0.5 second */
|
2009-10-26 10:38:58 -04:00
|
|
|
timecode_ruler_scale = timecode_show_frames;
|
|
|
|
timecode_mark_modulo = 2;
|
2010-09-17 14:20:37 -04:00
|
|
|
timecode_nmarks = 2 + (range / (framepos_t)_session->frames_per_timecode_frame());
|
2005-09-25 14:42:24 -04:00
|
|
|
} else if (range <= fr) { /* 0.5-1 second */
|
2009-10-26 10:38:58 -04:00
|
|
|
timecode_ruler_scale = timecode_show_frames;
|
|
|
|
timecode_mark_modulo = 5;
|
2010-09-17 14:20:37 -04:00
|
|
|
timecode_nmarks = 2 + (range / (framepos_t)_session->frames_per_timecode_frame());
|
2005-09-25 14:42:24 -04:00
|
|
|
} else if (range <= 2 * fr) { /* 1-2 seconds */
|
2009-10-26 10:38:58 -04:00
|
|
|
timecode_ruler_scale = timecode_show_frames;
|
|
|
|
timecode_mark_modulo = 10;
|
2010-09-17 14:20:37 -04:00
|
|
|
timecode_nmarks = 2 + (range / (framepos_t)_session->frames_per_timecode_frame());
|
2005-09-25 14:42:24 -04:00
|
|
|
} else if (range <= 8 * fr) { /* 2-8 seconds */
|
2009-10-26 10:38:58 -04:00
|
|
|
timecode_ruler_scale = timecode_show_seconds;
|
|
|
|
timecode_mark_modulo = 1;
|
|
|
|
timecode_nmarks = 2 + (range / fr);
|
2005-09-25 14:42:24 -04:00
|
|
|
} else if (range <= 16 * fr) { /* 8-16 seconds */
|
2009-10-26 10:38:58 -04:00
|
|
|
timecode_ruler_scale = timecode_show_seconds;
|
|
|
|
timecode_mark_modulo = 2;
|
|
|
|
timecode_nmarks = 2 + (range / fr);
|
2005-09-25 14:42:24 -04:00
|
|
|
} else if (range <= 30 * fr) { /* 16-30 seconds */
|
2009-10-26 10:38:58 -04:00
|
|
|
timecode_ruler_scale = timecode_show_seconds;
|
|
|
|
timecode_mark_modulo = 5;
|
|
|
|
timecode_nmarks = 2 + (range / fr);
|
2005-09-25 14:42:24 -04:00
|
|
|
} else if (range <= 60 * fr) { /* 30-60 seconds */
|
2009-10-26 10:38:58 -04:00
|
|
|
timecode_ruler_scale = timecode_show_seconds;
|
|
|
|
timecode_mark_modulo = 5;
|
|
|
|
timecode_nmarks = 2 + (range / fr);
|
2005-09-25 14:42:24 -04:00
|
|
|
} else if (range <= 2 * 60 * fr) { /* 1-2 minutes */
|
2009-10-26 10:38:58 -04:00
|
|
|
timecode_ruler_scale = timecode_show_seconds;
|
|
|
|
timecode_mark_modulo = 15;
|
|
|
|
timecode_nmarks = 2 + (range / fr);
|
2005-09-25 14:42:24 -04:00
|
|
|
} else if (range <= 4 * 60 * fr) { /* 2-4 minutes */
|
2009-10-26 10:38:58 -04:00
|
|
|
timecode_ruler_scale = timecode_show_seconds;
|
|
|
|
timecode_mark_modulo = 30;
|
|
|
|
timecode_nmarks = 2 + (range / fr);
|
2005-09-25 14:42:24 -04:00
|
|
|
} else if (range <= 10 * 60 * fr) { /* 4-10 minutes */
|
2009-10-26 10:38:58 -04:00
|
|
|
timecode_ruler_scale = timecode_show_minutes;
|
|
|
|
timecode_mark_modulo = 2;
|
|
|
|
timecode_nmarks = 2 + 10;
|
2005-09-25 14:42:24 -04:00
|
|
|
} else if (range <= 30 * 60 * fr) { /* 10-30 minutes */
|
2009-10-26 10:38:58 -04:00
|
|
|
timecode_ruler_scale = timecode_show_minutes;
|
|
|
|
timecode_mark_modulo = 5;
|
|
|
|
timecode_nmarks = 2 + 30;
|
2005-09-25 14:42:24 -04:00
|
|
|
} else if (range <= 60 * 60 * fr) { /* 30 minutes - 1hr */
|
2009-10-26 10:38:58 -04:00
|
|
|
timecode_ruler_scale = timecode_show_minutes;
|
|
|
|
timecode_mark_modulo = 10;
|
|
|
|
timecode_nmarks = 2 + 60;
|
2005-09-25 14:42:24 -04:00
|
|
|
} else if (range <= 4 * 60 * 60 * fr) { /* 1 - 4 hrs*/
|
2009-10-26 10:38:58 -04:00
|
|
|
timecode_ruler_scale = timecode_show_minutes;
|
|
|
|
timecode_mark_modulo = 30;
|
|
|
|
timecode_nmarks = 2 + (60 * 4);
|
2005-09-25 14:42:24 -04:00
|
|
|
} else if (range <= 8 * 60 * 60 * fr) { /* 4 - 8 hrs*/
|
2009-10-26 10:38:58 -04:00
|
|
|
timecode_ruler_scale = timecode_show_hours;
|
|
|
|
timecode_mark_modulo = 1;
|
2015-10-04 14:51:05 -04:00
|
|
|
timecode_nmarks = 2 + 8;
|
2005-09-25 14:42:24 -04:00
|
|
|
} else if (range <= 16 * 60 * 60 * fr) { /* 16-24 hrs*/
|
2009-10-26 10:38:58 -04:00
|
|
|
timecode_ruler_scale = timecode_show_hours;
|
|
|
|
timecode_mark_modulo = 1;
|
|
|
|
timecode_nmarks = 2 + 24;
|
2005-09-25 14:42:24 -04:00
|
|
|
} else {
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2014-12-11 12:51:01 -05:00
|
|
|
const framecnt_t hours_in_range = range / (60 * 60 * fr);
|
2014-12-21 11:53:15 -05:00
|
|
|
const int text_width_rough_guess = 120; /* pixels, very very approximate guess at how wide the tick mark text is */
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2014-12-11 12:51:01 -05:00
|
|
|
/* Normally we do not need to know anything about the width of the canvas
|
|
|
|
to set the ruler scale, because the caller has already determined
|
|
|
|
the width and set lower + upper arguments to this function to match that.
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2014-12-11 12:51:01 -05:00
|
|
|
But in this case, where the range defined by lower and uppper can vary
|
|
|
|
substantially (basically anything from 24hrs+ to several billion years)
|
2015-10-04 14:51:05 -04:00
|
|
|
trying to decide which tick marks to show does require us to know
|
2014-12-11 12:51:01 -05:00
|
|
|
about the available width.
|
|
|
|
*/
|
|
|
|
|
|
|
|
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));
|
|
|
|
}
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
}
|
|
|
|
|
2014-06-11 23:54:04 -04:00
|
|
|
void
|
|
|
|
Editor::metric_get_timecode (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdouble lower, gdouble /*upper*/, gint /*maxchars*/)
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
{
|
2010-09-17 12:24:22 -04:00
|
|
|
framepos_t pos;
|
|
|
|
framecnt_t spacer;
|
2009-10-26 10:38:58 -04:00
|
|
|
Timecode::Time timecode;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
gchar buf[16];
|
|
|
|
gint n;
|
2014-06-11 23:54:04 -04:00
|
|
|
ArdourCanvas::Ruler::Mark mark;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
|
2009-12-17 13:24:23 -05:00
|
|
|
if (_session == 0) {
|
2014-06-11 23:54:04 -04:00
|
|
|
return;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
}
|
|
|
|
|
2010-09-17 12:24:22 -04:00
|
|
|
if (lower > (spacer = (framecnt_t)(128 * Editor::get_current_zoom ()))) {
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
lower = lower - spacer;
|
|
|
|
} else {
|
|
|
|
lower = 0;
|
|
|
|
}
|
|
|
|
|
2010-12-03 17:26:29 -05:00
|
|
|
pos = (framecnt_t) floor (lower);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2009-10-26 10:38:58 -04:00
|
|
|
switch (timecode_ruler_scale) {
|
|
|
|
case timecode_show_bits:
|
|
|
|
// Find timecode time of this sample (pos) with subframe accuracy
|
2010-12-01 12:51:17 -05:00
|
|
|
_session->sample_to_timecode(pos, timecode, true /* use_offset */, true /* use_subframes */ );
|
2009-10-26 10:38:58 -04:00
|
|
|
for (n = 0; n < timecode_nmarks; n++) {
|
2010-12-01 12:51:17 -05:00
|
|
|
_session->timecode_to_sample(timecode, pos, true /* use_offset */, true /* use_subframes */ );
|
2009-10-26 10:38:58 -04:00
|
|
|
if ((timecode.subframes % timecode_mark_modulo) == 0) {
|
|
|
|
if (timecode.subframes == 0) {
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Major;
|
2014-12-21 11:53:15 -05:00
|
|
|
snprintf (buf, sizeof(buf), "%s%02u:%02u:%02u:%02u", timecode.negative ? "-" : "", timecode.hours, timecode.minutes, timecode.seconds, timecode.frames);
|
2005-09-25 14:42:24 -04:00
|
|
|
} else {
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Minor;
|
2009-10-26 10:38:58 -04:00
|
|
|
snprintf (buf, sizeof(buf), ".%02u", timecode.subframes);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
snprintf (buf, sizeof(buf)," ");
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Micro;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.label = buf;
|
|
|
|
mark.position = pos;
|
|
|
|
marks.push_back (mark);
|
2005-09-25 14:42:24 -04:00
|
|
|
// Increment subframes by one
|
2009-12-17 13:24:23 -05:00
|
|
|
Timecode::increment_subframes( timecode, _session->config.get_subframes_per_frame() );
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2014-12-21 11:53:15 -05:00
|
|
|
break;
|
|
|
|
|
|
|
|
case timecode_show_frames:
|
|
|
|
// 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 );
|
|
|
|
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) {
|
|
|
|
if (timecode.frames == 0) {
|
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Major;
|
|
|
|
} else {
|
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Minor;
|
|
|
|
}
|
|
|
|
mark.position = pos;
|
|
|
|
snprintf (buf, sizeof(buf), "%s%02u:%02u:%02u:%02u", timecode.negative ? "-" : "", timecode.hours, timecode.minutes, timecode.seconds, timecode.frames);
|
|
|
|
} else {
|
|
|
|
snprintf (buf, sizeof(buf)," ");
|
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Micro;
|
|
|
|
mark.position = pos;
|
|
|
|
}
|
|
|
|
mark.label = buf;
|
|
|
|
marks.push_back (mark);
|
|
|
|
Timecode::increment( timecode, _session->config.get_subframes_per_frame() );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2009-10-26 10:38:58 -04:00
|
|
|
case timecode_show_seconds:
|
|
|
|
// Find timecode time of this sample (pos)
|
2010-12-01 12:51:17 -05:00
|
|
|
_session->sample_to_timecode(pos, timecode, true /* use_offset */, false /* use_subframes */ );
|
2005-09-25 14:42:24 -04:00
|
|
|
// Go to next whole second down
|
2009-10-26 10:38:58 -04:00
|
|
|
Timecode::seconds_floor( timecode );
|
|
|
|
for (n = 0; n < timecode_nmarks; n++) {
|
2010-12-01 12:51:17 -05:00
|
|
|
_session->timecode_to_sample(timecode, pos, true /* use_offset */, false /* use_subframes */ );
|
2009-10-26 10:38:58 -04:00
|
|
|
if ((timecode.seconds % timecode_mark_modulo) == 0) {
|
|
|
|
if (timecode.seconds == 0) {
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Major;
|
|
|
|
mark.position = pos;
|
2005-09-25 14:42:24 -04:00
|
|
|
} else {
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Minor;
|
|
|
|
mark.position = pos;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2014-12-21 11:53:15 -05:00
|
|
|
snprintf (buf, sizeof(buf), "%s%02u:%02u:%02u:%02u", timecode.negative ? "-" : "", timecode.hours, timecode.minutes, timecode.seconds, timecode.frames);
|
2005-09-25 14:42:24 -04:00
|
|
|
} else {
|
|
|
|
snprintf (buf, sizeof(buf)," ");
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Micro;
|
|
|
|
mark.position = pos;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.label = buf;
|
|
|
|
marks.push_back (mark);
|
2009-12-17 13:24:23 -05:00
|
|
|
Timecode::increment_seconds( timecode, _session->config.get_subframes_per_frame() );
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2014-12-21 11:53:15 -05:00
|
|
|
break;
|
|
|
|
|
2009-10-26 10:38:58 -04:00
|
|
|
case timecode_show_minutes:
|
2014-12-21 11:53:15 -05:00
|
|
|
//Find timecode time of this sample (pos)
|
2010-12-01 12:51:17 -05:00
|
|
|
_session->sample_to_timecode(pos, timecode, true /* use_offset */, false /* use_subframes */ );
|
2005-09-25 14:42:24 -04:00
|
|
|
// Go to next whole minute down
|
2009-10-26 10:38:58 -04:00
|
|
|
Timecode::minutes_floor( timecode );
|
|
|
|
for (n = 0; n < timecode_nmarks; n++) {
|
2010-12-01 12:51:17 -05:00
|
|
|
_session->timecode_to_sample(timecode, pos, true /* use_offset */, false /* use_subframes */ );
|
2009-10-26 10:38:58 -04:00
|
|
|
if ((timecode.minutes % timecode_mark_modulo) == 0) {
|
|
|
|
if (timecode.minutes == 0) {
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Major;
|
2005-09-25 14:42:24 -04:00
|
|
|
} else {
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Minor;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2014-12-21 11:53:15 -05:00
|
|
|
snprintf (buf, sizeof(buf), "%s%02u:%02u:%02u:%02u", timecode.negative ? "-" : "", timecode.hours, timecode.minutes, timecode.seconds, timecode.frames);
|
2005-09-25 14:42:24 -04:00
|
|
|
} else {
|
|
|
|
snprintf (buf, sizeof(buf)," ");
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Micro;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.label = buf;
|
|
|
|
mark.position = pos;
|
|
|
|
marks.push_back (mark);
|
2009-12-17 13:24:23 -05:00
|
|
|
Timecode::increment_minutes( timecode, _session->config.get_subframes_per_frame() );
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2014-12-21 11:53:15 -05:00
|
|
|
break;
|
2009-10-26 10:38:58 -04:00
|
|
|
case timecode_show_hours:
|
|
|
|
// Find timecode time of this sample (pos)
|
2010-12-01 12:51:17 -05:00
|
|
|
_session->sample_to_timecode(pos, timecode, true /* use_offset */, false /* use_subframes */ );
|
2005-09-25 14:42:24 -04:00
|
|
|
// Go to next whole hour down
|
2009-10-26 10:38:58 -04:00
|
|
|
Timecode::hours_floor( timecode );
|
|
|
|
for (n = 0; n < timecode_nmarks; n++) {
|
2010-12-01 12:51:17 -05:00
|
|
|
_session->timecode_to_sample(timecode, pos, true /* use_offset */, false /* use_subframes */ );
|
2009-10-26 10:38:58 -04:00
|
|
|
if ((timecode.hours % timecode_mark_modulo) == 0) {
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Major;
|
2014-12-21 11:53:15 -05:00
|
|
|
snprintf (buf, sizeof(buf), "%s%02u:%02u:%02u:%02u", timecode.negative ? "-" : "", timecode.hours, timecode.minutes, timecode.seconds, timecode.frames);
|
2005-09-25 14:42:24 -04:00
|
|
|
} else {
|
|
|
|
snprintf (buf, sizeof(buf)," ");
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Micro;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.label = buf;
|
|
|
|
mark.position = pos;
|
|
|
|
marks.push_back (mark);
|
2014-12-21 11:53:15 -05:00
|
|
|
Timecode::increment_hours( timecode, _session->config.get_subframes_per_frame() );
|
2014-12-11 12:51:01 -05:00
|
|
|
}
|
2014-12-21 11:53:15 -05:00
|
|
|
break;
|
2014-12-11 12:51:01 -05:00
|
|
|
case timecode_show_many_hours:
|
|
|
|
// Find timecode time of this sample (pos)
|
|
|
|
_session->sample_to_timecode(pos, timecode, true /* use_offset */, false /* use_subframes */ );
|
|
|
|
// Go to next whole hour down
|
|
|
|
Timecode::hours_floor (timecode);
|
|
|
|
|
|
|
|
for (n = 0; n < timecode_nmarks; ) {
|
|
|
|
_session->timecode_to_sample(timecode, pos, true /* use_offset */, false /* use_subframes */ );
|
|
|
|
if ((timecode.hours % timecode_mark_modulo) == 0) {
|
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Major;
|
2014-12-21 11:53:15 -05:00
|
|
|
snprintf (buf, sizeof(buf), "%s%02u:%02u:%02u:%02u", timecode.negative ? "-" : "", timecode.hours, timecode.minutes, timecode.seconds, timecode.frames);
|
2014-12-11 12:51:01 -05:00
|
|
|
mark.label = buf;
|
|
|
|
mark.position = pos;
|
|
|
|
marks.push_back (mark);
|
|
|
|
++n;
|
2015-10-04 14:51:05 -04:00
|
|
|
}
|
2014-12-11 12:51:01 -05:00
|
|
|
/* can't use Timecode::increment_hours() here because we may be traversing thousands of hours
|
|
|
|
and doing it 1 hour at a time is just stupid (and slow).
|
|
|
|
*/
|
|
|
|
timecode.hours += timecode_mark_modulo;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2014-12-21 11:53:15 -05:00
|
|
|
break;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
void
|
2012-11-27 17:48:59 -05:00
|
|
|
Editor::compute_bbt_ruler_scale (framepos_t lower, framepos_t upper,
|
|
|
|
ARDOUR::TempoMap::BBTPointList::const_iterator begin,
|
|
|
|
ARDOUR::TempoMap::BBTPointList::const_iterator end)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2010-12-14 13:13:37 -05:00
|
|
|
if (_session == 0) {
|
|
|
|
return;
|
|
|
|
}
|
2012-01-03 13:43:58 -05:00
|
|
|
|
|
|
|
TempoMap::BBTPointList::const_iterator i;
|
2010-12-14 13:13:37 -05:00
|
|
|
Timecode::BBT_Time lower_beat, upper_beat; // the beats at each end of the ruler
|
2006-09-18 23:29:16 -04:00
|
|
|
|
2010-12-14 13:13:37 -05:00
|
|
|
_session->bbt_time (lower, lower_beat);
|
|
|
|
_session->bbt_time (upper, upper_beat);
|
|
|
|
uint32_t beats = 0;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
bbt_accent_modulo = 1;
|
|
|
|
bbt_bar_helper_on = false;
|
2010-12-14 13:13:37 -05:00
|
|
|
bbt_bars = 0;
|
|
|
|
bbt_nmarks = 1;
|
2006-09-18 23:29:16 -04:00
|
|
|
|
2014-12-11 12:51:01 -05:00
|
|
|
bbt_ruler_scale = bbt_show_many;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2009-10-26 19:43:04 -04:00
|
|
|
switch (_snap_type) {
|
2010-05-24 20:35:53 -04:00
|
|
|
case SnapToBeatDiv2:
|
|
|
|
bbt_beat_subdivision = 2;
|
|
|
|
break;
|
2010-05-13 14:51:59 -04:00
|
|
|
case SnapToBeatDiv3:
|
2005-09-25 14:42:24 -04:00
|
|
|
bbt_beat_subdivision = 3;
|
2006-09-18 23:29:16 -04:00
|
|
|
break;
|
2010-05-13 14:51:59 -04:00
|
|
|
case SnapToBeatDiv4:
|
2005-09-25 14:42:24 -04:00
|
|
|
bbt_beat_subdivision = 4;
|
2006-09-18 23:29:16 -04:00
|
|
|
break;
|
2010-05-24 20:35:53 -04:00
|
|
|
case SnapToBeatDiv5:
|
|
|
|
bbt_beat_subdivision = 5;
|
|
|
|
bbt_accent_modulo = 2; // XXX YIKES
|
|
|
|
break;
|
|
|
|
case SnapToBeatDiv6:
|
|
|
|
bbt_beat_subdivision = 6;
|
|
|
|
bbt_accent_modulo = 2; // XXX YIKES
|
|
|
|
break;
|
|
|
|
case SnapToBeatDiv7:
|
|
|
|
bbt_beat_subdivision = 7;
|
|
|
|
bbt_accent_modulo = 2; // XXX YIKES
|
|
|
|
break;
|
2010-05-13 14:51:59 -04:00
|
|
|
case SnapToBeatDiv8:
|
2005-09-25 14:42:24 -04:00
|
|
|
bbt_beat_subdivision = 8;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
bbt_accent_modulo = 2;
|
2006-09-18 23:29:16 -04:00
|
|
|
break;
|
2010-05-24 20:35:53 -04:00
|
|
|
case SnapToBeatDiv10:
|
|
|
|
bbt_beat_subdivision = 10;
|
|
|
|
bbt_accent_modulo = 2; // XXX YIKES
|
2010-05-13 14:51:59 -04:00
|
|
|
break;
|
2010-05-24 20:35:53 -04:00
|
|
|
case SnapToBeatDiv12:
|
|
|
|
bbt_beat_subdivision = 12;
|
|
|
|
bbt_accent_modulo = 3;
|
2010-05-13 14:51:59 -04:00
|
|
|
break;
|
|
|
|
case SnapToBeatDiv14:
|
|
|
|
bbt_beat_subdivision = 14;
|
|
|
|
bbt_accent_modulo = 3; // XXX YIKES!
|
|
|
|
break;
|
2010-05-24 20:35:53 -04:00
|
|
|
case SnapToBeatDiv16:
|
|
|
|
bbt_beat_subdivision = 16;
|
|
|
|
bbt_accent_modulo = 4;
|
2010-05-13 14:51:59 -04:00
|
|
|
break;
|
2010-08-15 06:33:31 -04:00
|
|
|
case SnapToBeatDiv20:
|
|
|
|
bbt_beat_subdivision = 20;
|
|
|
|
bbt_accent_modulo = 5;
|
|
|
|
break;
|
2010-05-24 20:35:53 -04:00
|
|
|
case SnapToBeatDiv24:
|
|
|
|
bbt_beat_subdivision = 24;
|
|
|
|
bbt_accent_modulo = 6;
|
2010-05-13 14:51:59 -04:00
|
|
|
break;
|
2010-05-24 20:35:53 -04:00
|
|
|
case SnapToBeatDiv28:
|
|
|
|
bbt_beat_subdivision = 28;
|
|
|
|
bbt_accent_modulo = 7;
|
2010-05-13 14:51:59 -04:00
|
|
|
break;
|
2010-05-24 20:35:53 -04:00
|
|
|
case SnapToBeatDiv32:
|
|
|
|
bbt_beat_subdivision = 32;
|
|
|
|
bbt_accent_modulo = 8;
|
2010-05-13 14:51:59 -04:00
|
|
|
break;
|
2012-02-14 17:15:25 -05:00
|
|
|
case SnapToBeatDiv64:
|
|
|
|
bbt_beat_subdivision = 64;
|
|
|
|
bbt_accent_modulo = 8;
|
|
|
|
break;
|
|
|
|
case SnapToBeatDiv128:
|
|
|
|
bbt_beat_subdivision = 128;
|
|
|
|
bbt_accent_modulo = 8;
|
|
|
|
break;
|
2006-09-18 23:29:16 -04:00
|
|
|
default:
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
bbt_beat_subdivision = 4;
|
2006-09-18 23:29:16 -04:00
|
|
|
break;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2012-11-27 17:48:59 -05:00
|
|
|
if (distance (begin, end) == 0) {
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
return;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2012-11-27 17:48:59 -05:00
|
|
|
i = end;
|
2006-09-18 23:29:16 -04:00
|
|
|
i--;
|
2012-11-27 17:48:59 -05:00
|
|
|
if ((*i).beat >= (*begin).beat) {
|
|
|
|
bbt_bars = (*i).bar - (*begin).bar;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
} else {
|
2012-11-27 17:48:59 -05:00
|
|
|
bbt_bars = (*i).bar - (*begin).bar - 1;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
}
|
2012-11-27 17:48:59 -05:00
|
|
|
beats = distance (begin, end) - bbt_bars;
|
2006-09-18 23:29:16 -04:00
|
|
|
|
2011-01-17 20:16:05 -05:00
|
|
|
/* Only show the bar helper if there aren't many bars on the screen */
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
if ((bbt_bars < 2) || (beats < 5)) {
|
|
|
|
bbt_bar_helper_on = true;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
if (bbt_bars > 8192) {
|
2014-12-11 12:51:01 -05:00
|
|
|
bbt_ruler_scale = bbt_show_many;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
} else if (bbt_bars > 1024) {
|
2011-01-17 20:16:05 -05:00
|
|
|
bbt_ruler_scale = bbt_show_64;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
} else if (bbt_bars > 256) {
|
2011-01-17 20:16:05 -05:00
|
|
|
bbt_ruler_scale = bbt_show_16;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
} else if (bbt_bars > 64) {
|
2011-01-17 20:16:05 -05:00
|
|
|
bbt_ruler_scale = bbt_show_4;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
} else if (bbt_bars > 10) {
|
2011-01-17 20:16:05 -05:00
|
|
|
bbt_ruler_scale = bbt_show_1;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
} else if (bbt_bars > 2) {
|
2011-01-17 20:16:05 -05:00
|
|
|
bbt_ruler_scale = bbt_show_beats;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
} else if (bbt_bars > 0) {
|
2011-01-17 20:16:05 -05:00
|
|
|
bbt_ruler_scale = bbt_show_ticks;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
} else {
|
2011-01-17 20:16:05 -05:00
|
|
|
bbt_ruler_scale = bbt_show_ticks_detail;
|
2009-10-14 12:10:01 -04:00
|
|
|
}
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-01-06 11:39:40 -05:00
|
|
|
if ((bbt_ruler_scale == bbt_show_ticks_detail) && (lower_beat.beats == upper_beat.beats) && (upper_beat.ticks - lower_beat.ticks <= Timecode::BBT_Time::ticks_per_beat / 4)) {
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
bbt_ruler_scale = bbt_show_ticks_super_detail;
|
|
|
|
}
|
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2015-10-04 14:51:05 -04:00
|
|
|
static void
|
2014-06-11 23:54:04 -04:00
|
|
|
edit_last_mark_label (std::vector<ArdourCanvas::Ruler::Mark>& marks, const std::string& newlabel)
|
|
|
|
{
|
|
|
|
ArdourCanvas::Ruler::Mark copy = marks.back();
|
|
|
|
copy.label = newlabel;
|
|
|
|
marks.pop_back ();
|
|
|
|
marks.push_back (copy);
|
2015-10-05 10:17:49 -04:00
|
|
|
}
|
2014-06-11 23:54:04 -04:00
|
|
|
|
|
|
|
void
|
|
|
|
Editor::metric_get_bbt (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdouble lower, gdouble upper, gint /*maxchars*/)
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
{
|
2010-12-14 13:13:37 -05:00
|
|
|
if (_session == 0) {
|
2014-06-11 23:54:04 -04:00
|
|
|
return;
|
2010-12-14 13:13:37 -05:00
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2012-01-03 13:43:58 -05:00
|
|
|
TempoMap::BBTPointList::const_iterator i;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
|
2010-12-14 13:13:37 -05:00
|
|
|
char buf[64];
|
|
|
|
gint n = 0;
|
2010-09-17 14:20:37 -04:00
|
|
|
framepos_t pos;
|
2010-12-14 13:13:37 -05:00
|
|
|
Timecode::BBT_Time next_beat;
|
2010-09-17 14:20:37 -04:00
|
|
|
framepos_t next_beat_pos;
|
2010-12-14 13:13:37 -05:00
|
|
|
uint32_t beats = 0;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
uint32_t tick = 0;
|
|
|
|
uint32_t skip;
|
|
|
|
uint32_t t;
|
2010-09-17 14:20:37 -04:00
|
|
|
framepos_t frame_skip;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
double frame_skip_error;
|
|
|
|
double bbt_position_of_helper;
|
|
|
|
double accumulated_error;
|
|
|
|
bool i_am_accented = false;
|
|
|
|
bool helper_active = false;
|
2014-06-11 23:54:04 -04:00
|
|
|
ArdourCanvas::Ruler::Mark mark;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
|
2012-11-27 17:48:59 -05:00
|
|
|
ARDOUR::TempoMap::BBTPointList::const_iterator begin;
|
|
|
|
ARDOUR::TempoMap::BBTPointList::const_iterator end;
|
|
|
|
|
|
|
|
compute_current_bbt_points (lower, upper, begin, end);
|
|
|
|
|
|
|
|
if (distance (begin, end) == 0) {
|
2014-06-11 23:54:04 -04:00
|
|
|
return;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
switch (bbt_ruler_scale) {
|
|
|
|
|
|
|
|
case bbt_show_beats:
|
2012-11-27 17:48:59 -05:00
|
|
|
beats = distance (begin, end);
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
bbt_nmarks = beats + 2;
|
|
|
|
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.label = "";
|
|
|
|
mark.position = lower;
|
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Micro;
|
|
|
|
marks.push_back (mark);
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
|
2012-11-27 17:48:59 -05:00
|
|
|
for (n = 1, i = begin; n < bbt_nmarks && i != end; ++i) {
|
2012-01-01 23:04:14 -05:00
|
|
|
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
if ((*i).frame < lower && (bbt_bar_helper_on)) {
|
|
|
|
snprintf (buf, sizeof(buf), "<%" PRIu32 "|%" PRIu32, (*i).bar, (*i).beat);
|
2014-06-11 23:54:04 -04:00
|
|
|
edit_last_mark_label (marks, buf);
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
helper_active = true;
|
|
|
|
} else {
|
|
|
|
|
2012-01-03 21:49:01 -05:00
|
|
|
if ((*i).is_bar()) {
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Major;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
snprintf (buf, sizeof(buf), "%" PRIu32, (*i).bar);
|
|
|
|
} else if (((*i).beat % 2 == 1)) {
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Minor;
|
|
|
|
buf[0] = '\0';
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
} else {
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Micro;
|
|
|
|
buf[0] = '\0';
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
}
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.label = buf;
|
|
|
|
mark.position = (*i).frame;
|
|
|
|
marks.push_back (mark);
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
n++;
|
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
break;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
case bbt_show_ticks:
|
|
|
|
|
2012-11-27 17:48:59 -05:00
|
|
|
beats = distance (begin, end);
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
bbt_nmarks = (beats + 2) * bbt_beat_subdivision;
|
|
|
|
|
|
|
|
bbt_position_of_helper = lower + (30 * Editor::get_current_zoom ());
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2014-06-11 23:54:04 -04:00
|
|
|
// could do marks.assign() here to preallocate
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.label = "";
|
|
|
|
mark.position = lower;
|
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Micro;
|
|
|
|
marks.push_back (mark);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2012-11-27 17:48:59 -05:00
|
|
|
for (n = 1, i = begin; n < bbt_nmarks && i != end; ++i) {
|
2012-01-01 23:04:14 -05:00
|
|
|
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
if ((*i).frame < lower && (bbt_bar_helper_on)) {
|
|
|
|
snprintf (buf, sizeof(buf), "<%" PRIu32 "|%" PRIu32, (*i).bar, (*i).beat);
|
2014-06-11 23:54:04 -04:00
|
|
|
edit_last_mark_label (marks, buf);
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
helper_active = true;
|
|
|
|
} else {
|
2006-09-18 23:29:16 -04:00
|
|
|
|
2012-01-03 21:49:01 -05:00
|
|
|
if ((*i).is_bar()) {
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Major;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
snprintf (buf, sizeof(buf), "%" PRIu32, (*i).bar);
|
|
|
|
} else {
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Minor;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
snprintf (buf, sizeof(buf), "%" PRIu32, (*i).beat);
|
|
|
|
}
|
|
|
|
if (((*i).frame < bbt_position_of_helper) && helper_active) {
|
2014-06-11 23:54:04 -04:00
|
|
|
buf[0] = '\0';
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
}
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.label = buf;
|
|
|
|
mark.position = (*i).frame;
|
|
|
|
marks.push_back (mark);
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
n++;
|
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
/* Add the tick marks */
|
|
|
|
|
|
|
|
/* Find the next beat */
|
|
|
|
next_beat.beats = (*i).beat;
|
|
|
|
next_beat.bars = (*i).bar;
|
|
|
|
next_beat.ticks = 0;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2011-12-12 21:46:36 -05:00
|
|
|
if ((*i).meter->divisions_per_bar() > (next_beat.beats + 1)) {
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
next_beat.beats += 1;
|
2005-09-25 14:42:24 -04:00
|
|
|
} else {
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
next_beat.bars += 1;
|
|
|
|
next_beat.beats = 1;
|
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2009-12-17 13:24:23 -05:00
|
|
|
next_beat_pos = _session->tempo_map().frame_time(next_beat);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2010-09-17 14:20:37 -04:00
|
|
|
frame_skip = (framepos_t) floor (frame_skip_error = (_session->frame_rate() * 60) / (bbt_beat_subdivision * (*i).tempo->beats_per_minute()));
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
frame_skip_error -= frame_skip;
|
2012-01-06 11:39:40 -05:00
|
|
|
skip = (uint32_t) (Timecode::BBT_Time::ticks_per_beat / bbt_beat_subdivision);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
pos = (*i).frame + frame_skip;
|
|
|
|
accumulated_error = frame_skip_error;
|
|
|
|
|
|
|
|
tick = skip;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2012-01-06 11:39:40 -05:00
|
|
|
for (t = 0; (tick < Timecode::BBT_Time::ticks_per_beat) && (n < bbt_nmarks) && (pos < next_beat_pos) ; pos += frame_skip, tick += skip, ++t) {
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
|
|
|
|
if (t % bbt_accent_modulo == (bbt_accent_modulo - 1)) {
|
|
|
|
i_am_accented = true;
|
|
|
|
}
|
|
|
|
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.label = "";
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2010-09-17 14:20:37 -04:00
|
|
|
/* Error compensation for float to framepos_t*/
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
accumulated_error += frame_skip_error;
|
|
|
|
if (accumulated_error > 1) {
|
|
|
|
pos += 1;
|
|
|
|
accumulated_error -= 1.0f;
|
|
|
|
}
|
|
|
|
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.position = pos;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
|
|
|
|
if ((bbt_beat_subdivision > 4) && i_am_accented) {
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Minor;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
} else {
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Micro;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
}
|
|
|
|
i_am_accented = false;
|
2014-06-11 23:54:04 -04:00
|
|
|
marks.push_back (mark);
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
n++;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
break;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
case bbt_show_ticks_detail:
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2012-11-27 17:48:59 -05:00
|
|
|
beats = distance (begin, end);
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
bbt_nmarks = (beats + 2) * bbt_beat_subdivision;
|
2006-09-18 23:29:16 -04:00
|
|
|
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
bbt_position_of_helper = lower + (30 * Editor::get_current_zoom ());
|
2006-09-18 23:29:16 -04:00
|
|
|
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.label = "";
|
|
|
|
mark.position = lower;
|
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Micro;
|
|
|
|
marks.push_back (mark);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2012-11-27 17:48:59 -05:00
|
|
|
for (n = 1, i = begin; n < bbt_nmarks && i != end; ++i) {
|
2012-01-01 23:04:14 -05:00
|
|
|
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
if ((*i).frame < lower && (bbt_bar_helper_on)) {
|
|
|
|
snprintf (buf, sizeof(buf), "<%" PRIu32 "|%" PRIu32, (*i).bar, (*i).beat);
|
2014-06-11 23:54:04 -04:00
|
|
|
edit_last_mark_label (marks, buf);
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
helper_active = true;
|
|
|
|
} else {
|
2006-09-18 23:29:16 -04:00
|
|
|
|
2012-01-03 21:49:01 -05:00
|
|
|
if ((*i).is_bar()) {
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Major;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
snprintf (buf, sizeof(buf), "%" PRIu32, (*i).bar);
|
2006-09-18 23:29:16 -04:00
|
|
|
} else {
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Minor;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
snprintf (buf, sizeof(buf), "%" PRIu32, (*i).beat);
|
|
|
|
}
|
|
|
|
if (((*i).frame < bbt_position_of_helper) && helper_active) {
|
2014-06-11 23:54:04 -04:00
|
|
|
buf[0] = '\0';
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
}
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.label = buf;
|
|
|
|
mark.position = (*i).frame;
|
|
|
|
marks.push_back (mark);
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
n++;
|
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
/* Add the tick marks */
|
|
|
|
|
|
|
|
/* Find the next beat */
|
|
|
|
|
|
|
|
next_beat.beats = (*i).beat;
|
|
|
|
next_beat.bars = (*i).bar;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2011-12-12 21:46:36 -05:00
|
|
|
if ((*i).meter->divisions_per_bar() > (next_beat.beats + 1)) {
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
next_beat.beats += 1;
|
|
|
|
} else {
|
2006-09-18 23:29:16 -04:00
|
|
|
next_beat.bars += 1;
|
|
|
|
next_beat.beats = 1;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2009-12-17 13:24:23 -05:00
|
|
|
next_beat_pos = _session->tempo_map().frame_time(next_beat);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2010-09-17 14:20:37 -04:00
|
|
|
frame_skip = (framepos_t) floor (frame_skip_error = (_session->frame_rate() * 60) / (bbt_beat_subdivision * (*i).tempo->beats_per_minute()));
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
frame_skip_error -= frame_skip;
|
2012-01-06 11:39:40 -05:00
|
|
|
skip = (uint32_t) (Timecode::BBT_Time::ticks_per_beat / bbt_beat_subdivision);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
pos = (*i).frame + frame_skip;
|
|
|
|
accumulated_error = frame_skip_error;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
tick = skip;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2012-01-06 11:39:40 -05:00
|
|
|
for (t = 0; (tick < Timecode::BBT_Time::ticks_per_beat) && (n < bbt_nmarks) && (pos < next_beat_pos) ; pos += frame_skip, tick += skip, ++t) {
|
2005-09-25 14:42:24 -04:00
|
|
|
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
if (t % bbt_accent_modulo == (bbt_accent_modulo - 1)) {
|
|
|
|
i_am_accented = true;
|
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
if (i_am_accented && (pos > bbt_position_of_helper)){
|
|
|
|
snprintf (buf, sizeof(buf), "%" PRIu32, tick);
|
|
|
|
} else {
|
2014-06-11 23:54:04 -04:00
|
|
|
buf[0] = '\0';
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.label = buf;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2010-09-17 14:20:37 -04:00
|
|
|
/* Error compensation for float to framepos_t*/
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
accumulated_error += frame_skip_error;
|
|
|
|
if (accumulated_error > 1) {
|
|
|
|
pos += 1;
|
|
|
|
accumulated_error -= 1.0f;
|
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.position = pos;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
if ((bbt_beat_subdivision > 4) && i_am_accented) {
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Minor;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
} else {
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Micro;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
i_am_accented = false;
|
2009-10-14 12:10:01 -04:00
|
|
|
n++;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case bbt_show_ticks_super_detail:
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2012-11-27 17:48:59 -05:00
|
|
|
beats = distance (begin, end);
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
bbt_nmarks = (beats + 2) * bbt_beat_subdivision;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
bbt_position_of_helper = lower + (30 * Editor::get_current_zoom ());
|
|
|
|
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.label = "";
|
|
|
|
mark.position = lower;
|
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Micro;
|
|
|
|
marks.push_back (mark);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2012-11-27 17:48:59 -05:00
|
|
|
for (n = 1, i = begin; n < bbt_nmarks && i != end; ++i) {
|
2012-01-01 23:04:14 -05:00
|
|
|
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
if ((*i).frame < lower && (bbt_bar_helper_on)) {
|
|
|
|
snprintf (buf, sizeof(buf), "<%" PRIu32 "|%" PRIu32, (*i).bar, (*i).beat);
|
2014-06-11 23:54:04 -04:00
|
|
|
edit_last_mark_label (marks, buf);
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
helper_active = true;
|
|
|
|
} else {
|
|
|
|
|
2012-01-03 21:49:01 -05:00
|
|
|
if ((*i).is_bar()) {
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Major;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
snprintf (buf, sizeof(buf), "%" PRIu32, (*i).bar);
|
|
|
|
} else {
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Minor;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
snprintf (buf, sizeof(buf), "%" PRIu32, (*i).beat);
|
|
|
|
}
|
|
|
|
if (((*i).frame < bbt_position_of_helper) && helper_active) {
|
2014-06-11 23:54:04 -04:00
|
|
|
buf[0] = '\0';
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
}
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.label = buf;
|
|
|
|
mark.position = (*i).frame;
|
|
|
|
marks.push_back (mark);
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
n++;
|
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
/* Add the tick marks */
|
|
|
|
|
|
|
|
/* Find the next beat */
|
|
|
|
|
|
|
|
next_beat.beats = (*i).beat;
|
|
|
|
next_beat.bars = (*i).bar;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2011-12-12 21:46:36 -05:00
|
|
|
if ((*i).meter->divisions_per_bar() > (next_beat.beats + 1)) {
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
next_beat.beats += 1;
|
|
|
|
} else {
|
|
|
|
next_beat.bars += 1;
|
|
|
|
next_beat.beats = 1;
|
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2009-12-17 13:24:23 -05:00
|
|
|
next_beat_pos = _session->tempo_map().frame_time(next_beat);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2010-09-17 14:20:37 -04:00
|
|
|
frame_skip = (framepos_t) floor (frame_skip_error = (_session->frame_rate() * 60) / (bbt_beat_subdivision * (*i).tempo->beats_per_minute()));
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
frame_skip_error -= frame_skip;
|
2012-01-06 11:39:40 -05:00
|
|
|
skip = (uint32_t) (Timecode::BBT_Time::ticks_per_beat / bbt_beat_subdivision);
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
|
|
|
|
pos = (*i).frame + frame_skip;
|
|
|
|
accumulated_error = frame_skip_error;
|
|
|
|
|
|
|
|
tick = skip;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2012-01-06 11:39:40 -05:00
|
|
|
for (t = 0; (tick < Timecode::BBT_Time::ticks_per_beat) && (n < bbt_nmarks) && (pos < next_beat_pos) ; pos += frame_skip, tick += skip, ++t) {
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
|
|
|
|
if (t % bbt_accent_modulo == (bbt_accent_modulo - 1)) {
|
|
|
|
i_am_accented = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (pos > bbt_position_of_helper) {
|
|
|
|
snprintf (buf, sizeof(buf), "%" PRIu32, tick);
|
|
|
|
} else {
|
2014-06-11 23:54:04 -04:00
|
|
|
buf[0] = '\0';
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
}
|
|
|
|
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.label = buf;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
|
2010-09-17 14:20:37 -04:00
|
|
|
/* Error compensation for float to framepos_t*/
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
accumulated_error += frame_skip_error;
|
|
|
|
if (accumulated_error > 1) {
|
|
|
|
pos += 1;
|
|
|
|
accumulated_error -= 1.0f;
|
|
|
|
}
|
|
|
|
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.position = pos;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
if ((bbt_beat_subdivision > 4) && i_am_accented) {
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Minor;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
} else {
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Micro;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
}
|
|
|
|
i_am_accented = false;
|
2014-06-11 23:54:04 -04:00
|
|
|
marks.push_back (mark);
|
2009-10-14 12:10:01 -04:00
|
|
|
n++;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
2014-12-11 12:51:01 -05:00
|
|
|
case bbt_show_many:
|
|
|
|
bbt_nmarks = 1;
|
|
|
|
snprintf (buf, sizeof(buf), "cannot handle %" PRIu32 " bars", bbt_bars );
|
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Major;
|
|
|
|
mark.label = buf;
|
|
|
|
mark.position = lower;
|
|
|
|
marks.push_back (mark);
|
|
|
|
break;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
|
|
|
|
case bbt_show_64:
|
|
|
|
bbt_nmarks = (gint) (bbt_bars / 64) + 1;
|
2012-11-27 17:48:59 -05:00
|
|
|
for (n = 0, i = begin; i != end && n < bbt_nmarks; i++) {
|
2012-01-03 21:49:01 -05:00
|
|
|
if ((*i).is_bar()) {
|
2005-09-25 14:42:24 -04:00
|
|
|
if ((*i).bar % 64 == 1) {
|
|
|
|
if ((*i).bar % 256 == 1) {
|
|
|
|
snprintf (buf, sizeof(buf), "%" PRIu32, (*i).bar);
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Major;
|
2005-09-25 14:42:24 -04:00
|
|
|
} else {
|
2014-06-11 23:54:04 -04:00
|
|
|
buf[0] = '\0';
|
2005-09-25 14:42:24 -04:00
|
|
|
if ((*i).bar % 256 == 129) {
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Minor;
|
2005-09-25 14:42:24 -04:00
|
|
|
} else {
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Micro;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.label = buf;
|
|
|
|
mark.position = (*i).frame;
|
|
|
|
marks.push_back (mark);
|
|
|
|
++n;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case bbt_show_16:
|
|
|
|
bbt_nmarks = (bbt_bars / 16) + 1;
|
2012-11-27 17:48:59 -05:00
|
|
|
for (n = 0, i = begin; i != end && n < bbt_nmarks; i++) {
|
2012-01-03 21:49:01 -05:00
|
|
|
if ((*i).is_bar()) {
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
if ((*i).bar % 16 == 1) {
|
|
|
|
if ((*i).bar % 64 == 1) {
|
|
|
|
snprintf (buf, sizeof(buf), "%" PRIu32, (*i).bar);
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Major;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
} else {
|
2014-06-11 23:54:04 -04:00
|
|
|
buf[0] = '\0';
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
if ((*i).bar % 64 == 33) {
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Minor;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
} else {
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Micro;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.label = buf;
|
|
|
|
mark.position = (*i).frame;
|
|
|
|
marks.push_back (mark);
|
|
|
|
++n;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case bbt_show_4:
|
|
|
|
bbt_nmarks = (bbt_bars / 4) + 1;
|
2012-11-27 17:48:59 -05:00
|
|
|
for (n = 0, i = begin; i != end && n < bbt_nmarks; ++i) {
|
2012-01-03 21:49:01 -05:00
|
|
|
if ((*i).is_bar()) {
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
if ((*i).bar % 4 == 1) {
|
|
|
|
if ((*i).bar % 16 == 1) {
|
|
|
|
snprintf (buf, sizeof(buf), "%" PRIu32, (*i).bar);
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Major;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
} else {
|
2014-06-11 23:54:04 -04:00
|
|
|
buf[0] = '\0';
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
if ((*i).bar % 16 == 9) {
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Minor;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
} else {
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Micro;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.label = buf;
|
|
|
|
mark.position = (*i).frame;
|
|
|
|
marks.push_back (mark);
|
|
|
|
++n;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case bbt_show_1:
|
2014-06-11 23:54:04 -04:00
|
|
|
// default:
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
bbt_nmarks = bbt_bars + 2;
|
2014-06-11 23:54:04 -04:00
|
|
|
for (n = 0, i = begin; i != end && n < bbt_nmarks; ++i) {
|
2012-01-03 21:49:01 -05:00
|
|
|
if ((*i).is_bar()) {
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
if ((*i).bar % 4 == 1) {
|
|
|
|
snprintf (buf, sizeof(buf), "%" PRIu32, (*i).bar);
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Major;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
} else {
|
2014-06-11 23:54:04 -04:00
|
|
|
buf[0] = '\0';
|
|
|
|
if ((*i).bar % 4 == 3) {
|
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Minor;
|
|
|
|
} else {
|
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Micro;
|
|
|
|
}
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
}
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.label = buf;
|
|
|
|
mark.position = (*i).frame;
|
|
|
|
marks.push_back (mark);
|
|
|
|
++n;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
}
|
|
|
|
}
|
2014-06-11 23:54:04 -04:00
|
|
|
break;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-01-17 20:00:27 -05:00
|
|
|
void
|
2011-01-18 07:51:02 -05:00
|
|
|
Editor::set_samples_ruler_scale (framepos_t lower, framepos_t upper)
|
2011-01-17 20:00:27 -05:00
|
|
|
{
|
2011-01-18 07:51:02 -05:00
|
|
|
_samples_ruler_interval = (upper - lower) / 5;
|
2011-01-17 20:00:27 -05:00
|
|
|
}
|
|
|
|
|
2014-06-11 23:54:04 -04:00
|
|
|
void
|
|
|
|
Editor::metric_get_samples (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdouble lower, gdouble /*upper*/, gint /*maxchars*/)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2010-09-17 14:20:37 -04:00
|
|
|
framepos_t pos;
|
2011-01-17 20:00:27 -05:00
|
|
|
framepos_t const ilower = (framepos_t) floor (lower);
|
2005-09-25 14:42:24 -04:00
|
|
|
gchar buf[16];
|
|
|
|
gint nmarks;
|
|
|
|
gint n;
|
2014-06-11 23:54:04 -04:00
|
|
|
ArdourCanvas::Ruler::Mark mark;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-12-17 13:24:23 -05:00
|
|
|
if (_session == 0) {
|
2014-06-11 23:54:04 -04:00
|
|
|
return;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
nmarks = 5;
|
2011-01-18 07:51:02 -05:00
|
|
|
for (n = 0, pos = ilower; n < nmarks; pos += _samples_ruler_interval, ++n) {
|
2008-09-10 17:27:39 -04:00
|
|
|
snprintf (buf, sizeof(buf), "%" PRIi64, pos);
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.label = buf;
|
|
|
|
mark.position = pos;
|
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Major;
|
|
|
|
marks.push_back (mark);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-09-17 14:20:37 -04:00
|
|
|
sample_to_clock_parts ( framepos_t sample,
|
|
|
|
framepos_t sample_rate,
|
2005-09-25 14:42:24 -04:00
|
|
|
long *hrs_p,
|
|
|
|
long *mins_p,
|
|
|
|
long *secs_p,
|
|
|
|
long *millisecs_p)
|
|
|
|
|
|
|
|
{
|
2010-09-17 14:20:37 -04:00
|
|
|
framepos_t left;
|
2005-09-25 14:42:24 -04:00
|
|
|
long hrs;
|
|
|
|
long mins;
|
|
|
|
long secs;
|
|
|
|
long millisecs;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
left = sample;
|
2014-05-14 01:40:30 -04:00
|
|
|
hrs = left / (sample_rate * 60 * 60 * 1000);
|
|
|
|
left -= hrs * sample_rate * 60 * 60 * 1000;
|
|
|
|
mins = left / (sample_rate * 60 * 1000);
|
|
|
|
left -= mins * sample_rate * 60 * 1000;
|
|
|
|
secs = left / (sample_rate * 1000);
|
|
|
|
left -= secs * sample_rate * 1000;
|
|
|
|
millisecs = left / sample_rate;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
*millisecs_p = millisecs;
|
|
|
|
*secs_p = secs;
|
|
|
|
*mins_p = mins;
|
|
|
|
*hrs_p = hrs;
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
void
|
2011-01-17 20:16:05 -05:00
|
|
|
Editor::set_minsec_ruler_scale (framepos_t lower, framepos_t upper)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2014-12-11 12:51:01 -05:00
|
|
|
framepos_t fr = _session->frame_rate() * 1000;
|
2010-09-17 14:20:37 -04:00
|
|
|
framepos_t spacer;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-12-17 13:24:23 -05:00
|
|
|
if (_session == 0) {
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
return;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* to prevent 'flashing' */
|
2010-09-17 14:20:37 -04:00
|
|
|
if (lower > (spacer = (framepos_t)(128 * Editor::get_current_zoom ()))) {
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
lower -= spacer;
|
2005-09-25 14:42:24 -04:00
|
|
|
} else {
|
|
|
|
lower = 0;
|
|
|
|
}
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
upper += spacer;
|
2014-05-14 01:40:30 -04:00
|
|
|
framecnt_t const range = (upper - lower) * 1000;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2014-12-11 12:51:01 -05:00
|
|
|
if (range <= (fr / 10)) { /* 0-0.1 second */
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
minsec_mark_interval = fr / 1000; /* show 1/1000 seconds */
|
2014-12-11 12:51:01 -05:00
|
|
|
minsec_ruler_scale = minsec_show_msecs;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
minsec_mark_modulo = 10;
|
2014-12-11 12:51:01 -05:00
|
|
|
minsec_nmarks = 2 + (range / minsec_mark_interval);
|
2005-09-25 14:42:24 -04:00
|
|
|
} else if (range <= (fr / 2)) { /* 0-0.5 second */
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
minsec_mark_interval = fr / 100; /* show 1/100 seconds */
|
2014-12-11 12:51:01 -05:00
|
|
|
minsec_ruler_scale = minsec_show_msecs;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
minsec_mark_modulo = 100;
|
2014-12-11 12:51:01 -05:00
|
|
|
minsec_nmarks = 2 + (range / minsec_mark_interval);
|
2005-09-25 14:42:24 -04:00
|
|
|
} else if (range <= fr) { /* 0-1 second */
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
minsec_mark_interval = fr / 10; /* show 1/10 seconds */
|
2014-12-11 12:51:01 -05:00
|
|
|
minsec_ruler_scale = minsec_show_msecs;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
minsec_mark_modulo = 200;
|
2014-12-11 12:51:01 -05:00
|
|
|
minsec_nmarks = 2 + (range / minsec_mark_interval);
|
2005-09-25 14:42:24 -04:00
|
|
|
} else if (range <= 2 * fr) { /* 1-2 seconds */
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
minsec_mark_interval = fr / 10; /* show 1/10 seconds */
|
2014-12-11 12:51:01 -05:00
|
|
|
minsec_ruler_scale = minsec_show_msecs;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
minsec_mark_modulo = 500;
|
2014-12-11 12:51:01 -05:00
|
|
|
minsec_nmarks = 2 + (range / minsec_mark_interval);
|
2005-09-25 14:42:24 -04:00
|
|
|
} else if (range <= 8 * fr) { /* 2-5 seconds */
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
minsec_mark_interval = fr / 5; /* show 2 seconds */
|
2014-12-11 12:51:01 -05:00
|
|
|
minsec_ruler_scale = minsec_show_msecs;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
minsec_mark_modulo = 1000;
|
2014-12-11 12:51:01 -05:00
|
|
|
minsec_nmarks = 2 + (range / minsec_mark_interval);
|
2005-09-25 14:42:24 -04:00
|
|
|
} else if (range <= 16 * fr) { /* 8-16 seconds */
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
minsec_mark_interval = fr; /* show 1 seconds */
|
|
|
|
minsec_ruler_scale = minsec_show_seconds;
|
|
|
|
minsec_mark_modulo = 2;
|
2014-12-11 12:51:01 -05:00
|
|
|
minsec_nmarks = 2 + (range / minsec_mark_interval);
|
2005-09-25 14:42:24 -04:00
|
|
|
} else if (range <= 30 * fr) { /* 10-30 seconds */
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
minsec_mark_interval = fr; /* show 1 seconds */
|
|
|
|
minsec_ruler_scale = minsec_show_seconds;
|
|
|
|
minsec_mark_modulo = 5;
|
2014-12-11 12:51:01 -05:00
|
|
|
minsec_nmarks = 2 + (range / minsec_mark_interval);
|
2005-09-25 14:42:24 -04:00
|
|
|
} else if (range <= 60 * fr) { /* 30-60 seconds */
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
minsec_mark_interval = fr; /* show 1 seconds */
|
|
|
|
minsec_ruler_scale = minsec_show_seconds;
|
|
|
|
minsec_mark_modulo = 5;
|
2014-12-11 12:51:01 -05:00
|
|
|
minsec_nmarks = 2 + (range / minsec_mark_interval);
|
2005-09-25 14:42:24 -04:00
|
|
|
} else if (range <= 2 * 60 * fr) { /* 1-2 minutes */
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
minsec_mark_interval = 5 * fr; /* show 5 seconds */
|
|
|
|
minsec_ruler_scale = minsec_show_seconds;
|
|
|
|
minsec_mark_modulo = 3;
|
2014-12-11 12:51:01 -05:00
|
|
|
minsec_nmarks = 2 + (range / minsec_mark_interval);
|
2005-09-25 14:42:24 -04:00
|
|
|
} else if (range <= 4 * 60 * fr) { /* 4 minutes */
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
minsec_mark_interval = 5 * fr; /* show 10 seconds */
|
|
|
|
minsec_ruler_scale = minsec_show_seconds;
|
|
|
|
minsec_mark_modulo = 30;
|
2014-12-11 12:51:01 -05:00
|
|
|
minsec_nmarks = 2 + (range / minsec_mark_interval);
|
2005-09-25 14:42:24 -04:00
|
|
|
} else if (range <= 10 * 60 * fr) { /* 10 minutes */
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
minsec_mark_interval = 30 * fr; /* show 30 seconds */
|
|
|
|
minsec_ruler_scale = minsec_show_seconds;
|
|
|
|
minsec_mark_modulo = 120;
|
2014-12-11 12:51:01 -05:00
|
|
|
minsec_nmarks = 2 + (range / minsec_mark_interval);
|
2005-09-25 14:42:24 -04:00
|
|
|
} else if (range <= 30 * 60 * fr) { /* 10-30 minutes */
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
minsec_mark_interval = 60 * fr; /* show 1 minute */
|
|
|
|
minsec_ruler_scale = minsec_show_minutes;
|
|
|
|
minsec_mark_modulo = 5;
|
2014-12-11 12:51:01 -05:00
|
|
|
minsec_nmarks = 2 + (range / minsec_mark_interval);
|
2005-09-25 14:42:24 -04:00
|
|
|
} else if (range <= 60 * 60 * fr) { /* 30 minutes - 1hr */
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
minsec_mark_interval = 2 * 60 * fr; /* show 2 minutes */
|
|
|
|
minsec_ruler_scale = minsec_show_minutes;
|
|
|
|
minsec_mark_modulo = 10;
|
2014-12-11 12:51:01 -05:00
|
|
|
minsec_nmarks = 2 + (range / minsec_mark_interval);
|
2005-09-25 14:42:24 -04:00
|
|
|
} else if (range <= 4 * 60 * 60 * fr) { /* 1 - 4 hrs*/
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
minsec_mark_interval = 5 * 60 * fr; /* show 10 minutes */
|
|
|
|
minsec_ruler_scale = minsec_show_minutes;
|
|
|
|
minsec_mark_modulo = 30;
|
2014-12-11 12:51:01 -05:00
|
|
|
minsec_nmarks = 2 + (range / minsec_mark_interval);
|
2005-09-25 14:42:24 -04:00
|
|
|
} else if (range <= 8 * 60 * 60 * fr) { /* 4 - 8 hrs*/
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
minsec_mark_interval = 20 * 60 * fr; /* show 20 minutes */
|
|
|
|
minsec_ruler_scale = minsec_show_minutes;
|
|
|
|
minsec_mark_modulo = 60;
|
2014-12-11 12:51:01 -05:00
|
|
|
minsec_nmarks = 2 + (range / minsec_mark_interval);
|
2005-09-25 14:42:24 -04:00
|
|
|
} else if (range <= 16 * 60 * 60 * fr) { /* 16-24 hrs*/
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
minsec_mark_interval = 60 * 60 * fr; /* show 60 minutes */
|
|
|
|
minsec_ruler_scale = minsec_show_hours;
|
|
|
|
minsec_mark_modulo = 2;
|
2014-12-11 12:51:01 -05:00
|
|
|
minsec_nmarks = 2 + (range / minsec_mark_interval);
|
2005-09-25 14:42:24 -04:00
|
|
|
} else {
|
2014-11-23 07:34:46 -05:00
|
|
|
|
2014-12-11 12:51:01 -05:00
|
|
|
const framecnt_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
|
|
|
|
to set the ruler scale, because the caller has already determined
|
|
|
|
the width and set lower + upper arguments to this function to match that.
|
|
|
|
|
|
|
|
But in this case, where the range defined by lower and uppper can vary
|
|
|
|
substantially (anything from 24hrs+ to several billion years)
|
2015-10-04 14:51:05 -04:00
|
|
|
trying to decide which tick marks to show does require us to know
|
2014-12-11 12:51:01 -05:00
|
|
|
about the available width.
|
|
|
|
*/
|
|
|
|
|
|
|
|
minsec_nmarks = _track_canvas->width() / text_width_rough_guess;
|
|
|
|
minsec_mark_modulo = max ((framecnt_t) 1, 1 + (hours_in_range / minsec_nmarks));
|
|
|
|
minsec_mark_interval = minsec_mark_modulo * (60 * 60 * fr);
|
|
|
|
minsec_ruler_scale = minsec_show_many_hours;
|
|
|
|
}
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2014-06-11 23:54:04 -04:00
|
|
|
void
|
2014-12-11 12:51:01 -05:00
|
|
|
Editor::metric_get_minsec (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdouble lower, gdouble upper, gint /*maxchars*/)
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
{
|
2010-09-17 14:20:37 -04:00
|
|
|
framepos_t pos;
|
|
|
|
framepos_t spacer;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
long hrs, mins, secs, millisecs;
|
|
|
|
gchar buf[16];
|
|
|
|
gint n;
|
2014-06-11 23:54:04 -04:00
|
|
|
ArdourCanvas::Ruler::Mark mark;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
|
2009-12-17 13:24:23 -05:00
|
|
|
if (_session == 0) {
|
2014-06-11 23:54:04 -04:00
|
|
|
return;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/* to prevent 'flashing' */
|
2011-01-17 20:16:05 -05:00
|
|
|
if (lower > (spacer = (framepos_t) (128 * Editor::get_current_zoom ()))) {
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
lower = lower - spacer;
|
|
|
|
} else {
|
|
|
|
lower = 0;
|
|
|
|
}
|
|
|
|
|
2014-05-14 01:40:30 -04:00
|
|
|
pos = (((1000 * (framepos_t) floor(lower)) + (minsec_mark_interval/2))/minsec_mark_interval) * minsec_mark_interval;
|
2014-12-11 12:51:01 -05:00
|
|
|
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
switch (minsec_ruler_scale) {
|
2014-12-11 12:51:01 -05:00
|
|
|
|
|
|
|
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);
|
|
|
|
if (millisecs % minsec_mark_modulo == 0) {
|
|
|
|
if (millisecs == 0) {
|
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Major;
|
|
|
|
} else {
|
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Minor;
|
|
|
|
}
|
|
|
|
snprintf (buf, sizeof(buf), "%02ld:%02ld:%02ld.%03ld", hrs, mins, secs, millisecs);
|
|
|
|
} else {
|
|
|
|
buf[0] = '\0';
|
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Micro;
|
|
|
|
}
|
|
|
|
mark.label = buf;
|
|
|
|
mark.position = pos/1000.0;
|
|
|
|
marks.push_back (mark);
|
|
|
|
}
|
|
|
|
break;
|
2015-10-04 14:51:05 -04:00
|
|
|
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
case minsec_show_seconds:
|
|
|
|
for (n = 0; n < minsec_nmarks; pos += minsec_mark_interval, ++n) {
|
2009-12-17 13:24:23 -05:00
|
|
|
sample_to_clock_parts (pos, _session->frame_rate(), &hrs, &mins, &secs, &millisecs);
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
if (secs % minsec_mark_modulo == 0) {
|
2005-09-25 14:42:24 -04:00
|
|
|
if (secs == 0) {
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Major;
|
2005-09-25 14:42:24 -04:00
|
|
|
} else {
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Minor;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2014-12-11 12:51:01 -05:00
|
|
|
snprintf (buf, sizeof(buf), "%02ld:%02ld:%02ld", hrs, mins, secs);
|
2005-09-25 14:42:24 -04:00
|
|
|
} else {
|
2014-06-11 23:54:04 -04:00
|
|
|
buf[0] = '\0';
|
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Micro;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.label = buf;
|
|
|
|
mark.position = pos/1000.0;
|
|
|
|
marks.push_back (mark);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2014-12-11 12:51:01 -05:00
|
|
|
break;
|
|
|
|
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
case minsec_show_minutes:
|
|
|
|
for (n = 0; n < minsec_nmarks; pos += minsec_mark_interval, ++n) {
|
2009-12-17 13:24:23 -05:00
|
|
|
sample_to_clock_parts (pos, _session->frame_rate(), &hrs, &mins, &secs, &millisecs);
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
if (mins % minsec_mark_modulo == 0) {
|
2005-09-25 14:42:24 -04:00
|
|
|
if (mins == 0) {
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Major;
|
2005-09-25 14:42:24 -04:00
|
|
|
} else {
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Minor;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2014-12-11 12:51:01 -05:00
|
|
|
snprintf (buf, sizeof(buf), "%02ld:%02ld:%02ld", hrs, mins, secs);
|
2005-09-25 14:42:24 -04:00
|
|
|
} else {
|
2014-06-11 23:54:04 -04:00
|
|
|
buf[0] = '\0';
|
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Micro;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.label = buf;
|
|
|
|
mark.position = pos/1000.0;
|
|
|
|
marks.push_back (mark);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2014-12-11 12:51:01 -05:00
|
|
|
break;
|
|
|
|
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
case minsec_show_hours:
|
|
|
|
for (n = 0; n < minsec_nmarks; pos += minsec_mark_interval, ++n) {
|
2009-12-17 13:24:23 -05:00
|
|
|
sample_to_clock_parts (pos, _session->frame_rate(), &hrs, &mins, &secs, &millisecs);
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
if (hrs % minsec_mark_modulo == 0) {
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Major;
|
2014-12-11 12:51:01 -05:00
|
|
|
snprintf (buf, sizeof(buf), "%02ld:%02ld", hrs, mins);
|
2005-09-25 14:42:24 -04:00
|
|
|
} else {
|
2014-06-11 23:54:04 -04:00
|
|
|
buf[0] = '\0';
|
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Micro;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2014-06-11 23:54:04 -04:00
|
|
|
mark.label = buf;
|
|
|
|
mark.position = pos/1000.0;
|
|
|
|
marks.push_back (mark);
|
2014-12-11 12:51:01 -05:00
|
|
|
}
|
|
|
|
break;
|
2015-10-04 14:51:05 -04:00
|
|
|
|
2014-12-11 12:51:01 -05:00
|
|
|
case minsec_show_many_hours:
|
|
|
|
for (n = 0; n < minsec_nmarks; ) {
|
|
|
|
sample_to_clock_parts (pos, _session->frame_rate(), &hrs, &mins, &secs, &millisecs);
|
|
|
|
if (hrs % minsec_mark_modulo == 0) {
|
|
|
|
mark.style = ArdourCanvas::Ruler::Mark::Major;
|
|
|
|
snprintf (buf, sizeof(buf), "%02ld:00", hrs);
|
|
|
|
mark.label = buf;
|
|
|
|
mark.position = pos/1000.0;
|
|
|
|
marks.push_back (mark);
|
|
|
|
++n;
|
|
|
|
}
|
|
|
|
pos += minsec_mark_interval;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2014-12-11 12:51:01 -05:00
|
|
|
break;
|
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|