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 /** @param r Our row index.
59 * @param p Other port.
63 virtual void set_state (int r, std::string const & p, bool s, uint32_t k) = 0;
65 /** @param r Our row index.
66 * @param p Other port.
67 * @return true if r is connected to p, otherwise false.
69 virtual bool get_state (int r, std::string const &p) const = 0;
71 virtual uint32_t n_rows () const = 0;
72 virtual uint32_t maximum_rows () const = 0;
73 virtual uint32_t minimum_rows () const = 0;
74 virtual std::string row_name (int) const = 0;
75 virtual void add_row () = 0;
76 virtual void remove_row (int) = 0;
77 virtual std::string row_descriptor () const = 0;
79 Gtk::Widget& scrolled_window() { return _scrolled_window; }
84 void set_ports (const std::list<std::string>&);
87 PortGroupList _port_group_list;
88 ARDOUR::DataType _type;
90 std::vector<PortGroupUI*> _port_group_ui;
91 std::vector<Gtk::EventBox*> _row_labels;
92 Gtk::VBox* _row_labels_vbox;
93 Gtk::HBox _overall_hbox;
95 Gtk::HBox _port_group_hbox;
96 Gtk::ScrolledWindow _scrolled_window;
97 Gtk::Label* _side_vbox_pad;
98 Gtk::HBox _visibility_checkbutton_box;
101 bool row_label_button_pressed (GdkEventButton*, int);
102 void reset_visibility ();