diff options
| author | Calvin Morrison <calvin@pobox.com> | 2026-06-22 14:43:39 -0400 |
|---|---|---|
| committer | Calvin Morrison <calvin@pobox.com> | 2026-06-22 14:43:39 -0400 |
| commit | c7e71230f74415c3f56220d29701780e6f1a9fdd (patch) | |
| tree | 7f8869fe64d3fd63c06df8ffc76b9ab1b0a58035 /moc_x11.c | |
| parent | cbc81ba76807acefecaa7cc60853fd7b35853266 (diff) | |
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 <noreply@anthropic.com>
Diffstat (limited to 'moc_x11.c')
| -rw-r--r-- | moc_x11.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -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); } |
