1 #ifndef _INPUT_MAPPING_H
2 #define _INPUT_MAPPING_H 1
8 enum class InputSourceType { SILENCE, CAPTURE_CARD, ALSA_INPUT };
13 bool operator== (const DeviceSpec &other) const {
14 return type == other.type && index == other.index;
17 bool operator< (const DeviceSpec &other) const {
18 if (type != other.type)
19 return type < other.type;
20 return index < other.index;
24 std::string display_name;
25 unsigned num_channels;
26 std::string alsa_name, alsa_info, alsa_address; // ALSA devices only, obviously.
29 static inline uint64_t DeviceSpec_to_key(const DeviceSpec &device_spec)
31 return (uint64_t(device_spec.type) << 32) | device_spec.index;
34 static inline DeviceSpec key_to_DeviceSpec(uint64_t key)
36 return DeviceSpec{ InputSourceType(key >> 32), unsigned(key & 0xffffffff) };
43 int source_channel[2] { -1, -1 }; // Left and right. -1 = none.
46 std::vector<Bus> buses;
49 #endif // !defined(_INPUT_MAPPING_H)