removal of TriggerBox passthru property, GUI edition

This commit is contained in:
Paul Davis
2022-01-30 13:38:10 -07:00
parent d43e2c25bc
commit cdda0b6d30
2 changed files with 0 additions and 92 deletions

View File

@@ -114,73 +114,6 @@ Loopster::render (ArdourCanvas::Rect const& area, Cairo::RefPtr<Cairo::Context>
context->set_identity_matrix ();
}
class PassThru : public ArdourCanvas::Rectangle
{
public:
PassThru (ArdourCanvas::Item* canvas);
void render (ArdourCanvas::Rect const& area, Cairo::RefPtr<Cairo::Context> context) const;
void set_enabled (bool e);
private:
bool _enabled;
};
PassThru::PassThru (Item* parent)
: ArdourCanvas::Rectangle (parent)
, _enabled (false)
{
}
void
PassThru::set_enabled (bool e)
{
if (e != _enabled) {
_enabled = e;
redraw ();
}
}
void
PassThru::render (ArdourCanvas::Rect const& area, Cairo::RefPtr<Cairo::Context> context) const
{
/* Note that item_to_window() already takes _position into account (as
* part of item_to_canvas()
*/
ArdourCanvas::Rect self (item_to_window (_rect));
ArdourCanvas::Rect const draw = self.intersection (area);
if (!draw) {
return;
}
context->set_identity_matrix ();
context->translate (self.x0, self.y0 - 0.5);
float size = _rect.height ();
const double scale = UIConfiguration::instance ().get_ui_scale ();
if (_enabled) {
/* outer white circle */
set_source_rgba (context, rgba_to_color (1, 1, 1, 1));
context->arc (size / 2, size / 2, size / 2 - 3 * scale, 0, 2 * M_PI);
context->fill ();
/* black circle */
set_source_rgba (context, rgba_to_color (0, 0, 0, 1));
context->arc (size / 2, size / 2, size / 2 - 5 * scale, 0, 2 * M_PI);
context->fill ();
/* inner white circle */
set_source_rgba (context, rgba_to_color (1, 1, 1, 1));
context->arc (size / 2, size / 2, size / 2 - 7 * scale, 0, 2 * M_PI);
context->fill ();
}
context->set_identity_matrix ();
}
TriggerMaster::TriggerMaster (Item* parent)
: ArdourCanvas::Rectangle (parent)
, _context_menu (0)
@@ -197,7 +130,6 @@ TriggerMaster::TriggerMaster (Item* parent)
name_text->set_ignore_events (false);
_loopster = new Loopster (this);
_passthru = new PassThru (this);
#if 0 /* XXX trigger changes */
_triggerbox->PropertyChanged.connect (_trigger_prop_connection, MISSING_INVALIDATOR, boost::bind (&TriggerMaster::prop_change, this, _1), gui_context());
@@ -381,13 +313,6 @@ TriggerMaster::context_menu ()
b = BBT_Offset (-1, 0, 0);
qitems.push_back (MenuElem (TriggerUI::quantize_length_to_string (b), sigc::bind (sigc::mem_fun (*this, &TriggerMaster::set_all_quantization), b)));
items.push_back (CheckMenuElem (_("Toggle Monitor Thru"), sigc::mem_fun (*this, &TriggerMaster::toggle_thru)));
if (_triggerbox->pass_thru ()) {
_ignore_menu_action = true;
dynamic_cast<Gtk::CheckMenuItem*> (&items.back ())->set_active (true);
_ignore_menu_action = false;
}
items.push_back (MenuElem (_("Set All Follow Actions..."), *follow_menu));
items.push_back (MenuElem (_("Set All Launch Styles..."), *launch_menu));
items.push_back (MenuElem (_("Set All Quantizations..."), *quant_menu));
@@ -399,16 +324,6 @@ TriggerMaster::context_menu ()
_context_menu->popup (1, gtk_get_current_event_time ());
}
void
TriggerMaster::toggle_thru ()
{
if (_ignore_menu_action) {
return;
}
_triggerbox->set_pass_thru (!_triggerbox->pass_thru ());
}
void
TriggerMaster::clear_all_triggers ()
{
@@ -493,7 +408,6 @@ TriggerMaster::_size_allocate (ArdourCanvas::Rect const& alloc)
name_text->clamp_width (twidth);
_loopster->set (ArdourCanvas::Rect (0, 0, height, height));
_passthru->set (ArdourCanvas::Rect (width - height, 0, width, height));
/* font scale may have changed. uiconfig 'embeds' the ui-scale in the font */
name_text->set_font_description (UIConfiguration::instance ().get_NormalFont ());
@@ -506,8 +420,6 @@ TriggerMaster::prop_change (PropertyChange const& change)
return;
}
_passthru->set_enabled (_triggerbox->pass_thru ());
std::string text;
ARDOUR::TriggerPtr trigger = _triggerbox->currently_playing ();

View File

@@ -47,8 +47,6 @@ namespace ArdourCanvas
class Polygon;
}
class PassThru;
class Loopster : public ArdourCanvas::Rectangle
{
public:
@@ -75,7 +73,6 @@ public:
ArdourCanvas::Text* name_text;
void toggle_thru ();
void maybe_update ();
bool event_handler (GdkEvent*);
void selection_change ();
@@ -98,7 +95,6 @@ private:
boost::shared_ptr<ARDOUR::TriggerBox> _triggerbox;
Loopster* _loopster;
PassThru* _passthru;
Gtk::ColorSelectionDialog _color_dialog;
Gtk::Menu* _context_menu;