2 Copyright (C) 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_bundle_manager_h__
21 #define __ardour_ui_bundle_manager_h__
23 #include <gtkmm/treeview.h>
24 #include <gtkmm/liststore.h>
25 #include <gtkmm/entry.h>
26 #include "ardour_dialog.h"
27 #include "port_matrix.h"
35 class BundleEditorMatrix : public PortMatrix
38 BundleEditorMatrix (Gtk::Window *, ARDOUR::Session *, boost::shared_ptr<ARDOUR::Bundle>);
40 void set_state (ARDOUR::BundleChannel c[2], bool s);
41 PortMatrixNode::State get_state (ARDOUR::BundleChannel c[2]) const;
43 bool can_add_channel (boost::shared_ptr<ARDOUR::Bundle>) const;
45 void add_channel (boost::shared_ptr<ARDOUR::Bundle>);
46 bool can_remove_channels (boost::shared_ptr<ARDOUR::Bundle>) const;
47 void remove_channel (ARDOUR::BundleChannel);
48 bool can_rename_channels (boost::shared_ptr<ARDOUR::Bundle>) const;
49 void rename_channel (ARDOUR::BundleChannel);
50 void setup_ports (int);
51 bool list_is_global (int) const;
53 std::string disassociation_verb () const {
54 return _("Disassociate");
63 boost::shared_ptr<PortGroup> _port_group;
64 boost::shared_ptr<ARDOUR::Bundle> _bundle;
67 class BundleEditor : public ArdourDialog
70 BundleEditor (ARDOUR::Session *, boost::shared_ptr<ARDOUR::UserBundle>);
77 void input_or_output_changed ();
81 BundleEditorMatrix _matrix;
82 boost::shared_ptr<ARDOUR::UserBundle> _bundle;
84 Gtk::ComboBoxText _input_or_output;
85 Gtk::ComboBoxText _type;
88 class BundleManager : public ArdourDialog
91 BundleManager (ARDOUR::Session *);
97 void delete_clicked ();
98 void add_bundle (boost::shared_ptr<ARDOUR::Bundle>);
99 void bundle_changed (ARDOUR::Bundle::Change, boost::shared_ptr<ARDOUR::UserBundle>);
100 void set_button_sensitivity ();
101 void row_activated (Gtk::TreeModel::Path const & p, Gtk::TreeViewColumn* c);
103 class ModelColumns : public Gtk::TreeModelColumnRecord
111 Gtk::TreeModelColumn<Glib::ustring> name;
112 Gtk::TreeModelColumn<boost::shared_ptr<ARDOUR::UserBundle> > bundle;
115 Gtk::TreeView _tree_view;
116 Glib::RefPtr<Gtk::ListStore> _list_model;
117 ModelColumns _list_model_columns;
118 ARDOUR::Session* _session;
119 Gtk::Button edit_button;
120 Gtk::Button delete_button;
123 class NameChannelDialog : public ArdourDialog
126 NameChannelDialog ();
127 NameChannelDialog (boost::shared_ptr<ARDOUR::Bundle>, uint32_t);
129 std::string get_name () const;
135 boost::shared_ptr<ARDOUR::Bundle> _bundle;