From c557bf28a78d296045f9ba8432944d25f50d25ec Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 3 Apr 2008 19:53:58 +0000 Subject: rename menu items for monitoring options, and make the one based on JACK insensitive if there are no JACK ports capable of being monitored in that way git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3209 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/ardour/audioengine.h | 2 ++ libs/ardour/audioengine.cc | 26 ++++++++++++++++++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) (limited to 'libs/ardour') diff --git a/libs/ardour/ardour/audioengine.h b/libs/ardour/ardour/audioengine.h index 3329a036e4..31c892a2b7 100644 --- a/libs/ardour/ardour/audioengine.h +++ b/libs/ardour/ardour/audioengine.h @@ -127,6 +127,8 @@ class AudioEngine : public sigc::trackable const char ** get_ports (const std::string& port_name_pattern, const std::string& type_name_pattern, uint32_t flags); + bool can_request_hardware_monitoring (); + uint32_t n_physical_audio_outputs () const; uint32_t n_physical_audio_inputs () const; diff --git a/libs/ardour/audioengine.cc b/libs/ardour/audioengine.cc index d057a31cea..9521dfe730 100644 --- a/libs/ardour/audioengine.cc +++ b/libs/ardour/audioengine.cc @@ -813,6 +813,25 @@ AudioEngine::halted (void *arg) } } +bool +AudioEngine::can_request_hardware_monitoring () +{ + const char ** ports; + + if (!_jack) { + return 0; + } + + if ((ports = jack_get_ports (_jack, NULL, JACK_DEFAULT_AUDIO_TYPE, JackPortCanMonitor)) == 0) { + return false; + } + + free (ports); + + return true; +} + + uint32_t AudioEngine::n_physical_audio_outputs () const { @@ -827,10 +846,9 @@ AudioEngine::n_physical_audio_outputs () const return 0; } - if (ports) { - for (i = 0; ports[i]; ++i); - free (ports); - } + for (i = 0; ports[i]; ++i); + free (ports); + return i; } -- cgit v1.2.3