1
0
Fork 0
forked from len0rd/rockbox

playlist: Use PLAYLIST_QUEUED instead of PLAYLIST_QUEUE_MASK

We don't need two names for the same 1-bit field.

Change-Id: I71ed61198da8d6e4bf4d449d8704982918099f7d
This commit is contained in:
Aidan MacDonald 2023-05-15 10:08:14 +01:00
parent a6eaffe40d
commit 4745970974

View file

@ -157,7 +157,6 @@
*/ */
#define PLAYLIST_SEEK_MASK 0x0FFFFFFF #define PLAYLIST_SEEK_MASK 0x0FFFFFFF
#define PLAYLIST_INSERT_TYPE_MASK 0xC0000000 #define PLAYLIST_INSERT_TYPE_MASK 0xC0000000
#define PLAYLIST_QUEUE_MASK 0x20000000
#define PLAYLIST_INSERT_TYPE_PREPEND 0x40000000 #define PLAYLIST_INSERT_TYPE_PREPEND 0x40000000
#define PLAYLIST_INSERT_TYPE_INSERT 0x80000000 #define PLAYLIST_INSERT_TYPE_INSERT 0x80000000
@ -718,7 +717,7 @@ static int recreate_control_unlocked(struct playlist_info* playlist)
{ {
if (playlist->indices[i] & PLAYLIST_INSERT_TYPE_MASK) if (playlist->indices[i] & PLAYLIST_INSERT_TYPE_MASK)
{ {
bool queue = playlist->indices[i] & PLAYLIST_QUEUE_MASK; bool queue = playlist->indices[i] & PLAYLIST_QUEUED;
char inserted_file[MAX_PATH+1]; char inserted_file[MAX_PATH+1];
lseek(temp_fd, playlist->indices[i] & PLAYLIST_SEEK_MASK, lseek(temp_fd, playlist->indices[i] & PLAYLIST_SEEK_MASK,
@ -1746,7 +1745,7 @@ static int get_next_index(const struct playlist_info* playlist, int steps,
/* second time around so skip the queued files */ /* second time around so skip the queued files */
for (i=0; i<playlist->amount; i++) for (i=0; i<playlist->amount; i++)
{ {
if (playlist->indices[index] & PLAYLIST_QUEUE_MASK) if (playlist->indices[index] & PLAYLIST_QUEUED)
index = (index+1) % playlist->amount; index = (index+1) % playlist->amount;
else else
{ {
@ -2393,7 +2392,7 @@ int playlist_get_track_info(struct playlist_info* playlist, int index,
if (playlist->indices[index] & PLAYLIST_INSERT_TYPE_MASK) if (playlist->indices[index] & PLAYLIST_INSERT_TYPE_MASK)
{ {
if (playlist->indices[index] & PLAYLIST_QUEUE_MASK) if (playlist->indices[index] & PLAYLIST_QUEUED)
info->attr |= PLAYLIST_ATTR_QUEUED; info->attr |= PLAYLIST_ATTR_QUEUED;
else else
info->attr |= PLAYLIST_ATTR_INSERTED; info->attr |= PLAYLIST_ATTR_INSERTED;
@ -2729,7 +2728,7 @@ int playlist_move(struct playlist_info* playlist, int index, int new_index)
} }
} }
queue = playlist->indices[index] & PLAYLIST_QUEUE_MASK; queue = playlist->indices[index] & PLAYLIST_QUEUED;
if (get_track_filename(playlist, index, filename, sizeof(filename))) if (get_track_filename(playlist, index, filename, sizeof(filename)))
goto out; goto out;
@ -2852,7 +2851,7 @@ int playlist_next(int steps)
{ {
index = get_next_index(playlist, i, -1); index = get_next_index(playlist, i, -1);
if (index >= 0 && playlist->indices[index] & PLAYLIST_QUEUE_MASK) if (index >= 0 && playlist->indices[index] & PLAYLIST_QUEUED)
{ {
remove_track_unlocked(playlist, index, true); remove_track_unlocked(playlist, index, true);
steps--; /* one less track */ steps--; /* one less track */
@ -3573,7 +3572,7 @@ int playlist_save(struct playlist_info* playlist, char *filename,
} }
/* Don't save queued files */ /* Don't save queued files */
if (!(playlist->indices[index] & PLAYLIST_QUEUE_MASK)) if (!(playlist->indices[index] & PLAYLIST_QUEUED))
{ {
if (get_track_filename(playlist, index, tmp_buf, sizeof(tmp_buf))) if (get_track_filename(playlist, index, tmp_buf, sizeof(tmp_buf)))
{ {
@ -3635,7 +3634,7 @@ int playlist_save(struct playlist_info* playlist, char *filename,
index = playlist->first_index; index = playlist->first_index;
for (i=0, count=0; i<playlist->amount; i++) for (i=0, count=0; i<playlist->amount; i++)
{ {
if (!(playlist->indices[index] & PLAYLIST_QUEUE_MASK)) if (!(playlist->indices[index] & PLAYLIST_QUEUED))
{ {
playlist->indices[index] = seek_buf[count]; playlist->indices[index] = seek_buf[count];
count++; count++;