From 47459709740a6fa771ffc829a243dfe1fcff8708 Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Mon, 15 May 2023 10:08:14 +0100 Subject: playlist: Use PLAYLIST_QUEUED instead of PLAYLIST_QUEUE_MASK We don't need two names for the same 1-bit field. Change-Id: I71ed61198da8d6e4bf4d449d8704982918099f7d --- apps/playlist.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'apps') diff --git a/apps/playlist.c b/apps/playlist.c index d0aedb5ca1..67edc5fbe5 100644 --- a/apps/playlist.c +++ b/apps/playlist.c @@ -157,7 +157,6 @@ */ #define PLAYLIST_SEEK_MASK 0x0FFFFFFF #define PLAYLIST_INSERT_TYPE_MASK 0xC0000000 -#define PLAYLIST_QUEUE_MASK 0x20000000 #define PLAYLIST_INSERT_TYPE_PREPEND 0x40000000 #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) { - bool queue = playlist->indices[i] & PLAYLIST_QUEUE_MASK; + bool queue = playlist->indices[i] & PLAYLIST_QUEUED; char inserted_file[MAX_PATH+1]; 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 */ for (i=0; iamount; i++) { - if (playlist->indices[index] & PLAYLIST_QUEUE_MASK) + if (playlist->indices[index] & PLAYLIST_QUEUED) index = (index+1) % playlist->amount; 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_QUEUE_MASK) + if (playlist->indices[index] & PLAYLIST_QUEUED) info->attr |= PLAYLIST_ATTR_QUEUED; else 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))) goto out; @@ -2852,7 +2851,7 @@ int playlist_next(int steps) { 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); steps--; /* one less track */ @@ -3573,7 +3572,7 @@ int playlist_save(struct playlist_info* playlist, char *filename, } /* 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))) { @@ -3635,7 +3634,7 @@ int playlist_save(struct playlist_info* playlist, char *filename, index = playlist->first_index; for (i=0, count=0; iamount; i++) { - if (!(playlist->indices[index] & PLAYLIST_QUEUE_MASK)) + if (!(playlist->indices[index] & PLAYLIST_QUEUED)) { playlist->indices[index] = seek_buf[count]; count++; -- cgit v1.2.3