mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 06:44:57 +01:00
Compare commits
14 commits
2152e7ba3b
...
90e6107972
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
90e6107972 | ||
|
|
8ddf057553 | ||
|
|
b884f7c534 | ||
|
|
68c87c3f29 | ||
|
|
76c62139c8 | ||
|
|
02f4daffe4 | ||
|
|
ee5d3da929 | ||
|
|
97439d8777 | ||
|
|
f8564ba4df | ||
|
|
4c9460b697 | ||
|
|
46e2a03863 | ||
|
|
413f2e9d1b | ||
|
|
b6e0332148 | ||
|
|
993c7c4bec |
20 changed files with 119 additions and 29 deletions
|
|
@ -144,6 +144,7 @@ AudioClipEditor::AudioClipEditor ()
|
|||
scroll_bar_handle->set_outline (false);
|
||||
scroll_bar_handle->set_corner_radius (5.);
|
||||
scroll_bar_handle->Event.connect (sigc::mem_fun (*this, &AudioClipEditor::scroll_event_handler));
|
||||
scroll_bar_handle->disable_scroll_translation ();
|
||||
|
||||
/* A scrolling container for our waves and lines etc. */
|
||||
|
||||
|
|
|
|||
|
|
@ -253,6 +253,7 @@ CueBoxUI::context_menu (uint64_t idx)
|
|||
fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::ForwardTrigger)), sigc::bind (sigc::mem_fun (*this, &CueBoxUI::set_all_follow_action), FollowAction (FollowAction::ForwardTrigger), idx)));
|
||||
fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::AnyTrigger)), sigc::bind (sigc::mem_fun (*this, &CueBoxUI::set_all_follow_action), FollowAction (FollowAction::AnyTrigger), idx)));
|
||||
fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::OtherTrigger)), sigc::bind (sigc::mem_fun (*this, &CueBoxUI::set_all_follow_action), FollowAction (FollowAction::OtherTrigger), idx)));
|
||||
fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::JumpTrigger)), sigc::bind (sigc::mem_fun (*this, &CueBoxUI::set_all_follow_action), FollowAction (FollowAction::JumpTrigger), idx)));
|
||||
|
||||
Menu* launch_menu = manage (new Menu);
|
||||
MenuList& litems = launch_menu->items ();
|
||||
|
|
|
|||
|
|
@ -26,13 +26,20 @@
|
|||
#include <gtkmm/scrolledwindow.h>
|
||||
#include <gtkmm/treemodel.h>
|
||||
#include <gtkmm/treestore.h>
|
||||
#include <gtkmm/treeview.h>
|
||||
|
||||
#include "pbd/properties.h"
|
||||
#include "pbd/signals.h"
|
||||
|
||||
#include "ardour/route.h"
|
||||
#include "ardour/session_handle.h"
|
||||
#include "ardour/types.h"
|
||||
|
||||
#include "gtkmm2ext/widget_state.h"
|
||||
|
||||
#include "editor_component.h"
|
||||
|
||||
class VCATimeAxisView;
|
||||
class TimeAxisView;
|
||||
|
||||
class EditorRoutes : public EditorComponent, public PBD::ScopedConnectionList, public ARDOUR::SessionHandlePtr
|
||||
{
|
||||
|
|
@ -86,7 +93,6 @@ private:
|
|||
void on_tv_solo_isolate_toggled (std::string const &);
|
||||
void on_tv_solo_safe_toggled (std::string const &);
|
||||
void build_menu ();
|
||||
void presentation_info_changed (PBD::PropertyChange const &);
|
||||
void row_deleted (Gtk::TreeModel::Path const &);
|
||||
void visible_changed (std::string const &);
|
||||
void trigger_changed (std::string const &);
|
||||
|
|
@ -197,7 +203,7 @@ private:
|
|||
bool _redisplay_on_resume;
|
||||
bool _idle_update_queued;
|
||||
|
||||
volatile int _redisplay_active;
|
||||
int _redisplay_active;
|
||||
|
||||
Gtk::Menu* _menu;
|
||||
Gtk::Widget* old_focus;
|
||||
|
|
|
|||
|
|
@ -146,6 +146,7 @@ SlotPropertyTable::SlotPropertyTable ()
|
|||
_follow_left.AddMenuElem (MenuElem (follow_action_to_string(FollowAction (FollowAction::ForwardTrigger)), sigc::bind (sigc::mem_fun (*this, &SlotPropertyTable::set_follow_action), FollowAction (FollowAction::ForwardTrigger), 0)));
|
||||
_follow_left.AddMenuElem (MenuElem (follow_action_to_string(FollowAction (FollowAction::AnyTrigger)), sigc::bind (sigc::mem_fun (*this, &SlotPropertyTable::set_follow_action), FollowAction (FollowAction::AnyTrigger), 0)));
|
||||
_follow_left.AddMenuElem (MenuElem (follow_action_to_string(FollowAction (FollowAction::OtherTrigger)), sigc::bind (sigc::mem_fun (*this, &SlotPropertyTable::set_follow_action), FollowAction (FollowAction::OtherTrigger), 0)));
|
||||
_follow_left.AddMenuElem (MenuElem (follow_action_to_string(FollowAction (FollowAction::JumpTrigger)), sigc::bind (sigc::mem_fun (*this, &SlotPropertyTable::set_follow_action), FollowAction (FollowAction::JumpTrigger), 0)));
|
||||
_follow_left.set_sizing_text (longest_follow);
|
||||
|
||||
_follow_right.set_name("FollowAction");
|
||||
|
|
@ -158,6 +159,7 @@ SlotPropertyTable::SlotPropertyTable ()
|
|||
_follow_right.AddMenuElem (MenuElem (follow_action_to_string(FollowAction (FollowAction::ForwardTrigger)), sigc::bind (sigc::mem_fun (*this, &SlotPropertyTable::set_follow_action), FollowAction (FollowAction::ForwardTrigger), 1)));
|
||||
_follow_right.AddMenuElem (MenuElem (follow_action_to_string(FollowAction (FollowAction::AnyTrigger)), sigc::bind (sigc::mem_fun (*this, &SlotPropertyTable::set_follow_action), FollowAction (FollowAction::AnyTrigger), 1)));
|
||||
_follow_right.AddMenuElem (MenuElem (follow_action_to_string(FollowAction (FollowAction::OtherTrigger)), sigc::bind (sigc::mem_fun (*this, &SlotPropertyTable::set_follow_action), FollowAction (FollowAction::OtherTrigger), 1)));
|
||||
_follow_right.AddMenuElem (MenuElem (follow_action_to_string(FollowAction (FollowAction::JumpTrigger)), sigc::bind (sigc::mem_fun (*this, &SlotPropertyTable::set_follow_action), FollowAction (FollowAction::JumpTrigger), 1)));
|
||||
_follow_right.set_sizing_text (longest_follow);
|
||||
|
||||
_launch_style_button.set_name("FollowAction");
|
||||
|
|
|
|||
|
|
@ -350,6 +350,7 @@ TriggerMaster::context_menu ()
|
|||
fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::ReverseTrigger)), sigc::bind (sigc::mem_fun (*this, &TriggerMaster::set_all_follow_action), FollowAction (FollowAction::ReverseTrigger))));
|
||||
fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::AnyTrigger)), sigc::bind (sigc::mem_fun (*this, &TriggerMaster::set_all_follow_action), FollowAction (FollowAction::AnyTrigger))));
|
||||
fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::OtherTrigger)), sigc::bind (sigc::mem_fun (*this, &TriggerMaster::set_all_follow_action), FollowAction (FollowAction::OtherTrigger))));
|
||||
fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::JumpTrigger)), sigc::bind (sigc::mem_fun (*this, &TriggerMaster::set_all_follow_action), FollowAction (FollowAction::JumpTrigger))));
|
||||
|
||||
Menu* launch_menu = manage (new Menu);
|
||||
MenuList& litems = launch_menu->items ();
|
||||
|
|
@ -731,6 +732,8 @@ CueMaster::context_menu ()
|
|||
fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::ReverseTrigger)), sigc::bind (sigc::mem_fun (*this, &CueMaster::set_all_follow_action), FollowAction (FollowAction::ReverseTrigger))));
|
||||
fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::AnyTrigger)), sigc::bind (sigc::mem_fun (*this, &CueMaster::set_all_follow_action), FollowAction (FollowAction::AnyTrigger))));
|
||||
fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::OtherTrigger)), sigc::bind (sigc::mem_fun (*this, &CueMaster::set_all_follow_action), FollowAction (FollowAction::OtherTrigger))));
|
||||
fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::JumpTrigger)), sigc::bind (sigc::mem_fun (*this, &CueMaster::set_all_follow_action), FollowAction (FollowAction::JumpTrigger))));
|
||||
|
||||
|
||||
Menu* launch_menu = manage (new Menu);
|
||||
MenuList& litems = launch_menu->items ();
|
||||
|
|
|
|||
|
|
@ -88,6 +88,7 @@ TriggerUI::TriggerUI ()
|
|||
follow_strings.push_back (follow_action_to_string (FollowAction (FollowAction::LastTrigger)));
|
||||
follow_strings.push_back (follow_action_to_string (FollowAction (FollowAction::AnyTrigger)));
|
||||
follow_strings.push_back (follow_action_to_string (FollowAction (FollowAction::OtherTrigger)));
|
||||
follow_strings.push_back (follow_action_to_string (FollowAction (FollowAction::JumpTrigger)));
|
||||
|
||||
for (std::vector<std::string>::const_iterator i = follow_strings.begin(); i != follow_strings.end(); ++i) {
|
||||
if (i->length() > longest_follow.length()) {
|
||||
|
|
@ -646,6 +647,11 @@ TriggerUI::follow_context_menu ()
|
|||
dynamic_cast<Gtk::CheckMenuItem*> (&fitems.back ())->set_active (true);
|
||||
}
|
||||
|
||||
fitems.push_back (RadioMenuElem (fagroup, TriggerUI::follow_action_to_string(FollowAction (FollowAction::JumpTrigger)), sigc::bind(sigc::mem_fun (*this, &TriggerUI::set_follow_action), FollowAction (FollowAction::JumpTrigger))));
|
||||
if (trigger ()->follow_action (0) == FollowAction::JumpTrigger) {
|
||||
dynamic_cast<Gtk::CheckMenuItem*> (&fitems.back ())->set_active (true);
|
||||
}
|
||||
|
||||
_ignore_menu_action = false;
|
||||
|
||||
items.push_back (MenuElem (_("Follow Action..."), *follow_menu));
|
||||
|
|
@ -805,6 +811,8 @@ TriggerUI::follow_action_to_string (FollowAction const & fa)
|
|||
return _("Any");
|
||||
case FollowAction::OtherTrigger:
|
||||
return _("Other");
|
||||
case FollowAction::JumpTrigger:
|
||||
return _("Jump");
|
||||
}
|
||||
/*NOTREACHED*/
|
||||
return std::string();
|
||||
|
|
|
|||
|
|
@ -294,6 +294,21 @@ TriggerEntry::draw_follow_icon (Cairo::RefPtr<Cairo::Context> context, FollowAct
|
|||
context->set_matrix (m);
|
||||
}
|
||||
context->set_identity_matrix ();
|
||||
} break;
|
||||
/* ben: new shape here ? */
|
||||
case FollowAction::JumpTrigger: {
|
||||
context->set_line_width (1.5 * scale);
|
||||
set_source_rgba (context, HSV (UIConfiguration::instance ().color ("neutral:midground")).lighter (0.25).color ()); // needs to be brighter to maintain balance
|
||||
for (int i = 0; i < 6; i++) {
|
||||
Cairo::Matrix m = context->get_matrix ();
|
||||
context->translate (size / 2, size / 2);
|
||||
context->rotate (i * M_PI / 3);
|
||||
context->move_to (0, 2 * scale);
|
||||
context->line_to (0, (size / 2) - 4 * scale);
|
||||
context->stroke ();
|
||||
context->set_matrix (m);
|
||||
}
|
||||
context->set_identity_matrix ();
|
||||
} break;
|
||||
case FollowAction::None:
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -890,7 +890,10 @@ ARDOUR_UI_UTILS::convert_drop_to_paths (vector<string>& paths, const SelectionDa
|
|||
*/
|
||||
string txt = data.get_text();
|
||||
|
||||
char* p = (char *) malloc (txt.length() + 1);
|
||||
/* copy to char* for easy char-wise checks and modification */
|
||||
char* tmp = (char *) malloc (txt.length() + 1);
|
||||
char* p = tmp;
|
||||
|
||||
txt.copy (p, txt.length(), 0);
|
||||
p[txt.length()] = '\0';
|
||||
|
||||
|
|
@ -922,7 +925,7 @@ ARDOUR_UI_UTILS::convert_drop_to_paths (vector<string>& paths, const SelectionDa
|
|||
}
|
||||
}
|
||||
|
||||
free ((void*)p);
|
||||
free ((void*)tmp);
|
||||
|
||||
if (uris.empty()) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -324,6 +324,8 @@ class LIBARDOUR_API Trigger : public PBD::Stateful {
|
|||
void set_region_internal (boost::shared_ptr<Region>);
|
||||
virtual void retrigger() = 0;
|
||||
virtual void _startup (Temporal::BBT_Offset const &);
|
||||
|
||||
bool internal_use_follow_length() const;
|
||||
};
|
||||
|
||||
typedef boost::shared_ptr<Trigger> TriggerPtr;
|
||||
|
|
|
|||
|
|
@ -836,12 +836,13 @@ struct FollowAction {
|
|||
LastTrigger,
|
||||
AnyTrigger,
|
||||
OtherTrigger,
|
||||
JumpTrigger,
|
||||
};
|
||||
|
||||
/* We could theoretically limit this to default_triggers_per_box but
|
||||
* doing it this way makes it likely that this will not change. Could
|
||||
* be worth a constexpr-style compile time assert to check
|
||||
* default_triggers_per_box < 64.
|
||||
* default_triggers_per_box < 64
|
||||
*/
|
||||
|
||||
typedef std::bitset<64> Targets;
|
||||
|
|
@ -854,6 +855,13 @@ struct FollowAction {
|
|||
FollowAction (Type t, std::string const & bitstring) : type (t), targets (bitstring) {}
|
||||
FollowAction (std::string const &);
|
||||
|
||||
static Targets target_any () { Targets t; t.set(); return t; }
|
||||
static Targets target_other (uint8_t skip) { Targets t; t.set (); t.reset (skip); return t; }
|
||||
static Targets target_next_wrap (uint8_t from) { Targets t; if (from < t.size() - 1) { t.set (from + 1); } else { t.set (0); } return t; }
|
||||
static Targets target_prev_wrap (uint8_t from) { Targets t; if (from) { t.set (from - 1); } else { t.set (t.size() - 1); } return t; }
|
||||
static Targets target_next_nowrap (uint8_t from) { Targets t; if (from < t.size() - 1) { t.set (from + 1); } return t; }
|
||||
static Targets target_prev_nowrap (uint8_t from) { Targets t; if (from) { t.set (from - 1); } return t; }
|
||||
|
||||
bool operator!= (FollowAction const & other) const {
|
||||
return other.type != type || other.targets != targets;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -871,6 +871,7 @@ setup_enum_writer ()
|
|||
REGISTER_CLASS_ENUM (FollowAction, LastTrigger);
|
||||
REGISTER_CLASS_ENUM (FollowAction, AnyTrigger);
|
||||
REGISTER_CLASS_ENUM (FollowAction, OtherTrigger);
|
||||
REGISTER_CLASS_ENUM (FollowAction, JumpTrigger);
|
||||
REGISTER (_FollowAction);
|
||||
|
||||
REGISTER_CLASS_ENUM (Trigger, OneShot);
|
||||
|
|
|
|||
|
|
@ -147,6 +147,10 @@ Session::memento_command_factory(XMLNode *n)
|
|||
/* we failed */
|
||||
info << string_compose (_("Could not reconstitute MementoCommand from XMLNode. object type = %1 id = %2"), type_name, id.to_s()) << endmsg;
|
||||
|
||||
delete after;
|
||||
delete before;
|
||||
delete child;
|
||||
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1419,10 +1419,10 @@ Session::state (bool save_template, snapshot_t snapshot_type, bool only_used_ass
|
|||
ca->add_child_nocopy (*can);
|
||||
/* see above, child is still "Regions" here */
|
||||
if (i->second->playlist() == 0 && only_used_assets) {
|
||||
if (boost::shared_ptr<AudioRegion> ar = boost::dynamic_pointer_cast<AudioRegion>( i->second)) {
|
||||
if (boost::shared_ptr<AudioRegion> ar = boost::dynamic_pointer_cast<AudioRegion> (i->second)) {
|
||||
child->add_child_nocopy (ar->get_basic_state ());
|
||||
} else {
|
||||
child->add_child_nocopy (ar->get_state ());
|
||||
child->add_child_nocopy (i->second->get_state ());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1120,10 +1120,10 @@ Session::butler_transport_work (bool have_process_lock)
|
|||
bool finished = true;
|
||||
PostTransportWork ptw = post_transport_work();
|
||||
#ifndef NDEBUG
|
||||
uint64_t before;
|
||||
uint64_t before = g_get_monotonic_time();
|
||||
#endif
|
||||
|
||||
DEBUG_TRACE (DEBUG::Transport, string_compose ("Butler transport work, todo = [%1] (0x%3%4%5) at %2\n", enum_2_string (ptw), (before = g_get_monotonic_time()), std::hex, ptw, std::dec));
|
||||
DEBUG_TRACE (DEBUG::Transport, string_compose ("Butler transport work, todo = [%1] (0x%3%4%5) at %2\n", enum_2_string (ptw), before, std::hex, ptw, std::dec));
|
||||
|
||||
if (ptw & PostTransportAdjustPlaybackBuffering) {
|
||||
/* need to prevent concurrency with ARDOUR::Reader::run(),
|
||||
|
|
|
|||
|
|
@ -407,6 +407,12 @@ Trigger::set_use_follow_length (bool ufl)
|
|||
_box.session().set_dirty();
|
||||
}
|
||||
|
||||
bool
|
||||
Trigger::internal_use_follow_length () const
|
||||
{
|
||||
return (_follow_action0.val().type != FollowAction::None) && _use_follow_length;
|
||||
}
|
||||
|
||||
void
|
||||
Trigger::set_legato (bool yn)
|
||||
{
|
||||
|
|
@ -703,6 +709,7 @@ Trigger::maybe_compute_next_transition (samplepos_t start_sample, Temporal::Beat
|
|||
transition_samples = start_sample;
|
||||
transition_beats = start;
|
||||
transition_time = timepos_t (start);
|
||||
transition_bbt = tmap->bbt_at (transition_beats);
|
||||
} else if (q.bars == 0) {
|
||||
Temporal::Beats transition_beats = start.round_up_to_multiple (Temporal::Beats (q.beats, q.ticks));
|
||||
transition_bbt = tmap->bbt_at (transition_beats);
|
||||
|
|
@ -1054,20 +1061,20 @@ AudioTrigger::set_expected_end_sample (Temporal::TempoMap::SharedPtr const & tma
|
|||
end_by_follow_length, _follow_length, end_by_barcnt, end_by_data_length));
|
||||
|
||||
if (stretching()) {
|
||||
if (_use_follow_length) {
|
||||
if (internal_use_follow_length()) {
|
||||
expected_end_sample = std::min (end_by_follow_length, end_by_barcnt);
|
||||
} else {
|
||||
expected_end_sample = end_by_barcnt;
|
||||
}
|
||||
} else {
|
||||
if (_use_follow_length) {
|
||||
if (internal_use_follow_length()) {
|
||||
expected_end_sample = std::min (end_by_follow_length, end_by_data_length);
|
||||
} else {
|
||||
expected_end_sample = end_by_data_length;
|
||||
}
|
||||
}
|
||||
|
||||
if (_use_follow_length) {
|
||||
if (internal_use_follow_length()) {
|
||||
final_sample = end_by_follow_length - transition_sample;
|
||||
} else {
|
||||
final_sample = expected_end_sample - transition_sample;
|
||||
|
|
@ -1075,7 +1082,7 @@ AudioTrigger::set_expected_end_sample (Temporal::TempoMap::SharedPtr const & tma
|
|||
|
||||
samplecnt_t usable_length;
|
||||
|
||||
if (_use_follow_length && (end_by_follow_length < end_by_data_length)) {
|
||||
if (internal_use_follow_length() && (end_by_follow_length < end_by_data_length)) {
|
||||
usable_length = tmap->sample_at (tmap->bbt_walk (Temporal::BBT_Time (), _follow_length));
|
||||
} else {
|
||||
usable_length = data.length;
|
||||
|
|
@ -1751,7 +1758,7 @@ MIDITrigger::set_expected_end_sample (Temporal::TempoMap::SharedPtr const & tmap
|
|||
|
||||
Temporal::Beats usable_length;
|
||||
|
||||
if (_use_follow_length && (end_by_follow_length < end_by_data_length)) {
|
||||
if (internal_use_follow_length() && (end_by_follow_length < end_by_data_length)) {
|
||||
usable_length = tmap->quarters_at (tmap->bbt_walk (transition_bbt, _follow_length)) - transition_beats;
|
||||
} else {
|
||||
usable_length = data_length;
|
||||
|
|
@ -1761,7 +1768,7 @@ MIDITrigger::set_expected_end_sample (Temporal::TempoMap::SharedPtr const & tmap
|
|||
|
||||
if (launch_style() != Repeat || (q == Temporal::BBT_Offset())) {
|
||||
|
||||
if (_use_follow_length) {
|
||||
if (internal_use_follow_length()) {
|
||||
final_beat = end_by_follow_length;
|
||||
} else {
|
||||
final_beat = end_by_data_length;
|
||||
|
|
@ -2995,6 +3002,9 @@ TriggerBox::determine_next_trigger (uint32_t current)
|
|||
{
|
||||
uint32_t n;
|
||||
uint32_t runnable = 0;
|
||||
std::vector<int32_t> possible_targets;
|
||||
|
||||
possible_targets.reserve (default_triggers_per_box);
|
||||
|
||||
/* count number of triggers that can actually be run (i.e. they have a region) */
|
||||
|
||||
|
|
@ -3008,6 +3018,11 @@ TriggerBox::determine_next_trigger (uint32_t current)
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (all_triggers[current]->follow_action (0).type == FollowAction::None) {
|
||||
/* when left follow action is disabled, no follow action */
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* decide which of the two follow actions we're going to use (based on
|
||||
* random number and the probability setting)
|
||||
*/
|
||||
|
|
@ -3157,6 +3172,17 @@ TriggerBox::determine_next_trigger (uint32_t current)
|
|||
}
|
||||
return n;
|
||||
|
||||
case FollowAction::JumpTrigger:
|
||||
for (std::size_t n = 0; n < default_triggers_per_box; ++n) {
|
||||
if (fa.targets.test (n) && all_triggers[n]->region()) {
|
||||
possible_targets.push_back (n);
|
||||
}
|
||||
}
|
||||
if (possible_targets.empty()) {
|
||||
return 1;
|
||||
}
|
||||
return possible_targets[_pcg.rand (possible_targets.size())];
|
||||
|
||||
|
||||
/* NOTREACHED */
|
||||
case FollowAction::Stop:
|
||||
|
|
|
|||
|
|
@ -299,7 +299,6 @@ Canvas::window_to_canvas (Duple const & d) const
|
|||
{
|
||||
ScrollGroup* best_group = 0;
|
||||
ScrollGroup* sg = 0;
|
||||
bool grabbed_item_inside = false;
|
||||
|
||||
/* if the coordinates are negative, clamp to zero and find the item
|
||||
* that covers that "edge" position.
|
||||
|
|
@ -333,8 +332,6 @@ Canvas::window_to_canvas (Duple const & d) const
|
|||
|
||||
best_group = sg;
|
||||
|
||||
grabbed_item_inside = check_grabbed_item_inside (sg);
|
||||
|
||||
if (sg->sensitivity() == (ScrollGroup::ScrollsVertically | ScrollGroup::ScrollsHorizontally)) {
|
||||
/* Can't do any better than this. */
|
||||
break;
|
||||
|
|
@ -343,7 +340,7 @@ Canvas::window_to_canvas (Duple const & d) const
|
|||
}
|
||||
}
|
||||
|
||||
if (best_group && (!have_grab() || grabbed_item_inside)) {
|
||||
if (best_group && (!have_grab() || grab_can_translate ())) {
|
||||
return d.translate (best_group->scroll_offset());
|
||||
}
|
||||
|
||||
|
|
@ -1518,13 +1515,14 @@ GtkCanvas::resize_handler ()
|
|||
}
|
||||
|
||||
bool
|
||||
GtkCanvas::check_grabbed_item_inside (Item* possible_parent) const
|
||||
GtkCanvas::grab_can_translate () const
|
||||
{
|
||||
if (!_grabbed_item) {
|
||||
return false;
|
||||
/* weird, but correct! */
|
||||
return true;
|
||||
}
|
||||
|
||||
return _grabbed_item->is_descendant_of (*possible_parent);
|
||||
return _grabbed_item->scroll_translation ();
|
||||
}
|
||||
|
||||
/** Create a GtkCanvaSViewport.
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ public:
|
|||
virtual void unfocus (Item*) = 0;
|
||||
|
||||
virtual bool have_grab() const { return false; }
|
||||
virtual bool check_grabbed_item_inside (Item*) const { return false; }
|
||||
virtual bool grab_can_translate () const { return true; }
|
||||
|
||||
void render (Rect const &, Cairo::RefPtr<Cairo::Context> const &) const;
|
||||
|
||||
|
|
@ -218,7 +218,7 @@ public:
|
|||
void unfocus (Item*);
|
||||
|
||||
bool have_grab() const { return _grabbed_item; }
|
||||
bool check_grabbed_item_inside (Item*) const;
|
||||
bool grab_can_translate () const;
|
||||
|
||||
Rect visible_area () const;
|
||||
Coord width() const;
|
||||
|
|
|
|||
|
|
@ -285,6 +285,9 @@ public:
|
|||
bool resize_queued() const { return _resize_queued; }
|
||||
void queue_resize();
|
||||
|
||||
bool scroll_translation() const { return _scroll_translation; }
|
||||
void disable_scroll_translation ();
|
||||
|
||||
/* only derived containers need to implement this, but this
|
||||
is where they compute the sizes and position and their
|
||||
children. A fixed-layout container (i.e. one where every child
|
||||
|
|
@ -369,7 +372,8 @@ private:
|
|||
|
||||
std::string _tooltip;
|
||||
bool _ignore_events;
|
||||
|
||||
bool _scroll_translation;
|
||||
|
||||
void find_scroll_parent ();
|
||||
void propagate_show_hide ();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ Item::Item (Canvas* canvas)
|
|||
, _requested_width (-1)
|
||||
, _requested_height (-1)
|
||||
, _ignore_events (false)
|
||||
, _scroll_translation (true)
|
||||
{
|
||||
DEBUG_TRACE (DEBUG::CanvasItems, string_compose ("new canvas item %1\n", this));
|
||||
}
|
||||
|
|
@ -68,6 +69,7 @@ Item::Item (Item* parent)
|
|||
, _requested_width (-1)
|
||||
, _requested_height (-1)
|
||||
, _ignore_events (false)
|
||||
, _scroll_translation (true)
|
||||
{
|
||||
DEBUG_TRACE (DEBUG::CanvasItems, string_compose ("new canvas item %1\n", this));
|
||||
|
||||
|
|
@ -1342,3 +1344,9 @@ Item::set_pack_options (PackOptions po)
|
|||
/* must be called before adding/packing Item in a Container */
|
||||
_pack_options = po;
|
||||
}
|
||||
|
||||
void
|
||||
Item::disable_scroll_translation ()
|
||||
{
|
||||
_scroll_translation = false;
|
||||
}
|
||||
|
|
|
|||
6
wscript
6
wscript
|
|
@ -807,8 +807,8 @@ def options(opt):
|
|||
help='Compile with -rdynamic -- allow obtaining backtraces from within Ardour')
|
||||
opt.add_option('--no-carbon', action='store_true', default=False, dest='nocarbon',
|
||||
help='Compile without support for AU Plugins with only CARBON UI (needed for 64bit)')
|
||||
opt.add_option('--no-compile-database', action='store_true', default=False, dest='clang_compile_db',
|
||||
help='Do not call clang_compilation_database to write compile_commands.json prior to build')
|
||||
opt.add_option('--compile-database', action='store_true', default=False, dest='clang_compile_db',
|
||||
help='Enable clang_compilation_database to write compile_commands.json prior to build')
|
||||
opt.add_option('--boost-sp-debug', action='store_true', default=False, dest='boost_sp_debug',
|
||||
help='Compile with Boost shared pointer debugging')
|
||||
opt.add_option('--debug-symbols', action='store_true', default=False, dest='debug_symbols',
|
||||
|
|
@ -937,7 +937,7 @@ def configure(conf):
|
|||
conf.load('compiler_cxx')
|
||||
if Options.options.dist_target == 'mingw':
|
||||
conf.load('winres')
|
||||
elif not Options.options.clang_compile_db:
|
||||
elif Options.options.clang_compile_db:
|
||||
conf.load('clang_compilation_database')
|
||||
|
||||
if Options.options.dist_target == 'msvc':
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue