From ec1ce20be1dc30748c31fc18afc1b4ca1532852e Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Thu, 16 Jan 2014 13:18:58 -0500 Subject: add is-available verb --- pulse.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'pulse.h') diff --git a/pulse.h b/pulse.h index 2d980f0..7c17baf 100644 --- a/pulse.h +++ b/pulse.h @@ -48,6 +48,12 @@ struct Operations { class Device { public: + typedef enum { + AVAILABLE_UNKNOWN = 0, + AVAILABLE_NO, + AVAILABLE_YES, + } Availability; + Device(const pa_source_info* info); Device(const pa_sink_info* info); Device(const pa_sink_input_info* info); @@ -77,6 +83,7 @@ class Device { int balance_; uint32_t card_idx_; Operations ops_; + Device::Availability available_ = Device::AVAILABLE_UNKNOWN; }; class Card { @@ -198,6 +205,10 @@ class PulseClient { bool IsMuted(const Device& device) const { return device.mute_; }; bool SetMute(Device& device, bool mute); + Device::Availability Availability(const Device& device) const { + return device.available_; + } + // Set the profile for a card by name. bool SetProfile(Card& card, const string& profile); -- cgit v1.2.3