diff options
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; } |