Index: libroarpulse/introspect.c
===================================================================
--- libroarpulse/introspect.c	(revision 5381)
+++ libroarpulse/introspect.c	(revision 5509)
@@ -63,5 +63,5 @@
 
  painfo.name                = ROAR_PA_DEFAULT_SINK;
- painfo.index               = 0;
+ painfo.index               = 0; // fixme!
  painfo.description         = "RoarAudio default mixer";
  painfo.owner_module        = PA_INVALID_INDEX;
@@ -140,5 +140,52 @@
 
 /** Get some information about a sink input by its index */
-pa_operation* pa_context_get_sink_input_info(pa_context *c, uint32_t idx, pa_sink_input_info_cb_t cb, void *userdata);
+pa_operation* pa_context_get_sink_input_info(pa_context *c, uint32_t idx, pa_sink_input_info_cb_t cb, void *userdata) {
+ pa_sink_input_info pa_info;
+// struct roar_stream_info info;
+ struct roar_stream stream;
+ struct roar_mixer_settings mixer;
+ long long int s;
+ int channels;
+ char buf[256];
+ int i;
+
+ memset(&pa_info, 0, sizeof(pa_info));
+
+ roar_get_stream(roar_pa_context_get_con(c), &stream, idx);
+
+ roar_stream_get_name(roar_pa_context_get_con(c), &stream, buf, sizeof(buf));
+
+ if ( roar_get_vol(roar_pa_context_get_con(c), idx, &mixer, &channels) == -1 ) {
+  channels = 1;
+  mixer.mixer[0] = 65535;
+  mixer.rpg_mul = mixer.rpg_div = 1;
+ }
+
+// roar_stream_get_info(roar_pa_context_get_con(c), &stream, &info);
+
+ pa_info.index  = idx;
+ pa_info.name   = buf;
+ pa_info.owner_module = PA_INVALID_INDEX;
+ pa_info.client = PA_INVALID_INDEX;
+ pa_info.sink   = idx;
+//libroarpulse.c:int roar_pa_auinfo2sspec (pa_sample_spec * ss, const struct roar_audio_info * info) {
+ roar_pa_auinfo2sspec(&(pa_info.sample_spec), &(stream.info));
+ pa_info.volume.channels = channels;
+ for (i = 0; i < channels; i++) {
+  s  = mixer.mixer[i];
+  s *= mixer.rpg_mul;
+  s *= PA_VOLUME_NORM;
+  s /= mixer.rpg_div;
+  s /= 65535;
+  pa_info.volume.values[i] = s;
+ }
+ pa_info.resample_method = "server side";
+ pa_info.driver = "RoarAudio";
+// pa_info.mute = (info.flags & ROAR_FLAG_MUTE) ? 1 : 0;
+
+ cb(c, &pa_info, 1, userdata);
+
+ return roar_pa_operation_new(PA_OPERATION_DONE);
+}
 
 /** Get the complete sink input list */
@@ -164,5 +211,27 @@
 
 /** Set the volume of a sink input stream */
-pa_operation* pa_context_set_sink_input_volume(pa_context *c, uint32_t idx, const pa_cvolume *volume, pa_context_success_cb_t cb, void *userdata);
+pa_operation* pa_context_set_sink_input_volume(pa_context *c, uint32_t idx, const pa_cvolume *volume, pa_context_success_cb_t cb, void *userdata) {
+ struct roar_mixer_settings mixer;
+ long long int s;
+ size_t i;
+
+ mixer.rpg_mul = 1;
+ mixer.rpg_div = 1;
+
+ for (i = 0; i < volume->channels; i++) {
+  s  = volume->values[i];
+  s *= 65535;
+  s /= PA_VOLUME_NORM;
+  mixer.mixer[i] = s;
+ }
+
+ if ( roar_set_vol(roar_pa_context_get_con(c), idx, &mixer, volume->channels, ROAR_SET_VOL_ALL) == -1 ) {
+  cb(c, 0, userdata);
+ } else {
+  cb(c, 1, userdata);
+ }
+
+ return roar_pa_operation_new(PA_OPERATION_DONE);
+}
 
 /** Set the volume of a source device specified by its index \since 0.8 */
Index: libroarpulse/stream.c
===================================================================
--- libroarpulse/stream.c	(revision 5508)
+++ libroarpulse/stream.c	(revision 5509)
@@ -177,6 +177,13 @@
 /** Return the device (sink input or source output) index this stream is connected to */
 uint32_t pa_stream_get_index(pa_stream *s) {
- (void)s;
- return 0;
+ struct roar_stream_info info;
+
+ if ( roar_stream_get_info(roar_pa_context_get_con(s->c), &(s->stream), &info) == -1 )
+  return 0;
+
+ if ( info.mixer == -1 )
+  return 0;
+
+ return info.mixer;
 }
 
@@ -697,5 +704,26 @@
 
 /** Pause (or resume) playback of this stream temporarily. Available on both playback and recording streams. \since 0.3 */
-pa_operation* pa_stream_cork(pa_stream *s, int b, pa_stream_success_cb_t cb, void *userdata);
+pa_operation* pa_stream_cork(pa_stream *s, int b, pa_stream_success_cb_t cb, void *userdata) {
+ int action = b ? ROAR_SET_FLAG : ROAR_RESET_FLAG;
+
+ if ( roar_stream_set_flags(roar_pa_context_get_con(s->c), &(s->stream), ROAR_FLAG_PAUSE, action) == -1 ) {
+  cb(s, 0, userdata);
+ } else {
+  cb(s, 1, userdata);
+ }
+
+ return roar_pa_operation_new(PA_OPERATION_DONE);
+}
+
+/** Return 1 if the this stream has been corked. This will return 0 if
+ * not, and negative on error. \since 0.9.11 */
+int pa_stream_is_corked(pa_stream *s) {
+ struct roar_stream_info info;
+
+ if ( roar_stream_get_info(roar_pa_context_get_con(s->c), &(s->stream), &info) == -1 )
+  return -1;
+
+ return (info.flags & ROAR_FLAG_PAUSE) ? 1 : 0;
+}
 
 /** Flush the playback buffer of this stream. Most of the time you're
