2007-10-19 09:30:07 -04:00
|
|
|
/*
|
2009-10-14 12:10:01 -04:00
|
|
|
Copyright (C) 2007 Paul Davis
|
2007-10-19 09:30:07 -04:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __ardour_ui_bundle_manager_h__
|
|
|
|
#define __ardour_ui_bundle_manager_h__
|
|
|
|
|
|
|
|
#include <gtkmm/treeview.h>
|
|
|
|
#include <gtkmm/liststore.h>
|
2009-01-20 09:46:00 -05:00
|
|
|
#include <gtkmm/entry.h>
|
2007-10-19 09:30:07 -04:00
|
|
|
#include "ardour_dialog.h"
|
|
|
|
#include "port_matrix.h"
|
|
|
|
|
|
|
|
namespace ARDOUR {
|
|
|
|
class Session;
|
|
|
|
class Bundle;
|
|
|
|
}
|
|
|
|
|
|
|
|
class BundleEditorMatrix : public PortMatrix
|
|
|
|
{
|
|
|
|
public:
|
2009-12-04 22:04:54 -05:00
|
|
|
BundleEditorMatrix (Gtk::Window *, ARDOUR::Session *, boost::shared_ptr<ARDOUR::Bundle>);
|
2009-01-20 09:46:00 -05:00
|
|
|
|
2009-01-30 10:08:09 -05:00
|
|
|
void set_state (ARDOUR::BundleChannel c[2], bool s);
|
2009-05-03 10:31:42 -04:00
|
|
|
PortMatrixNode::State get_state (ARDOUR::BundleChannel c[2]) const;
|
2009-07-19 20:22:09 -04:00
|
|
|
|
|
|
|
bool can_add_channel (boost::shared_ptr<ARDOUR::Bundle>) const;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2010-06-30 21:14:14 -04:00
|
|
|
void add_channel (boost::shared_ptr<ARDOUR::Bundle>, ARDOUR::DataType);
|
2009-07-19 20:22:09 -04:00
|
|
|
bool can_remove_channels (boost::shared_ptr<ARDOUR::Bundle>) const;
|
2009-01-30 10:08:09 -05:00
|
|
|
void remove_channel (ARDOUR::BundleChannel);
|
2009-07-19 20:22:09 -04:00
|
|
|
bool can_rename_channels (boost::shared_ptr<ARDOUR::Bundle>) const;
|
2009-01-30 10:08:09 -05:00
|
|
|
void rename_channel (ARDOUR::BundleChannel);
|
2009-02-08 22:18:10 -05:00
|
|
|
void setup_ports (int);
|
|
|
|
bool list_is_global (int) const;
|
2009-01-25 01:47:11 -05:00
|
|
|
|
2010-05-07 21:20:33 -04:00
|
|
|
std::string disassociation_verb () const;
|
2009-07-19 15:07:31 -04:00
|
|
|
|
2009-01-25 01:47:11 -05:00
|
|
|
private:
|
2009-01-30 10:08:09 -05:00
|
|
|
enum {
|
|
|
|
OTHER = 0,
|
|
|
|
OURS = 1
|
|
|
|
};
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2009-01-30 10:08:09 -05:00
|
|
|
boost::shared_ptr<PortGroup> _port_group;
|
|
|
|
boost::shared_ptr<ARDOUR::Bundle> _bundle;
|
2007-10-19 09:30:07 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
class BundleEditor : public ArdourDialog
|
|
|
|
{
|
|
|
|
public:
|
2009-12-04 22:04:54 -05:00
|
|
|
BundleEditor (ARDOUR::Session *, boost::shared_ptr<ARDOUR::UserBundle>);
|
2007-10-19 09:30:07 -04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void on_map ();
|
|
|
|
|
|
|
|
private:
|
|
|
|
void name_changed ();
|
|
|
|
void input_or_output_changed ();
|
2009-08-29 16:48:11 -04:00
|
|
|
void on_show ();
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2007-10-19 09:30:07 -04:00
|
|
|
BundleEditorMatrix _matrix;
|
|
|
|
boost::shared_ptr<ARDOUR::UserBundle> _bundle;
|
|
|
|
Gtk::Entry _name;
|
|
|
|
Gtk::ComboBoxText _input_or_output;
|
|
|
|
};
|
|
|
|
|
|
|
|
class BundleManager : public ArdourDialog
|
|
|
|
{
|
|
|
|
public:
|
2009-12-04 22:04:54 -05:00
|
|
|
BundleManager (ARDOUR::Session *);
|
2007-10-19 09:30:07 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
void new_clicked ();
|
|
|
|
void edit_clicked ();
|
|
|
|
void delete_clicked ();
|
|
|
|
void add_bundle (boost::shared_ptr<ARDOUR::Bundle>);
|
2009-02-08 22:18:10 -05:00
|
|
|
void bundle_changed (ARDOUR::Bundle::Change, boost::shared_ptr<ARDOUR::UserBundle>);
|
2007-10-19 09:30:07 -04:00
|
|
|
void set_button_sensitivity ();
|
2009-11-07 15:33:41 -05:00
|
|
|
void row_activated (Gtk::TreeModel::Path const & p, Gtk::TreeViewColumn* c);
|
2007-10-19 09:30:07 -04:00
|
|
|
|
|
|
|
class ModelColumns : public Gtk::TreeModelColumnRecord
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ModelColumns () {
|
|
|
|
add (name);
|
|
|
|
add (bundle);
|
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2007-10-19 09:30:07 -04:00
|
|
|
Gtk::TreeModelColumn<Glib::ustring> name;
|
|
|
|
Gtk::TreeModelColumn<boost::shared_ptr<ARDOUR::UserBundle> > bundle;
|
|
|
|
};
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2007-10-19 09:30:07 -04:00
|
|
|
Gtk::TreeView _tree_view;
|
|
|
|
Glib::RefPtr<Gtk::ListStore> _list_model;
|
|
|
|
ModelColumns _list_model_columns;
|
|
|
|
Gtk::Button edit_button;
|
|
|
|
Gtk::Button delete_button;
|
2009-12-19 15:26:31 -05:00
|
|
|
PBD::ScopedConnectionList bundle_connections;
|
2007-10-19 09:30:07 -04:00
|
|
|
};
|
|
|
|
|
2009-01-20 09:46:00 -05:00
|
|
|
class NameChannelDialog : public ArdourDialog
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NameChannelDialog ();
|
|
|
|
NameChannelDialog (boost::shared_ptr<ARDOUR::Bundle>, uint32_t);
|
|
|
|
|
|
|
|
std::string get_name () const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
void setup ();
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2009-01-20 09:46:00 -05:00
|
|
|
boost::shared_ptr<ARDOUR::Bundle> _bundle;
|
|
|
|
uint32_t _channel;
|
|
|
|
Gtk::Entry _name;
|
|
|
|
bool _adding;
|
|
|
|
};
|
|
|
|
|
2007-10-19 09:30:07 -04:00
|
|
|
#endif
|