ardour
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | Private Member Functions | Private Attributes | List of all members
PortMatrix Class Referenceabstract

#include <port_matrix.h>

Inheritance diagram for PortMatrix:
ARDOUR::SessionHandlePtr BundleEditorMatrix GlobalPortMatrix IOSelector MonitorSelector

Public Types

enum  Arrangement { TOP_TO_RIGHT, LEFT_TO_BOTTOM }
 
enum  Result { Cancelled, Accepted }
 

Public Member Functions

 PortMatrix (Gtk::Window *, ARDOUR::Session *, ARDOUR::DataType)
 
 ~PortMatrix ()
 
void set_type (ARDOUR::DataType)
 
ARDOUR::DataType type () const
 
void disassociate_all ()
 
void setup_scrollbars ()
 
void popup_menu (ARDOUR::BundleChannel, ARDOUR::BundleChannel, uint32_t)
 
int min_height_divisor () const
 
void set_min_height_divisor (int f)
 
Arrangement arrangement () const
 
bool show_only_bundles () const
 
PortGroupList const * columns () const
 
boost::shared_ptr< const
PortGroup
visible_columns () const
 
int column_index () const
 
PortGroupList const * rows () const
 
boost::shared_ptr< const
PortGroup
visible_rows () const
 
int row_index () const
 
PortGroupList const * ports (int d) const
 
boost::shared_ptr< const
PortGroup
visible_ports (int d) const
 
void init ()
 
void setup ()
 
virtual void setup_ports (int)=0
 
void setup_all_ports ()
 
std::pair< uint32_t, uint32_t > max_size () const
 
bool should_show (ARDOUR::DataType) const
 
uint32_t count_of_our_type (ARDOUR::ChanCount) const
 
uint32_t count_of_our_type_min_1 (ARDOUR::ChanCount) const
 
PortMatrixNode::State get_association (PortMatrixNode) const
 
void flip ()
 
bool key_press (GdkEventKey *)
 
virtual void set_state (ARDOUR::BundleChannel c[2], bool s)=0
 
virtual PortMatrixNode::State get_state (ARDOUR::BundleChannel c[2]) const =0
 
virtual bool list_is_global (int) const =0
 
virtual bool can_add_channels (boost::shared_ptr< ARDOUR::Bundle >) const
 
virtual void add_channel (boost::shared_ptr< ARDOUR::Bundle >, ARDOUR::DataType)
 
virtual bool can_remove_channels (boost::shared_ptr< ARDOUR::Bundle >) const
 
virtual void remove_channel (ARDOUR::BundleChannel)
 
virtual void remove_all_channels (boost::weak_ptr< ARDOUR::Bundle >)
 
virtual bool can_rename_channels (boost::shared_ptr< ARDOUR::Bundle >) const
 
virtual void rename_channel (ARDOUR::BundleChannel)
 
virtual std::string disassociation_verb () const =0
 
virtual std::string channel_noun () const
 
- Public Member Functions inherited from ARDOUR::SessionHandlePtr
 SessionHandlePtr (ARDOUR::Session *s)
 
 SessionHandlePtr ()
 
virtual ~SessionHandlePtr ()
 
virtual void set_session (ARDOUR::Session *)
 

Static Public Member Functions

static bool bundle_with_channels (boost::shared_ptr< ARDOUR::Bundle >)
 

Public Attributes

sigc::signal< void, ResultFinished
 

Protected Attributes

PortGroupList _ports [2]
 
- Protected Attributes inherited from ARDOUR::SessionHandlePtr
ARDOUR::Session_session
 
PBD::ScopedConnectionList _session_connections
 

Private Member Functions

void hscroll_changed ()
 
void vscroll_changed ()
 
void routes_changed ()
 
void reconnect_to_routes ()
 
void select_arrangement ()
 
void add_channel_proxy (boost::weak_ptr< ARDOUR::Bundle >, ARDOUR::DataType)
 
void remove_channel_proxy (boost::weak_ptr< ARDOUR::Bundle >, uint32_t)
 
void rename_channel_proxy (boost::weak_ptr< ARDOUR::Bundle >, uint32_t)
 
void disassociate_all_on_channel (boost::weak_ptr< ARDOUR::Bundle >, uint32_t, int)
 
void disassociate_all_on_bundle (boost::weak_ptr< ARDOUR::Bundle >, int)
 
void setup_global_ports ()
 
void setup_global_ports_proxy ()
 
void toggle_show_only_bundles ()
 
bool on_scroll_event (GdkEventScroll *)
 
boost::shared_ptr< ARDOUR::IOio_from_bundle (boost::shared_ptr< ARDOUR::Bundle >) const
 
void setup_notebooks ()
 
void remove_notebook_pages (Gtk::Notebook &)
 
void notebook_page_selected (GtkNotebookPage *, guint)
 
void route_processors_changed (ARDOUR::RouteProcessorChange)
 
void body_dimensions_changed ()
 
void session_going_away ()
 
void add_remove_option (Gtk::Menu_Helpers::MenuList &, boost::weak_ptr< ARDOUR::Bundle >, int)
 
void add_disassociate_option (Gtk::Menu_Helpers::MenuList &, boost::weak_ptr< ARDOUR::Bundle >, int, int)
 
void port_connected_or_disconnected ()
 
void update_tab_highlighting ()
 
std::pair< int, int > check_flip () const
 
bool can_flip () const
 

Private Attributes

Gtk::Window * _parent
 
ARDOUR::DataType _type
 
PBD::ScopedConnectionList _route_connections
 
PBD::ScopedConnectionList _changed_connections
 
PBD::ScopedConnectionList _bundle_changed_connections
 
PortMatrixBody_body
 
Gtk::HScrollbar _hscroll
 
Gtk::VScrollbar _vscroll
 
Gtk::Notebook _vnotebook
 
Gtk::Notebook _hnotebook
 
Gtk::Label _vlabel
 
Gtk::Label _hlabel
 
Gtk::VBox _vbox
 
Gtk::HBox _hbox
 
Gtk::Label _hspacer
 
Gtk::Label _vspacer
 
Gtk::Menu * _menu
 
Arrangement _arrangement
 
int _row_index
 
int _column_index
 
int _min_height_divisor
 
bool _show_only_bundles
 
bool _inhibit_toggle_show_only_bundles
 
bool _ignore_notebook_page_selected
 

Additional Inherited Members

Detailed Description

Definition at line 60 of file port_matrix.h.

Member Enumeration Documentation

Enumerator
TOP_TO_RIGHT 

column labels on top, row labels to the right

LEFT_TO_BOTTOM 

row labels to the left, column labels on the bottom

Definition at line 83 of file port_matrix.h.

Enumerator
Cancelled 
Accepted 

Definition at line 159 of file port_matrix.h.

Constructor & Destructor Documentation

PortMatrix::PortMatrix ( Gtk::Window *  parent,
ARDOUR::Session session,
ARDOUR::DataType  type 
)

PortMatrix constructor.

Parameters
sessionOur session.
typePort type that we are handling.

Definition at line 52 of file port_matrix.cc.

PortMatrix::~PortMatrix ( )

Definition at line 108 of file port_matrix.cc.

Member Function Documentation

void PortMatrix::add_channel ( boost::shared_ptr< ARDOUR::Bundle b,
ARDOUR::DataType  t 
)
virtual

Reimplemented in BundleEditorMatrix.

Definition at line 724 of file port_matrix.cc.

void PortMatrix::add_channel_proxy ( boost::weak_ptr< ARDOUR::Bundle w,
ARDOUR::DataType  t 
)
private

Definition at line 787 of file port_matrix.cc.

void PortMatrix::add_disassociate_option ( Gtk::Menu_Helpers::MenuList &  ,
boost::weak_ptr< ARDOUR::Bundle ,
int  ,
int   
)
private

Definition at line 979 of file port_matrix.cc.

void PortMatrix::add_remove_option ( Gtk::Menu_Helpers::MenuList &  ,
boost::weak_ptr< ARDOUR::Bundle ,
int   
)
private

Definition at line 964 of file port_matrix.cc.

Arrangement PortMatrix::arrangement ( ) const
inline
Returns
Arrangement in use

Definition at line 90 of file port_matrix.h.

void PortMatrix::body_dimensions_changed ( )
private

Definition at line 902 of file port_matrix.cc.

bool PortMatrix::bundle_with_channels ( boost::shared_ptr< ARDOUR::Bundle b)
static
Returns
true if b is a non-zero pointer and the bundle it points to has some channels

Definition at line 1156 of file port_matrix.cc.

bool PortMatrix::can_add_channels ( boost::shared_ptr< ARDOUR::Bundle b) const
virtual

Reimplemented in MonitorSelector, and BundleEditorMatrix.

Definition at line 718 of file port_matrix.cc.

bool PortMatrix::can_flip ( ) const
private

Definition at line 1204 of file port_matrix.cc.

bool PortMatrix::can_remove_channels ( boost::shared_ptr< ARDOUR::Bundle b) const
virtual

Reimplemented in MonitorSelector, and BundleEditorMatrix.

Definition at line 741 of file port_matrix.cc.

virtual bool PortMatrix::can_rename_channels ( boost::shared_ptr< ARDOUR::Bundle ) const
inlinevirtual

Reimplemented in MonitorSelector, and BundleEditorMatrix.

Definition at line 152 of file port_matrix.h.

string PortMatrix::channel_noun ( ) const
virtual

Reimplemented in GlobalPortMatrix, IOSelector, and MonitorSelector.

Definition at line 1053 of file port_matrix.cc.

pair< int, int > PortMatrix::check_flip ( ) const
private

See if a `flip' is possible.

Returns
If flip is possible, the new (row, column) notebook indices that should be selected; otherwise, (-1, -1)

Definition at line 1166 of file port_matrix.cc.

int PortMatrix::column_index ( ) const
inline
Returns
index into the _ports array for the list which is displayed as columns

Definition at line 102 of file port_matrix.h.

PortGroupList const * PortMatrix::columns ( ) const
Returns
columns list

Definition at line 390 of file port_matrix.cc.

uint32_t PortMatrix::count_of_our_type ( ARDOUR::ChanCount  c) const

Definition at line 1066 of file port_matrix.cc.

uint32_t PortMatrix::count_of_our_type_min_1 ( ARDOUR::ChanCount  c) const
Returns
The number of ports of our type in the given channel count, but returning 1 if there are no ports.

Definition at line 1079 of file port_matrix.cc.

void PortMatrix::disassociate_all ( )

Disassociate all of our ports from each other

Definition at line 275 of file port_matrix.cc.

void PortMatrix::disassociate_all_on_bundle ( boost::weak_ptr< ARDOUR::Bundle bundle,
int  dim 
)
private

Definition at line 574 of file port_matrix.cc.

void PortMatrix::disassociate_all_on_channel ( boost::weak_ptr< ARDOUR::Bundle bundle,
uint32_t  channel,
int  dim 
)
private

Definition at line 589 of file port_matrix.cc.

virtual std::string PortMatrix::disassociation_verb ( ) const
pure virtual
void PortMatrix::flip ( )

Flip the column and row pages around, if possible

Definition at line 1211 of file port_matrix.cc.

PortMatrixNode::State PortMatrix::get_association ( PortMatrixNode  node) const

Definition at line 1090 of file port_matrix.cc.

virtual PortMatrixNode::State PortMatrix::get_state ( ARDOUR::BundleChannel  c[2]) const
pure virtual
Parameters
cChannels; where c[0] is from _ports[0] and c[1] is from _ports[1].
Returns
state

Implemented in BundleEditorMatrix, GlobalPortMatrix, IOSelector, and MonitorSelector.

void PortMatrix::hscroll_changed ( )
private

Definition at line 235 of file port_matrix.cc.

void PortMatrix::init ( )

Perform initial and once-only setup. This must be called by subclasses after they have set up _ports[] to at least some reasonable extent. Two-part initialisation is necessary because setting up _ports is largely done by virtual functions in subclasses.

Definition at line 122 of file port_matrix.cc.

boost::shared_ptr< IO > PortMatrix::io_from_bundle ( boost::shared_ptr< ARDOUR::Bundle b) const
private

Definition at line 707 of file port_matrix.cc.

bool PortMatrix::key_press ( GdkEventKey *  k)

Definition at line 1223 of file port_matrix.cc.

virtual bool PortMatrix::list_is_global ( int  ) const
pure virtual
pair< uint32_t, uint32_t > PortMatrix::max_size ( ) const

Definition at line 672 of file port_matrix.cc.

int PortMatrix::min_height_divisor ( ) const
inline

Definition at line 76 of file port_matrix.h.

void PortMatrix::notebook_page_selected ( GtkNotebookPage *  ,
guint   
)
private

Definition at line 884 of file port_matrix.cc.

bool PortMatrix::on_scroll_event ( GdkEventScroll *  ev)
private

Definition at line 683 of file port_matrix.cc.

void PortMatrix::popup_menu ( ARDOUR::BundleChannel  column,
ARDOUR::BundleChannel  row,
uint32_t  t 
)
Parameters
columnColumn; its bundle may be 0 if we are over a row heading.
rowRow; its bundle may be 0 if we are over a column heading.

Definition at line 418 of file port_matrix.cc.

void PortMatrix::port_connected_or_disconnected ( )
private

Definition at line 994 of file port_matrix.cc.

PortGroupList const* PortMatrix::ports ( int  d) const
inline

Definition at line 114 of file port_matrix.h.

void PortMatrix::reconnect_to_routes ( )
private

Disconnect from and reconnect to routes' signals that we need to watch for things that affect the matrix

Definition at line 177 of file port_matrix.cc.

void PortMatrix::remove_all_channels ( boost::weak_ptr< ARDOUR::Bundle w)
virtual

Definition at line 769 of file port_matrix.cc.

void PortMatrix::remove_channel ( ARDOUR::BundleChannel  b)
virtual

Reimplemented in BundleEditorMatrix.

Definition at line 747 of file port_matrix.cc.

void PortMatrix::remove_channel_proxy ( boost::weak_ptr< ARDOUR::Bundle b,
uint32_t  c 
)
private

Definition at line 551 of file port_matrix.cc.

void PortMatrix::remove_notebook_pages ( Gtk::Notebook &  n)
private

Definition at line 874 of file port_matrix.cc.

virtual void PortMatrix::rename_channel ( ARDOUR::BundleChannel  )
inlinevirtual

Reimplemented in BundleEditorMatrix.

Definition at line 155 of file port_matrix.h.

void PortMatrix::rename_channel_proxy ( boost::weak_ptr< ARDOUR::Bundle b,
uint32_t  c 
)
private

Definition at line 563 of file port_matrix.cc.

void PortMatrix::route_processors_changed ( ARDOUR::RouteProcessorChange  c)
private

Definition at line 189 of file port_matrix.cc.

void PortMatrix::routes_changed ( )
private

A route has been added to or removed from the session

Definition at line 201 of file port_matrix.cc.

int PortMatrix::row_index ( ) const
inline
Returns
index into the _ports array for the list which is displayed as rows

Definition at line 110 of file port_matrix.h.

PortGroupList const * PortMatrix::rows ( ) const

Definition at line 403 of file port_matrix.cc.

void PortMatrix::select_arrangement ( )
private

Definition at line 308 of file port_matrix.cc.

void PortMatrix::session_going_away ( )
privatevirtual

Reimplemented from ARDOUR::SessionHandlePtr.

Definition at line 896 of file port_matrix.cc.

void PortMatrix::set_min_height_divisor ( int  f)
inline

Definition at line 79 of file port_matrix.h.

virtual void PortMatrix::set_state ( ARDOUR::BundleChannel  c[2],
bool  s 
)
pure virtual
Parameters
cChannels; where c[0] is from _ports[0] and c[1] is from _ports[1].
sNew state.

Implemented in BundleEditorMatrix, GlobalPortMatrix, IOSelector, and MonitorSelector.

void PortMatrix::set_type ( ARDOUR::DataType  t)

Definition at line 229 of file port_matrix.cc.

void PortMatrix::setup ( )

Set up everything that depends on the content of _ports[]

Definition at line 210 of file port_matrix.cc.

void PortMatrix::setup_all_ports ( )

Definition at line 642 of file port_matrix.cc.

void PortMatrix::setup_global_ports ( )
private

Definition at line 619 of file port_matrix.cc.

void PortMatrix::setup_global_ports_proxy ( )
private

Definition at line 632 of file port_matrix.cc.

void PortMatrix::setup_notebooks ( )
private

Definition at line 798 of file port_matrix.cc.

virtual void PortMatrix::setup_ports ( int  )
pure virtual
void PortMatrix::setup_scrollbars ( )

Definition at line 247 of file port_matrix.cc.

bool PortMatrix::should_show ( ARDOUR::DataType  t) const
Returns
true if this matrix should show bundles / ports of type

Definition at line 1060 of file port_matrix.cc.

bool PortMatrix::show_only_bundles ( ) const
inline

Definition at line 94 of file port_matrix.h.

void PortMatrix::toggle_show_only_bundles ( )
private

Definition at line 655 of file port_matrix.cc.

ARDOUR::DataType PortMatrix::type ( ) const
inline

Definition at line 68 of file port_matrix.h.

void PortMatrix::update_tab_highlighting ( )
private

Update the highlighting of tab names to reflect which ones have connections. This is pretty inefficient, unfortunately, but maybe that doesn't matter too much.

Definition at line 1005 of file port_matrix.cc.

boost::shared_ptr< const PortGroup > PortMatrix::visible_columns ( ) const

Definition at line 396 of file port_matrix.cc.

boost::shared_ptr< const PortGroup > PortMatrix::visible_ports ( int  d) const
Returns
The PortGroup that is currently visible (ie selected by the notebook) along a given axis.

Definition at line 929 of file port_matrix.cc.

boost::shared_ptr< const PortGroup > PortMatrix::visible_rows ( ) const

Definition at line 409 of file port_matrix.cc.

void PortMatrix::vscroll_changed ( )
private

Definition at line 241 of file port_matrix.cc.

Member Data Documentation

Arrangement PortMatrix::_arrangement
private

Definition at line 228 of file port_matrix.h.

PortMatrixBody* PortMatrix::_body
private

Definition at line 216 of file port_matrix.h.

PBD::ScopedConnectionList PortMatrix::_bundle_changed_connections
private

Definition at line 214 of file port_matrix.h.

PBD::ScopedConnectionList PortMatrix::_changed_connections
private

Definition at line 213 of file port_matrix.h.

int PortMatrix::_column_index
private

Definition at line 230 of file port_matrix.h.

Gtk::HBox PortMatrix::_hbox
private

Definition at line 224 of file port_matrix.h.

Gtk::Label PortMatrix::_hlabel
private

Definition at line 222 of file port_matrix.h.

Gtk::Notebook PortMatrix::_hnotebook
private

Definition at line 220 of file port_matrix.h.

Gtk::HScrollbar PortMatrix::_hscroll
private

Definition at line 217 of file port_matrix.h.

Gtk::Label PortMatrix::_hspacer
private

Definition at line 225 of file port_matrix.h.

bool PortMatrix::_ignore_notebook_page_selected
private

Definition at line 234 of file port_matrix.h.

bool PortMatrix::_inhibit_toggle_show_only_bundles
private

Definition at line 233 of file port_matrix.h.

Gtk::Menu* PortMatrix::_menu
private

Definition at line 227 of file port_matrix.h.

int PortMatrix::_min_height_divisor
private

Definition at line 231 of file port_matrix.h.

Gtk::Window* PortMatrix::_parent
private

Definition at line 208 of file port_matrix.h.

PortGroupList PortMatrix::_ports[2]
protected

We have two port group lists. One will be presented on the rows of the matrix, the other on the columns. The PortMatrix chooses the arrangement based on which has more ports in it. Subclasses must fill these two lists with the port groups that they wish to present. The PortMatrix will arrange its layout such that signal flow is vaguely from left to right as you go from list 0 to list 1. Hence subclasses which deal with inputs and outputs should put outputs in list 0 and inputs in list 1.

Definition at line 176 of file port_matrix.h.

PBD::ScopedConnectionList PortMatrix::_route_connections
private

Definition at line 212 of file port_matrix.h.

int PortMatrix::_row_index
private

Definition at line 229 of file port_matrix.h.

bool PortMatrix::_show_only_bundles
private

Definition at line 232 of file port_matrix.h.

ARDOUR::DataType PortMatrix::_type
private

port type that we are working with, or NIL if we are working with all of them

Definition at line 211 of file port_matrix.h.

Gtk::VBox PortMatrix::_vbox
private

Definition at line 223 of file port_matrix.h.

Gtk::Label PortMatrix::_vlabel
private

Definition at line 221 of file port_matrix.h.

Gtk::Notebook PortMatrix::_vnotebook
private

Definition at line 219 of file port_matrix.h.

Gtk::VScrollbar PortMatrix::_vscroll
private

Definition at line 218 of file port_matrix.h.

Gtk::Label PortMatrix::_vspacer
private

Definition at line 226 of file port_matrix.h.

sigc::signal<void, Result> PortMatrix::Finished

Definition at line 164 of file port_matrix.h.


The documentation for this class was generated from the following files: