+struct DeviceInfo {
+ std::string name;
+ unsigned num_channels;
+};
+
+static inline uint64_t DeviceSpec_to_key(const DeviceSpec &device_spec)
+{
+ return (uint64_t(device_spec.type) << 32) | device_spec.index;
+}
+
+static inline DeviceSpec key_to_DeviceSpec(uint64_t key)
+{
+ return DeviceSpec{ InputSourceType(key >> 32), unsigned(key & 0xffffffff) };
+}