diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2023-05-15 10:08:14 +0100 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2023-09-30 09:03:58 +0100 |
commit | 47459709740a6fa771ffc829a243dfe1fcff8708 (patch) | |
tree | eebd04d16336b7490e4bb2b286a95eb149543457 | |
parent | a6eaffe40d5e2b697686d56a648d98aca376284d (diff) | |
download | rockbox-47459709740a6fa771ffc829a243dfe1fcff8708.tar.gz rockbox-47459709740a6fa771ffc829a243dfe1fcff8708.zip |
playlist: Use PLAYLIST_QUEUED instead of PLAYLIST_QUEUE_MASK
We don't need two names for the same 1-bit field.
Change-Id: I71ed61198da8d6e4bf4d449d8704982918099f7d
-rw-r--r-- | apps/playlist.c | 15 |
1 files changed, 7 insertions, 8 deletions
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 @@ | |||
157 | */ | 157 | */ |
158 | #define PLAYLIST_SEEK_MASK 0x0FFFFFFF | 158 | #define PLAYLIST_SEEK_MASK 0x0FFFFFFF |
159 | #define PLAYLIST_INSERT_TYPE_MASK 0xC0000000 | 159 | #define PLAYLIST_INSERT_TYPE_MASK 0xC0000000 |
160 | #define PLAYLIST_QUEUE_MASK 0x20000000 | ||
161 | 160 | ||
162 | #define PLAYLIST_INSERT_TYPE_PREPEND 0x40000000 | 161 | #define PLAYLIST_INSERT_TYPE_PREPEND 0x40000000 |
163 | #define PLAYLIST_INSERT_TYPE_INSERT 0x80000000 | 162 | #define PLAYLIST_INSERT_TYPE_INSERT 0x80000000 |
@@ -718,7 +717,7 @@ static int recreate_control_unlocked(struct playlist_info* playlist) | |||
718 | { | 717 | { |
719 | if (playlist->indices[i] & PLAYLIST_INSERT_TYPE_MASK) | 718 | if (playlist->indices[i] & PLAYLIST_INSERT_TYPE_MASK) |
720 | { | 719 | { |
721 | bool queue = playlist->indices[i] & PLAYLIST_QUEUE_MASK; | 720 | bool queue = playlist->indices[i] & PLAYLIST_QUEUED; |
722 | char inserted_file[MAX_PATH+1]; | 721 | char inserted_file[MAX_PATH+1]; |
723 | 722 | ||
724 | lseek(temp_fd, playlist->indices[i] & PLAYLIST_SEEK_MASK, | 723 | 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, | |||
1746 | /* second time around so skip the queued files */ | 1745 | /* second time around so skip the queued files */ |
1747 | for (i=0; i<playlist->amount; i++) | 1746 | for (i=0; i<playlist->amount; i++) |
1748 | { | 1747 | { |
1749 | if (playlist->indices[index] & PLAYLIST_QUEUE_MASK) | 1748 | if (playlist->indices[index] & PLAYLIST_QUEUED) |
1750 | index = (index+1) % playlist->amount; | 1749 | index = (index+1) % playlist->amount; |
1751 | else | 1750 | else |
1752 | { | 1751 | { |
@@ -2393,7 +2392,7 @@ int playlist_get_track_info(struct playlist_info* playlist, int index, | |||
2393 | 2392 | ||
2394 | if (playlist->indices[index] & PLAYLIST_INSERT_TYPE_MASK) | 2393 | if (playlist->indices[index] & PLAYLIST_INSERT_TYPE_MASK) |
2395 | { | 2394 | { |
2396 | if (playlist->indices[index] & PLAYLIST_QUEUE_MASK) | 2395 | if (playlist->indices[index] & PLAYLIST_QUEUED) |
2397 | info->attr |= PLAYLIST_ATTR_QUEUED; | 2396 | info->attr |= PLAYLIST_ATTR_QUEUED; |
2398 | else | 2397 | else |
2399 | info->attr |= PLAYLIST_ATTR_INSERTED; | 2398 | info->attr |= PLAYLIST_ATTR_INSERTED; |
@@ -2729,7 +2728,7 @@ int playlist_move(struct playlist_info* playlist, int index, int new_index) | |||
2729 | } | 2728 | } |
2730 | } | 2729 | } |
2731 | 2730 | ||
2732 | queue = playlist->indices[index] & PLAYLIST_QUEUE_MASK; | 2731 | queue = playlist->indices[index] & PLAYLIST_QUEUED; |
2733 | 2732 | ||
2734 | if (get_track_filename(playlist, index, filename, sizeof(filename))) | 2733 | if (get_track_filename(playlist, index, filename, sizeof(filename))) |
2735 | goto out; | 2734 | goto out; |
@@ -2852,7 +2851,7 @@ int playlist_next(int steps) | |||
2852 | { | 2851 | { |
2853 | index = get_next_index(playlist, i, -1); | 2852 | index = get_next_index(playlist, i, -1); |
2854 | 2853 | ||
2855 | if (index >= 0 && playlist->indices[index] & PLAYLIST_QUEUE_MASK) | 2854 | if (index >= 0 && playlist->indices[index] & PLAYLIST_QUEUED) |
2856 | { | 2855 | { |
2857 | remove_track_unlocked(playlist, index, true); | 2856 | remove_track_unlocked(playlist, index, true); |
2858 | steps--; /* one less track */ | 2857 | steps--; /* one less track */ |
@@ -3573,7 +3572,7 @@ int playlist_save(struct playlist_info* playlist, char *filename, | |||
3573 | } | 3572 | } |
3574 | 3573 | ||
3575 | /* Don't save queued files */ | 3574 | /* Don't save queued files */ |
3576 | if (!(playlist->indices[index] & PLAYLIST_QUEUE_MASK)) | 3575 | if (!(playlist->indices[index] & PLAYLIST_QUEUED)) |
3577 | { | 3576 | { |
3578 | if (get_track_filename(playlist, index, tmp_buf, sizeof(tmp_buf))) | 3577 | if (get_track_filename(playlist, index, tmp_buf, sizeof(tmp_buf))) |
3579 | { | 3578 | { |
@@ -3635,7 +3634,7 @@ int playlist_save(struct playlist_info* playlist, char *filename, | |||
3635 | index = playlist->first_index; | 3634 | index = playlist->first_index; |
3636 | for (i=0, count=0; i<playlist->amount; i++) | 3635 | for (i=0, count=0; i<playlist->amount; i++) |
3637 | { | 3636 | { |
3638 | if (!(playlist->indices[index] & PLAYLIST_QUEUE_MASK)) | 3637 | if (!(playlist->indices[index] & PLAYLIST_QUEUED)) |
3639 | { | 3638 | { |
3640 | playlist->indices[index] = seek_buf[count]; | 3639 | playlist->indices[index] = seek_buf[count]; |
3641 | count++; | 3640 | count++; |