]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - audiod_command.c
Add mood methods {artist, title, album, comment}_matches.
[paraslash.git] / audiod_command.c
index e57283cebe32a7dab6955f9d519b2752bd09e967..b3312940412a93511c4c730485e3db30a80bc9c9 100644 (file)
@@ -6,6 +6,7 @@
 
 /** \file audiod_command.c commands for para_audiod */
 
+#include <regex.h>
 #include <sys/types.h>
 #include <dirent.h>
 
@@ -16,9 +17,7 @@
 #include "sched.h"
 #include "ggo.h"
 #include "filter.h"
-#include "grab_client.cmdline.h"
 #include "grab_client.h"
-
 #include "error.h"
 #include "audiod.h"
 #include "net.h"
@@ -214,68 +213,9 @@ int com_stat(int fd, int argc, char **argv)
        return ret;
 }
 
-#if 0
-static struct filter_node *find_filter_node(int slot_num, int format, int filternum)
+int com_grab(int fd, int argc, char **argv)
 {
-       int i;
-
-       FOR_EACH_SLOT(i) {
-               struct slot_info *s = &slot[i];
-               if (s->format < 0 || !s->fc)
-                       continue;
-               if (slot_num >= 0 && slot_num != i)
-                       continue;
-               if (format >= 0 && s->format != format)
-                       continue;
-               if (num_filters(i) <= filternum)
-                       continue;
-               /* success */
-               return  s->fc->filter_nodes + filternum;
-       }
-       return NULL;
-}
-#endif
-
-int com_grab(int fd, __a_unused int argc, __a_unused char **argv)
-{
-       client_write(fd, "grab is currently b0rken\n");
-       close(fd);
-       return 1;
-#if 0
-       struct grab_client *gc;
-       struct filter_node *fn;
-       int i, err;
-       char *msg;
-
-       gc = grab_client_new(fd, cmdline, &err);
-       if (!gc)
-               goto err_out;
-       fn = find_filter_node(gc->conf->slot_arg, gc->audio_format_num, gc->conf->filter_num_arg);
-       if (fn)
-               activate_grab_client(gc, fn);
-       return 1;
-err_out:
-       if (err != -E_GC_HELP_GIVEN && err != -E_GC_VERSION_GIVEN)
-               return err;
-       if (err == -E_GC_HELP_GIVEN) {
-               msg = make_message("%s\n\n", grab_client_args_info_usage);
-               for (i = 0; grab_client_args_info_help[i]; i++) {
-                       char *tmp = make_message("%s%s\n", msg,
-                               grab_client_args_info_help[i]);
-                       free(msg);
-                       msg = tmp;
-               }
-       } else
-               msg = make_message("%s %s\n",
-                       GRAB_CLIENT_CMDLINE_PARSER_PACKAGE,
-                       GRAB_CLIENT_CMDLINE_PARSER_VERSION);
-       err = client_write(fd, msg);
-       free(msg);
-       if (err < 0)
-               return err;
-       close(fd);
-       return 1;
-#endif
+       return grab_client_new(fd, argc, argv);
 }
 
 __noreturn int com_term(int fd, __a_unused int argc, __a_unused char **argv)
@@ -390,6 +330,7 @@ out:
        }
        return ret;
 }
+
 /**
  * Send the current audiod status to all connected stat clients.
  */