summaryrefslogtreecommitdiffstats
path: root/server/spice.h
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2011-05-23 12:20:17 +0200
committerMarc-André Lureau <marcandre.lureau@redhat.com>2011-06-22 12:12:26 +0200
commitd1758b328811979beb58ff9ddb9cf4f318fa28f7 (patch)
tree7d2f66e34e762db3194eb86d5d6387e286217b35 /server/spice.h
parent5ec91855d818078523653e79562921bcea9bef14 (diff)
downloadspice-d1758b328811979beb58ff9ddb9cf4f318fa28f7.tar.gz
spice-d1758b328811979beb58ff9ddb9cf4f318fa28f7.tar.xz
spice-d1758b328811979beb58ff9ddb9cf4f318fa28f7.zip
sndworker: add AudioVolume/AudioMute messages
These messages allow the guest to send the audio device volume to the client. It uses an arbitrary scale of 16bits, which works good enough for now. Save VolumeState in {Playback,Record}State, so that we can send the current volume on channel connection. Note about future improvements: - add exact dB support - add client to guest volume change Updated since v2: - bumped record and playback interface minor version to allow conditional compilation Updated since v1: - sync record volume on connection too
Diffstat (limited to 'server/spice.h')
-rw-r--r--server/spice.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/server/spice.h b/server/spice.h
index 425d5869..f64ff414 100644
--- a/server/spice.h
+++ b/server/spice.h
@@ -268,7 +268,7 @@ struct SpiceTabletInstance {
#define SPICE_INTERFACE_PLAYBACK "playback"
#define SPICE_INTERFACE_PLAYBACK_MAJOR 1
-#define SPICE_INTERFACE_PLAYBACK_MINOR 1
+#define SPICE_INTERFACE_PLAYBACK_MINOR 2
typedef struct SpicePlaybackInterface SpicePlaybackInterface;
typedef struct SpicePlaybackInstance SpicePlaybackInstance;
typedef struct SpicePlaybackState SpicePlaybackState;
@@ -296,10 +296,13 @@ void spice_server_playback_get_buffer(SpicePlaybackInstance *sin,
uint32_t **samples, uint32_t *nsamples);
void spice_server_playback_put_samples(SpicePlaybackInstance *sin,
uint32_t *samples);
+void spice_server_playback_set_volume(SpicePlaybackInstance *sin,
+ uint8_t nchannels, uint16_t *volume);
+void spice_server_playback_set_mute(SpicePlaybackInstance *sin, uint8_t mute);
#define SPICE_INTERFACE_RECORD "record"
#define SPICE_INTERFACE_RECORD_MAJOR 2
-#define SPICE_INTERFACE_RECORD_MINOR 1
+#define SPICE_INTERFACE_RECORD_MINOR 2
typedef struct SpiceRecordInterface SpiceRecordInterface;
typedef struct SpiceRecordInstance SpiceRecordInstance;
typedef struct SpiceRecordState SpiceRecordState;
@@ -321,6 +324,9 @@ void spice_server_record_start(SpiceRecordInstance *sin);
void spice_server_record_stop(SpiceRecordInstance *sin);
uint32_t spice_server_record_get_samples(SpiceRecordInstance *sin,
uint32_t *samples, uint32_t bufsize);
+void spice_server_record_set_volume(SpiceRecordInstance *sin,
+ uint8_t nchannels, uint16_t *volume);
+void spice_server_record_set_mute(SpiceRecordInstance *sin, uint8_t mute);
/* char device interfaces */