2005-09-25 14:42:24 -04:00
|
|
|
/*
|
2009-10-14 12:10:01 -04:00
|
|
|
Copyright (C) 2002-2007 Paul Davis
|
2005-09-25 14:42:24 -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_io_selector_h__
|
|
|
|
#define __ardour_ui_io_selector_h__
|
|
|
|
|
2007-10-10 14:37:13 -04:00
|
|
|
#include "ardour_dialog.h"
|
2007-10-19 09:30:07 -04:00
|
|
|
#include "port_matrix.h"
|
2009-07-19 15:07:31 -04:00
|
|
|
#include "i18n.h"
|
2006-06-07 10:54:12 -04:00
|
|
|
|
2009-01-20 09:46:00 -05:00
|
|
|
namespace ARDOUR {
|
|
|
|
class PortInsert;
|
|
|
|
}
|
|
|
|
|
2009-01-30 10:08:09 -05:00
|
|
|
class IOSelector : public PortMatrix
|
|
|
|
{
|
2005-09-25 14:42:24 -04:00
|
|
|
public:
|
2009-12-04 22:04:54 -05:00
|
|
|
IOSelector (Gtk::Window*, ARDOUR::Session *, boost::shared_ptr<ARDOUR::IO>);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-01-30 10:08:09 -05:00
|
|
|
void set_state (ARDOUR::BundleChannel c[2], bool);
|
2009-05-03 10:31:42 -04:00
|
|
|
PortMatrixNode::State get_state (ARDOUR::BundleChannel c[2]) const;
|
2009-01-20 09:46:00 -05:00
|
|
|
|
2009-07-19 15:07:31 -04:00
|
|
|
std::string disassociation_verb () const {
|
|
|
|
return _("Disconnect");
|
|
|
|
}
|
2009-07-19 16:42:14 -04:00
|
|
|
|
|
|
|
std::string channel_noun () const {
|
|
|
|
return _("port");
|
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2009-01-30 10:08:09 -05:00
|
|
|
uint32_t n_io_ports () const;
|
2009-01-20 09:46:00 -05:00
|
|
|
boost::shared_ptr<ARDOUR::IO> const io () { return _io; }
|
2009-02-08 22:18:10 -05:00
|
|
|
void setup_ports (int);
|
|
|
|
bool list_is_global (int) const;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-01-30 10:08:09 -05:00
|
|
|
bool find_inputs_for_io_outputs () const {
|
|
|
|
return _find_inputs_for_io_outputs;
|
|
|
|
}
|
|
|
|
|
2009-02-08 22:18:10 -05:00
|
|
|
int ours () const {
|
|
|
|
return _ours;
|
|
|
|
}
|
|
|
|
|
|
|
|
int other () const {
|
|
|
|
return _other;
|
|
|
|
}
|
|
|
|
|
2007-10-10 14:37:13 -04:00
|
|
|
private:
|
2009-07-19 16:12:59 -04:00
|
|
|
|
2009-01-30 10:08:09 -05:00
|
|
|
int _other;
|
|
|
|
int _ours;
|
2007-10-10 14:37:13 -04:00
|
|
|
boost::shared_ptr<ARDOUR::IO> _io;
|
2009-01-30 10:08:09 -05:00
|
|
|
boost::shared_ptr<PortGroup> _port_group;
|
|
|
|
bool _find_inputs_for_io_outputs;
|
2005-09-25 14:42:24 -04:00
|
|
|
};
|
|
|
|
|
2009-07-17 18:54:45 -04:00
|
|
|
class IOSelectorWindow : public Gtk::Window
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
|
|
|
public:
|
2009-12-04 22:04:54 -05:00
|
|
|
IOSelectorWindow (ARDOUR::Session *, boost::shared_ptr<ARDOUR::IO>, bool can_cancel = false);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
IOSelector& selector() { return _selector; }
|
|
|
|
|
|
|
|
protected:
|
2005-10-31 19:56:09 -05:00
|
|
|
void on_map ();
|
2009-08-29 16:48:11 -04:00
|
|
|
void on_show ();
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
private:
|
|
|
|
IOSelector _selector;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-09-30 10:18:15 -04:00
|
|
|
void io_name_changed (void *src);
|
2009-09-12 22:03:04 -04:00
|
|
|
bool wm_delete (GdkEventAny*);
|
2005-09-25 14:42:24 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2009-12-04 07:32:33 -05:00
|
|
|
class PortInsertUI : public Gtk::HBox
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2009-10-14 12:10:01 -04:00
|
|
|
public:
|
2009-12-04 22:04:54 -05:00
|
|
|
PortInsertUI (Gtk::Window*, ARDOUR::Session *, boost::shared_ptr<ARDOUR::PortInsert>);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
void redisplay ();
|
|
|
|
void finished (IOSelector::Result);
|
|
|
|
|
|
|
|
private:
|
2010-03-16 11:33:04 -04:00
|
|
|
boost::shared_ptr<ARDOUR::PortInsert> _pi;
|
|
|
|
|
|
|
|
Gtk::ToggleButton latency_button;
|
2005-09-25 14:42:24 -04:00
|
|
|
IOSelector input_selector;
|
|
|
|
IOSelector output_selector;
|
2010-03-16 11:33:04 -04:00
|
|
|
Gtk::Label latency_display;
|
|
|
|
Gtk::Frame latency_frame;
|
|
|
|
Gtk::HBox latency_hbox;
|
|
|
|
sigc::connection latency_timeout;
|
|
|
|
|
|
|
|
bool check_latency_measurement ();
|
|
|
|
void latency_button_toggled ();
|
2005-09-25 14:42:24 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
class PortInsertWindow : public ArdourDialog
|
|
|
|
{
|
2009-10-14 12:10:01 -04:00
|
|
|
public:
|
2009-12-04 22:04:54 -05:00
|
|
|
PortInsertWindow (ARDOUR::Session *, boost::shared_ptr<ARDOUR::PortInsert>, bool can_cancel = false);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
protected:
|
2005-10-31 19:56:09 -05:00
|
|
|
void on_map ();
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
private:
|
|
|
|
PortInsertUI _portinsertui;
|
|
|
|
Gtk::VBox vbox;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
Gtk::Button ok_button;
|
|
|
|
Gtk::Button cancel_button;
|
|
|
|
Gtk::Frame button_frame;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
void cancel ();
|
|
|
|
void accept ();
|
|
|
|
|
2006-08-24 21:07:15 -04:00
|
|
|
void plugin_going_away ();
|
2009-12-21 13:23:07 -05:00
|
|
|
PBD::ScopedConnection going_away_connection;
|
2009-09-12 22:03:04 -04:00
|
|
|
|
|
|
|
bool wm_delete (GdkEventAny*);
|
2005-09-25 14:42:24 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2007-10-10 14:37:13 -04:00
|
|
|
#endif
|