From c7e71230f74415c3f56220d29701780e6f1a9fdd Mon Sep 17 00:00:00 2001 From: Calvin Morrison Date: Mon, 22 Jun 2026 14:43:39 -0400 Subject: Add libmoc playback commands and Athena widget UI Extends moc_library with playlist tracking and thread-safe playback commands (play/pause/stop/next/prev/playlist add/remove/clear), and adds moc_xaw.c, an Athena widget UI with a directory browser and live playlist view. Also taller default window and playlist rendering in moc_x11. Co-Authored-By: Claude Sonnet 4.6 --- moc_x11.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'moc_x11.c') diff --git a/moc_x11.c b/moc_x11.c index efff073..3ec7c50 100644 --- a/moc_x11.c +++ b/moc_x11.c @@ -93,7 +93,7 @@ int main() { } int s = DefaultScreen(dpy); - Window win = XCreateSimpleWindow(dpy, RootWindow(dpy, s), 10, 10, 660, 200, 1, + Window win = XCreateSimpleWindow(dpy, RootWindow(dpy, s), 10, 10, 660, 600, 1, BlackPixel(dpy, s), WhitePixel(dpy, s)); XSelectInput(dpy, win, ExposureMask | ButtonPress | KeyPressMask); XMapWindow(dpy, win); @@ -152,6 +152,18 @@ int main() { } + + y_offset += 10; + XDrawString(dpy, win, DefaultGC(dpy, s), x, y_offset, "Playlist:", 9); + y_offset += 15; + { + struct moc_plist_item *item; + for (item = mh->playlist; item; item = item->next) { + const char *label = (item->title && item->title[0]) ? item->title : item->file; + XDrawString(dpy, win, DefaultGC(dpy, s), x, y_offset, label, strlen(label)); + y_offset += 15; + } + } pthread_mutex_unlock(&mh->lock); } -- cgit v1.2.3