2 Copyright (C) 2002-2007 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __ardour_ui_port_matrix_h__
21 #define __ardour_ui_port_matrix_h__
23 #include <gtkmm/box.h>
24 #include <gtkmm/checkbutton.h>
25 #include <gtkmm/table.h>
26 #include <gtkmm/frame.h>
27 #include <gtkmm/eventbox.h>
28 #include <gtkmm/scrolledwindow.h>
30 #include "ardour_dialog.h"
31 #include "port_group.h"
40 class PortMatrix : public Gtk::VBox {
42 PortMatrix (ARDOUR::Session&, ARDOUR::DataType, bool, PortGroupList::Mask);
52 sigc::signal<void, Result> Finished;
54 void set_type (ARDOUR::DataType);
55 void set_offer_inputs (bool);
56 bool offering_input() const { return _offer_inputs; }
58 virtual void set_state (int, std::string const &, bool, uint32_t) = 0;
59 virtual bool get_state (int, std::string const &) const = 0;
60 virtual uint32_t n_rows () const = 0;
61 virtual uint32_t maximum_rows () const = 0;
62 virtual uint32_t minimum_rows () const = 0;
63 virtual std::string row_name (int) const = 0;
64 virtual void add_row () = 0;
65 virtual void remove_row (int) = 0;
66 virtual std::string row_descriptor () const = 0;
68 Gtk::Widget& scrolled_window() { return _scrolled_window; }
73 void set_ports (const std::list<std::string>&);
76 PortGroupList _port_group_list;
77 ARDOUR::DataType _type;
79 std::vector<PortGroupUI*> _port_group_ui;
80 std::vector<Gtk::EventBox*> _row_labels;
81 Gtk::VBox* _row_labels_vbox;
82 Gtk::HBox _overall_hbox;
84 Gtk::HBox _port_group_hbox;
85 Gtk::ScrolledWindow _scrolled_window;
86 Gtk::Label* _side_vbox_pad;
87 Gtk::HBox _visibility_checkbutton_box;
91 void setup_dimensions ();
92 bool row_label_button_pressed (GdkEventButton*, int);
93 void reset_visibility ();