Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Redesign] Brand New Queuing System ✨ #484

Merged
merged 137 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
137 commits
Select commit Hold shift + click to select a range
ef77863
replaced AudioServiceHelper queue with QueueService for unshuffled al…
Chaphasilor May 18, 2023
4be2568
proper queue implementation
Chaphasilor May 18, 2023
c51955b
looping a single track working
Chaphasilor May 18, 2023
1936f8d
use new queue for `shuffleAll()`
Chaphasilor May 19, 2023
b22fb96
implemented 'loop all' for linear and shuffled mode
Chaphasilor May 19, 2023
1f0afd0
working looping (linear & shuffled)
Chaphasilor May 21, 2023
a8d52ea
'loop all' working when skipping backwards
Chaphasilor May 21, 2023
c80c778
simplify external queue updates
Chaphasilor May 21, 2023
b7eea9b
working shuffle toggle
Chaphasilor May 21, 2023
e1ec780
Merge branch 'redesign' into better-queue-rebase
Chaphasilor May 21, 2023
90b9d4d
stream queue to queue list
Chaphasilor May 21, 2023
272e28b
use new queue for instant mixes
Chaphasilor May 21, 2023
03f4f24
add sleep timer to player screen menu
Chaphasilor May 21, 2023
b7e8fdf
reimplement queue list bottom sheet with CustomScrollView
Chaphasilor May 22, 2023
731fb9e
working track selection in queue (skipByOffset)
Chaphasilor May 22, 2023
f30f94c
scroll to current track when opening queue panel
Chaphasilor May 24, 2023
81c4f14
bugfixes
Chaphasilor May 24, 2023
eddbc5e
small improvements
Chaphasilor May 24, 2023
43cb0e2
tried combining current track detection with proper skipping in queue
Chaphasilor May 24, 2023
6c8cdbb
update queue stream on auto advance
Chaphasilor May 25, 2023
36aa49d
still a mess but somewhat usable
Chaphasilor May 25, 2023
554cb43
just_audio-based shuffling with Next Up support almost working
Chaphasilor Jun 2, 2023
f4d2a82
fully working shuffle mode
Chaphasilor Jun 2, 2023
32aac37
disable fake Next Up queue
Chaphasilor Jun 2, 2023
02daccb
fix shuffle indices calculation
Chaphasilor Jun 2, 2023
15b495e
fix shuffle always starting on the first index
Chaphasilor Jun 2, 2023
84b0ac2
Merge branch 'redesign' into better-queue-just_audio
Chaphasilor Jun 2, 2023
0ebb4ae
fix playback always being shuffled, try to not always start shuffle o…
Chaphasilor Jun 2, 2023
fca95c7
fix skipByOffset() when shuffle is enabled
Chaphasilor Jun 2, 2023
d9bb469
implementing moving and removing queue items
Chaphasilor Jun 5, 2023
33df18a
improved queue list
Chaphasilor Jun 7, 2023
c10ac61
working next up logic
Chaphasilor Jun 9, 2023
1cf3c47
fix reorder if shuffle is active
Chaphasilor Jun 9, 2023
a2ad87b
fix reordering issues
Chaphasilor Jun 9, 2023
bc1b75b
fix adding to Next Up when shuffle is enabled
Chaphasilor Jun 9, 2023
4248aae
small fixes
Chaphasilor Jun 9, 2023
e8a017a
Merge branch 'better-queue-just_audio' into better-queue
Chaphasilor Jun 10, 2023
b59b21d
added playback history (service)
Chaphasilor Jun 10, 2023
f93b234
re-add missing packages
Chaphasilor Jun 10, 2023
7774d66
improve next up + shuffle behavior
Chaphasilor Jun 10, 2023
0154021
adding tracks to Next Up or queue fully working now
Chaphasilor Jun 11, 2023
cc4a44b
initial try at another custom implementation
Chaphasilor Jul 23, 2023
12e4c77
theoretically working implementation using `flutter_reorderable_list`
Chaphasilor Jul 23, 2023
92ed02d
update internal list during reorder instead of going through QueueSer…
Chaphasilor Jul 24, 2023
91ebd37
attempted to separate queue list into separate widgets with independe…
Chaphasilor Jul 24, 2023
2e02350
use visibility instead of opacity
Chaphasilor Jul 30, 2023
d36eb6a
huge queue redesign progress
Chaphasilor Jul 30, 2023
0befb2c
fix widgets in queue list not updating
Chaphasilor Jul 31, 2023
7c33dd3
Merge branch 'better-queue-rewrite-isolated-lists' into better-queue-…
Chaphasilor Jul 31, 2023
7903cff
remove unneeded dependency
Chaphasilor Jul 31, 2023
f3350ca
disable queue drag handles when shuffle is active
Chaphasilor Aug 10, 2023
53d862f
improve scroll behavior
Chaphasilor Aug 10, 2023
84946ee
allow dismissing bottom sheet by scrolling up
Chaphasilor Aug 10, 2023
867d57d
properly update previous tracks on track change
Chaphasilor Aug 10, 2023
b63a0fa
Merge branch 'better-queue-rewrite' into better-queue
Chaphasilor Aug 10, 2023
a5ba1d0
some fixes
Chaphasilor Aug 10, 2023
001cb95
design, scroll and reactivity improvements
Chaphasilor Aug 11, 2023
2f90d20
added song menus when tapping three dots icon
Chaphasilor Aug 11, 2023
44ec707
minor improvements
Chaphasilor Aug 11, 2023
e42f300
don't use lazyPreparation to (hopefully) support pre-loading
Chaphasilor Aug 11, 2023
233739c
enable favorite icon in current track widget
Chaphasilor Aug 11, 2023
36610e9
make recent tracks toggleable
Chaphasilor Aug 16, 2023
0947a14
fix shuffle always starting on first index
Chaphasilor Aug 16, 2023
9d244e6
support starting album/playlist from specific index
Chaphasilor Aug 16, 2023
fa31e35
fix setting album and playlist name as queue source
Chaphasilor Aug 16, 2023
4e9e566
use long press & swipe instead of menu and remove buttons
Chaphasilor Aug 22, 2023
835e6f3
round top corners of bottom sheet
Chaphasilor Aug 22, 2023
77b4827
fix dismissing and wrong index offsets
Chaphasilor Aug 22, 2023
1e08f1b
navigate to queue source when tapping source string
Chaphasilor Sep 17, 2023
821606e
ability to play albums/playlists next / add to next up
Chaphasilor Sep 18, 2023
5b52754
shuffle next / to next up
Chaphasilor Sep 18, 2023
cc6a055
dynamic colors, design and layout improvements
Chaphasilor Sep 18, 2023
6b72110
try to fix build errors
Chaphasilor Sep 20, 2023
e791df6
Merge branch 'redesign' into better-queue
Chaphasilor Sep 20, 2023
04773fb
improved playback history screen
Chaphasilor Sep 20, 2023
6ef5f00
improved BaseItemDto favorite state handling
Chaphasilor Sep 21, 2023
3efde88
added localized strings
Chaphasilor Sep 21, 2023
c047239
design and interaction improvements
Chaphasilor Sep 22, 2023
e9b4c6b
added haptic feedback to QueueList
Chaphasilor Sep 22, 2023
9db72f5
smaller design tweaks to tie in the color theme
Chaphasilor Sep 22, 2023
0f39cf9
fix dismissing tracks from queue, adjust progress slider color
Chaphasilor Sep 24, 2023
cfe5432
add button for clearing next up
Chaphasilor Sep 24, 2023
4a5693c
fixes & improvements ™
Chaphasilor Sep 24, 2023
2ef5510
formatting
Chaphasilor Sep 25, 2023
c65d04d
small design tweaks
Chaphasilor Sep 25, 2023
ce5eee2
started to improve playback reporting
Chaphasilor Sep 26, 2023
8378c89
fix rewind instead of skip back position < 5s
Chaphasilor Sep 28, 2023
78c61a3
design/layout fixes
Chaphasilor Sep 28, 2023
dd7012d
fix playback reporting when manually skipping
Chaphasilor Sep 28, 2023
36df835
update dependencies
Chaphasilor Sep 28, 2023
860d8b1
fix (temporary) button layout on album screen
Chaphasilor Sep 28, 2023
6421ecb
replace non-functional stop button with like button
Chaphasilor Sep 28, 2023
635f949
improve playback history page
Chaphasilor Sep 28, 2023
5e85c25
re-enable chopper logs
Chaphasilor Sep 28, 2023
6446695
clean up, less verbose logging
Chaphasilor Sep 28, 2023
2b711ab
increase buffer duration to compensate for spotty connections
Chaphasilor Sep 28, 2023
e32b9a8
remove dead code
Chaphasilor Sep 29, 2023
c9f1902
use animated theme, refactor recent tracks toggle
Chaphasilor Sep 30, 2023
1c596ad
fix instant mixes, small queue service API changes
Chaphasilor Oct 2, 2023
678b4ad
small adjustments
Chaphasilor Oct 2, 2023
9fdbb52
made queue list current track progress slider responsive
Chaphasilor Oct 3, 2023
a240509
fix next up source change
Chaphasilor Oct 3, 2023
c436ae2
fix loop one skip behavior
Chaphasilor Oct 3, 2023
61683c6
persist FinampLoopMode across restarts
Chaphasilor Oct 3, 2023
0c3aa16
add new queue sources & some fixes
Chaphasilor Oct 12, 2023
db953ee
reword "recently played" to "previous tracks"
Chaphasilor Oct 12, 2023
4124b65
fix text thickness of "playing from" label
Chaphasilor Oct 12, 2023
148a69a
hopefully work around Impeller issues with SliderThemes
Chaphasilor Oct 12, 2023
4f59674
add looping tracks to local playback history
Chaphasilor Oct 15, 2023
19b8ee8
increase `maxBufferDuration` to reduce request frequency
Chaphasilor Oct 15, 2023
c811900
add track to playback history when rewinding
Chaphasilor Oct 15, 2023
60907b4
Navigate to source when clicking "Playing from"
Chaphasilor Oct 15, 2023
ab41bab
add buttons for adding albums/playlists to queue
Chaphasilor Oct 20, 2023
32dba48
add scrollbar to queue panel
Chaphasilor Oct 21, 2023
5710e28
don't shuffle twice
Chaphasilor Oct 21, 2023
3386a4e
Merge remote-tracking branch 'origin/redesign' into better-queue
Chaphasilor Oct 24, 2023
c39c416
fix shuffle indices being wrong until updating queue
Chaphasilor Oct 24, 2023
7cb1aba
improved way of fixing shuffle always starting on first track
Chaphasilor Oct 24, 2023
0fc9e9b
fix light mode contrast calculation
Chaphasilor Oct 25, 2023
8116198
light mode color adjustments
Chaphasilor Oct 25, 2023
7034e6c
move accent color generation to now playing bar
Chaphasilor Oct 25, 2023
9fb3be4
refactor now_playing_bar.dart, fix errors when changing theme
Chaphasilor Oct 29, 2023
0ba857c
updated now playing bar design
Chaphasilor Oct 29, 2023
00e47ae
added favorite button to playback history items
Chaphasilor Nov 17, 2023
a2b6c63
show artist chips for all track artists
Chaphasilor Nov 17, 2023
6450daf
improve text wrapping and reduce layout shifts on player screen
Chaphasilor Nov 17, 2023
dd7e8cf
prevent overflow for long/many artists
Chaphasilor Nov 18, 2023
d95f041
fix artist overflow in queue list
Chaphasilor Nov 18, 2023
7ee2b97
fix overflow in player screen appbar title (source info)
Chaphasilor Nov 18, 2023
cb91d6f
group recent playbacks by minute in history
Chaphasilor Nov 18, 2023
c063cb9
fix metastable first item when starting playback for the first time
Chaphasilor Nov 18, 2023
81f2e53
fix layout issues
Chaphasilor Nov 18, 2023
fdeb781
light theme contrast fixes
Chaphasilor Nov 19, 2023
258f183
format changed files
Chaphasilor Nov 19, 2023
c99817b
fix overflow on now playing bar
Chaphasilor Nov 19, 2023
ba78f92
go back to metastable to get initial index to work
Chaphasilor Nov 19, 2023
ce6ed6b
fix shuffled queue not being played in order
Chaphasilor Nov 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.VIBRATE"/>
</manifest>
1 change: 1 addition & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
Expand Down
1 change: 1 addition & 0 deletions android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.VIBRATE"/>
</manifest>
26 changes: 13 additions & 13 deletions lib/at_contrast.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,33 +24,33 @@ extension AtContrast on Color {

double minLightness = 0.0;
double maxLightness = 1.0;
double diff = contrast - targetContrast;
double diff = contrast.abs() - targetContrast.abs();
int steps = 0;
int maxSteps = 25;

while (diff.abs() > _tolerance) {
// If diff is negative, we need more contrast.
while (diff < -_tolerance && steps < maxSteps) {
steps++;
print("$steps $diff");
// If diff is negative, we need more contrast. Otherwise, we need less
print("contrast: $steps $diff");
if (diff.isNegative) {
minLightness = hslColor.lightness;
if (lighter) {
minLightness = hslColor.lightness;
} else {
maxLightness = hslColor.lightness;
}

final lightDiff = maxLightness - hslColor.lightness;
final lightDiff =
lighter ? maxLightness - minLightness : minLightness - maxLightness;

hslColor = hslColor.withLightness(hslColor.lightness + lightDiff / 2);
} else {
maxLightness = hslColor.lightness;

final lightDiff = hslColor.lightness - minLightness;

hslColor = hslColor.withLightness(hslColor.lightness - lightDiff / 2);
}

contrast = contrastRatio(
hslColor.toColor().computeLuminance(),
backgroundLuminance,
);

diff = (contrast - targetContrast);
diff = (contrast.abs() - targetContrast.abs());
}

_atContrastLogger.info("Calculated contrast in $steps steps");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class _AddToPlaylistListState extends State<AddToPlaylistList> {
return AlbumItem(
album: snapshot.data![index],
parentType: snapshot.data![index].type,
isPlaylist: true,
onTap: () async {
try {
await jellyfinApiHelper.addItemstoPlaylist(
Expand Down
8 changes: 5 additions & 3 deletions lib/components/AlbumScreen/album_screen_content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,15 @@ class _AlbumScreenContentState extends State<AlbumScreenContent> {
SliverAppBar(
title: Text(widget.parent.name ??
AppLocalizations.of(context)!.unknownName),
// 125 + 64 is the total height of the widget we use as a
// 125 + 186 is the total height of the widget we use as a
// FlexibleSpaceBar. We add the toolbar height since the widget
// should appear below the appbar.
// TODO: This height is affected by platform density.
expandedHeight: kToolbarHeight + 125 + 64,
expandedHeight: kToolbarHeight + 125 + 186,
pinned: true,
flexibleSpace: AlbumScreenContentFlexibleSpaceBar(
album: widget.parent,
parentItem: widget.parent,
isPlaylist: widget.parent.type == "Playlist",
items: widget.children,
),
actions: [
Expand Down Expand Up @@ -172,6 +173,7 @@ class _SongsSliverListState extends State<SongsSliverList> {
children: widget.childrenForQueue,
index: index + indexOffset,
parentId: widget.parent.id,
parentName: widget.parent.name,
onDelete: () {
final item = removeItem();
if (widget.onDelete != null) {
Expand Down
Loading
Loading