NO-OP: clang-format

This commit is contained in:
Robin Gareus 2022-01-11 13:52:02 +01:00
parent 8b90ea39a2
commit 192d513cba
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
2 changed files with 113 additions and 110 deletions

View file

@ -18,11 +18,11 @@
#include <vector> #include <vector>
#include "gtkmm/sizegroup.h"
#include <gtkmm/filechooserdialog.h> #include <gtkmm/filechooserdialog.h>
#include <gtkmm/menu.h> #include <gtkmm/menu.h>
#include <gtkmm/menuitem.h> #include <gtkmm/menuitem.h>
#include <gtkmm/stock.h> #include <gtkmm/stock.h>
#include "gtkmm/sizegroup.h"
#include "pbd/compose.h" #include "pbd/compose.h"
#include "pbd/convert.h" #include "pbd/convert.h"
@ -51,10 +51,10 @@
#include "public_editor.h" #include "public_editor.h"
#include "region_view.h" #include "region_view.h"
#include "selection.h" #include "selection.h"
#include "slot_properties_box.h"
#include "timers.h" #include "timers.h"
#include "trigger_ui.h" #include "trigger_ui.h"
#include "triggerbox_ui.h" #include "triggerbox_ui.h"
#include "slot_properties_box.h"
#include "ui_config.h" #include "ui_config.h"
#include "utils.h" #include "utils.h"
@ -98,7 +98,7 @@ TriggerEntry::TriggerEntry (Item* item, TriggerReference tr)
name_text->show (); name_text->show ();
/* this will trigger a call to on_trigger_changed() */ /* this will trigger a call to on_trigger_changed() */
set_trigger(tr); set_trigger (tr);
/* event handling */ /* event handling */
play_button->Event.connect (sigc::mem_fun (*this, &TriggerEntry::play_button_event)); play_button->Event.connect (sigc::mem_fun (*this, &TriggerEntry::play_button_event));
@ -146,8 +146,8 @@ TriggerEntry::selection_change ()
void void
TriggerEntry::maybe_update () TriggerEntry::maybe_update ()
{ {
if (trigger()->active()) { if (trigger ()->active ()) {
redraw(); redraw ();
} }
} }
@ -160,17 +160,17 @@ TriggerEntry::_size_allocate (ArdourCanvas::Rect const& alloc)
const Distance height = _rect.height (); const Distance height = _rect.height ();
play_button->set (ArdourCanvas::Rect (0, 0, height, height)); play_button->set (ArdourCanvas::Rect (0, 0, height, height));
name_button->set (ArdourCanvas::Rect (height, 0, width-height, height)); name_button->set (ArdourCanvas::Rect (height, 0, width - height, height));
follow_button->set (ArdourCanvas::Rect (width-height, 0, width, height)); follow_button->set (ArdourCanvas::Rect (width - height, 0, width, height));
const double scale = UIConfiguration::instance ().get_ui_scale (); const double scale = UIConfiguration::instance ().get_ui_scale ();
_poly_margin = 2. * scale; _poly_margin = 2. * scale;
_poly_size = height - 2 * _poly_margin; _poly_size = height - 2 * _poly_margin;
name_text->size_allocate (ArdourCanvas::Rect (0, 0, width, height -_poly_margin*2)); name_text->size_allocate (ArdourCanvas::Rect (0, 0, width, height - _poly_margin * 2));
float tleft = height; // make room for the play button float tleft = height; // make room for the play button
name_text->set_position (Duple (tleft + _poly_margin, _poly_margin)); //@paul why do we need tleft here? isn't name_text a child of name_button? name_text->set_position (Duple (tleft + _poly_margin, _poly_margin)); // @paul why do we need tleft here? isn't name_text a child of name_button?
name_text->clamp_width (width - height*2 -_poly_margin*3 ); name_text->clamp_width (width - height * 2 - _poly_margin * 3);
/* font scale may have changed. uiconfig 'embeds' the ui-scale in the font */ /* font scale may have changed. uiconfig 'embeds' the ui-scale in the font */
name_text->set_font_description (UIConfiguration::instance ().get_NormalFont ()); name_text->set_font_description (UIConfiguration::instance ().get_NormalFont ());
@ -179,11 +179,11 @@ TriggerEntry::_size_allocate (ArdourCanvas::Rect const& alloc)
void void
TriggerEntry::draw_follow_icon (Cairo::RefPtr<Cairo::Context> context, Trigger::FollowAction icon, float size, float scale) const TriggerEntry::draw_follow_icon (Cairo::RefPtr<Cairo::Context> context, Trigger::FollowAction icon, float size, float scale) const
{ {
uint32_t bg_color = fill_color(); uint32_t bg_color = fill_color ();
uint32_t fg_color = UIConfiguration::instance ().color ("neutral:midground"); uint32_t fg_color = UIConfiguration::instance ().color ("neutral:midground");
//in the case where there is a random follow-action, just put a "?" /* in the case where there is a random follow-action, just put a "?" */
if (trigger()->follow_action_probability()>0) { if (trigger ()->follow_action_probability () > 0) {
Glib::RefPtr<Pango::Layout> layout = Pango::Layout::create (context); Glib::RefPtr<Pango::Layout> layout = Pango::Layout::create (context);
layout->set_font_description (UIConfiguration::instance ().get_SmallMonospaceFont ()); layout->set_font_description (UIConfiguration::instance ().get_SmallMonospaceFont ());
layout->set_text ("?"); layout->set_text ("?");
@ -233,7 +233,7 @@ TriggerEntry::draw_follow_icon (Cairo::RefPtr<Cairo::Context> context, Trigger::
context->fill (); context->fill ();
context->arc (size / 2, 7 * scale, 1 * scale, 0, 2 * M_PI); context->arc (size / 2, 7 * scale, 1 * scale, 0, 2 * M_PI);
set_source_rgba (context, fill_color()); set_source_rgba (context, fill_color ());
context->fill (); context->fill ();
set_source_rgba (context, fg_color); set_source_rgba (context, fg_color);
@ -269,28 +269,28 @@ TriggerEntry::draw_follow_icon (Cairo::RefPtr<Cairo::Context> context, Trigger::
layout->show_in_cairo_context (context); layout->show_in_cairo_context (context);
} break; } break;
case Trigger::AnyTrigger: { case Trigger::AnyTrigger: {
for (int i = 0; i<6; i++) { for (int i = 0; i < 6; i++) {
Cairo::Matrix m = context->get_matrix(); Cairo::Matrix m = context->get_matrix ();
context->translate (size / 2, size /2); context->translate (size / 2, size / 2);
context->rotate (i*M_PI/3); context->rotate (i * M_PI / 3);
context->move_to (0, 0); context->move_to (0, 0);
context->line_to (0, (size/2)-4*scale); context->line_to (0, (size / 2) - 4 * scale);
context->stroke (); context->stroke ();
context->set_matrix(m); context->set_matrix (m);
} }
context->set_identity_matrix (); context->set_identity_matrix ();
} break; } break;
case Trigger::OtherTrigger: { case Trigger::OtherTrigger: {
context->set_line_width (1.5 * scale); 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 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++) { for (int i = 0; i < 6; i++) {
Cairo::Matrix m = context->get_matrix(); Cairo::Matrix m = context->get_matrix ();
context->translate (size / 2, size /2); context->translate (size / 2, size / 2);
context->rotate (i*M_PI/3); context->rotate (i * M_PI / 3);
context->move_to (0, 2*scale); context->move_to (0, 2 * scale);
context->line_to (0, (size/2)-4*scale); context->line_to (0, (size / 2) - 4 * scale);
context->stroke (); context->stroke ();
context->set_matrix(m); context->set_matrix (m);
} }
context->set_identity_matrix (); context->set_identity_matrix ();
} break; } break;
@ -300,60 +300,61 @@ TriggerEntry::draw_follow_icon (Cairo::RefPtr<Cairo::Context> context, Trigger::
} }
} }
void void
TriggerEntry::draw_launch_icon (Cairo::RefPtr<Cairo::Context> context, float sz, float scale) const TriggerEntry::draw_launch_icon (Cairo::RefPtr<Cairo::Context> context, float sz, float scale) const
{ {
context->set_line_width (1 * scale); context->set_line_width (1 * scale);
float margin = 4*scale; float margin = 4 * scale;
float size = sz - 2*margin; float size = sz - 2 * margin;
bool active = trigger()->active(); bool active = trigger ()->active ();
if (active && trigger()->launch_style()==Trigger::Toggle) { if (active && trigger ()->launch_style () == Trigger::Toggle) {
//clicking again will Stop this clip /* clicking again will Stop this clip */
set_source_rgba (context, UIConfiguration::instance ().color ("neutral:foreground")); set_source_rgba (context, UIConfiguration::instance ().color ("neutral:foreground"));
context->move_to (margin, margin); context->move_to (margin, margin);
context->rel_line_to (size, 0); context->rel_line_to (size, 0);
context->rel_line_to (0, size); context->rel_line_to (0, size);
context->rel_line_to (-size, 0); context->rel_line_to (-size, 0);
context->rel_line_to (0, -size); context->rel_line_to (0, -size);
context->fill (); context->fill ();
return; //done return;
} }
if (!trigger()->region ()) { if (!trigger ()->region ()) {
//no content in this slot, it is only a Stop button /* no content in this slot, it is only a Stop button */
context->move_to (margin, margin); context->move_to (margin, margin);
context->rel_line_to (size, 0); context->rel_line_to (size, 0);
context->rel_line_to (0, size); context->rel_line_to (0, size);
context->rel_line_to (-size, 0); context->rel_line_to (-size, 0);
context->rel_line_to (0, -size); context->rel_line_to (0, -size);
set_source_rgba (context, UIConfiguration::instance ().color ("neutral:midground")); set_source_rgba (context, UIConfiguration::instance ().color ("neutral:midground"));
context->stroke (); context->stroke ();
return; //done return;
} }
set_source_rgba (context, UIConfiguration::instance ().color ("neutral:midground")); set_source_rgba (context, UIConfiguration::instance ().color ("neutral:midground"));
switch (trigger()->launch_style()) { switch (trigger ()->launch_style ()) {
case Trigger::Toggle: case Trigger::Toggle:
if (active) { if (active) {
context->move_to (margin, margin); //special case: now it's a square Stop button /* special case: now it's a square Stop button */
context->rel_line_to (size, 0); context->move_to (margin, margin);
context->rel_line_to (0, size); context->rel_line_to (size, 0);
context->rel_line_to (0, size);
context->rel_line_to (-size, 0); context->rel_line_to (-size, 0);
context->line_to (margin, margin); context->line_to (margin, margin);
set_source_rgba (context, UIConfiguration::instance ().color ("neutral:foreground")); set_source_rgba (context, UIConfiguration::instance ().color ("neutral:foreground"));
context->fill (); context->fill ();
context->stroke (); context->stroke ();
} else { } else {
context->move_to (margin, margin); //boxy arrow /* boxy arrow */
context->move_to (margin, margin);
context->rel_line_to (0, size); context->rel_line_to (0, size);
context->rel_line_to (size*1/3, 0); context->rel_line_to (size * 1 / 3, 0);
context->rel_line_to (size*2/3, -size/2); context->rel_line_to (size * 2 / 3, -size / 2);
context->rel_line_to (-size*2/3, -size/2); context->rel_line_to (-size * 2 / 3, -size / 2);
context->line_to (margin, margin); context->line_to (margin, margin);
set_source_rgba (context, UIConfiguration::instance ().color ("neutral:midground")); set_source_rgba (context, UIConfiguration::instance ().color ("neutral:midground"));
context->stroke (); context->stroke ();
@ -362,7 +363,7 @@ TriggerEntry::draw_launch_icon (Cairo::RefPtr<Cairo::Context> context, float sz,
case Trigger::OneShot: case Trigger::OneShot:
context->move_to (margin, margin); context->move_to (margin, margin);
context->rel_line_to (0, size); context->rel_line_to (0, size);
context->rel_line_to (size, -size/2); context->rel_line_to (size, -size / 2);
context->line_to (margin, margin); context->line_to (margin, margin);
if (active) { if (active) {
set_source_rgba (context, UIConfiguration::instance ().color ("neutral:foreground")); set_source_rgba (context, UIConfiguration::instance ().color ("neutral:foreground"));
@ -373,37 +374,39 @@ TriggerEntry::draw_launch_icon (Cairo::RefPtr<Cairo::Context> context, float sz,
context->stroke (); context->stroke ();
} }
break; break;
case Trigger::ReTrigger: //line + boxy arrow + line case Trigger::ReTrigger:
/* line + boxy arrow + line */
if (active) { if (active) {
set_source_rgba (context, UIConfiguration::instance ().color ("neutral:foreground")); set_source_rgba (context, UIConfiguration::instance ().color ("neutral:foreground"));
} else { } else {
set_source_rgba (context, UIConfiguration::instance ().color ("neutral:midground")); set_source_rgba (context, UIConfiguration::instance ().color ("neutral:midground"));
} }
//vertical line at left /* vertical line at left */
context->set_line_width (2 * scale); context->set_line_width (2 * scale);
context->move_to (margin + 1*scale, margin); context->move_to (margin + 1 * scale, margin);
context->line_to (margin + 1*scale, margin+size); context->line_to (margin + 1 * scale, margin + size);
context->stroke (); context->stroke ();
//small triangle /* small triangle */
context->set_line_width (1 * scale); context->set_line_width (1 * scale);
context->move_to (margin + scale*4, margin + 2*scale); context->move_to (margin + scale * 4, margin + 2 * scale);
context->line_to (margin + size, margin+size/2); context->line_to (margin + size, margin + size / 2);
context->line_to (margin + scale*4, margin+size-2*scale); context->line_to (margin + scale * 4, margin + size - 2 * scale);
context->line_to (margin + scale*4, margin + 2*scale); context->line_to (margin + scale * 4, margin + 2 * scale);
if (active) { if (active) {
context->fill (); context->fill ();
} else { } else {
context->stroke (); context->stroke ();
} }
break; break;
case Trigger::Gate: //diamond shape case Trigger::Gate:
context->move_to ( margin+size/2, margin ); /* diamond shape */
context->rel_line_to ( size/2, size/2); context->move_to (margin + size / 2, margin);
context->rel_line_to ( -size/2, size/2); context->rel_line_to (size / 2, size / 2);
context->rel_line_to ( -size/2, -size/2); context->rel_line_to (-size / 2, size / 2);
context->rel_line_to ( size/2, -size/2); context->rel_line_to (-size / 2, -size / 2);
context->rel_line_to (size / 2, -size / 2);
if (active) { if (active) {
set_source_rgba (context, UIConfiguration::instance ().color ("neutral:foreground")); set_source_rgba (context, UIConfiguration::instance ().color ("neutral:foreground"));
context->fill (); context->fill ();
@ -413,21 +416,23 @@ TriggerEntry::draw_launch_icon (Cairo::RefPtr<Cairo::Context> context, float sz,
context->stroke (); context->stroke ();
} }
break; break;
case Trigger::Repeat: //'stutter' shape case Trigger::Repeat:
/* 'stutter' shape */
context->set_line_width (1 * scale); context->set_line_width (1 * scale);
context->move_to ( margin, margin ); context->move_to (margin, margin);
context->rel_line_to ( 0, size); context->rel_line_to (0, size);
context->move_to ( margin + scale*3, margin + scale*2 ); context->move_to (margin + scale * 3, margin + scale * 2);
context->rel_line_to ( 0, size - scale*4); context->rel_line_to (0, size - scale * 4);
context->move_to ( margin + scale*6, margin + scale*3 ); context->move_to (margin + scale * 6, margin + scale * 3);
context->rel_line_to ( 0, size - scale*6); context->rel_line_to (0, size - scale * 6);
if (active) { if (active) {
set_source_rgba (context, UIConfiguration::instance ().color ("neutral:foregroundest")); set_source_rgba (context, UIConfiguration::instance ().color ("neutral:foregroundest"));
} else { } else {
set_source_rgba (context, HSV (UIConfiguration::instance ().color ("neutral:midground")).lighter (0.25).color ()); //stutter shape needs to be brighter to maintain balance /* stutter shape needs to be brighter to maintain balance */
set_source_rgba (context, HSV (UIConfiguration::instance ().color ("neutral:midground")).lighter (0.25).color ());
} }
context->stroke (); context->stroke ();
break; break;
@ -444,8 +449,8 @@ TriggerEntry::render (ArdourCanvas::Rect const& area, Cairo::RefPtr<Cairo::Conte
Rectangle::render (area, context); Rectangle::render (area, context);
/* Note that item_to_window() already takes _position into account (as /* Note that item_to_window() already takes _position into account (as
part of item_to_canvas() * part of item_to_canvas()
*/ */
ArdourCanvas::Rect self (item_to_window (_rect)); ArdourCanvas::Rect self (item_to_window (_rect));
const ArdourCanvas::Rect draw = self.intersection (area); const ArdourCanvas::Rect draw = self.intersection (area);
@ -466,7 +471,7 @@ TriggerEntry::render (ArdourCanvas::Rect const& area, Cairo::RefPtr<Cairo::Conte
render_children (area, context); render_children (area, context);
if (trigger()->scene_isolated ()) { if (trigger ()->scene_isolated ()) {
/* left shadow */ /* left shadow */
context->set_identity_matrix (); context->set_identity_matrix ();
context->translate (self.x0, self.y0 - 0.5); context->translate (self.x0, self.y0 - 0.5);
@ -499,12 +504,12 @@ TriggerEntry::render (ArdourCanvas::Rect const& area, Cairo::RefPtr<Cairo::Conte
} }
/* follow-action icon */ /* follow-action icon */
if (trigger()->region () && trigger()->use_follow()) { if (trigger ()->region () && trigger ()->use_follow ()) {
context->set_identity_matrix (); context->set_identity_matrix ();
context->translate (self.x0, self.y0 - 0.5); context->translate (self.x0, self.y0 - 0.5);
context->translate (width - height, 0); // right side of the widget context->translate (width - height, 0); // right side of the widget
set_source_rgba (context, UIConfiguration::instance ().color ("neutral:midground")); set_source_rgba (context, UIConfiguration::instance ().color ("neutral:midground"));
draw_follow_icon (context, trigger()->follow_action (0), height, scale); draw_follow_icon (context, trigger ()->follow_action (0), height, scale);
context->set_identity_matrix (); context->set_identity_matrix ();
} }
} }
@ -513,14 +518,14 @@ void
TriggerEntry::on_trigger_changed (PropertyChange const& change) TriggerEntry::on_trigger_changed (PropertyChange const& change)
{ {
if (change.contains (ARDOUR::Properties::name)) { if (change.contains (ARDOUR::Properties::name)) {
if (trigger()->region ()) { if (trigger ()->region ()) {
name_text->set (short_version (trigger()->name (), 16)); name_text->set (short_version (trigger ()->name (), 16));
} else { } else {
name_text->set (""); name_text->set ("");
} }
} }
name_text->set_color (trigger()->color()); name_text->set_color (trigger ()->color ());
PropertyChange interesting_stuff; PropertyChange interesting_stuff;
interesting_stuff.add (ARDOUR::Properties::name); interesting_stuff.add (ARDOUR::Properties::name);
@ -628,9 +633,9 @@ TriggerEntry::play_button_event (GdkEvent* ev)
case GDK_BUTTON_PRESS: case GDK_BUTTON_PRESS:
if (ev->button.button == 1) { if (ev->button.button == 1) {
if (Keyboard::modifier_state_equals (ev->button.state, Keyboard::PrimaryModifier)) { if (Keyboard::modifier_state_equals (ev->button.state, Keyboard::PrimaryModifier)) {
trigger()->box().stop_all_immediately (); trigger ()->box ().stop_all_immediately ();
} else { } else {
trigger()->box().stop_all_quantized (); trigger ()->box ().stop_all_quantized ();
} }
return true; return true;
} }
@ -644,13 +649,13 @@ TriggerEntry::play_button_event (GdkEvent* ev)
case GDK_BUTTON_PRESS: case GDK_BUTTON_PRESS:
switch (ev->button.button) { switch (ev->button.button) {
case 1: case 1:
if (trigger()->launch_style () == Trigger::Gate || if (trigger ()->launch_style () == Trigger::Gate ||
trigger()->launch_style () == Trigger::Repeat) { trigger ()->launch_style () == Trigger::Repeat) {
trigger()->bang (); trigger ()->bang ();
_grabbed = true; _grabbed = true;
play_button->grab(); play_button->grab ();
} else { } else {
trigger()->bang (); trigger ()->bang ();
} }
return true; return true;
default: default:
@ -661,8 +666,8 @@ TriggerEntry::play_button_event (GdkEvent* ev)
switch (ev->button.button) { switch (ev->button.button) {
case 1: case 1:
if (_grabbed) { if (_grabbed) {
trigger()->unbang (); trigger ()->unbang ();
play_button->ungrab(); play_button->ungrab ();
_grabbed = false; _grabbed = false;
} }
break; break;
@ -720,7 +725,6 @@ TriggerEntry::follow_button_event (GdkEvent* ev)
return false; return false;
} }
/* ***************************************************** */ /* ***************************************************** */
TriggerBoxUI::TriggerBoxUI (ArdourCanvas::Item* parent, TriggerBox& tb) TriggerBoxUI::TriggerBoxUI (ArdourCanvas::Item* parent, TriggerBox& tb)
@ -783,7 +787,7 @@ void
TriggerBoxUI::build () TriggerBoxUI::build ()
{ {
TriggerPtr t; TriggerPtr t;
uint64_t n = 0; uint64_t n = 0;
// clear_items (true); // clear_items (true);
@ -896,7 +900,7 @@ TriggerBoxUI::drag_data_received (Glib::RefPtr<Gdk::DragContext> const& context,
/* Long term goal is to receive all information from another TriggerBox Slot, /* Long term goal is to receive all information from another TriggerBox Slot,
* not just the region. * not just the region.
*/ */
PBD::ID rid (data.get_data_as_string ()); PBD::ID rid (data.get_data_as_string ());
boost::shared_ptr<Region> region = RegionFactory::region_by_id (rid); boost::shared_ptr<Region> region = RegionFactory::region_by_id (rid);
if (region) { if (region) {
_triggerbox.set_from_selection (n, region); _triggerbox.set_from_selection (n, region);
@ -922,17 +926,17 @@ bool
TriggerBoxUI::event (GdkEvent* ev, uint64_t n) TriggerBoxUI::event (GdkEvent* ev, uint64_t n)
{ {
assert (n < _slots.size ()); assert (n < _slots.size ());
if (!_slots[n]->trigger()->region ()) { if (!_slots[n]->trigger ()->region ()) {
return false; return false;
} }
switch (ev->type) { switch (ev->type) {
case GDK_2BUTTON_PRESS: case GDK_2BUTTON_PRESS:
gdk_pointer_ungrab (GDK_CURRENT_TIME); gdk_pointer_ungrab (GDK_CURRENT_TIME);
break; break;
case GDK_BUTTON_RELEASE: case GDK_BUTTON_RELEASE:
gdk_pointer_ungrab (GDK_CURRENT_TIME); gdk_pointer_ungrab (GDK_CURRENT_TIME);
break; break;
case GDK_BUTTON_PRESS: case GDK_BUTTON_PRESS:
@ -941,7 +945,7 @@ TriggerBoxUI::event (GdkEvent* ev, uint64_t n)
if (bev->button == 1) { if (bev->button == 1) {
_drag_start_x = bev->x; _drag_start_x = bev->x;
_drag_start_y = bev->y; _drag_start_y = bev->y;
gdk_pointer_grab (bev->window, false, GdkEventMask (Gdk::POINTER_MOTION_MASK | Gdk::BUTTON_PRESS_MASK |Gdk::BUTTON_RELEASE_MASK), NULL, NULL, bev->time); gdk_pointer_grab (bev->window, false, GdkEventMask (Gdk::POINTER_MOTION_MASK | Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK), NULL, NULL, bev->time);
} else { } else {
_drag_start_x = -1; _drag_start_x = -1;
_drag_start_y = -1; _drag_start_y = -1;
@ -951,11 +955,11 @@ TriggerBoxUI::event (GdkEvent* ev, uint64_t n)
case GDK_MOTION_NOTIFY: case GDK_MOTION_NOTIFY:
if (!_drag_active) { if (!_drag_active) {
int x, y; int x, y;
Gdk::ModifierType mask; Gdk::ModifierType mask;
GtkCanvas* gtkcanvas = static_cast<GtkCanvas*> (canvas ()); GtkCanvas* gtkcanvas = static_cast<GtkCanvas*> (canvas ());
gtkcanvas->get_window()->get_pointer (x, y, mask); gtkcanvas->get_window ()->get_pointer (x, y, mask);
if (mask & GDK_BUTTON1_MASK) { if (mask & GDK_BUTTON1_MASK) {
if (gtkcanvas->drag_check_threshold (_drag_start_x, _drag_start_y, x, y)) { if (gtkcanvas->drag_check_threshold (_drag_start_x, _drag_start_y, x, y)) {
@ -1006,7 +1010,7 @@ TriggerBoxUI::drag_data_get (Glib::RefPtr<Gdk::DragContext> const&, Gtk::Selecti
/* use selection, for now */ /* use selection, for now */
TriggerSelection ts = PublicEditor::instance ().get_selection ().triggers; TriggerSelection ts = PublicEditor::instance ().get_selection ().triggers;
for (auto& te : ts) { for (auto& te : ts) {
region = te->trigger()->region (); region = te->trigger ()->region ();
} }
if (region) { if (region) {
data.set (data.get_target (), region->id ().to_s ()); data.set (data.get_target (), region->id ().to_s ());

View file

@ -73,10 +73,9 @@ public:
bool follow_button_event (GdkEvent*); bool follow_button_event (GdkEvent*);
private: private:
bool _grabbed; bool _grabbed;
double _poly_size;
double _poly_size; double _poly_margin;
double _poly_margin;
PBD::ScopedConnection owner_prop_connection; PBD::ScopedConnection owner_prop_connection;
void owner_prop_change (PBD::PropertyChange const&); void owner_prop_change (PBD::PropertyChange const&);
@ -99,8 +98,8 @@ public:
private: private:
typedef std::vector<TriggerEntry*> Slots; typedef std::vector<TriggerEntry*> Slots;
ARDOUR::TriggerBox& _triggerbox; ARDOUR::TriggerBox& _triggerbox;
Slots _slots; Slots _slots;
int _drag_start_x; int _drag_start_x;
int _drag_start_y; int _drag_start_y;