/* * Author Ben Loftis * Copyright (C) 2021 Paul Davis * * 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., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef _gtk_ardour_trigger_master_h_ #define _gtk_ardour_ardour_trigger_master_h_ #include "pbd/properties.h" #include "ardour/triggerbox.h" #include "canvas/canvas.h" #include "canvas/rectangle.h" #include "canvas/table.h" namespace Gtk { class FileChooserDialog; class Menu; } namespace Temporal { struct BBT_Offset; } namespace ArdourCanvas { class Text; class Polygon; } class PassThru; class Loopster : public ArdourCanvas::Rectangle { public: Loopster (ArdourCanvas::Item* canvas); void render (ArdourCanvas::Rect const& area, Cairo::RefPtr context) const; void set_fraction (float); private: float _fraction; }; class TriggerMaster : public ArdourCanvas::Rectangle { public: TriggerMaster (ArdourCanvas::Item* canvas); ~TriggerMaster (); void set_trigger (boost::shared_ptr); void render (ArdourCanvas::Rect const&, Cairo::RefPtr) const; void _size_allocate (ArdourCanvas::Rect const&); ArdourCanvas::Text* name_text; ArdourCanvas::Polygon* stop_shape; void toggle_thru (); void maybe_update (); bool event_handler (GdkEvent*); void selection_change (); private: void context_menu (); void set_all_follow_action (ARDOUR::Trigger::FollowAction); void set_all_launch_style (ARDOUR::Trigger::LaunchStyle); void set_all_quantization (Temporal::BBT_Offset const&); void prop_change (PBD::PropertyChange const& change); void owner_prop_change (PBD::PropertyChange const&); void ui_parameter_changed (std::string const& p); void set_default_colors (); void shape_stop_button (); boost::shared_ptr _triggerbox; Loopster* _loopster; PassThru* _passthru; Gtk::Menu* _context_menu; double _poly_size; double _poly_margin; PBD::ScopedConnection _trigger_prop_connection; PBD::ScopedConnection _owner_prop_connection; sigc::connection _update_connection; }; class CueMaster : public ArdourCanvas::Rectangle, public ARDOUR::SessionHandlePtr { public: CueMaster (ArdourCanvas::Item* canvas); ~CueMaster (); void render (ArdourCanvas::Rect const& area, Cairo::RefPtr context) const; void _size_allocate (ArdourCanvas::Rect const& alloc); ArdourCanvas::Polygon* stop_shape; ArdourCanvas::Text* name_text; void maybe_update (); bool event_handler (GdkEvent*); private: void ui_parameter_changed (std::string const& p); void set_default_colors (); void shape_stop_button (); double _poly_size; double _poly_margin; }; #endif