2 * Copyright (C) 2007-2012 Carl Hetherington <carl@carlh.net>
3 * Copyright (C) 2008-2010 Paul Davis <paul@linuxaudiosystems.com>
4 * Copyright (C) 2009-2014 David Robillard <d@drobilla.net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 #ifndef __ardour_ui_bundle_manager_h__
22 #define __ardour_ui_bundle_manager_h__
24 #include <gtkmm/entry.h>
25 #include <gtkmm/liststore.h>
26 #include <gtkmm/treeview.h>
28 #include "ardour/user_bundle.h"
30 #include "ardour_dialog.h"
31 #include "port_matrix.h"
38 class BundleEditorMatrix : public PortMatrix
41 BundleEditorMatrix (Gtk::Window *, ARDOUR::Session *, boost::shared_ptr<ARDOUR::Bundle>);
43 void set_state (ARDOUR::BundleChannel c[2], bool s);
44 PortMatrixNode::State get_state (ARDOUR::BundleChannel c[2]) const;
46 bool can_add_channels (boost::shared_ptr<ARDOUR::Bundle>) const;
48 void add_channel (boost::shared_ptr<ARDOUR::Bundle>, ARDOUR::DataType);
49 bool can_remove_channels (boost::shared_ptr<ARDOUR::Bundle>) const;
50 void remove_channel (ARDOUR::BundleChannel);
51 bool can_rename_channels (boost::shared_ptr<ARDOUR::Bundle>) const;
52 void rename_channel (ARDOUR::BundleChannel);
53 void setup_ports (int);
54 bool list_is_global (int) const;
56 std::string disassociation_verb () const;
64 boost::shared_ptr<PortGroup> _port_group;
65 boost::shared_ptr<ARDOUR::Bundle> _bundle;
68 class BundleEditor : public ArdourDialog
71 BundleEditor (ARDOUR::Session *, boost::shared_ptr<ARDOUR::UserBundle>);
78 void input_or_output_changed ();
81 BundleEditorMatrix _matrix;
82 boost::shared_ptr<ARDOUR::UserBundle> _bundle;
84 Gtk::ComboBoxText _input_or_output;
87 class BundleManager : public ArdourDialog
90 BundleManager (ARDOUR::Session *);
96 void delete_clicked ();
97 void add_bundle (boost::shared_ptr<ARDOUR::Bundle>);
98 void bundle_changed (ARDOUR::Bundle::Change, boost::shared_ptr<ARDOUR::UserBundle>);
99 void set_button_sensitivity ();
100 void row_activated (Gtk::TreeModel::Path const & p, Gtk::TreeViewColumn* c);
102 class ModelColumns : public Gtk::TreeModelColumnRecord
110 Gtk::TreeModelColumn<std::string> name;
111 Gtk::TreeModelColumn<boost::shared_ptr<ARDOUR::UserBundle> > bundle;
114 Gtk::TreeView _tree_view;
115 Glib::RefPtr<Gtk::ListStore> _list_model;
116 ModelColumns _list_model_columns;
117 Gtk::Button edit_button;
118 Gtk::Button delete_button;
119 PBD::ScopedConnectionList bundle_connections;
122 class NameChannelDialog : public ArdourDialog
125 NameChannelDialog ();
126 NameChannelDialog (boost::shared_ptr<ARDOUR::Bundle>, uint32_t);
128 std::string get_name () const;
134 boost::shared_ptr<ARDOUR::Bundle> _bundle;