chiark
/
gitweb
/
~mdw
/
disorder
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move RTP check. This seems to improve matters - formerly the RTP
[disorder]
/
disobedience
/
queue.c
diff --git
a/disobedience/queue.c
b/disobedience/queue.c
index 8ff6b6fcd3c2ba5663ed7a2ec35df5aad0c8d9b8..026c492464a410fd6662650cc6753212a5e8ab53 100644
(file)
--- a/
disobedience/queue.c
+++ b/
disobedience/queue.c
@@
-225,7
+225,7
@@
static struct queuelike ql_queue; /**< @brief The main queue */
static struct queuelike ql_recent; /*< @brief Recently-played tracks */
static struct queuelike ql_added; /*< @brief Newly added tracks */
static struct queue_entry *actual_queue; /**< @brief actual queue */
static struct queuelike ql_recent; /*< @brief Recently-played tracks */
static struct queuelike ql_added; /*< @brief Newly added tracks */
static struct queue_entry *actual_queue; /**< @brief actual queue */
-st
atic struct queue_entry *playing_track; /**< @brief current
y playing */
+st
ruct queue_entry *playing_track; /**< @brief currentl
y playing */
static time_t last_playing = (time_t)-1; /**< @brief when last got playing */
static int namepart_lookups_outstanding;
static int namepart_completions_deferred; /* # of completions not processed */
static time_t last_playing = (time_t)-1; /**< @brief when last got playing */
static int namepart_lookups_outstanding;
static int namepart_completions_deferred; /* # of completions not processed */
@@
-1083,6
+1083,8
@@
static void playing_completed(void attribute((unused)) *v,
* field is */
time(&last_playing);
queuelike_completed(&ql_queue, 0, actual_queue);
* field is */
time(&last_playing);
queuelike_completed(&ql_queue, 0, actual_queue);
+ /* Notify any interested parties */
+ event_raise("playing-track-changed", q);
}
}
}
}
@@
-1202,7
+1204,8
@@
static int scratch_sensitive(struct queuelike attribute((unused)) *ql,
/* We can scratch if the playing track is selected */
return (playing_track
&& (disorder_eclient_state(client) & DISORDER_CONNECTED)
/* We can scratch if the playing track is selected */
return (playing_track
&& (disorder_eclient_state(client) & DISORDER_CONNECTED)
- && selection_selected(ql->selection, playing_track->id));
+ && selection_selected(ql->selection, playing_track->id)
+ && right_scratchable(last_rights, config->username, playing_track));
}
/** @brief Called when disorder_eclient_scratch completes */
}
/** @brief Called when disorder_eclient_scratch completes */
@@
-1228,7
+1231,8
@@
static int remove_sensitive(struct queuelike *ql,
return ((disorder_eclient_state(client) & DISORDER_CONNECTED)
&& ((q
&& q != playing_track)
return ((disorder_eclient_state(client) & DISORDER_CONNECTED)
&& ((q
&& q != playing_track)
- || count_selected_nonplaying(ql)));
+ || count_selected_nonplaying(ql))
+ && right_removable(last_rights, config->username, q));
}
static void remove_completed(void attribute((unused)) *v,
}
static void remove_completed(void attribute((unused)) *v,
@@
-1260,7
+1264,8
@@
static int properties_sensitive(struct queuelike *ql,
struct queue_entry attribute((unused)) *q) {
/* "Properties" is sensitive if at least something is selected */
return (hash_count(ql->selection) > 0
struct queue_entry attribute((unused)) *q) {
/* "Properties" is sensitive if at least something is selected */
return (hash_count(ql->selection) > 0
- && (disorder_eclient_state(client) & DISORDER_CONNECTED));
+ && (disorder_eclient_state(client) & DISORDER_CONNECTED)
+ && (last_rights & RIGHT_PREFS));
}
/** @brief Pop up properties for the selected tracks */
}
/** @brief Pop up properties for the selected tracks */
@@
-1307,7
+1312,8
@@
static int play_sensitive(struct queuelike *ql,
struct queue_entry attribute((unused)) *q) {
/* "Play" is sensitive if at least something is selected */
return (hash_count(ql->selection) > 0
struct queue_entry attribute((unused)) *q) {
/* "Play" is sensitive if at least something is selected */
return (hash_count(ql->selection) > 0
- && (disorder_eclient_state(client) & DISORDER_CONNECTED));
+ && (disorder_eclient_state(client) & DISORDER_CONNECTED)
+ && (last_rights & RIGHT_PLAY));
}
/** @brief Play the selected tracks */
}
/** @brief Play the selected tracks */
@@
-1524,7
+1530,8
@@
static void added_changed(const char attribute((unused)) *event,
static int queue_properties_sensitive(GtkWidget *w) {
return (!!queue_count_selected(g_object_get_data(G_OBJECT(w), "queue"))
static int queue_properties_sensitive(GtkWidget *w) {
return (!!queue_count_selected(g_object_get_data(G_OBJECT(w), "queue"))
- && (disorder_eclient_state(client) & DISORDER_CONNECTED));
+ && (disorder_eclient_state(client) & DISORDER_CONNECTED)
+ && (last_rights & RIGHT_PREFS));
}
static int queue_selectall_sensitive(GtkWidget *w) {
}
static int queue_selectall_sensitive(GtkWidget *w) {
@@
-1556,6
+1563,7
@@
static const struct tabtype tabtype_queue = {
queue_properties_activate,
queue_selectall_activate,
queue_selectnone_activate,
queue_properties_activate,
queue_selectall_activate,
queue_selectnone_activate,
+ 0
};
/* Other entry points ------------------------------------------------------ */
};
/* Other entry points ------------------------------------------------------ */