/* * Copyright (C) 2005-2021 Paul Davis * Copyright (C) 2013-2021 Robin Gareus * * 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 _gtkardour_io_button_h_ #define _gtkardour_io_button_h_ #include #include #include #include "widgets/ardour_button.h" namespace ARDOUR { class Bundle; class IO; class Route; class Track; class Port; } class RouteUI; class IOButton : public ArdourWidgets::ArdourButton { public: IOButton (bool input); ~IOButton (); void set_route (boost::shared_ptr, RouteUI*); static ARDOUR::DataType guess_main_type (boost::shared_ptr); static void set_label (ArdourWidgets::ArdourButton&, ARDOUR::Session&, boost::shared_ptr&, boost::shared_ptr); private: void update (); bool button_press (GdkEventButton*); bool button_release (GdkEventButton*); void button_resized (Gtk::Allocation&); void port_pretty_name_changed (std::string); void port_connected_or_disconnected (boost::weak_ptr, boost::weak_ptr); void maybe_add_bundle_to_menu (boost::shared_ptr, ARDOUR::BundleList const&, ARDOUR::DataType = ARDOUR::DataType::NIL); void disconnect (); void add_port (ARDOUR::DataType); void bundle_chosen (boost::shared_ptr); boost::shared_ptr io () const; boost::shared_ptr track () const; bool _input; boost::shared_ptr _route; RouteUI* _route_ui; Gtk::Menu _menu; std::list > _menu_bundles; PBD::ScopedConnectionList _connections; PBD::ScopedConnectionList _bundle_connections; }; #endif