mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 23:05:04 +01:00
Implement clock delta modes
* use new config variable * update GUI to select delta-modes * delegate delta-calculation to MainClock * save offset to calculate absolute-time
This commit is contained in:
parent
1be2790cac
commit
15150c57c1
10 changed files with 128 additions and 58 deletions
|
|
@ -202,7 +202,7 @@ using namespace Editing;
|
||||||
|
|
||||||
ARDOUR_UI *ARDOUR_UI::theArdourUI = 0;
|
ARDOUR_UI *ARDOUR_UI::theArdourUI = 0;
|
||||||
|
|
||||||
sigc::signal<void, samplepos_t, bool, samplepos_t> ARDOUR_UI::Clock;
|
sigc::signal<void, samplepos_t> ARDOUR_UI::Clock;
|
||||||
sigc::signal<void> ARDOUR_UI::CloseAllDialogs;
|
sigc::signal<void> ARDOUR_UI::CloseAllDialogs;
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
|
|
@ -2704,7 +2704,7 @@ ARDOUR_UI::update_clocks ()
|
||||||
if (!_session) return;
|
if (!_session) return;
|
||||||
|
|
||||||
if (editor && !editor->dragging_playhead()) {
|
if (editor && !editor->dragging_playhead()) {
|
||||||
Clock (_session->audible_sample(), false, editor->get_preferred_edit_position (EDIT_IGNORE_PHEAD)); /* EMIT_SIGNAL */
|
Clock (_session->audible_sample()); /* EMIT_SIGNAL */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -5286,16 +5286,34 @@ ARDOUR_UI::use_config ()
|
||||||
void
|
void
|
||||||
ARDOUR_UI::update_transport_clocks (samplepos_t pos)
|
ARDOUR_UI::update_transport_clocks (samplepos_t pos)
|
||||||
{
|
{
|
||||||
if (UIConfiguration::instance().get_primary_clock_delta_edit_cursor()) {
|
switch (UIConfiguration::instance().get_primary_clock_delta_mode()) {
|
||||||
primary_clock->set (pos, false, editor->get_preferred_edit_position (EDIT_IGNORE_PHEAD));
|
case NoDelta:
|
||||||
} else {
|
primary_clock->set (pos);
|
||||||
primary_clock->set (pos);
|
break;
|
||||||
|
case DeltaEditPoint:
|
||||||
|
primary_clock->set (pos, false, editor->get_preferred_edit_position (EDIT_IGNORE_PHEAD));
|
||||||
|
break;
|
||||||
|
case DeltaOriginMarker:
|
||||||
|
{
|
||||||
|
Location* loc = _session->locations()->clock_origin_location ();
|
||||||
|
primary_clock->set (pos, false, loc ? loc->start() : 0);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UIConfiguration::instance().get_secondary_clock_delta_edit_cursor()) {
|
switch (UIConfiguration::instance().get_secondary_clock_delta_mode()) {
|
||||||
secondary_clock->set (pos, false, editor->get_preferred_edit_position (EDIT_IGNORE_PHEAD));
|
case NoDelta:
|
||||||
} else {
|
secondary_clock->set (pos);
|
||||||
secondary_clock->set (pos);
|
break;
|
||||||
|
case DeltaEditPoint:
|
||||||
|
secondary_clock->set (pos, false, editor->get_preferred_edit_position (EDIT_IGNORE_PHEAD));
|
||||||
|
break;
|
||||||
|
case DeltaOriginMarker:
|
||||||
|
{
|
||||||
|
Location* loc = _session->locations()->clock_origin_location ();
|
||||||
|
secondary_clock->set (pos, false, loc ? loc->start() : 0);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (big_clock_window) {
|
if (big_clock_window) {
|
||||||
|
|
|
||||||
|
|
@ -233,7 +233,7 @@ public:
|
||||||
*
|
*
|
||||||
* (either RapidScreenUpdate || SuperRapidScreenUpdate - user-config)
|
* (either RapidScreenUpdate || SuperRapidScreenUpdate - user-config)
|
||||||
*/
|
*/
|
||||||
static sigc::signal<void, samplepos_t, bool, samplepos_t> Clock;
|
static sigc::signal<void, samplepos_t> Clock;
|
||||||
|
|
||||||
static void close_all_dialogs () { CloseAllDialogs(); }
|
static void close_all_dialogs () { CloseAllDialogs(); }
|
||||||
static sigc::signal<void> CloseAllDialogs;
|
static sigc::signal<void> CloseAllDialogs;
|
||||||
|
|
|
||||||
|
|
@ -334,8 +334,8 @@ ARDOUR_UI::setup_transport ()
|
||||||
monitor_disk_button.set_related_action (act);
|
monitor_disk_button.set_related_action (act);
|
||||||
|
|
||||||
/* connect signals */
|
/* connect signals */
|
||||||
ARDOUR_UI::Clock.connect (sigc::mem_fun (primary_clock, &AudioClock::set));
|
ARDOUR_UI::Clock.connect (sigc::bind (sigc::mem_fun (primary_clock, &MainClock::set), false, 0));
|
||||||
ARDOUR_UI::Clock.connect (sigc::mem_fun (secondary_clock, &AudioClock::set));
|
ARDOUR_UI::Clock.connect (sigc::bind (sigc::mem_fun (secondary_clock, &MainClock::set), false, 0));
|
||||||
|
|
||||||
primary_clock->ValueChanged.connect (sigc::mem_fun(*this, &ARDOUR_UI::primary_clock_value_changed));
|
primary_clock->ValueChanged.connect (sigc::mem_fun(*this, &ARDOUR_UI::primary_clock_value_changed));
|
||||||
secondary_clock->ValueChanged.connect (sigc::mem_fun(*this, &ARDOUR_UI::secondary_clock_value_changed));
|
secondary_clock->ValueChanged.connect (sigc::mem_fun(*this, &ARDOUR_UI::secondary_clock_value_changed));
|
||||||
|
|
|
||||||
|
|
@ -442,8 +442,8 @@ ARDOUR_UI::parameter_changed (std::string p)
|
||||||
|
|
||||||
} else if (p == "show-track-meters") {
|
} else if (p == "show-track-meters") {
|
||||||
if (editor) editor->toggle_meter_updating();
|
if (editor) editor->toggle_meter_updating();
|
||||||
} else if (p == "primary-clock-delta-edit-cursor") {
|
} else if (p == "primary-clock-delta-mode") {
|
||||||
if (UIConfiguration::instance().get_primary_clock_delta_edit_cursor()) {
|
if (UIConfiguration::instance().get_primary_clock_delta_mode() != NoDelta) {
|
||||||
primary_clock->set_is_duration (true);
|
primary_clock->set_is_duration (true);
|
||||||
primary_clock->set_editable (false);
|
primary_clock->set_editable (false);
|
||||||
primary_clock->set_widget_name ("transport delta");
|
primary_clock->set_widget_name ("transport delta");
|
||||||
|
|
@ -452,8 +452,8 @@ ARDOUR_UI::parameter_changed (std::string p)
|
||||||
primary_clock->set_editable (true);
|
primary_clock->set_editable (true);
|
||||||
primary_clock->set_widget_name ("transport");
|
primary_clock->set_widget_name ("transport");
|
||||||
}
|
}
|
||||||
} else if (p == "secondary-clock-delta-edit-cursor") {
|
} else if (p == "secondary-clock-delta-mode") {
|
||||||
if (UIConfiguration::instance().get_secondary_clock_delta_edit_cursor()) {
|
if (UIConfiguration::instance().get_secondary_clock_delta_mode() != NoDelta) {
|
||||||
secondary_clock->set_is_duration (true);
|
secondary_clock->set_is_duration (true);
|
||||||
secondary_clock->set_editable (false);
|
secondary_clock->set_editable (false);
|
||||||
secondary_clock->set_widget_name ("secondary delta");
|
secondary_clock->set_widget_name ("secondary delta");
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,7 @@ AudioClock::AudioClock (const string& clock_name, bool transient, const string&
|
||||||
|
|
||||||
_mode = BBT; /* lie to force mode switch */
|
_mode = BBT; /* lie to force mode switch */
|
||||||
set_mode (Timecode);
|
set_mode (Timecode);
|
||||||
set (last_when, true);
|
AudioClock::set (last_when, true);
|
||||||
|
|
||||||
if (!is_transient) {
|
if (!is_transient) {
|
||||||
clocks.push_back (this);
|
clocks.push_back (this);
|
||||||
|
|
@ -187,7 +187,7 @@ AudioClock::set_font (Pango::FontDescription font)
|
||||||
tmp->get_pixel_size (em_width, ignore_height);
|
tmp->get_pixel_size (em_width, ignore_height);
|
||||||
|
|
||||||
/* force redraw of markup with new font-size */
|
/* force redraw of markup with new font-size */
|
||||||
set (last_when, true);
|
AudioClock::set (last_when, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -554,7 +554,7 @@ AudioClock::end_edit (bool modify)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
set (pos, true);
|
AudioClock::set (pos, true);
|
||||||
_layout->set_attributes (normal_attributes);
|
_layout->set_attributes (normal_attributes);
|
||||||
ValueChanged(); /* EMIT_SIGNAL */
|
ValueChanged(); /* EMIT_SIGNAL */
|
||||||
}
|
}
|
||||||
|
|
@ -781,14 +781,14 @@ AudioClock::end_edit_relative (bool add)
|
||||||
|
|
||||||
if (samples != 0) {
|
if (samples != 0) {
|
||||||
if (add) {
|
if (add) {
|
||||||
set (current_time() + samples, true);
|
AudioClock::set (current_time() + samples, true);
|
||||||
} else {
|
} else {
|
||||||
samplepos_t c = current_time();
|
samplepos_t c = current_time();
|
||||||
|
|
||||||
if (c > samples || _negative_allowed) {
|
if (c > samples || _negative_allowed) {
|
||||||
set (c - samples, true);
|
AudioClock::set (c - samples, true);
|
||||||
} else {
|
} else {
|
||||||
set (0, true);
|
AudioClock::set (0, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ValueChanged (); /* EMIT SIGNAL */
|
ValueChanged (); /* EMIT SIGNAL */
|
||||||
|
|
@ -802,7 +802,7 @@ AudioClock::end_edit_relative (bool add)
|
||||||
void
|
void
|
||||||
AudioClock::session_property_changed (const PropertyChange&)
|
AudioClock::session_property_changed (const PropertyChange&)
|
||||||
{
|
{
|
||||||
set (last_when, true);
|
AudioClock::set (last_when, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -814,7 +814,7 @@ AudioClock::session_configuration_changed (std::string p)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p == "sync-source" || p == "external-sync") {
|
if (p == "sync-source" || p == "external-sync") {
|
||||||
set (current_time(), true);
|
AudioClock::set (current_time(), true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -831,7 +831,7 @@ AudioClock::session_configuration_changed (std::string p)
|
||||||
} else {
|
} else {
|
||||||
current = current_time ();
|
current = current_time ();
|
||||||
}
|
}
|
||||||
set (current, true);
|
AudioClock::set (current, true);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
@ -845,6 +845,7 @@ AudioClock::set (samplepos_t when, bool force, samplecnt_t offset)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_offset = offset;
|
||||||
if (is_duration) {
|
if (is_duration) {
|
||||||
when = when - offset;
|
when = when - offset;
|
||||||
}
|
}
|
||||||
|
|
@ -1312,7 +1313,7 @@ AudioClock::set_session (Session *s)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
set (last_when, true);
|
AudioClock::set (last_when, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1744,7 +1745,7 @@ AudioClock::on_scroll_event (GdkEventScroll *ev)
|
||||||
if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
|
if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
|
||||||
samples *= 10;
|
samples *= 10;
|
||||||
}
|
}
|
||||||
set (current_time() + samples, true);
|
AudioClock::set (current_time() + samples, true);
|
||||||
ValueChanged (); /* EMIT_SIGNAL */
|
ValueChanged (); /* EMIT_SIGNAL */
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -1757,9 +1758,9 @@ AudioClock::on_scroll_event (GdkEventScroll *ev)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_negative_allowed && (double)current_time() - (double)samples < 0.0) {
|
if (!_negative_allowed && (double)current_time() - (double)samples < 0.0) {
|
||||||
set (0, true);
|
AudioClock::set (0, true);
|
||||||
} else {
|
} else {
|
||||||
set (current_time() - samples, true);
|
AudioClock::set (current_time() - samples, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
ValueChanged (); /* EMIT_SIGNAL */
|
ValueChanged (); /* EMIT_SIGNAL */
|
||||||
|
|
@ -1809,9 +1810,9 @@ AudioClock::on_motion_notify_event (GdkEventMotion *ev)
|
||||||
samples = get_sample_step (drag_field, pos, dir);
|
samples = get_sample_step (drag_field, pos, dir);
|
||||||
|
|
||||||
if (samples != 0 && samples * drag_accum < current_time()) {
|
if (samples != 0 && samples * drag_accum < current_time()) {
|
||||||
set ((samplepos_t) floor (pos - drag_accum * samples), false); // minus because up is negative in GTK
|
AudioClock::set ((samplepos_t) floor (pos - drag_accum * samples), false); // minus because up is negative in GTK
|
||||||
} else {
|
} else {
|
||||||
set (0 , false);
|
AudioClock::set (0 , false);
|
||||||
}
|
}
|
||||||
|
|
||||||
drag_accum= 0;
|
drag_accum= 0;
|
||||||
|
|
@ -2154,7 +2155,7 @@ AudioClock::set_from_playhead ()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
set (_session->transport_sample());
|
AudioClock::set (_session->transport_sample());
|
||||||
ValueChanged ();
|
ValueChanged ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2237,7 +2238,7 @@ AudioClock::set_mode (Mode m, bool noemit)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
set (last_when, true);
|
AudioClock::set (last_when, true);
|
||||||
|
|
||||||
if (!is_transient && !noemit) {
|
if (!is_transient && !noemit) {
|
||||||
ModeChanged (); /* EMIT SIGNAL (the static one)*/
|
ModeChanged (); /* EMIT SIGNAL (the static one)*/
|
||||||
|
|
@ -2279,7 +2280,7 @@ AudioClock::set_is_duration (bool yn)
|
||||||
}
|
}
|
||||||
|
|
||||||
is_duration = yn;
|
is_duration = yn;
|
||||||
set (last_when, true);
|
AudioClock::set (last_when, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -2295,7 +2296,7 @@ AudioClock::set_off (bool yn)
|
||||||
* change
|
* change
|
||||||
*/
|
*/
|
||||||
|
|
||||||
set (last_when, true);
|
AudioClock::set (last_when, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ class AudioClock : public CairoWidget, public ARDOUR::SessionHandlePtr
|
||||||
|
|
||||||
void focus ();
|
void focus ();
|
||||||
|
|
||||||
void set (samplepos_t, bool force = false, ARDOUR::samplecnt_t offset = 0);
|
virtual void set (samplepos_t, bool force = false, ARDOUR::samplecnt_t offset = 0);
|
||||||
void set_from_playhead ();
|
void set_from_playhead ();
|
||||||
void locate ();
|
void locate ();
|
||||||
void set_mode (Mode, bool noemit = false);
|
void set_mode (Mode, bool noemit = false);
|
||||||
|
|
@ -105,7 +105,8 @@ class AudioClock : public CairoWidget, public ARDOUR::SessionHandlePtr
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void render (Cairo::RefPtr<Cairo::Context> const&, cairo_rectangle_t*);
|
void render (Cairo::RefPtr<Cairo::Context> const&, cairo_rectangle_t*);
|
||||||
bool get_is_duration () const { return is_duration; } ;
|
bool get_is_duration () const { return is_duration; }
|
||||||
|
ARDOUR::samplecnt_t offset () const { return _offset; }
|
||||||
|
|
||||||
virtual void build_ops_menu ();
|
virtual void build_ops_menu ();
|
||||||
Gtk::Menu *ops_menu;
|
Gtk::Menu *ops_menu;
|
||||||
|
|
@ -133,6 +134,8 @@ class AudioClock : public CairoWidget, public ARDOUR::SessionHandlePtr
|
||||||
|
|
||||||
samplepos_t _limit_pos;
|
samplepos_t _limit_pos;
|
||||||
|
|
||||||
|
ARDOUR::samplecnt_t _offset;
|
||||||
|
|
||||||
Glib::RefPtr<Pango::Layout> _layout;
|
Glib::RefPtr<Pango::Layout> _layout;
|
||||||
|
|
||||||
bool _with_info;
|
bool _with_info;
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ BigClockWindow::BigClockWindow (AudioClock& c)
|
||||||
: ArdourWindow (_("Big Clock"))
|
: ArdourWindow (_("Big Clock"))
|
||||||
, clock (c)
|
, clock (c)
|
||||||
{
|
{
|
||||||
ARDOUR_UI::Clock.connect (sigc::mem_fun (clock, &AudioClock::set));
|
ARDOUR_UI::Clock.connect (sigc::bind (sigc::mem_fun (clock, &AudioClock::set), false, 0));
|
||||||
|
|
||||||
clock.set_corner_radius (0.0);
|
clock.set_corner_radius (0.0);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "pbd/unwind.h"
|
||||||
#include "ardour/tempo.h"
|
#include "ardour/tempo.h"
|
||||||
|
|
||||||
#include "actions.h"
|
#include "actions.h"
|
||||||
|
|
@ -27,6 +28,7 @@
|
||||||
#include "pbd/i18n.h"
|
#include "pbd/i18n.h"
|
||||||
|
|
||||||
using namespace Gtk;
|
using namespace Gtk;
|
||||||
|
using namespace ARDOUR;
|
||||||
|
|
||||||
MainClock::MainClock (
|
MainClock::MainClock (
|
||||||
const std::string& clock_name,
|
const std::string& clock_name,
|
||||||
|
|
@ -34,7 +36,8 @@ MainClock::MainClock (
|
||||||
bool primary
|
bool primary
|
||||||
)
|
)
|
||||||
: AudioClock (clock_name, false, widget_name, true, true, false, true)
|
: AudioClock (clock_name, false, widget_name, true, true, false, true)
|
||||||
, _primary (primary)
|
, _primary (primary)
|
||||||
|
, _suspend_delta_mode_signal (false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -55,21 +58,33 @@ MainClock::build_ops_menu ()
|
||||||
|
|
||||||
MenuList& ops_items = ops_menu->items();
|
MenuList& ops_items = ops_menu->items();
|
||||||
ops_items.push_back (SeparatorElem ());
|
ops_items.push_back (SeparatorElem ());
|
||||||
ops_items.push_back (CheckMenuElem (_("Display delta to edit cursor"), sigc::mem_fun (*this, &MainClock::display_delta_to_edit_cursor)));
|
RadioMenuItem::Group group;
|
||||||
Gtk::CheckMenuItem* c = dynamic_cast<Gtk::CheckMenuItem *> (&ops_items.back());
|
PBD::Unwinder<bool> uw (_suspend_delta_mode_signal, true);
|
||||||
|
ClockDeltaMode mode;
|
||||||
if (_primary) {
|
if (_primary) {
|
||||||
if (UIConfiguration::instance().get_primary_clock_delta_edit_cursor ()) {
|
mode = UIConfiguration::instance().get_primary_clock_delta_mode ();
|
||||||
UIConfiguration::instance().set_primary_clock_delta_edit_cursor (false);
|
|
||||||
c->set_active (true);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (UIConfiguration::instance().get_secondary_clock_delta_edit_cursor ()) {
|
mode = UIConfiguration::instance().get_secondary_clock_delta_mode ();
|
||||||
UIConfiguration::instance().set_secondary_clock_delta_edit_cursor (false);
|
}
|
||||||
c->set_active (true);
|
|
||||||
}
|
ops_items.push_back (RadioMenuElem (group, _("Display absolute time"), sigc::bind (sigc::mem_fun (*this, &MainClock::set_display_delta_mode), NoDelta)));
|
||||||
|
if (mode == NoDelta) {
|
||||||
|
RadioMenuItem* i = dynamic_cast<RadioMenuItem *> (&ops_items.back ());
|
||||||
|
i->set_active (true);
|
||||||
|
}
|
||||||
|
ops_items.push_back (RadioMenuElem (group, _("Display delta to edit cursor"), sigc::bind (sigc::mem_fun (*this, &MainClock::set_display_delta_mode), DeltaEditPoint)));
|
||||||
|
if (mode == DeltaEditPoint) {
|
||||||
|
RadioMenuItem* i = dynamic_cast<RadioMenuItem *> (&ops_items.back ());
|
||||||
|
i->set_active (true);
|
||||||
|
}
|
||||||
|
ops_items.push_back (RadioMenuElem (group, _("Display delta to origin marker"), sigc::bind (sigc::mem_fun (*this, &MainClock::set_display_delta_mode), DeltaOriginMarker)));
|
||||||
|
if (mode == DeltaOriginMarker) {
|
||||||
|
RadioMenuItem* i = dynamic_cast<RadioMenuItem *> (&ops_items.back ());
|
||||||
|
i->set_active (true);
|
||||||
}
|
}
|
||||||
|
|
||||||
ops_items.push_back (SeparatorElem());
|
ops_items.push_back (SeparatorElem());
|
||||||
|
|
||||||
ops_items.push_back (MenuElem (_("Edit Tempo"), sigc::mem_fun(*this, &MainClock::edit_current_tempo)));
|
ops_items.push_back (MenuElem (_("Edit Tempo"), sigc::mem_fun(*this, &MainClock::edit_current_tempo)));
|
||||||
ops_items.push_back (MenuElem (_("Edit Meter"), sigc::mem_fun(*this, &MainClock::edit_current_meter)));
|
ops_items.push_back (MenuElem (_("Edit Meter"), sigc::mem_fun(*this, &MainClock::edit_current_meter)));
|
||||||
ops_items.push_back (MenuElem (_("Insert Tempo Change"), sigc::mem_fun(*this, &MainClock::insert_new_tempo)));
|
ops_items.push_back (MenuElem (_("Insert Tempo Change"), sigc::mem_fun(*this, &MainClock::insert_new_tempo)));
|
||||||
|
|
@ -80,20 +95,51 @@ samplepos_t
|
||||||
MainClock::absolute_time () const
|
MainClock::absolute_time () const
|
||||||
{
|
{
|
||||||
if (get_is_duration ()) {
|
if (get_is_duration ()) {
|
||||||
// delta to edit cursor
|
return current_time () + offset ();
|
||||||
return current_time () + PublicEditor::instance().get_preferred_edit_position (Editing::EDIT_IGNORE_PHEAD);
|
|
||||||
} else {
|
} else {
|
||||||
return current_time ();
|
return current_time ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MainClock::display_delta_to_edit_cursor ()
|
MainClock::set (samplepos_t when, bool force, ARDOUR::samplecnt_t /*offset*/)
|
||||||
{
|
{
|
||||||
|
ClockDeltaMode mode;
|
||||||
if (_primary) {
|
if (_primary) {
|
||||||
UIConfiguration::instance().set_primary_clock_delta_edit_cursor (!UIConfiguration::instance().get_primary_clock_delta_edit_cursor ());
|
mode = UIConfiguration::instance().get_primary_clock_delta_mode ();
|
||||||
} else {
|
} else {
|
||||||
UIConfiguration::instance().set_secondary_clock_delta_edit_cursor (!UIConfiguration::instance().get_secondary_clock_delta_edit_cursor ());
|
mode = UIConfiguration::instance().get_secondary_clock_delta_mode ();
|
||||||
|
}
|
||||||
|
if (!PublicEditor::instance().session()) {
|
||||||
|
mode = NoDelta;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (mode) {
|
||||||
|
case NoDelta:
|
||||||
|
AudioClock::set (when, force, 0);
|
||||||
|
break;
|
||||||
|
case DeltaEditPoint:
|
||||||
|
AudioClock::set (when, force, PublicEditor::instance().get_preferred_edit_position (Editing::EDIT_IGNORE_PHEAD));
|
||||||
|
break;
|
||||||
|
case DeltaOriginMarker:
|
||||||
|
{
|
||||||
|
Location* loc = PublicEditor::instance().session()->locations()->clock_origin_location ();
|
||||||
|
AudioClock::set (when, force, loc ? loc->start() : 0);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
MainClock::set_display_delta_mode (ClockDeltaMode m)
|
||||||
|
{
|
||||||
|
if (_suspend_delta_mode_signal) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (_primary) {
|
||||||
|
UIConfiguration::instance().set_primary_clock_delta_mode (m);
|
||||||
|
} else {
|
||||||
|
UIConfiguration::instance().set_secondary_clock_delta_mode (m);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,18 +31,20 @@ public:
|
||||||
MainClock (const std::string& clock_name, const std::string& widget_name, bool primary);
|
MainClock (const std::string& clock_name, const std::string& widget_name, bool primary);
|
||||||
samplepos_t absolute_time () const;
|
samplepos_t absolute_time () const;
|
||||||
void set_session (ARDOUR::Session *s);
|
void set_session (ARDOUR::Session *s);
|
||||||
|
void set (samplepos_t, bool force = false, ARDOUR::samplecnt_t offset = 0);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// Editor *_editor;
|
// Editor *_editor;
|
||||||
|
|
||||||
void build_ops_menu ();
|
void build_ops_menu ();
|
||||||
void display_delta_to_edit_cursor ();
|
void set_display_delta_mode (ARDOUR::ClockDeltaMode);
|
||||||
void edit_current_tempo ();
|
void edit_current_tempo ();
|
||||||
void edit_current_meter ();
|
void edit_current_meter ();
|
||||||
void insert_new_tempo ();
|
void insert_new_tempo ();
|
||||||
void insert_new_meter ();
|
void insert_new_meter ();
|
||||||
bool _primary;
|
bool _primary;
|
||||||
|
bool _suspend_delta_mode_signal;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __gtk_ardour_main_clock_h__
|
#endif // __gtk_ardour_main_clock_h__
|
||||||
|
|
|
||||||
|
|
@ -62,8 +62,8 @@ UI_CONFIG_VARIABLE (std::string, mixer_strip_visibility, "mixer-element-visibili
|
||||||
UI_CONFIG_VARIABLE (bool, allow_non_quarter_pulse, "allow-non-quarter-pulse", false)
|
UI_CONFIG_VARIABLE (bool, allow_non_quarter_pulse, "allow-non-quarter-pulse", false)
|
||||||
UI_CONFIG_VARIABLE (bool, show_region_gain, "show-region-gain", false)
|
UI_CONFIG_VARIABLE (bool, show_region_gain, "show-region-gain", false)
|
||||||
UI_CONFIG_VARIABLE (bool, show_name_highlight, "show-name-highlight", false)
|
UI_CONFIG_VARIABLE (bool, show_name_highlight, "show-name-highlight", false)
|
||||||
UI_CONFIG_VARIABLE (bool, primary_clock_delta_edit_cursor, "primary-clock-delta-edit-cursor", false)
|
UI_CONFIG_VARIABLE (ARDOUR::ClockDeltaMode, primary_clock_delta_mode, "primary-clock-delta-mode", NoDelta)
|
||||||
UI_CONFIG_VARIABLE (bool, secondary_clock_delta_edit_cursor, "secondary-clock-delta-edit-cursor", false)
|
UI_CONFIG_VARIABLE (ARDOUR::ClockDeltaMode, secondary_clock_delta_mode, "secondary-clock-delta-mode", NoDelta)
|
||||||
UI_CONFIG_VARIABLE (uint64_t, clock_display_limit, "clock-display-limit", 2592000) /* seconds; default 30days (720h), 0 = unlimited */
|
UI_CONFIG_VARIABLE (uint64_t, clock_display_limit, "clock-display-limit", 2592000) /* seconds; default 30days (720h), 0 = unlimited */
|
||||||
UI_CONFIG_VARIABLE (bool, show_track_meters, "show-track-meters", true)
|
UI_CONFIG_VARIABLE (bool, show_track_meters, "show-track-meters", true)
|
||||||
UI_CONFIG_VARIABLE (bool, editor_stereo_only_meters, "editor-stereo-only-meters", false)
|
UI_CONFIG_VARIABLE (bool, editor_stereo_only_meters, "editor-stereo-only-meters", false)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue