diff options
author | quou <quou@disroot.org> | 2024-06-03 21:05:14 +1000 |
---|---|---|
committer | quou <quou@disroot.org> | 2024-06-03 21:05:22 +1000 |
commit | 6589107006fd4fc06bdb7d02cb4b1eef45395458 (patch) | |
tree | af196448b28aa4a1ec612e2c1b1578465c203c12 /main.c | |
parent | 62b4a3ededd237f4b4850d91c052585e2f687499 (diff) |
Basic audio playback with pulseaudio.
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -5,6 +5,7 @@ #include "memory.h" Library lib; +Player pl; int libtab_msg( UIElement *el, @@ -12,9 +13,9 @@ int libtab_msg( int di, void *dp ) { + Song* song; if (msg == UI_MSG_TABLE_GET_ITEM) { UITableGetItem *m = (UITableGetItem*)dp; - Song* song; song = &lib.songs[lib.indices[m->index]]; m->isSelected = 0; switch (m->column) { @@ -48,6 +49,15 @@ int libtab_msg( ); default: return 0; } + } else if (msg == UI_MSG_LEFT_UP) { + int hit = UITableHitTest( + (UITable*)el, + el->window->cursorX, + el->window->cursorY + ); + song = &lib.songs[lib.indices[hit]]; + init_player(&pl); + play_song(&pl, song); } return 0; } |