Beispiel #1
0
static void
set_cursor (DdbListview *listview, DB_playItem_t *it) {
    int new_cursor = deadbeef->pl_get_idx_of_iter (it, PL_SEARCH);
    if (new_cursor != -1) {
        int cursor = deadbeef->pl_get_cursor (PL_SEARCH);
        if (new_cursor != cursor) {
            deadbeef->pl_set_cursor (PL_SEARCH, new_cursor);
            ddb_listview_draw_row (listview, new_cursor, NULL);
            if (cursor != -1) {
                ddb_listview_draw_row (listview, cursor, NULL);
            }
        }
        ddb_listview_scroll_to (listview, new_cursor);
    }
}
Beispiel #2
0
void main_selection_changed (DdbListviewIter it, int idx) {
    DdbListview *search = DDB_LISTVIEW (lookup_widget (searchwin, "searchlist"));
    if (idx == -1) {
        ddb_listview_refresh (search, DDB_REFRESH_LIST);
    }
    else {
        ddb_listview_draw_row (search, search_get_idx ((DB_playItem_t *)it), it);
    }
}
Beispiel #3
0
void main_selection_changed (DdbListview *ps, DdbListviewIter it, int idx) {
    DdbListview *search = DDB_LISTVIEW (lookup_widget (searchwin, "searchlist"));
    if (idx == -1) {
        ddb_listview_refresh (search, DDB_REFRESH_LIST);
    }
    else {
        ddb_listview_draw_row (search, search_get_idx ((DB_playItem_t *)it), it);
    }
    deadbeef->sendmessage (DB_EV_SELCHANGED, (uintptr_t)ps, deadbeef->plt_get_curr_idx (), PL_MAIN);
}
Beispiel #4
0
static gboolean
paused_cb (gpointer p) {
    DB_playItem_t *it = deadbeef->streamer_get_playing_track();
    if (it) {
        int idx = deadbeef->pl_get_idx_of_iter(it, PL_SEARCH);
        if (idx != -1) {
            ddb_listview_draw_row(DDB_LISTVIEW(p), idx, (DdbListviewIter)it);
        }
        deadbeef->pl_item_unref(it);
    }
    return FALSE;
}
Beispiel #5
0
static gboolean
row_redraw_cb (gpointer p) {
    DB_playItem_t *it = (DB_playItem_t *)p;
    DdbListview *listview = playlist_visible();
    if (listview) {
        int idx = deadbeef->pl_get_idx_of_iter(it, PL_SEARCH);
        if (idx != -1) {
            ddb_listview_draw_row(listview, idx, it);
        }
    }
    deadbeef->pl_item_unref(it);
    return FALSE;
}
Beispiel #6
0
static gboolean
songstarted_cb (gpointer p) {
    DB_playItem_t *it = p;
    DdbListview *listview = playlist_visible();
    if (listview) {
        int idx = deadbeef->pl_get_idx_of_iter (it, PL_SEARCH);
        if (idx != -1) {
            if (!gtkui_listview_busy) {
                if (deadbeef->conf_get_int ("playlist.scroll.cursorfollowplayback", 1)) {
                    ddb_listview_select_single (listview, idx);
                    deadbeef->pl_set_cursor (PL_SEARCH, idx);
                }
                if (deadbeef->conf_get_int ("playlist.scroll.followplayback", 1)) {
                    ddb_listview_scroll_to (listview, idx);
                }
            }
            ddb_listview_draw_row (listview, idx, it);
        }
    }
    deadbeef->pl_item_unref (it);
    return FALSE;
}