buffer_tree: Add code to splice out a node of the buffer tree.
[paraslash.git] / grab_client.h
index 2832f09361a702de79bff240ae336a80d3e078f1..04e0a75b15a32f5ccf13ec1c2fe40ddde6336acc 100644 (file)
@@ -7,43 +7,53 @@
 /** \file grab_client.h exported symbols from grab_client.c */
 
 #include "config.h"
+
 /**
- * handle blocking writes for the grab client fds
- *
- * - pedantic: close fd if write would block
- * - sloppy: ignore the data and do not write
- * - aggressive: write anyway (default)
- *
+ * How to handle blocking writes for the grab client fds.
  */
-enum grab_mode {GRAB_SLOPPY, GRAB_AGGRESSIVE, GRAB_PEDANTIC};
+enum grab_mode {
+       /** Ignore the data and do not write. */
+       GM_SLOPPY,
+       /** Write anyway (default). */
+       GM_AGGRESSIVE,
+       /** Close fd if write would block. */
+       GM_PEDANTIC,
+};
 
-/** describes one active grab client
+/** Flags specified as arguments to the grab command. */
+enum grab_flags {
+       /** Grab the filter input instead of its output. */
+       GF_INPUT_GRAB = 1,
+       /** Stop grabbing if audio file changes. */
+       GF_ONE_SHOT = 2,
+};
+
+/**
+ * Describes one active grab client.
  *
- * \sa filter_callback, filter_node::callbacks
+ * \sa filter_callback, filter_node::callbacks.
  */
 struct grab_client {
-/** the file descriptor to send the grabbed stream to */
+       /** The file descriptor to send the grabbed stream to. */
        int fd;
-/** the command line options for this grab client */
-       struct grab_client_args_info *conf;
-/** pedantic, sloppy, or aggressive, computed from command line */
-       enum grab_mode mode;
-/** non-zero if the write() to \a fd failed */
+       /** Non-zero if the write() to \a fd failed. */
        int error;
-/** the number of the desired audio format, computed from command line */
+       /** See \ref grab_mode. */
+       enum grab_mode mode;
+       /** Point of filter chain to grab. */
+       int32_t filter_num;
+       /** The number of the desired audio format. */
        int audio_format_num;
-/** the callback data which gets attached to a suitable filter_node */
+       /** Flags given at the command line. */
+       enum grab_flags flags;
+       /** The callback data which gets attached to a suitable filter_node. */
        struct filter_callback fcb;
-/** all grab clients belong either to a filter node or to the inactive list */
+       /** All grab clients belong either to a filter node or to the inactive list. */
        struct list_head node;
-/** the number of command line options */
-       int argc;
-/** pointers to the command line options */
-       char **argv;
 };
 
-__malloc struct grab_client *grab_client_new(int fd, char *line, int *err);
-void activate_inactive_grab_clients(int slot_num, int audio_format_num,
+int grab_client_new(int fd, int argc, char **argv);
+void activate_inactive_grab_clients(int audio_format_num,
                struct filter_chain *fc);
 void activate_grab_client(struct grab_client *gc, struct filter_node *fn);
 void init_grabbing(void);