/* If there's a track playing, update its row */
if(playing_track)
ql_update_row(playing_track, 0);
+ /* If the first (nonplaying) track starts in the past, update the queue to
+ * get new expected start times; but rate limit this checking. (If we only
+ * do it once a minute then the rest of the queue can get out of date too
+ * easily.) */
+ struct queue_entry *q = ql_queue.q;
+ if(q) {
+ if(q == playing_track)
+ q = q->next;
+ if(q) {
+ time_t now;
+ time(&now);
+ if(q->expected / 15 < now / 15)
+ queue_changed(0,0,0);
+ }
+ }
return TRUE;
}
{ "Adopt track", ql_adopt_activate, ql_adopt_sensitive, 0, 0 },
};
+static const GtkTargetEntry queue_targets[] = {
+ {
+ QUEUED_TRACKS, /* drag type */
+ GTK_TARGET_SAME_WIDGET, /* rearrangement within a widget */
+ QUEUED_TRACKS_ID /* ID value */
+ },
+ {
+ PLAYABLE_TRACKS, /* drag type */
+ GTK_TARGET_SAME_APP|GTK_TARGET_OTHER_WIDGET, /* copying between widgets */
+ PLAYABLE_TRACKS_ID, /* ID value */
+ },
+ {
+ .target = NULL
+ }
+};
+
struct queuelike ql_queue = {
.name = "queue",
.init = queue_init,
.ncolumns = sizeof queue_columns / sizeof *queue_columns,
.menuitems = queue_menuitems,
.nmenuitems = sizeof queue_menuitems / sizeof *queue_menuitems,
- .drop = queue_drop
+ .drop = queue_drop,
+ .drag_source_targets = queue_targets,
+ .drag_source_actions = GDK_ACTION_MOVE|GDK_ACTION_COPY,
+ .drag_dest_targets = queue_targets,
+ .drag_dest_actions = GDK_ACTION_MOVE|GDK_ACTION_COPY,
};
/** @brief Called when a key is pressed in the queue tree view */