From: Olaf Wintermann Date: Tue, 15 Jul 2025 18:50:20 +0000 (+0200) Subject: allow multiple open commands in instance socket connection X-Git-Url: https://uap-core.de/gitweb/?a=commitdiff_plain;h=adffa60d352249a2f17328d2e8daf9a9f6680d93;p=uwplayer.git allow multiple open commands in instance socket connection --- diff --git a/application/settings.c b/application/settings.c index 2ae1e06..8ee4029 100644 --- a/application/settings.c +++ b/application/settings.c @@ -348,12 +348,17 @@ int CreateSingleInstanceSocket(Display *dp, Bool *already_running) { return 0; } +static Boolean clearPlaylist = TRUE; + static Boolean cmd_open(XtPointer data) { MainWindow *win = GetMainWindow(); char *file = data; printf("open %s\n", file); - PlayListClear(win); + if(clearPlaylist) { + PlayListClear(win); + clearPlaylist = FALSE; + } PlayListAddFile(win, file); PlayListPlayTrack(win, win->playlist.tracks->size-1); @@ -402,6 +407,7 @@ void* instance_socket_thread(void *data) { break; } printf("accept instance connection\n"); + clearPlaylist = TRUE; // the first open command will clear the playlist msgbuf.pos = 0; msgbuf.size = 0;