aboutsummaryrefslogtreecommitdiff
path: root/include/sound.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/sound.hpp')
-rw-r--r--include/sound.hpp24
1 files changed, 19 insertions, 5 deletions
diff --git a/include/sound.hpp b/include/sound.hpp
index 7bcc120..87e2e2d 100644
--- a/include/sound.hpp
+++ b/include/sound.hpp
@@ -26,7 +26,7 @@ typedef struct {
unsigned int frames;
} SoundDevice;
-struct AudioInput {
+struct AudioDevice {
std::string name;
std::string description;
};
@@ -34,10 +34,22 @@ struct AudioInput {
struct AudioDevices {
std::string default_output;
std::string default_input;
- std::vector<AudioInput> audio_inputs;
+ std::vector<AudioDevice> audio_inputs;
+};
+
+enum class AudioInputType {
+ DEVICE,
+ APPLICATION
+};
+
+struct AudioInput {
+ std::string name;
+ AudioInputType type = AudioInputType::DEVICE;
+ bool inverted = false;
};
struct MergedAudioInputs {
+ std::string track_name;
std::vector<AudioInput> audio_inputs;
};
@@ -48,9 +60,10 @@ typedef enum {
} AudioFormat;
/*
- Get a sound device by name, returning the device into the @device parameter.
- The device should be closed with @sound_device_close after it has been used
- to clean up internal resources.
+ Get a sound device by name, returning the device into the |device| parameter.
+ |device_name| can be a device name or "default_output" or "default_input".
+ If the device name is "default_output" or "default_input" then it will automatically switch which
+ device is records from when the default output/input is changed in the system audio settings.
Returns 0 on success, or a negative value on failure.
*/
int sound_device_get_by_name(SoundDevice *device, const char *device_name, const char *description, unsigned int num_channels, unsigned int period_frame_size, AudioFormat audio_format);
@@ -64,5 +77,6 @@ void sound_device_close(SoundDevice *device);
int sound_device_read_next_chunk(SoundDevice *device, void **buffer, double timeout_sec, double *latency_seconds);
AudioDevices get_pulseaudio_inputs();
+bool pulseaudio_server_is_pipewire();
#endif /* GPU_SCREEN_RECORDER_H */