2005-09-25 18:42:24 +00:00
|
|
|
/*
|
2019-08-02 23:26:43 +02:00
|
|
|
* Copyright (C) 2005-2006 Doug McLain <doug@nostar.net>
|
|
|
|
|
* Copyright (C) 2005-2006 Taybin Rutkin <taybin@taybin.com>
|
|
|
|
|
* Copyright (C) 2005-2011 Paul Davis <paul@linuxaudiosystems.com>
|
|
|
|
|
* Copyright (C) 2007-2010 Carl Hetherington <carl@carlh.net>
|
|
|
|
|
* Copyright (C) 2007-2011 David Robillard <d@drobilla.net>
|
|
|
|
|
*
|
|
|
|
|
* 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.,
|
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
|
*/
|
2005-09-25 18:42:24 +00:00
|
|
|
|
2024-09-25 18:38:59 -06:00
|
|
|
#pragma once
|
2005-09-25 18:42:24 +00:00
|
|
|
|
2007-10-19 13:30:07 +00:00
|
|
|
#include "port_matrix.h"
|
2011-11-18 21:56:01 +00:00
|
|
|
#include "ardour_window.h"
|
2006-06-07 14:54:12 +00:00
|
|
|
|
2009-01-30 15:08:09 +00:00
|
|
|
class IOSelector : public PortMatrix
|
|
|
|
|
{
|
2017-07-01 21:11:14 +02:00
|
|
|
public:
|
2023-02-16 16:33:28 -07:00
|
|
|
IOSelector (Gtk::Window*, ARDOUR::Session *, std::shared_ptr<ARDOUR::IO>);
|
2005-09-25 18:42:24 +00:00
|
|
|
|
2009-01-30 15:08:09 +00:00
|
|
|
void set_state (ARDOUR::BundleChannel c[2], bool);
|
2009-05-03 14:31:42 +00:00
|
|
|
PortMatrixNode::State get_state (ARDOUR::BundleChannel c[2]) const;
|
2009-01-20 14:46:00 +00:00
|
|
|
|
2010-05-08 01:20:33 +00:00
|
|
|
std::string disassociation_verb () const;
|
|
|
|
|
std::string channel_noun () const;
|
2009-10-14 16:10:01 +00:00
|
|
|
|
2017-07-01 18:42:24 +02:00
|
|
|
ARDOUR::Session* session() const { return _session; }
|
2010-08-16 19:58:34 +00:00
|
|
|
|
2009-01-30 15:08:09 +00:00
|
|
|
uint32_t n_io_ports () const;
|
2023-02-16 16:33:28 -07:00
|
|
|
std::shared_ptr<ARDOUR::IO> const io () { return _io; }
|
2009-02-09 03:18:10 +00:00
|
|
|
void setup_ports (int);
|
|
|
|
|
bool list_is_global (int) const;
|
2005-09-25 18:42:24 +00:00
|
|
|
|
2009-01-30 15:08:09 +00:00
|
|
|
bool find_inputs_for_io_outputs () const {
|
|
|
|
|
return _find_inputs_for_io_outputs;
|
|
|
|
|
}
|
|
|
|
|
|
2009-02-09 03:18:10 +00:00
|
|
|
int ours () const {
|
|
|
|
|
return _ours;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int other () const {
|
|
|
|
|
return _other;
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-01 21:11:14 +02:00
|
|
|
private:
|
2009-07-19 20:12:59 +00:00
|
|
|
|
2010-07-27 02:09:51 +00:00
|
|
|
void setup_type ();
|
|
|
|
|
void io_changed ();
|
|
|
|
|
void io_changed_proxy ();
|
2011-06-01 17:00:29 +00:00
|
|
|
|
2009-01-30 15:08:09 +00:00
|
|
|
int _other;
|
|
|
|
|
int _ours;
|
2023-02-16 16:33:28 -07:00
|
|
|
std::shared_ptr<ARDOUR::IO> _io;
|
|
|
|
|
std::shared_ptr<PortGroup> _port_group;
|
2009-01-30 15:08:09 +00:00
|
|
|
bool _find_inputs_for_io_outputs;
|
2010-07-27 02:09:51 +00:00
|
|
|
PBD::ScopedConnection _io_connection;
|
2005-09-25 18:42:24 +00:00
|
|
|
};
|
|
|
|
|
|
2011-11-18 21:56:01 +00:00
|
|
|
class IOSelectorWindow : public ArdourWindow
|
2005-09-25 18:42:24 +00:00
|
|
|
{
|
|
|
|
|
public:
|
2023-02-16 16:33:28 -07:00
|
|
|
IOSelectorWindow (ARDOUR::Session *, std::shared_ptr<ARDOUR::IO>, bool can_cancel = false);
|
2005-09-25 18:42:24 +00:00
|
|
|
|
|
|
|
|
IOSelector& selector() { return _selector; }
|
|
|
|
|
|
|
|
|
|
protected:
|
2005-11-01 00:56:09 +00:00
|
|
|
void on_map ();
|
2009-08-29 20:48:11 +00:00
|
|
|
void on_show ();
|
2009-10-14 16:10:01 +00:00
|
|
|
|
2005-09-25 18:42:24 +00:00
|
|
|
private:
|
|
|
|
|
IOSelector _selector;
|
2009-10-14 16:10:01 +00:00
|
|
|
|
2008-09-30 14:18:15 +00:00
|
|
|
void io_name_changed (void *src);
|
2009-09-13 02:03:04 +00:00
|
|
|
bool wm_delete (GdkEventAny*);
|
2005-09-25 18:42:24 +00:00
|
|
|
};
|
|
|
|
|
|