20 #include <gtkmm/stock.h>
21 #include <gtkmm/button.h>
22 #include <gtkmm/label.h>
23 #include <gtkmm/entry.h>
24 #include <gtkmm/table.h>
25 #include <gtkmm/comboboxtext.h>
26 #include <gtkmm/alignment.h>
73 for (Bundle::PortList::const_iterator i = pl.begin(); i != pl.end(); ++i) {
85 if (c[0].bundle->nchannels() == ChanCount::ZERO || c[1].
bundle->nchannels() == ChanCount::ZERO) {
94 for (Bundle::PortList::const_iterator i = pl.begin(); i != pl.end(); ++i) {
120 if (d.run () != Gtk::RESPONSE_ACCEPT) {
166 if (d.run () != Gtk::RESPONSE_ACCEPT) {
176 return (dim ==
OTHER);
182 return _(
"Disassociate");
186 :
ArdourDialog (
_(
"Edit Bundle")), _matrix (this, session, bundle), _bundle (bundle)
188 Gtk::Table* t =
new Gtk::Table (3, 2);
192 Gtk::Alignment* a =
new Gtk::Alignment (1, 0.5, 0, 1);
193 a->add (*Gtk::manage (
new Gtk::Label (
_(
"Name:"))));
194 t->attach (*Gtk::manage (a), 0, 1, 0, 1, Gtk::FILL, Gtk::FILL);
195 t->attach (
_name, 1, 2, 0, 1);
200 a =
new Gtk::Alignment (1, 0.5, 0, 1);
201 a->add (*Gtk::manage (
new Gtk::Label (
_(
"Direction:"))));
202 t->attach (*Gtk::manage (a), 0, 1, 1, 2, Gtk::FILL, Gtk::FILL);
203 a =
new Gtk::Alignment (0, 0.5, 0, 1);
205 t->attach (*Gtk::manage (a), 1, 2, 1, 2);
217 get_vbox()->pack_start (*Gtk::manage (t),
false,
false);
218 get_vbox()->pack_start (
_matrix);
219 get_vbox()->set_spacing (4);
221 add_button (Gtk::Stock::CLOSE, Gtk::RESPONSE_ACCEPT);
230 Gtk::Window::on_show ();
265 , edit_button (
_(
"Edit"))
266 , delete_button (
_(
"Delete"))
276 for (BundleList::iterator i = bundles->begin(); i != bundles->end(); ++i) {
281 Gtk::VBox* buttons =
new Gtk::VBox;
282 buttons->set_spacing (8);
283 Gtk::Button* b =
new Gtk::Button (
_(
"New"));
284 b->set_image (*Gtk::manage (
new Gtk::Image (Gtk::Stock::NEW, Gtk::ICON_SIZE_BUTTON)));
286 buttons->pack_start (*Gtk::manage (b),
false,
false);
287 edit_button.set_image (*Gtk::manage (
new Gtk::Image (Gtk::Stock::EDIT, Gtk::ICON_SIZE_BUTTON)));
290 delete_button.set_image (*Gtk::manage (
new Gtk::Image (Gtk::StockID(GTK_STOCK_DELETE), Gtk::ICON_SIZE_BUTTON)));
294 Gtk::HBox* h =
new Gtk::HBox;
296 h->set_border_width (8);
298 h->pack_start (*Gtk::manage (buttons),
false,
false);
300 get_vbox()->set_spacing (8);
301 get_vbox()->pack_start (*Gtk::manage (h));
303 set_default_size (480, 240);
305 _tree_view.get_selection()->signal_changed().connect (
313 Gtk::Button* close_but = add_button (Gtk::Stock::CLOSE, Gtk::RESPONSE_ACCEPT);
314 close_but->signal_clicked ().connect (sigc::mem_fun (*
this, &Gtk::Window::hide));
324 bool const sel = (
_tree_view.get_selection()->get_selected() != 0);
349 Gtk::TreeModel::iterator i =
_tree_view.get_selection()->get_selected();
360 Gtk::TreeModel::iterator i =
_tree_view.get_selection()->get_selected();
376 Gtk::TreeModel::iterator i =
_list_model->append ();
386 if ((c & Bundle::NameChanged) == 0) {
390 Gtk::TreeModel::iterator i =
_list_model->children().begin ();
407 Gtk::TreeModel::iterator i =
_list_model->get_iter (p);
437 Gtk::HBox* box = Gtk::manage (
new Gtk::HBox ());
439 box->pack_start (*Gtk::manage (
new Gtk::Label (
_(
"Name"))));
440 box->pack_start (
_name);
441 _name.set_activates_default (
true);
443 get_vbox ()->pack_end (*box);
446 add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
448 add_button (Gtk::Stock::ADD, Gtk::RESPONSE_ACCEPT);
450 add_button (Gtk::Stock::APPLY, Gtk::RESPONSE_ACCEPT);
452 set_default_response (Gtk::RESPONSE_ACCEPT);
458 return _name.get_text ();
void rename_channel(ARDOUR::BundleChannel)
void input_or_output_changed()
void add_channel(boost::shared_ptr< ARDOUR::Bundle >, ARDOUR::DataType)
void resize_window_to_proportion_of_monitor(Gtk::Window *, int, int)
void bundle_changed(ARDOUR::Bundle::Change, boost::shared_ptr< ARDOUR::UserBundle >)
boost::shared_ptr< ARDOUR::UserBundle > _bundle
bool can_add_channels(boost::shared_ptr< ARDOUR::Bundle >) const
std::string get_name() const
std::string channel_name(uint32_t) const
the ports are not associated
virtual bool can_add_channels(boost::shared_ptr< ARDOUR::Bundle >) const
void gather(ARDOUR::Session *, ARDOUR::DataType, bool, bool, bool)
ModelColumns _list_model_columns
shared_ptr< T > dynamic_pointer_cast(shared_ptr< U > const &r)
std::vector< std::string > PortList
void set_ports_are_inputs()
PortMatrixNode::State get_state(ARDOUR::BundleChannel c[2]) const
virtual bool can_rename_channels(boost::shared_ptr< ARDOUR::Bundle >) const
Gtk::TreeModelColumn< std::string > name
void add_bundle(boost::shared_ptr< Bundle >, bool emit_signal=true)
Gtk::Button delete_button
void add_group(boost::shared_ptr< PortGroup >)
PBD::ScopedConnectionList bundle_connections
Glib::RefPtr< Gtk::ListStore > _list_model
void remove_channel(ARDOUR::BundleChannel)
void set_state(ARDOUR::BundleChannel c[2], bool s)
void add_bundle(boost::shared_ptr< ARDOUR::Bundle >, bool allow_dups=false)
virtual bool can_remove_channels(boost::shared_ptr< ARDOUR::Bundle >) const
bool list_is_global(int) const
void row_activated(Gtk::TreeModel::Path const &p, Gtk::TreeViewColumn *c)
BundleEditorMatrix _matrix
bool ports_are_inputs() const
std::string disassociation_verb() const
boost::shared_ptr< BundleList > bundles()
void remove_ports_from_channels()
void add_channel(std::string const &, DataType)
BundleManager(ARDOUR::Session *)
Gtk::TreeModelColumn< boost::shared_ptr< ARDOUR::UserBundle > > bundle
bool show_only_bundles() const
void set_ports_are_outputs()
BundleEditor(ARDOUR::Session *, boost::shared_ptr< ARDOUR::UserBundle >)
PBD::Signal1< void, Change > Changed
std::pair< uint32_t, uint32_t > max_size() const
Gtk::ComboBoxText _input_or_output
bool can_rename_channels(boost::shared_ptr< ARDOUR::Bundle >) const
virtual void add_channel(boost::shared_ptr< ARDOUR::Bundle >, ARDOUR::DataType)
boost::shared_ptr< Bundle > bundle
bool key_press(GdkEventKey *)
void add_bundle(boost::shared_ptr< ARDOUR::Bundle >)
int channel
channel index, or -1 for "all"
void remove_bundle(boost::shared_ptr< Bundle >)
virtual void set_session(ARDOUR::Session *)
boost::shared_ptr< ARDOUR::Bundle > _bundle
void set_button_sensitivity()
void set_name(std::string const &)
BundleEditorMatrix(Gtk::Window *, ARDOUR::Session *, boost::shared_ptr< ARDOUR::Bundle >)
boost::shared_ptr< PortGroup > _port_group
bool can_remove_channels(boost::shared_ptr< ARDOUR::Bundle >) const
ARDOUR::Session * _session
void remove_bundle(boost::shared_ptr< ARDOUR::Bundle >)