projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LCXL: some more small tweaks
[ardour.git]
/
gtk2_ardour
/
io_selector.cc
diff --git
a/gtk2_ardour/io_selector.cc
b/gtk2_ardour/io_selector.cc
index 30c581367dbb82a65054dccbde8e3c83d6282756..99050cc34ba0a5a75c728d2cf1da11cdd6004b1c 100644
(file)
--- a/
gtk2_ardour/io_selector.cc
+++ b/
gtk2_ardour/io_selector.cc
@@
-17,29
+17,26
@@
*/
*/
-#include <gtkmm/messagedialog.h>
+#include <stdint.h>
+
#include <glibmm/objectbase.h>
#include <gtkmm2ext/doi.h>
#include <glibmm/objectbase.h>
#include <gtkmm2ext/doi.h>
-#include "ardour/port_insert.h"
-#include "ardour/session.h"
-#include "ardour/io.h"
#include "ardour/audioengine.h"
#include "ardour/audioengine.h"
-#include "ardour/track.h"
-#include "ardour/audio_track.h"
-#include "ardour/midi_track.h"
-#include "ardour/mtdm.h"
+#include "ardour/bundle.h"
#include "ardour/data_type.h"
#include "ardour/data_type.h"
+#include "ardour/io.h"
#include "ardour/port.h"
#include "ardour/port.h"
-#include "ardour/
bundle
.h"
+#include "ardour/
session
.h"
#include "io_selector.h"
#include "utils.h"
#include "gui_thread.h"
#include "io_selector.h"
#include "utils.h"
#include "gui_thread.h"
-#include "i18n.h"
+#include "
pbd/
i18n.h"
using namespace ARDOUR;
using namespace ARDOUR;
+using namespace ARDOUR_UI_UTILS;
using namespace Gtk;
IOSelector::IOSelector (Gtk::Window* p, ARDOUR::Session* session, boost::shared_ptr<ARDOUR::IO> io)
using namespace Gtk;
IOSelector::IOSelector (Gtk::Window* p, ARDOUR::Session* session, boost::shared_ptr<ARDOUR::IO> io)
@@
-47,7
+44,7
@@
IOSelector::IOSelector (Gtk::Window* p, ARDOUR::Session* session, boost::shared_
, _io (io)
{
setup_type ();
, _io (io)
{
setup_type ();
-
+
/* signal flow from 0 to 1 */
_find_inputs_for_io_outputs = (_io->direction() == IO::Output);
/* signal flow from 0 to 1 */
_find_inputs_for_io_outputs = (_io->direction() == IO::Output);
@@
-97,7
+94,7
@@
IOSelector::io_changed_proxy ()
so we can't call setup_all_ports (which results in a call to Route::foreach_processor)
without a deadlock unless we break things up with this idle handler.
*/
so we can't call setup_all_ports (which results in a call to Route::foreach_processor)
without a deadlock unless we break things up with this idle handler.
*/
-
+
Glib::signal_idle().connect_once (sigc::mem_fun (*this, &IOSelector::io_changed));
}
Glib::signal_idle().connect_once (sigc::mem_fun (*this, &IOSelector::io_changed));
}
@@
-119,7
+116,7
@@
IOSelector::setup_ports (int dim)
if (dim == _other) {
if (dim == _other) {
- _ports[_other].gather (_session, type(), _find_inputs_for_io_outputs, false);
+ _ports[_other].gather (_session, type(), _find_inputs_for_io_outputs, false
, show_only_bundles ()
);
} else {
} else {
@@
-139,15
+136,19
@@
IOSelector::set_state (ARDOUR::BundleChannel c[2], bool s)
for (ARDOUR::Bundle::PortList::const_iterator i = our_ports.begin(); i != our_ports.end(); ++i) {
for (ARDOUR::Bundle::PortList::const_iterator j = other_ports.begin(); j != other_ports.end(); ++j) {
for (ARDOUR::Bundle::PortList::const_iterator i = our_ports.begin(); i != our_ports.end(); ++i) {
for (ARDOUR::Bundle::PortList::const_iterator j = other_ports.begin(); j != other_ports.end(); ++j) {
-
Port*
f = _session->engine().get_port_by_name (*i);
+
boost::shared_ptr<Port>
f = _session->engine().get_port_by_name (*i);
if (!f) {
return;
}
if (s) {
if (!f) {
return;
}
if (s) {
- _io->connect (f, *j, 0);
+ if (!f->connected_to (*j)) {
+ _io->connect (f, *j, 0);
+ }
} else {
} else {
- _io->disconnect (f, *j, 0);
+ if (f->connected_to (*j)) {
+ _io->disconnect (f, *j, 0);
+ }
}
}
}
}
}
}
@@
-156,6
+157,10
@@
IOSelector::set_state (ARDOUR::BundleChannel c[2], bool s)
PortMatrixNode::State
IOSelector::get_state (ARDOUR::BundleChannel c[2]) const
{
PortMatrixNode::State
IOSelector::get_state (ARDOUR::BundleChannel c[2]) const
{
+ if (c[0].bundle->nchannels() == ChanCount::ZERO || c[1].bundle->nchannels() == ChanCount::ZERO) {
+ return PortMatrixNode::NOT_ASSOCIATED;
+ }
+
ARDOUR::Bundle::PortList const & our_ports = c[_ours].bundle->channel_ports (c[_ours].channel);
ARDOUR::Bundle::PortList const & other_ports = c[_other].bundle->channel_ports (c[_other].channel);
ARDOUR::Bundle::PortList const & our_ports = c[_ours].bundle->channel_ports (c[_ours].channel);
ARDOUR::Bundle::PortList const & other_ports = c[_other].bundle->channel_ports (c[_other].channel);
@@
-168,7
+173,7
@@
IOSelector::get_state (ARDOUR::BundleChannel c[2]) const
for (ARDOUR::Bundle::PortList::const_iterator i = our_ports.begin(); i != our_ports.end(); ++i) {
for (ARDOUR::Bundle::PortList::const_iterator j = other_ports.begin(); j != other_ports.end(); ++j) {
for (ARDOUR::Bundle::PortList::const_iterator i = our_ports.begin(); i != our_ports.end(); ++i) {
for (ARDOUR::Bundle::PortList::const_iterator j = other_ports.begin(); j != other_ports.end(); ++j) {
-
Port*
f = _session->engine().get_port_by_name (*i);
+
boost::shared_ptr<Port>
f = _session->engine().get_port_by_name (*i);
/* since we are talking about an IO, our ports should all have an associated Port *,
so the above call should never fail */
/* since we are talking about an IO, our ports should all have an associated Port *,
so the above call should never fail */
@@
-200,28
+205,26
@@
IOSelector::list_is_global (int dim) const
return (dim == _other);
}
return (dim == _other);
}
-string
+st
d::st
ring
IOSelector::disassociation_verb () const
{
return _("Disconnect");
}
IOSelector::disassociation_verb () const
{
return _("Disconnect");
}
-string
+st
d::st
ring
IOSelector::channel_noun () const
{
return _("port");
}
IOSelectorWindow::IOSelectorWindow (ARDOUR::Session* session, boost::shared_ptr<ARDOUR::IO> io, bool /*can_cancel*/)
IOSelector::channel_noun () const
{
return _("port");
}
IOSelectorWindow::IOSelectorWindow (ARDOUR::Session* session, boost::shared_ptr<ARDOUR::IO> io, bool /*can_cancel*/)
- : _selector (this, session, io)
+ : ArdourWindow (_("I/O selector"))
+ , _selector (this, session, io)
{
set_name ("IOSelectorWindow2");
{
set_name ("IOSelectorWindow2");
- set_title (_("I/O selector"));
add (_selector);
add (_selector);
- set_position (Gtk::WIN_POS_MOUSE);
-
io_name_changed (this);
show_all ();
io_name_changed (this);
show_all ();
@@
-233,8
+236,7
@@
bool
IOSelectorWindow::wm_delete (GdkEventAny* /*event*/)
{
_selector.Finished (IOSelector::Accepted);
IOSelectorWindow::wm_delete (GdkEventAny* /*event*/)
{
_selector.Finished (IOSelector::Accepted);
- hide ();
- return true;
+ return false;
}
}
@@
-249,7
+251,7
@@
void
IOSelectorWindow::on_show ()
{
Gtk::Window::on_show ();
IOSelectorWindow::on_show ()
{
Gtk::Window::on_show ();
- pair<uint32_t, uint32_t> const pm_max = _selector.max_size ();
+
std::
pair<uint32_t, uint32_t> const pm_max = _selector.max_size ();
resize_window_to_proportion_of_monitor (this, pm_max.first, pm_max.second);
}
resize_window_to_proportion_of_monitor (this, pm_max.first, pm_max.second);
}
@@
-258,7
+260,7
@@
IOSelectorWindow::io_name_changed (void*)
{
ENSURE_GUI_THREAD (*this, &IOSelectorWindow::io_name_changed, src)
{
ENSURE_GUI_THREAD (*this, &IOSelectorWindow::io_name_changed, src)
- string title;
+ st
d::st
ring title;
if (!_selector.find_inputs_for_io_outputs()) {
title = string_compose(_("%1 input"), _selector.io()->name());
if (!_selector.find_inputs_for_io_outputs()) {
title = string_compose(_("%1 input"), _selector.io()->name());