Ardour  9.0-pre0-582-g084a23a80d
io_selector.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2006 Doug McLain <doug@nostar.net>
3  * Copyright (C) 2005-2006 Taybin Rutkin <taybin@taybin.com>
4  * Copyright (C) 2005-2011 Paul Davis <paul@linuxaudiosystems.com>
5  * Copyright (C) 2007-2010 Carl Hetherington <carl@carlh.net>
6  * Copyright (C) 2007-2011 David Robillard <d@drobilla.net>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License along
19  * with this program; if not, write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21  */
22 
23 #pragma once
24 
25 #include "port_matrix.h"
26 #include "ardour_window.h"
27 
28 class IOSelector : public PortMatrix
29 {
30 public:
31  IOSelector (Gtk::Window*, ARDOUR::Session *, std::shared_ptr<ARDOUR::IO>);
32 
33  void set_state (ARDOUR::BundleChannel c[2], bool);
35 
36  std::string disassociation_verb () const;
37  std::string channel_noun () const;
38 
39  ARDOUR::Session* session() const { return _session; }
40 
41  uint32_t n_io_ports () const;
42  std::shared_ptr<ARDOUR::IO> const io () { return _io; }
43  void setup_ports (int);
44  bool list_is_global (int) const;
45 
48  }
49 
50  int ours () const {
51  return _ours;
52  }
53 
54  int other () const {
55  return _other;
56  }
57 
58 private:
59 
60  void setup_type ();
61  void io_changed ();
63 
64  int _other;
65  int _ours;
66  std::shared_ptr<ARDOUR::IO> _io;
67  std::shared_ptr<PortGroup> _port_group;
70 };
71 
73 {
74  public:
75  IOSelectorWindow (ARDOUR::Session *, std::shared_ptr<ARDOUR::IO>, bool can_cancel = false);
76 
77  IOSelector& selector() { return _selector; }
78 
79  protected:
80  void on_map ();
81  void on_show ();
82 
83  private:
85 
86  void io_name_changed (void *src);
88 };
89 
ARDOUR::Session * _session
IOSelector & selector()
Definition: io_selector.h:77
void on_show()
This is a default handler for the signal signal_show().
bool wm_delete(GdkEventAny *)
IOSelector _selector
Definition: io_selector.h:84
IOSelectorWindow(ARDOUR::Session *, std::shared_ptr< ARDOUR::IO >, bool can_cancel=false)
void io_name_changed(void *src)
void on_map()
This is a default handler for the signal signal_map().
void io_changed()
void setup_type()
bool _find_inputs_for_io_outputs
Definition: io_selector.h:68
uint32_t n_io_ports() const
PBD::ScopedConnection _io_connection
Definition: io_selector.h:69
std::shared_ptr< ARDOUR::IO > const io()
Definition: io_selector.h:42
std::string channel_noun() const
void io_changed_proxy()
IOSelector(Gtk::Window *, ARDOUR::Session *, std::shared_ptr< ARDOUR::IO >)
int ours() const
Definition: io_selector.h:50
void set_state(ARDOUR::BundleChannel c[2], bool)
std::string disassociation_verb() const
ARDOUR::Session * session() const
Definition: io_selector.h:39
void setup_ports(int)
int other() const
Definition: io_selector.h:54
PortMatrixNode::State get_state(ARDOUR::BundleChannel c[2]) const
bool find_inputs_for_io_outputs() const
Definition: io_selector.h:46
std::shared_ptr< ARDOUR::IO > _io
Definition: io_selector.h:66
std::shared_ptr< PortGroup > _port_group
Definition: io_selector.h:67
bool list_is_global(int) const