[pulseaudio-commits] r1184 - in /trunk/src/pulse: introspect.c introspect.h

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Thu Aug 3 15:33:14 PDT 2006


Author: lennart
Date: Fri Aug  4 00:33:11 2006
New Revision: 1184

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=1184&root=pulseaudio&view=rev
Log:
implement pa_context_move_source_output_by_{name,index}()

Modified:
    trunk/src/pulse/introspect.c
    trunk/src/pulse/introspect.h

Modified: trunk/src/pulse/introspect.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/pulse/introspect.c?rev=1184&root=pulseaudio&r1=1183&r2=1184&view=diff
==============================================================================
--- trunk/src/pulse/introspect.c (original)
+++ trunk/src/pulse/introspect.c Fri Aug  4 00:33:11 2006
@@ -1288,3 +1288,53 @@
 
     return o;
 }
+
+pa_operation* pa_context_move_source_output_by_name(pa_context *c, uint32_t idx, char *source_name, pa_context_success_cb_t cb, void* userdata) {
+    pa_operation *o;
+    pa_tagstruct *t;
+    uint32_t tag;
+
+    assert(c);
+    assert(c->ref >= 1);
+
+    PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
+    PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 10, PA_ERR_NOTSUPPORTED);
+    PA_CHECK_VALIDITY_RETURN_NULL(c, idx != PA_INVALID_INDEX, PA_ERR_INVALID);
+    PA_CHECK_VALIDITY_RETURN_NULL(c, source_name && *source_name, PA_ERR_INVALID);
+
+    o = pa_operation_new(c, NULL, (pa_operation_cb_t) cb, userdata);
+
+    t = pa_tagstruct_command(c, PA_COMMAND_MOVE_SOURCE_OUTPUT, &tag);
+    pa_tagstruct_putu32(t, idx);
+    pa_tagstruct_putu32(t, PA_INVALID_INDEX);
+    pa_tagstruct_puts(t, source_name);
+    pa_pstream_send_tagstruct(c->pstream, t);
+    pa_pdispatch_register_reply(c->pdispatch, tag, DEFAULT_TIMEOUT, pa_context_simple_ack_callback, pa_operation_ref(o), (pa_free_cb_t) pa_operation_unref);
+
+    return o;
+}
+
+pa_operation* pa_context_move_source_output_by_index(pa_context *c, uint32_t idx, uint32_t source_idx, pa_context_success_cb_t cb, void* userdata) {
+    pa_operation *o;
+    pa_tagstruct *t;
+    uint32_t tag;
+
+    assert(c);
+    assert(c->ref >= 1);
+
+    PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
+    PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 10, PA_ERR_NOTSUPPORTED);
+    PA_CHECK_VALIDITY_RETURN_NULL(c, idx != PA_INVALID_INDEX, PA_ERR_INVALID);
+    PA_CHECK_VALIDITY_RETURN_NULL(c, source_idx != PA_INVALID_INDEX, PA_ERR_INVALID);
+
+    o = pa_operation_new(c, NULL, (pa_operation_cb_t) cb, userdata);
+
+    t = pa_tagstruct_command(c, PA_COMMAND_MOVE_SOURCE_OUTPUT, &tag);
+    pa_tagstruct_putu32(t, idx);
+    pa_tagstruct_putu32(t, source_idx);
+    pa_tagstruct_puts(t, NULL);
+    pa_pstream_send_tagstruct(c->pstream, t);
+    pa_pdispatch_register_reply(c->pdispatch, tag, DEFAULT_TIMEOUT, pa_context_simple_ack_callback, pa_operation_ref(o), (pa_free_cb_t) pa_operation_unref);
+
+    return o;
+}

Modified: trunk/src/pulse/introspect.h
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/pulse/introspect.h?rev=1184&root=pulseaudio&r1=1183&r2=1184&view=diff
==============================================================================
--- trunk/src/pulse/introspect.h (original)
+++ trunk/src/pulse/introspect.h Fri Aug  4 00:33:11 2006
@@ -490,6 +490,12 @@
 /** Move the specified sink input to a different sink. \since 0.9.5 */
 pa_operation* pa_context_move_sink_input_by_index(pa_context *c, uint32_t idx, uint32_t sink_idx, pa_context_success_cb_t cb, void* userdata);
 
+/** Move the specified source output to a different source. \since 0.9.5 */
+pa_operation* pa_context_move_source_output_by_name(pa_context *c, uint32_t idx, char *source_name, pa_context_success_cb_t cb, void* userdata);
+
+/** Move the specified source output to a different source. \since 0.9.5 */
+pa_operation* pa_context_move_source_output_by_index(pa_context *c, uint32_t idx, uint32_t source_idx, pa_context_success_cb_t cb, void* userdata);
+
 PA_C_DECL_END
 
 #endif




More information about the pulseaudio-commits mailing list