From f61d17119ceb939ec9b840dc39a6a064b11668a8 Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Sun, 29 Aug 2010 19:44:28 +0200 Subject: gtkui plugin overrides pl_add_file and pl_add_dir API functions and shows progress dialog --- main.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 601a8e0b..3c06e3fa 100644 --- a/main.c +++ b/main.c @@ -225,6 +225,9 @@ server_exec_command_line (const char *cmdline, int len, char *sendback, int sbsi pl_clear (); pl_reset_cursor (); } + if (parg < pend) { + deadbeef->pl_add_files_begin (); + } while (parg < pend) { char resolved[PATH_MAX]; const char *pname; @@ -234,14 +237,15 @@ server_exec_command_line (const char *cmdline, int len, char *sendback, int sbsi else { pname = parg; } - if (pl_add_dir (pname, NULL, NULL) < 0) { - if (pl_add_file (pname, NULL, NULL) < 0) { + if (deadbeef->pl_add_dir (pname, NULL, NULL) < 0) { + if (deadbeef->pl_add_file (pname, NULL, NULL) < 0) { fprintf (stderr, "failed to add file or folder %s\n", pname); } } parg += strlen (parg); parg++; } + deadbeef->pl_add_files_end (); messagepump_push (M_PLAYLISTREFRESH, 0, 0, 0); if (!queue) { messagepump_push (M_PLAYSONG, 0, 1, 0); -- cgit v1.2.3