X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=alsa_input.h;h=3b98885677832ec6f1763555fbb4f36ada45e429;hb=26e1ec466d4730b6abc0e20201d704cfdf41a6eb;hp=f1216dea5a3aa898cfcca00f304eef0b24446504;hpb=c558d684af1bcbbca87207ede74071850c835b7c;p=nageru diff --git a/alsa_input.h b/alsa_input.h index f1216de..3b98885 100644 --- a/alsa_input.h +++ b/alsa_input.h @@ -22,6 +22,7 @@ #include "timebase.h" class ALSAPool; +class DeviceSpecProto; class ALSAInput { public: @@ -119,6 +120,8 @@ public: // at any given time as a result of an error or hotplug event; // a card that is held will go to the DEAD state instead. bool held = false; + + std::string display_name() const { return name + " (" + info + ")"; } }; void init(); @@ -150,6 +153,15 @@ public: // EMPTY or DEAD state. Only for ALSAInput and for internal use. void free_card(unsigned index); + // Create a new card, mark it immediately as DEAD and hold it. + // Returns the new index. + unsigned create_dead_card(const std::string &name, const std::string &info, unsigned num_channels); + + // Make a protobuf representation of the given card, so that it can be + // matched against at a later stage. For AudioMixer only. + // The given card must be held. + void serialize_device(unsigned index, DeviceSpecProto *serialized); + private: mutable std::mutex mu; std::vector devices; // Under mu.