diff --git a/lib/native/api/player.dart b/lib/native/api/player.dart index dea8fee5..685a7042 100644 --- a/lib/native/api/player.dart +++ b/lib/native/api/player.dart @@ -10,9 +10,18 @@ import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; // Rust type: RustOpaqueMoi> abstract class AnnixPlayer implements RustOpaqueInterface { + Future addProvider( + {required String url, required String auth, required int priority}); + + Future clearProvider(); + bool isPlaying(); - factory AnnixPlayer() => RustLib.instance.api.crateApiPlayerAnnixPlayerNew(); + factory AnnixPlayer({required String cachePath}) => + RustLib.instance.api.crateApiPlayerAnnixPlayerNew(cachePath: cachePath); + + Future open( + {required String identifier, required AudioQuality quality}); Future openFile({required String path}); @@ -26,11 +35,22 @@ abstract class AnnixPlayer implements RustOpaqueInterface { Future seek({required int position}); + Future setTrack( + {required String identifier, required AudioQuality quality}); + Future setVolume({required double volume}); Future stop(); } +enum AudioQuality { + low, + medium, + high, + lossless, + ; +} + enum PlayerStateEvent { /// Started playing play, diff --git a/lib/native/frb_generated.dart b/lib/native/frb_generated.dart index d6ed1a6b..9bebcddf 100644 --- a/lib/native/frb_generated.dart +++ b/lib/native/frb_generated.dart @@ -59,7 +59,7 @@ class RustLib extends BaseEntrypoint { String get codegenVersion => '2.1.0'; @override - int get rustContentHash => -2003164833; + int get rustContentHash => -1883214556; static const kDefaultExternalLibraryLoaderConfig = ExternalLibraryLoaderConfig( @@ -75,9 +75,23 @@ abstract class RustLibApi extends BaseApi { Future crateApiNetworkUpdateNetworkStatus({required bool isOnline}); + Future crateApiPlayerAnnixPlayerAddProvider( + {required AnnixPlayer that, + required String url, + required String auth, + required int priority}); + + Future crateApiPlayerAnnixPlayerClearProvider( + {required AnnixPlayer that}); + bool crateApiPlayerAnnixPlayerIsPlaying({required AnnixPlayer that}); - AnnixPlayer crateApiPlayerAnnixPlayerNew(); + AnnixPlayer crateApiPlayerAnnixPlayerNew({required String cachePath}); + + Future crateApiPlayerAnnixPlayerOpen( + {required AnnixPlayer that, + required String identifier, + required AudioQuality quality}); Future crateApiPlayerAnnixPlayerOpenFile( {required AnnixPlayer that, required String path}); @@ -95,6 +109,11 @@ abstract class RustLibApi extends BaseApi { Future crateApiPlayerAnnixPlayerSeek( {required AnnixPlayer that, required int position}); + Future crateApiPlayerAnnixPlayerSetTrack( + {required AnnixPlayer that, + required String identifier, + required AudioQuality quality}); + Future crateApiPlayerAnnixPlayerSetVolume( {required AnnixPlayer that, required double volume}); @@ -231,6 +250,66 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { argNames: ["isOnline"], ); + @override + Future crateApiPlayerAnnixPlayerAddProvider( + {required AnnixPlayer that, + required String url, + required String auth, + required int priority}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerAnnixPlayer( + that, serializer); + sse_encode_String(url, serializer); + sse_encode_String(auth, serializer); + sse_encode_i_32(priority, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 3, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: null, + ), + constMeta: kCrateApiPlayerAnnixPlayerAddProviderConstMeta, + argValues: [that, url, auth, priority], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiPlayerAnnixPlayerAddProviderConstMeta => + const TaskConstMeta( + debugName: "AnnixPlayer_add_provider", + argNames: ["that", "url", "auth", "priority"], + ); + + @override + Future crateApiPlayerAnnixPlayerClearProvider( + {required AnnixPlayer that}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerAnnixPlayer( + that, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 4, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: null, + ), + constMeta: kCrateApiPlayerAnnixPlayerClearProviderConstMeta, + argValues: [that], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiPlayerAnnixPlayerClearProviderConstMeta => + const TaskConstMeta( + debugName: "AnnixPlayer_clear_provider", + argNames: ["that"], + ); + @override bool crateApiPlayerAnnixPlayerIsPlaying({required AnnixPlayer that}) { return handler.executeSync(SyncTask( @@ -238,7 +317,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { final serializer = SseSerializer(generalizedFrbRustBinding); sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerAnnixPlayer( that, serializer); - return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 3)!; + return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 5)!; }, codec: SseCodec( decodeSuccessData: sse_decode_bool, @@ -257,11 +336,12 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - AnnixPlayer crateApiPlayerAnnixPlayerNew() { + AnnixPlayer crateApiPlayerAnnixPlayerNew({required String cachePath}) { return handler.executeSync(SyncTask( callFfi: () { final serializer = SseSerializer(generalizedFrbRustBinding); - return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 4)!; + sse_encode_String(cachePath, serializer); + return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 6)!; }, codec: SseCodec( decodeSuccessData: @@ -269,7 +349,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { decodeErrorData: null, ), constMeta: kCrateApiPlayerAnnixPlayerNewConstMeta, - argValues: [], + argValues: [cachePath], apiImpl: this, )); } @@ -277,7 +357,38 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { TaskConstMeta get kCrateApiPlayerAnnixPlayerNewConstMeta => const TaskConstMeta( debugName: "AnnixPlayer_new", - argNames: [], + argNames: ["cachePath"], + ); + + @override + Future crateApiPlayerAnnixPlayerOpen( + {required AnnixPlayer that, + required String identifier, + required AudioQuality quality}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerAnnixPlayer( + that, serializer); + sse_encode_String(identifier, serializer); + sse_encode_audio_quality(quality, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 7, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: sse_decode_AnyhowException, + ), + constMeta: kCrateApiPlayerAnnixPlayerOpenConstMeta, + argValues: [that, identifier, quality], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiPlayerAnnixPlayerOpenConstMeta => + const TaskConstMeta( + debugName: "AnnixPlayer_open", + argNames: ["that", "identifier", "quality"], ); @override @@ -290,7 +401,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { that, serializer); sse_encode_String(path, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 5, port: port_); + funcId: 8, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_unit, @@ -316,7 +427,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerAnnixPlayer( that, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 6, port: port_); + funcId: 9, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_unit, @@ -342,7 +453,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerAnnixPlayer( that, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 7, port: port_); + funcId: 10, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_unit, @@ -371,7 +482,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { that, serializer); sse_encode_StreamSink_player_state_event_Sse(stream, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 8, port: port_); + funcId: 11, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_unit, @@ -401,7 +512,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { that, serializer); sse_encode_StreamSink_progress_state_Sse(stream, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 9, port: port_); + funcId: 12, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_unit, @@ -430,7 +541,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { that, serializer); sse_encode_u_32(position, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 10, port: port_); + funcId: 13, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_unit, @@ -448,6 +559,37 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { argNames: ["that", "position"], ); + @override + Future crateApiPlayerAnnixPlayerSetTrack( + {required AnnixPlayer that, + required String identifier, + required AudioQuality quality}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerAnnixPlayer( + that, serializer); + sse_encode_String(identifier, serializer); + sse_encode_audio_quality(quality, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 14, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: sse_decode_AnyhowException, + ), + constMeta: kCrateApiPlayerAnnixPlayerSetTrackConstMeta, + argValues: [that, identifier, quality], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateApiPlayerAnnixPlayerSetTrackConstMeta => + const TaskConstMeta( + debugName: "AnnixPlayer_set_track", + argNames: ["that", "identifier", "quality"], + ); + @override Future crateApiPlayerAnnixPlayerSetVolume( {required AnnixPlayer that, required double volume}) { @@ -458,7 +600,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { that, serializer); sse_encode_f_32(volume, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 11, port: port_); + funcId: 15, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_unit, @@ -484,7 +626,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerAnnixPlayer( that, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 12, port: port_); + funcId: 16, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_unit, @@ -508,7 +650,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { callFfi: () { final serializer = SseSerializer(generalizedFrbRustBinding); sse_encode_String(path, serializer); - return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 13)!; + return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 17)!; }, codec: SseCodec( decodeSuccessData: sse_decode_u_32, @@ -535,7 +677,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_box_autoadd_local_db(that, serializer); sse_encode_Uuid(albumId, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 14, port: port_); + funcId: 18, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_opt_String, @@ -563,7 +705,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_String(tag, serializer); sse_encode_bool(recursive, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 15, port: port_); + funcId: 19, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_list_Uuid, @@ -588,7 +730,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { final serializer = SseSerializer(generalizedFrbRustBinding); sse_encode_box_autoadd_local_db(that, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 16, port: port_); + funcId: 20, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_list_tag_item, @@ -613,7 +755,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { final serializer = SseSerializer(generalizedFrbRustBinding); sse_encode_String(path, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 17, port: port_); + funcId: 21, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_local_db, @@ -639,7 +781,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_box_autoadd_local_store(that, serializer); sse_encode_opt_String(category, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 18, port: port_); + funcId: 22, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_unit, @@ -669,7 +811,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_String(category, serializer); sse_encode_String(key, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 19, port: port_); + funcId: 23, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_opt_String, @@ -701,7 +843,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_String(key, serializer); sse_encode_String(value, serializer); pdeCallFfi(generalizedFrbRustBinding, serializer, - funcId: 20, port: port_); + funcId: 24, port: port_); }, codec: SseCodec( decodeSuccessData: sse_decode_unit, @@ -725,7 +867,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { callFfi: () { final serializer = SseSerializer(generalizedFrbRustBinding); sse_encode_String(root, serializer); - return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 21)!; + return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 25)!; }, codec: SseCodec( decodeSuccessData: sse_decode_local_store, @@ -751,7 +893,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { final serializer = SseSerializer(generalizedFrbRustBinding); sse_encode_box_autoadd_native_preference_store(that, serializer); sse_encode_String(key, serializer); - return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 22)!; + return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 26)!; }, codec: SseCodec( decodeSuccessData: sse_decode_opt_String, @@ -776,7 +918,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { callFfi: () { final serializer = SseSerializer(generalizedFrbRustBinding); sse_encode_String(root, serializer); - return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 23)!; + return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 27)!; }, codec: SseCodec( decodeSuccessData: sse_decode_native_preference_store, @@ -802,7 +944,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { final serializer = SseSerializer(generalizedFrbRustBinding); sse_encode_box_autoadd_native_preference_store(that, serializer); sse_encode_String(key, serializer); - return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 24)!; + return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 28)!; }, codec: SseCodec( decodeSuccessData: sse_decode_unit, @@ -828,7 +970,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { final serializer = SseSerializer(generalizedFrbRustBinding); sse_encode_box_autoadd_native_preference_store(that, serializer); sse_encode_String(prefix, serializer); - return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 25)!; + return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 29)!; }, codec: SseCodec( decodeSuccessData: sse_decode_unit, @@ -857,7 +999,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_box_autoadd_native_preference_store(that, serializer); sse_encode_String(key, serializer); sse_encode_String(value, serializer); - return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 26)!; + return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 30)!; }, codec: SseCodec( decodeSuccessData: sse_decode_unit, @@ -968,6 +1110,12 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { return UuidValue.fromByteList(dco_decode_list_prim_u_8_strict(raw)); } + @protected + AudioQuality dco_decode_audio_quality(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return AudioQuality.values[raw as int]; + } + @protected bool dco_decode_bool(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -1213,6 +1361,13 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { return UuidValue.fromByteList(inner); } + @protected + AudioQuality sse_decode_audio_quality(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var inner = sse_decode_i_32(deserializer); + return AudioQuality.values[inner]; + } + @protected bool sse_decode_bool(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -1470,6 +1625,12 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_list_prim_u_8_strict(self.toBytes(), serializer); } + @protected + void sse_encode_audio_quality(AudioQuality self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_i_32(self.index, serializer); + } + @protected void sse_encode_bool(bool self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -1642,10 +1803,25 @@ class AnnixPlayerImpl extends RustOpaque implements AnnixPlayer { RustLib.instance.api.rust_arc_decrement_strong_count_AnnixPlayerPtr, ); + Future addProvider( + {required String url, required String auth, required int priority}) => + RustLib.instance.api.crateApiPlayerAnnixPlayerAddProvider( + that: this, url: url, auth: auth, priority: priority); + + Future clearProvider() => + RustLib.instance.api.crateApiPlayerAnnixPlayerClearProvider( + that: this, + ); + bool isPlaying() => RustLib.instance.api.crateApiPlayerAnnixPlayerIsPlaying( that: this, ); + Future open( + {required String identifier, required AudioQuality quality}) => + RustLib.instance.api.crateApiPlayerAnnixPlayerOpen( + that: this, identifier: identifier, quality: quality); + Future openFile({required String path}) => RustLib.instance.api .crateApiPlayerAnnixPlayerOpenFile(that: this, path: path); @@ -1670,6 +1846,11 @@ class AnnixPlayerImpl extends RustOpaque implements AnnixPlayer { Future seek({required int position}) => RustLib.instance.api .crateApiPlayerAnnixPlayerSeek(that: this, position: position); + Future setTrack( + {required String identifier, required AudioQuality quality}) => + RustLib.instance.api.crateApiPlayerAnnixPlayerSetTrack( + that: this, identifier: identifier, quality: quality); + Future setVolume({required double volume}) => RustLib.instance.api .crateApiPlayerAnnixPlayerSetVolume(that: this, volume: volume); diff --git a/lib/native/frb_generated.io.dart b/lib/native/frb_generated.io.dart index 07152b9b..544e1567 100644 --- a/lib/native/frb_generated.io.dart +++ b/lib/native/frb_generated.io.dart @@ -72,6 +72,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected UuidValue dco_decode_Uuid(dynamic raw); + @protected + AudioQuality dco_decode_audio_quality(dynamic raw); + @protected bool dco_decode_bool(dynamic raw); @@ -179,6 +182,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected UuidValue sse_decode_Uuid(SseDeserializer deserializer); + @protected + AudioQuality sse_decode_audio_quality(SseDeserializer deserializer); + @protected bool sse_decode_bool(SseDeserializer deserializer); @@ -288,6 +294,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected void sse_encode_Uuid(UuidValue self, SseSerializer serializer); + @protected + void sse_encode_audio_quality(AudioQuality self, SseSerializer serializer); + @protected void sse_encode_bool(bool self, SseSerializer serializer); diff --git a/lib/native/frb_generated.web.dart b/lib/native/frb_generated.web.dart index 2e8fc1a4..efbb22d7 100644 --- a/lib/native/frb_generated.web.dart +++ b/lib/native/frb_generated.web.dart @@ -74,6 +74,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected UuidValue dco_decode_Uuid(dynamic raw); + @protected + AudioQuality dco_decode_audio_quality(dynamic raw); + @protected bool dco_decode_bool(dynamic raw); @@ -181,6 +184,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected UuidValue sse_decode_Uuid(SseDeserializer deserializer); + @protected + AudioQuality sse_decode_audio_quality(SseDeserializer deserializer); + @protected bool sse_decode_bool(SseDeserializer deserializer); @@ -290,6 +296,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected void sse_encode_Uuid(UuidValue self, SseSerializer serializer); + @protected + void sse_encode_audio_quality(AudioQuality self, SseSerializer serializer); + @protected void sse_encode_bool(bool self, SseSerializer serializer); diff --git a/lib/services/playback/playback_service.dart b/lib/services/playback/playback_service.dart index 7de52017..5c279a1d 100644 --- a/lib/services/playback/playback_service.dart +++ b/lib/services/playback/playback_service.dart @@ -7,6 +7,7 @@ import 'package:annix/services/annil/annil.dart'; import 'package:annix/services/anniv/anniv.dart'; import 'package:annix/services/anniv/anniv_model.dart'; import 'package:annix/services/metadata/metadata_model.dart'; +import 'package:annix/services/path.dart'; import 'package:annix/services/playback/playback.dart'; import 'package:annix/native/api/player.dart'; import 'package:annix/ui/widgets/utils/property_value_notifier.dart'; @@ -40,8 +41,21 @@ void playFullList({ ); } +AudioQuality fromQuality(PreferQuality q) { + switch (q) { + case PreferQuality.low: + return AudioQuality.low; + case PreferQuality.medium: + return AudioQuality.medium; + case PreferQuality.high: + return AudioQuality.high; + case PreferQuality.lossless: + return AudioQuality.lossless; + } +} + class PlaybackService extends ChangeNotifier { - static final AnnixPlayer player = AnnixPlayer(); + static final AnnixPlayer player = AnnixPlayer(cachePath: audioCachePath()); // TODO: cache this map static final PropertyValueNotifier> durationMap = @@ -128,6 +142,16 @@ class PlaybackService extends ChangeNotifier { WidgetsBinding.instance.addPostFrameCallback((final _) => play(reload: true, setSourceOnly: true, trackPlayback: false)); + + final db = ref.read(localDatabaseProvider); + final annilServersStream = db.sortedAnnilServers().watch(); + annilServersStream.listen((servers) { + PlaybackService.player.clearProvider(); + for (final server in servers) { + PlaybackService.player.addProvider( + url: server.url, auth: server.token, priority: server.priority); + } + }); } Future play({ @@ -166,7 +190,6 @@ class PlaybackService extends ChangeNotifier { await stop(); return; } - final currentIndex = playingIndex!; // stop previous playback FLog.trace(text: 'Start playing'); @@ -184,46 +207,20 @@ class PlaybackService extends ChangeNotifier { } } - final toPlayId = source.id; - if (!source.preloaded) { - // current track is not preloaded, buffering - playerStatus = PlayerStatus.buffering; - notifyListeners(); - } - - // preload the next track - if (queue.length > currentIndex + 1) { - queue[currentIndex + 1].preload(ref); - } - - try { - source.preload(ref); - // wait for audio file to download and play it - await source.setOnPlayer(PlaybackService.player); - if (setSourceOnly) { - loadedAndPaused = true; - } else { - await PlaybackService.player.play(); - } - } catch (e) { - if (e is AudioCancelledError) { - return; - } + final settings = ref.read(settingsProvider); + await PlaybackService.player.setTrack( + identifier: source.identifier.toString(), + quality: fromQuality(settings.defaultAudioQuality.value)); - // TODO: tell user why paused - FLog.error(text: 'Failed to play', exception: e); - await pause(); + if (setSourceOnly) { + loadedAndPaused = true; + playerStatus = PlayerStatus.paused; + } else { + await PlaybackService.player.play(); + playerStatus = PlayerStatus.playing; } - // when playback starts, set state to playing - if (playing.id == toPlayId && playerStatus == PlayerStatus.buffering) { - if (setSourceOnly) { - playerStatus = PlayerStatus.paused; - } else { - playerStatus = PlayerStatus.playing; - } - notifyListeners(); - } + notifyListeners(); } Future pause() async { @@ -259,13 +256,13 @@ class PlaybackService extends ChangeNotifier { case LoopMode.off: // to the next song / stop if (currentIndex > 0) { - setPlayingIndex(currentIndex - 1); + await setPlayingIndex(currentIndex - 1); await play(reload: true); } break; case LoopMode.all: // to the previous song / last song - setPlayingIndex((currentIndex > 0 ? currentIndex : queue.length) - 1); + await setPlayingIndex((currentIndex > 0 ? currentIndex : queue.length) - 1); await play(reload: true); break; case LoopMode.one: @@ -275,7 +272,7 @@ class PlaybackService extends ChangeNotifier { break; case LoopMode.random: // to a random song - setPlayingIndex(rng.nextInt(queue.length)); + await setPlayingIndex(rng.nextInt(queue.length)); await play(reload: true); break; } @@ -289,7 +286,7 @@ class PlaybackService extends ChangeNotifier { case LoopMode.off: // to the next song / stop if (currentIndex < queue.length - 1) { - setPlayingIndex(currentIndex + 1); + await setPlayingIndex(currentIndex + 1); await play(reload: true); } else { await stop(); @@ -297,7 +294,7 @@ class PlaybackService extends ChangeNotifier { break; case LoopMode.all: // to the next song / first song - setPlayingIndex((currentIndex + 1) % queue.length); + await setPlayingIndex((currentIndex + 1) % queue.length); await play(reload: true); break; case LoopMode.one: @@ -307,7 +304,7 @@ class PlaybackService extends ChangeNotifier { break; case LoopMode.random: // to a random song - setPlayingIndex(rng.nextInt(queue.length)); + await setPlayingIndex(rng.nextInt(queue.length)); await play(reload: true); break; } @@ -334,7 +331,7 @@ class PlaybackService extends ChangeNotifier { queue.removeAt(index); if (removeCurrentPlayingTrack) { - setPlayingIndex(index, notify: false); + await setPlayingIndex(index, notify: false); await play(reload: true); } notifyListeners(); @@ -346,7 +343,7 @@ class PlaybackService extends ChangeNotifier { final to = index % queue.length; if (to != playingIndex) { // index changed, set new audio source - setPlayingIndex(to); + await setPlayingIndex(to); await play(reload: true); } else { // index not changed, seek to start @@ -383,7 +380,7 @@ class PlaybackService extends ChangeNotifier { queue = songs; // 2. set playing index if (songs.isNotEmpty) { - setPlayingIndex(initialIndex % songs.length, reload: true, notify: false); + await setPlayingIndex(initialIndex % songs.length, reload: true, notify: false); } else { playing?.dispose(); playing = null; diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 06323e33..ceee33e5 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ "gimli", ] @@ -32,9 +32,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] @@ -59,9 +59,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "alsa" @@ -70,7 +70,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37fe60779335388a88c01ac6c3be40304d1e349de3ada3b15f7808bb90fa9dce" dependencies = [ "alsa-sys", - "bitflags 2.4.2", + "bitflags 2.6.0", "libc", ] @@ -84,6 +84,12 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + [[package]] name = "android_log-sys" version = "0.3.1" @@ -97,11 +103,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c494134f746c14dc653a35a4ea5aca24ac368529da5370ecf41fe0341c35772f" dependencies = [ "android_log-sys", - "env_logger", + "env_logger 0.10.2", "log", "once_cell", ] +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + [[package]] name = "anni-artist" version = "0.1.1" @@ -128,10 +143,44 @@ dependencies = [ "thiserror", ] +[[package]] +name = "anni-common" +version = "0.1.4" +source = "git+https://github.com/ProjectAnni/anni#9207e60bb864bc4a924f1d313454504c0c61f3b7" +dependencies = [ + "anni-artist", + "byteorder", + "chardetng", + "encoding_rs", + "log", + "once_cell", + "path-absolutize", + "pathdiff", + "regex", + "serde", + "serde_json", + "thiserror", + "trash", +] + +[[package]] +name = "anni-flac" +version = "0.2.2" +source = "git+https://github.com/ProjectAnni/anni#9207e60bb864bc4a924f1d313454504c0c61f3b7" +dependencies = [ + "async-trait", + "byteorder", + "hex", + "image 0.24.9", + "log", + "thiserror", + "tokio", +] + [[package]] name = "anni-playback" version = "0.1.0" -source = "git+https://github.com/ProjectAnni/anni#9207e60bb864bc4a924f1d313454504c0c61f3b7" +source = "git+https://github.com/ProjectAnni/anni?rev=9207e60#9207e60bb864bc4a924f1d313454504c0c61f3b7" dependencies = [ "anyhow", "arrayvec", @@ -144,8 +193,44 @@ dependencies = [ "rangemap", "reqwest", "rubato", - "symphonia", - "symphonia-core", + "symphonia 0.5.2", + "symphonia-core 0.5.2", +] + +[[package]] +name = "anni-player" +version = "0.1.0" +source = "git+https://github.com/snylonue/anni-player?rev=466a434#466a43494519b85ef45f878739e8f46fb8c06f86" +dependencies = [ + "anni-playback", + "anni-provider", + "anyhow", + "env_logger 0.10.2", + "log", + "once_cell", + "reqwest", + "symphonia 0.5.4", + "uuid", +] + +[[package]] +name = "anni-provider" +version = "0.3.0" +source = "git+https://github.com/ProjectAnni/anni#9207e60bb864bc4a924f1d313454504c0c61f3b7" +dependencies = [ + "anni-common 0.1.4 (git+https://github.com/ProjectAnni/anni)", + "anni-flac", + "async-trait", + "dashmap 5.5.3", + "futures", + "log", + "lru", + "parking_lot", + "thiserror", + "tokio", + "tokio-stream", + "tokio-util", + "uuid", ] [[package]] @@ -155,7 +240,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b0d76f32d2c9f30c0b756bf09776904170881369cd6b2bf664a21987f616cb1f" dependencies = [ "anni-artist", - "anni-common", + "anni-common 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "indexmap 1.9.3", "log", "once_cell", @@ -171,20 +256,69 @@ dependencies = [ "uuid", ] +[[package]] +name = "anstream" +version = "0.6.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" + +[[package]] +name = "anstyle-parse" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", +] + [[package]] name = "anyhow" -version = "1.0.75" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" dependencies = [ "backtrace", ] [[package]] name = "arbitrary" -version = "0.4.7" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db55d72333851e17d572bec876e390cd3b11eb1ef53ae821dd9f3b653d2b4569" +checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" [[package]] name = "arg_enum_proc_macro" @@ -194,7 +328,7 @@ checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn", ] [[package]] @@ -202,8 +336,16 @@ name = "arrayvec" version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "async-trait" +version = "0.1.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ - "serde", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -232,9 +374,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "av1-grain" @@ -247,7 +389,6 @@ dependencies = [ "log", "nom", "num-rational", - "serde", "v_frame", ] @@ -262,9 +403,9 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", "cc", @@ -287,10 +428,10 @@ version = "0.69.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "cexpr", "clang-sys", - "itertools 0.12.1", + "itertools", "lazy_static", "lazycell", "proc-macro2", @@ -298,7 +439,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.39", + "syn", ] [[package]] @@ -315,15 +456,15 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.2" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "bitstream-io" -version = "1.10.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e445576659fd04a57b44cbd00aa37aaa815ebefa0aa3cb677a6b5e63d883074f" +checksum = "3dcde5f311c85b8ca30c2e4198d4326bc342c76541590106f5fa4a50946ea499" [[package]] name = "block-buffer" @@ -342,24 +483,21 @@ checksum = "832133bbabbbaa9fbdba793456a2827627a7d2b8fb96032fa1e7666d7895832b" [[package]] name = "built" -version = "0.5.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b9c056b9ed43aee5e064b683aa1ec783e19c6acec7559e3ae931b7490472fbe" -dependencies = [ - "cargo-lock", -] +checksum = "236e6289eda5a812bc6b53c3b024039382a2895fbbeef2d748b2931546d392c4" [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bytemuck" -version = "1.14.0" +version = "1.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" +checksum = "b236fc92302c97ed75b38da1f4917b5cdda4984745740f153a5d3059e48d725e" [[package]] name = "byteorder" @@ -375,27 +513,15 @@ checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" [[package]] name = "bytes" -version = "1.5.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" - -[[package]] -name = "cargo-lock" -version = "8.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "031718ddb8f78aa5def78a09e90defe30151d1f6c672f937af4dd916429ed996" -dependencies = [ - "semver", - "serde", - "toml 0.5.11", - "url", -] +checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952" [[package]] name = "cc" -version = "1.0.83" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "324c74f2155653c90b04f25b2a47a8a631360cb908f92a772695f430c7e31052" dependencies = [ "jobserver", "libc", @@ -443,11 +569,23 @@ dependencies = [ "memchr", ] +[[package]] +name = "chrono" +version = "0.4.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "num-traits", + "windows-targets 0.52.6", +] + [[package]] name = "clang-sys" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" dependencies = [ "glob", "libc", @@ -469,11 +607,17 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" +[[package]] +name = "colorchoice" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" + [[package]] name = "combine" -version = "4.6.6" +version = "4.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" dependencies = [ "bytes", "memchr", @@ -528,8 +672,7 @@ dependencies = [ [[package]] name = "cpal" version = "0.15.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "873dab07c8f743075e57f524c583985fbaf745602acbe916a01539364369a779" +source = "git+https://github.com/sidit77/cpal.git?branch=master#66ed6bec97f25ec7f02a82f50d1aa9aef733a58e" dependencies = [ "alsa", "core-foundation-sys", @@ -545,7 +688,7 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "windows", + "windows 0.54.0", ] [[package]] @@ -572,9 +715,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.12" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" dependencies = [ "crossbeam-utils", ] @@ -609,9 +752,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crunchy" @@ -648,6 +791,19 @@ dependencies = [ "num_cpus", ] +[[package]] +name = "dashmap" +version = "5.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +dependencies = [ + "cfg-if", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core", +] + [[package]] name = "dasp_frame" version = "0.11.0" @@ -671,7 +827,7 @@ checksum = "51aac4c99b2e6775164b412ea33ae8441b2fde2dbf05a20bc0052a63d08c475b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn", ] [[package]] @@ -686,9 +842,9 @@ dependencies = [ [[package]] name = "ebur128" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12aebdd6b6b47b5880c049efb0e77f8762178a0745ef778878908f5981c05f52" +checksum = "c2d4466b277f37735da60bee5ba0ecd88e6e40a22d36e68b58d808f84f4ed989" dependencies = [ "bitflags 1.3.2", "dasp_frame", @@ -698,27 +854,53 @@ dependencies = [ [[package]] name = "either" -version = "1.10.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "encoding_rs" -version = "0.8.33" +version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ "cfg-if", ] +[[package]] +name = "env_filter" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" +dependencies = [ + "log", + "regex", +] + [[package]] name = "env_logger" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95b3f3e67048839cb0d0781f445682a35113da7121f7c949db0e2be96a4fbece" +checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" dependencies = [ + "humantime", + "is-terminal", "log", "regex", + "termcolor", +] + +[[package]] +name = "env_logger" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b35839ba51819680ba087cd351788c9a3c476841207e0b8cee0b04722343b9" +dependencies = [ + "anstream", + "anstyle", + "env_filter", + "humantime", + "log", ] [[package]] @@ -821,7 +1003,7 @@ dependencies = [ "md-5", "proc-macro2", "quote", - "syn 2.0.39", + "syn", ] [[package]] @@ -841,9 +1023,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -856,9 +1038,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -866,15 +1048,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -883,38 +1065,38 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-macro" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn", ] [[package]] name = "futures-sink" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-util" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-channel", "futures-core", @@ -940,9 +1122,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -961,9 +1143,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] name = "glob" @@ -1008,9 +1190,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", "allocator-api2", @@ -1022,7 +1204,7 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" dependencies = [ - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] @@ -1033,9 +1215,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" -version = "0.3.3" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hex" @@ -1067,9 +1249,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" [[package]] name = "httpdate" @@ -1077,11 +1259,17 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + [[package]] name = "hyper" -version = "0.14.28" +version = "0.14.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" dependencies = [ "bytes", "futures-channel", @@ -1115,6 +1303,29 @@ dependencies = [ "tokio-rustls", ] +[[package]] +name = "iana-time-zone" +version = "0.1.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core 0.52.0", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + [[package]] name = "idna" version = "0.5.0" @@ -1125,6 +1336,24 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "image" +version = "0.24.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5690139d2f55868e080017335e4b94cb7414274c74f1669c84fb5feba2c9f69d" +dependencies = [ + "bytemuck", + "byteorder", + "color_quant", + "exr", + "gif", + "jpeg-decoder", + "num-traits", + "png", + "qoi", + "tiff", +] + [[package]] name = "image" version = "0.25.1" @@ -1150,12 +1379,12 @@ dependencies = [ [[package]] name = "image-webp" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d730b085583c4d789dfd07fdcf185be59501666a90c97c40162b37e4fdad272d" +checksum = "f79afb8cbee2ef20f59ccd477a218c12a93943d075b492015ecb1bb81f8ee904" dependencies = [ "byteorder-lite", - "thiserror", + "quick-error", ] [[package]] @@ -1181,7 +1410,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] @@ -1192,7 +1421,7 @@ checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn", ] [[package]] @@ -1202,14 +1431,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] -name = "itertools" -version = "0.10.5" +name = "is-terminal" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ - "either", + "hermit-abi", + "libc", + "windows-sys 0.52.0", ] +[[package]] +name = "is_terminal_polyfill" +version = "1.70.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" + [[package]] name = "itertools" version = "0.12.1" @@ -1221,9 +1458,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jni" @@ -1249,9 +1486,9 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "jobserver" -version = "0.1.28" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" +checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" dependencies = [ "libc", ] @@ -1261,6 +1498,9 @@ name = "jpeg-decoder" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" +dependencies = [ + "rayon", +] [[package]] name = "js-sys" @@ -1273,9 +1513,9 @@ dependencies = [ [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "lazycell" @@ -1291,28 +1531,29 @@ checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" [[package]] name = "libc" -version = "0.2.150" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libfuzzer-sys" -version = "0.3.5" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcf184a4b6b274f82a5df6b357da6055d3e82272327bba281c28bbba6f1664ef" +checksum = "a96cfd5557eb82f2b83fed4955246c988d331975a002961b07c81584d107e7f7" dependencies = [ "arbitrary", "cc", + "once_cell", ] [[package]] name = "libloading" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" +checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" dependencies = [ "cfg-if", - "windows-targets 0.52.4", + "windows-targets 0.52.6", ] [[package]] @@ -1338,9 +1579,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "loop9" @@ -1351,6 +1592,15 @@ dependencies = [ "imgref", ] +[[package]] +name = "lru" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" +dependencies = [ + "hashbrown 0.14.5", +] + [[package]] name = "mach2" version = "0.4.2" @@ -1360,6 +1610,15 @@ dependencies = [ "libc", ] +[[package]] +name = "malloc_buf" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" +dependencies = [ + "libc", +] + [[package]] name = "material-colors" version = "0.3.3" @@ -1367,7 +1626,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d8a337c8c8d75b80c6db350ba39844f08eddf4c3fde1b83967b5ce5f3f82ff24" dependencies = [ "ahash", - "image", + "image 0.25.1", "indexmap 2.2.6", ] @@ -1393,9 +1652,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "mime" @@ -1411,9 +1670,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", "simd-adler32", @@ -1436,7 +1695,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2076a31b7010b17a38c01907c45b945e8f11495ee4dd588309718901b1f7a5b7" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "jni-sys", "log", "ndk-sys", @@ -1483,35 +1742,23 @@ checksum = "0676bb32a98c1a483ce53e500a81ad9c3d5b3f7c920c28c24e9cb0980d0b5bc8" [[package]] name = "num-bigint" -version = "0.4.4" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ - "autocfg", "num-integer", "num-traits", ] [[package]] name = "num-complex" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23c6602fda94a57c990fe0df199a035d83576b496aa29f4e634a8ac6004e68a6" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" dependencies = [ "num-traits", ] -[[package]] -name = "num-derive" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "num-derive" version = "0.4.2" @@ -1520,7 +1767,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn", ] [[package]] @@ -1534,11 +1781,10 @@ dependencies = [ [[package]] name = "num-rational" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" dependencies = [ - "autocfg", "num-bigint", "num-integer", "num-traits", @@ -1546,9 +1792,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] @@ -1581,14 +1827,23 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.39", + "syn", +] + +[[package]] +name = "objc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +dependencies = [ + "malloc_buf", ] [[package]] name = "object" -version = "0.32.1" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce" dependencies = [ "memchr", ] @@ -1602,7 +1857,7 @@ dependencies = [ "jni", "ndk", "ndk-context", - "num-derive 0.4.2", + "num-derive", "num-traits", "oboe-sys", ] @@ -1618,9 +1873,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "oslog" @@ -1629,10 +1884,33 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8343ce955f18e7e68c0207dd0ea776ec453035685395ababd2ea651c569728b3" dependencies = [ "cc", - "dashmap", + "dashmap 4.0.2", "log", ] +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.6", +] + [[package]] name = "paste" version = "1.0.15" @@ -1671,9 +1949,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -1708,9 +1986,9 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "primal-check" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9df7f93fd637f083201473dab4fee2db4c429d32e55e3299980ab3957ab916a0" +checksum = "dc0d895b311e3af9902528fbb8f928688abbd95872819320517cc24ca6b2bd08" dependencies = [ "num-integer", ] @@ -1726,13 +2004,32 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.70" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] +[[package]] +name = "profiling" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d84d1d7a6ac92673717f9f6d1518374ef257669c24ebc5ac25d5033828be58" +dependencies = [ + "profiling-procmacros", +] + +[[package]] +name = "profiling-procmacros" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8021cf59c8ec9c432cfc2526ac6b8aa508ecaf29cd415f271b8406c1b851c3fd" +dependencies = [ + "quote", + "syn", +] + [[package]] name = "qoi" version = "0.4.1" @@ -1750,9 +2047,9 @@ checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" [[package]] name = "quote" -version = "1.0.33" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -1795,9 +2092,9 @@ checksum = "f60fcc7d6849342eff22c4350c8b9a989ee8ceabc4b481253e8946b9fe83d684" [[package]] name = "rav1e" -version = "0.6.6" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16c383692a5e7abd9f6d1eddb1a5e0269f859392387883361bb09e5555852ec1" +checksum = "cd87ce80a7665b1cce111f8a16c1f3929f6547ce91ade6addf4ec86a8dda5ce9" dependencies = [ "arbitrary", "arg_enum_proc_macro", @@ -1807,21 +2104,20 @@ dependencies = [ "built", "cfg-if", "interpolate_name", - "itertools 0.10.5", + "itertools", "libc", "libfuzzer-sys", "log", "maybe-rayon", "new_debug_unreachable", "noop_proc_macro", - "num-derive 0.3.3", + "num-derive", "num-traits", "once_cell", "paste", + "profiling", "rand", "rand_chacha", - "rust_hawktracer", - "rustc_version", "simd_helpers", "system-deps", "thiserror", @@ -1831,9 +2127,9 @@ dependencies = [ [[package]] name = "ravif" -version = "0.11.3" +version = "0.11.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "badc69028460108fa7e32d4aec2b0c980710d7a31a896864002c8c1fc61516ee" +checksum = "c6ba61c28ba24c0cf8406e025cb29a742637e3f70776e61c27a8a8b72a042d12" dependencies = [ "avif-serialize", "imgref", @@ -1873,11 +2169,20 @@ dependencies = [ "rustfft", ] +[[package]] +name = "redox_syscall" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +dependencies = [ + "bitflags 2.6.0", +] + [[package]] name = "regex" -version = "1.10.2" +version = "1.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" dependencies = [ "aho-corasick", "memchr", @@ -1887,9 +2192,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", @@ -1898,9 +2203,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "reqwest" @@ -1945,9 +2250,9 @@ dependencies = [ [[package]] name = "rgb" -version = "0.8.37" +version = "0.8.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05aaa8004b64fd573fc9d002f4e632d51ad4f026c2b5ba95fcb6c2f32c2c47d8" +checksum = "ade4539f42266ded9e755c605bdddf546242b2c961b03b06a7375260788a0523" dependencies = [ "bytemuck", ] @@ -1995,37 +2300,17 @@ dependencies = [ "uuid", ] -[[package]] -name = "rust_hawktracer" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3480a29b927f66c6e06527be7f49ef4d291a01d694ec1fe85b0de71d6b02ac1" -dependencies = [ - "rust_hawktracer_normal_macro", - "rust_hawktracer_proc_macro", -] - -[[package]] -name = "rust_hawktracer_normal_macro" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a570059949e1dcdc6f35228fa389f54c2c84dfe0c94c05022baacd56eacd2e9" - -[[package]] -name = "rust_hawktracer_proc_macro" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb626abdbed5e93f031baae60d72032f56bc964e11ac2ff65f2ba3ed98d6d3e1" - [[package]] name = "rust_lib_annix" version = "0.1.0" dependencies = [ "anni-playback", + "anni-player", "anni-repo", "anyhow", "cpal", "crossbeam", + "env_logger 0.11.3", "flutter_rust_bridge", "log", "material-colors", @@ -2037,9 +2322,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" @@ -2047,15 +2332,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - [[package]] name = "rustfft" version = "6.2.0" @@ -2073,9 +2349,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.11" +version = "0.21.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fecbfb7b1444f477b345853b1fce097a2c6fb637b2bfb87e6bc5db0f043fae4" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", "ring", @@ -2104,9 +2380,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "same-file" @@ -2133,40 +2409,31 @@ dependencies = [ "untrusted", ] -[[package]] -name = "semver" -version = "1.0.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" -dependencies = [ - "serde", -] - [[package]] name = "serde" -version = "1.0.193" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.193" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn", ] [[package]] name = "serde_json" -version = "1.0.109" +version = "1.0.120" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0652c533506ad7a2e353cce269330d6afd8bdfb6d75e0ace5b35aacbd7b9e9" +checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" dependencies = [ "itoa", "ryu", @@ -2185,9 +2452,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" dependencies = [ "serde", ] @@ -2236,15 +2503,15 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", "windows-sys 0.52.0", @@ -2271,11 +2538,25 @@ version = "0.5.2" source = "git+https://github.com/erikas-taroza/Symphonia?branch=mp4-opus-improvements#bb1314974788c1f0b74e7876fa644bf070a23e37" dependencies = [ "lazy_static", - "symphonia-bundle-flac", - "symphonia-codec-aac", - "symphonia-core", - "symphonia-format-ogg", - "symphonia-metadata", + "symphonia-bundle-flac 0.5.2", + "symphonia-codec-aac 0.5.2", + "symphonia-core 0.5.2", + "symphonia-format-ogg 0.5.2", + "symphonia-metadata 0.5.2", +] + +[[package]] +name = "symphonia" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "815c942ae7ee74737bb00f965fa5b5a2ac2ce7b6c01c0cc169bbeaf7abd5f5a9" +dependencies = [ + "lazy_static", + "symphonia-bundle-flac 0.5.4", + "symphonia-codec-aac 0.5.4", + "symphonia-core 0.5.4", + "symphonia-format-ogg 0.5.4", + "symphonia-metadata 0.5.4", ] [[package]] @@ -2284,9 +2565,21 @@ version = "0.5.2" source = "git+https://github.com/erikas-taroza/Symphonia?branch=mp4-opus-improvements#bb1314974788c1f0b74e7876fa644bf070a23e37" dependencies = [ "log", - "symphonia-core", - "symphonia-metadata", - "symphonia-utils-xiph", + "symphonia-core 0.5.2", + "symphonia-metadata 0.5.2", + "symphonia-utils-xiph 0.5.2", +] + +[[package]] +name = "symphonia-bundle-flac" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72e34f34298a7308d4397a6c7fbf5b84c5d491231ce3dd379707ba673ab3bd97" +dependencies = [ + "log", + "symphonia-core 0.5.4", + "symphonia-metadata 0.5.4", + "symphonia-utils-xiph 0.5.4", ] [[package]] @@ -2296,7 +2589,18 @@ source = "git+https://github.com/erikas-taroza/Symphonia?branch=mp4-opus-improve dependencies = [ "lazy_static", "log", - "symphonia-core", + "symphonia-core 0.5.2", +] + +[[package]] +name = "symphonia-codec-aac" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdbf25b545ad0d3ee3e891ea643ad115aff4ca92f6aec472086b957a58522f70" +dependencies = [ + "lazy_static", + "log", + "symphonia-core 0.5.4", ] [[package]] @@ -2311,15 +2615,40 @@ dependencies = [ "log", ] +[[package]] +name = "symphonia-core" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "798306779e3dc7d5231bd5691f5a813496dc79d3f56bf82e25789f2094e022c3" +dependencies = [ + "arrayvec", + "bitflags 1.3.2", + "bytemuck", + "lazy_static", + "log", +] + [[package]] name = "symphonia-format-ogg" version = "0.5.2" source = "git+https://github.com/erikas-taroza/Symphonia?branch=mp4-opus-improvements#bb1314974788c1f0b74e7876fa644bf070a23e37" dependencies = [ "log", - "symphonia-core", - "symphonia-metadata", - "symphonia-utils-xiph", + "symphonia-core 0.5.2", + "symphonia-metadata 0.5.2", + "symphonia-utils-xiph 0.5.2", +] + +[[package]] +name = "symphonia-format-ogg" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ada3505789516bcf00fc1157c67729eded428b455c27ca370e41f4d785bfa931" +dependencies = [ + "log", + "symphonia-core 0.5.4", + "symphonia-metadata 0.5.4", + "symphonia-utils-xiph 0.5.4", ] [[package]] @@ -2330,7 +2659,19 @@ dependencies = [ "encoding_rs", "lazy_static", "log", - "symphonia-core", + "symphonia-core 0.5.2", +] + +[[package]] +name = "symphonia-metadata" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc622b9841a10089c5b18e99eb904f4341615d5aa55bbf4eedde1be721a4023c" +dependencies = [ + "encoding_rs", + "lazy_static", + "log", + "symphonia-core 0.5.4", ] [[package]] @@ -2338,26 +2679,25 @@ name = "symphonia-utils-xiph" version = "0.5.2" source = "git+https://github.com/erikas-taroza/Symphonia?branch=mp4-opus-improvements#bb1314974788c1f0b74e7876fa644bf070a23e37" dependencies = [ - "symphonia-core", - "symphonia-metadata", + "symphonia-core 0.5.2", + "symphonia-metadata 0.5.2", ] [[package]] -name = "syn" -version = "1.0.109" +name = "symphonia-utils-xiph" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +checksum = "484472580fa49991afda5f6550ece662237b00c6f562c7d9638d1b086ed010fe" dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", + "symphonia-core 0.5.4", + "symphonia-metadata 0.5.4", ] [[package]] name = "syn" -version = "2.0.39" +version = "2.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +checksum = "b146dcf730474b4bcd16c311627b31ede9ab149045db4d6088b3becaea046462" dependencies = [ "proc-macro2", "quote", @@ -2400,34 +2740,43 @@ dependencies = [ "cfg-expr", "heck", "pkg-config", - "toml 0.8.12", + "toml 0.8.15", "version-compare", ] [[package]] name = "target-lexicon" -version = "0.12.14" +version = "0.12.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" +checksum = "4873307b7c257eddcb50c9bedf158eb669578359fb28428bef438fec8e6ba7c2" + +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] [[package]] name = "thiserror" -version = "1.0.55" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e3de26b0965292219b4287ff031fcba86837900fe9cd2b34ea8ad893c0953d2" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.55" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "268026685b2be38d7103e9e507c938a1fcb3d7e6eb15e87870b617bf37b6d581" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn", ] [[package]] @@ -2452,9 +2801,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] @@ -2467,9 +2816,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.34.0" +version = "1.38.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" +checksum = "eb2caba9f80616f438e09748d5acda951967e1ea58508ef53d9c6402485a46df" dependencies = [ "backtrace", "bytes", @@ -2492,26 +2841,28 @@ dependencies = [ ] [[package]] -name = "tokio-util" -version = "0.7.10" +name = "tokio-stream" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" dependencies = [ - "bytes", "futures-core", - "futures-sink", "pin-project-lite", "tokio", - "tracing", ] [[package]] -name = "toml" -version = "0.5.11" +name = "tokio-util" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ - "serde", + "bytes", + "futures-core", + "futures-io", + "futures-sink", + "pin-project-lite", + "tokio", ] [[package]] @@ -2528,21 +2879,21 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.12" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" +checksum = "ac2caab0bf757388c6c0ae23b3293fdb463fee59434529014f85e3263b995c28" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.12", + "toml_edit 0.22.16", ] [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" dependencies = [ "serde", ] @@ -2573,9 +2924,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.12" +version = "0.22.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3328d4f68a705b2a4498da1d580585d39a6510f98318a2cec3018a7ec61ddef" +checksum = "278f3d518e152219c994ce877758516bca5e118eaed6996192a774fb9fbf0788" dependencies = [ "indexmap 2.2.6", "serde", @@ -2619,6 +2970,22 @@ dependencies = [ "strength_reduce", ] +[[package]] +name = "trash" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c658458d46d9d5a153a3b5cdd88d8579ad50d4fb85d53961e4526c8fc7c55a57" +dependencies = [ + "chrono", + "libc", + "log", + "objc", + "once_cell", + "scopeguard", + "url", + "windows 0.44.0", +] + [[package]] name = "try-lock" version = "0.2.5" @@ -2660,20 +3027,26 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", "percent-encoding", ] +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + [[package]] name = "uuid" -version = "1.7.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" +checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" dependencies = [ "getrandom", "serde", @@ -2754,7 +3127,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.39", + "syn", "wasm-bindgen-shared", ] @@ -2788,7 +3161,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2801,9 +3174,9 @@ checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "web-sys" -version = "0.3.66" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ "js-sys", "wasm-bindgen", @@ -2822,44 +3195,42 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" [[package]] -name = "winapi" -version = "0.3.9" +name = "winapi-util" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", + "windows-sys 0.52.0", ] [[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.6" +name = "windows" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +checksum = "9e745dab35a0c4c77aa3ce42d595e13d2003d6902d6b08c9ef5fc326d08da12b" dependencies = [ - "winapi", + "windows-targets 0.42.2", ] -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - [[package]] name = "windows" version = "0.54.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9252e5725dbed82865af151df558e754e4a3c2c30818359eb17465f1346a1b49" dependencies = [ - "windows-core", - "windows-targets 0.52.4", + "windows-core 0.54.0", + "windows-implement", + "windows-interface", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] @@ -2869,16 +3240,38 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12661b9c89351d684a50a8a643ce5f608e20243b9fb84687800163429f161d65" dependencies = [ "windows-result", - "windows-targets 0.52.4", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-implement" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "942ac266be9249c84ca862f0a164a39533dc2f6f33dc98ec89c8da99b82ea0bd" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da33557140a288fae4e1d5f8873aaf9eb6613a9cf82c3e070223ff177f598b60" +dependencies = [ + "proc-macro2", + "quote", + "syn", ] [[package]] name = "windows-result" -version = "0.1.0" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd19df78e5168dfb0aedc343d1d1b8d422ab2db6756d2dc3fef75035402a3f64" +checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.6", ] [[package]] @@ -2905,7 +3298,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.6", ] [[package]] @@ -2940,17 +3333,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.4", - "windows_aarch64_msvc 0.52.4", - "windows_i686_gnu 0.52.4", - "windows_i686_msvc 0.52.4", - "windows_x86_64_gnu 0.52.4", - "windows_x86_64_gnullvm 0.52.4", - "windows_x86_64_msvc 0.52.4", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -2967,9 +3361,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -2985,9 +3379,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -3003,9 +3397,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.4" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -3021,9 +3421,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -3039,9 +3439,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -3057,9 +3457,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -3075,9 +3475,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" @@ -3109,22 +3509,22 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn", ] [[package]] diff --git a/rust/Cargo.toml b/rust/Cargo.toml index e223d365..4a2fc078 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -17,8 +17,14 @@ uuid = "1" crossbeam = { version = "0.8.2", features = ["crossbeam-channel"] } anyhow = "1.0.75" log = "0.4.20" +env_logger = "0.11" -anni-playback = { git = "https://github.com/ProjectAnni/anni" } +anni-playback = { git = "https://github.com/ProjectAnni/anni", rev = "9207e60" } +anni-player = { git = "https://github.com/snylonue/anni-player", rev = "466a434" } cpal = { version = "0.15.3", features = ["oboe-shared-stdcxx"] } rand = "0.8.5" material-colors = { version = "0.3.3", features = ["image"] } + +[patch.crates-io] +cpal = { git = "https://github.com/sidit77/cpal.git", branch = "master" } + diff --git a/rust/src/api/player.rs b/rust/src/api/player.rs index 77688f01..7362f60d 100644 --- a/rust/src/api/player.rs +++ b/rust/src/api/player.rs @@ -1,13 +1,15 @@ +pub use anni_player::provider::AudioQuality; + use std::{ - sync::{Arc, OnceLock}, + sync::{Arc, Once, OnceLock}, thread, }; use anni_playback::types::PlayerEvent; +use anni_player::{AnniPlayer, TypedPriorityProvider}; use flutter_rust_bridge::frb; use crate::frb_generated::StreamSink; -use crate::player::player::Player; pub enum PlayerStateEvent { /// Started playing @@ -40,17 +42,29 @@ fn update_player_state_stream( pub type StreamWrapper = Arc>>; +#[frb(mirror(AudioQuality))] +pub enum _AudioQuality { + Low, + Medium, + High, + Lossless, +} + #[frb(opaque)] pub struct AnnixPlayer { - player: Player, + player: AnniPlayer, _state: StreamWrapper, _progress: StreamWrapper, } impl AnnixPlayer { #[frb(sync)] - pub fn new() -> AnnixPlayer { - let (player, receiver) = Player::new(); + pub fn new(cache_path: String) -> AnnixPlayer { + static LOGGER: Once = Once::new(); + + LOGGER.call_once(|| env_logger::init()); + + let (player, receiver) = AnniPlayer::new(TypedPriorityProvider::new(vec![]), cache_path.into()); let progress = Arc::new(OnceLock::new()); let player_state = Arc::new(OnceLock::new()); @@ -100,7 +114,15 @@ impl AnnixPlayer { } pub fn open_file(&self, path: String) -> anyhow::Result<()> { - self.player.open_file(path, false) + self.player.open_file(path) + } + + pub fn open(&self, identifier: String, quality: AudioQuality) -> anyhow::Result<()> { + self.player.open(identifier.parse()?, quality) + } + + pub fn set_track(&self, identifier: String, quality: AudioQuality) -> anyhow::Result<()> { + self.player.load(identifier.parse()?, quality) } pub fn set_volume(&self, volume: f32) { @@ -117,7 +139,15 @@ impl AnnixPlayer { #[frb(sync)] pub fn is_playing(&self) -> bool { - self.player.is_playing() + self.player.player.is_playing() + } + + pub fn add_provider(&self, url: String, auth: String, priority: i32) { + self.player.add_provider(url, auth, priority); + } + + pub fn clear_provider(&self) { + self.player.clear_provider(); } pub fn player_state_stream(&self, stream: StreamSink) { diff --git a/rust/src/frb_generated.rs b/rust/src/frb_generated.rs index a64c4eff..ff71f63a 100644 --- a/rust/src/frb_generated.rs +++ b/rust/src/frb_generated.rs @@ -39,7 +39,7 @@ flutter_rust_bridge::frb_generated_boilerplate!( default_rust_auto_opaque = RustAutoOpaqueMoi, ); pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_VERSION: &str = "2.1.0"; -pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_CONTENT_HASH: i32 = -2003164833; +pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_CONTENT_HASH: i32 = -1883214556; // Section: executor @@ -117,6 +117,116 @@ fn wire__crate__api__network__update_network_status_impl( }, ) } +fn wire__crate__api__player__AnnixPlayer_add_provider_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, + rust_vec_len_: i32, + data_len_: i32, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "AnnixPlayer_add_provider", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let message = unsafe { + flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire( + ptr_, + rust_vec_len_, + data_len_, + ) + }; + let mut deserializer = + flutter_rust_bridge::for_generated::SseDeserializer::new(message); + let api_that = , + >>::sse_decode(&mut deserializer); + let api_url = ::sse_decode(&mut deserializer); + let api_auth = ::sse_decode(&mut deserializer); + let api_priority = ::sse_decode(&mut deserializer); + deserializer.end(); + move |context| { + transform_result_sse::<_, ()>((move || { + let mut api_that_guard = None; + let decode_indices_ = + flutter_rust_bridge::for_generated::lockable_compute_decode_order(vec![ + flutter_rust_bridge::for_generated::LockableOrderInfo::new( + &api_that, 0, false, + ), + ]); + for i in decode_indices_ { + match i { + 0 => api_that_guard = Some(api_that.lockable_decode_sync_ref()), + _ => unreachable!(), + } + } + let api_that_guard = api_that_guard.unwrap(); + let output_ok = Result::<_, ()>::Ok({ + crate::api::player::AnnixPlayer::add_provider( + &*api_that_guard, + api_url, + api_auth, + api_priority, + ); + })?; + Ok(output_ok) + })()) + } + }, + ) +} +fn wire__crate__api__player__AnnixPlayer_clear_provider_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, + rust_vec_len_: i32, + data_len_: i32, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "AnnixPlayer_clear_provider", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let message = unsafe { + flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire( + ptr_, + rust_vec_len_, + data_len_, + ) + }; + let mut deserializer = + flutter_rust_bridge::for_generated::SseDeserializer::new(message); + let api_that = , + >>::sse_decode(&mut deserializer); + deserializer.end(); + move |context| { + transform_result_sse::<_, ()>((move || { + let mut api_that_guard = None; + let decode_indices_ = + flutter_rust_bridge::for_generated::lockable_compute_decode_order(vec![ + flutter_rust_bridge::for_generated::LockableOrderInfo::new( + &api_that, 0, false, + ), + ]); + for i in decode_indices_ { + match i { + 0 => api_that_guard = Some(api_that.lockable_decode_sync_ref()), + _ => unreachable!(), + } + } + let api_that_guard = api_that_guard.unwrap(); + let output_ok = Result::<_, ()>::Ok({ + crate::api::player::AnnixPlayer::clear_provider(&*api_that_guard); + })?; + Ok(output_ok) + })()) + } + }, + ) +} fn wire__crate__api__player__AnnixPlayer_is_playing_impl( ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, rust_vec_len_: i32, @@ -186,14 +296,73 @@ fn wire__crate__api__player__AnnixPlayer_new_impl( }; let mut deserializer = flutter_rust_bridge::for_generated::SseDeserializer::new(message); + let api_cache_path = ::sse_decode(&mut deserializer); deserializer.end(); transform_result_sse::<_, ()>((move || { - let output_ok = Result::<_, ()>::Ok(crate::api::player::AnnixPlayer::new())?; + let output_ok = + Result::<_, ()>::Ok(crate::api::player::AnnixPlayer::new(api_cache_path))?; Ok(output_ok) })()) }, ) } +fn wire__crate__api__player__AnnixPlayer_open_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, + rust_vec_len_: i32, + data_len_: i32, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "AnnixPlayer_open", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let message = unsafe { + flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire( + ptr_, + rust_vec_len_, + data_len_, + ) + }; + let mut deserializer = + flutter_rust_bridge::for_generated::SseDeserializer::new(message); + let api_that = , + >>::sse_decode(&mut deserializer); + let api_identifier = ::sse_decode(&mut deserializer); + let api_quality = ::sse_decode(&mut deserializer); + deserializer.end(); + move |context| { + transform_result_sse::<_, flutter_rust_bridge::for_generated::anyhow::Error>( + (move || { + let mut api_that_guard = None; + let decode_indices_ = + flutter_rust_bridge::for_generated::lockable_compute_decode_order( + vec![flutter_rust_bridge::for_generated::LockableOrderInfo::new( + &api_that, 0, false, + )], + ); + for i in decode_indices_ { + match i { + 0 => api_that_guard = Some(api_that.lockable_decode_sync_ref()), + _ => unreachable!(), + } + } + let api_that_guard = api_that_guard.unwrap(); + let output_ok = crate::api::player::AnnixPlayer::open( + &*api_that_guard, + api_identifier, + api_quality, + )?; + Ok(output_ok) + })(), + ) + } + }, + ) +} fn wire__crate__api__player__AnnixPlayer_open_file_impl( port_: flutter_rust_bridge::for_generated::MessagePort, ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, @@ -517,6 +686,63 @@ fn wire__crate__api__player__AnnixPlayer_seek_impl( }, ) } +fn wire__crate__api__player__AnnixPlayer_set_track_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, + rust_vec_len_: i32, + data_len_: i32, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "AnnixPlayer_set_track", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let message = unsafe { + flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire( + ptr_, + rust_vec_len_, + data_len_, + ) + }; + let mut deserializer = + flutter_rust_bridge::for_generated::SseDeserializer::new(message); + let api_that = , + >>::sse_decode(&mut deserializer); + let api_identifier = ::sse_decode(&mut deserializer); + let api_quality = ::sse_decode(&mut deserializer); + deserializer.end(); + move |context| { + transform_result_sse::<_, flutter_rust_bridge::for_generated::anyhow::Error>( + (move || { + let mut api_that_guard = None; + let decode_indices_ = + flutter_rust_bridge::for_generated::lockable_compute_decode_order( + vec![flutter_rust_bridge::for_generated::LockableOrderInfo::new( + &api_that, 0, false, + )], + ); + for i in decode_indices_ { + match i { + 0 => api_that_guard = Some(api_that.lockable_decode_sync_ref()), + _ => unreachable!(), + } + } + let api_that_guard = api_that_guard.unwrap(); + let output_ok = crate::api::player::AnnixPlayer::set_track( + &*api_that_guard, + api_identifier, + api_quality, + )?; + Ok(output_ok) + })(), + ) + } + }, + ) +} fn wire__crate__api__player__AnnixPlayer_set_volume_impl( port_: flutter_rust_bridge::for_generated::MessagePort, ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, @@ -1205,6 +1431,20 @@ impl SseDecode for uuid::Uuid { } } +impl SseDecode for crate::api::player::AudioQuality { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = ::sse_decode(deserializer); + return match inner { + 0 => crate::api::player::AudioQuality::Low, + 1 => crate::api::player::AudioQuality::Medium, + 2 => crate::api::player::AudioQuality::High, + 3 => crate::api::player::AudioQuality::Lossless, + _ => unreachable!("Invalid variant for AudioQuality: {}", inner), + }; + } +} + impl SseDecode for bool { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { @@ -1402,40 +1642,56 @@ fn pde_ffi_dispatcher_primary_impl( 2 => { wire__crate__api__network__update_network_status_impl(port, ptr, rust_vec_len, data_len) } - 5 => { + 3 => wire__crate__api__player__AnnixPlayer_add_provider_impl( + port, + ptr, + rust_vec_len, + data_len, + ), + 4 => wire__crate__api__player__AnnixPlayer_clear_provider_impl( + port, + ptr, + rust_vec_len, + data_len, + ), + 7 => wire__crate__api__player__AnnixPlayer_open_impl(port, ptr, rust_vec_len, data_len), + 8 => { wire__crate__api__player__AnnixPlayer_open_file_impl(port, ptr, rust_vec_len, data_len) } - 6 => wire__crate__api__player__AnnixPlayer_pause_impl(port, ptr, rust_vec_len, data_len), - 7 => wire__crate__api__player__AnnixPlayer_play_impl(port, ptr, rust_vec_len, data_len), - 8 => wire__crate__api__player__AnnixPlayer_player_state_stream_impl( + 9 => wire__crate__api__player__AnnixPlayer_pause_impl(port, ptr, rust_vec_len, data_len), + 10 => wire__crate__api__player__AnnixPlayer_play_impl(port, ptr, rust_vec_len, data_len), + 11 => wire__crate__api__player__AnnixPlayer_player_state_stream_impl( port, ptr, rust_vec_len, data_len, ), - 9 => wire__crate__api__player__AnnixPlayer_progress_stream_impl( + 12 => wire__crate__api__player__AnnixPlayer_progress_stream_impl( port, ptr, rust_vec_len, data_len, ), - 10 => wire__crate__api__player__AnnixPlayer_seek_impl(port, ptr, rust_vec_len, data_len), - 11 => { + 13 => wire__crate__api__player__AnnixPlayer_seek_impl(port, ptr, rust_vec_len, data_len), + 14 => { + wire__crate__api__player__AnnixPlayer_set_track_impl(port, ptr, rust_vec_len, data_len) + } + 15 => { wire__crate__api__player__AnnixPlayer_set_volume_impl(port, ptr, rust_vec_len, data_len) } - 12 => wire__crate__api__player__AnnixPlayer_stop_impl(port, ptr, rust_vec_len, data_len), - 14 => wire__crate__api__simple__local_db_get_album_impl(port, ptr, rust_vec_len, data_len), - 15 => wire__crate__api__simple__local_db_get_albums_by_tag_impl( + 16 => wire__crate__api__player__AnnixPlayer_stop_impl(port, ptr, rust_vec_len, data_len), + 18 => wire__crate__api__simple__local_db_get_album_impl(port, ptr, rust_vec_len, data_len), + 19 => wire__crate__api__simple__local_db_get_albums_by_tag_impl( port, ptr, rust_vec_len, data_len, ), - 16 => wire__crate__api__simple__local_db_get_tags_impl(port, ptr, rust_vec_len, data_len), - 17 => wire__crate__api__simple__local_db_new_impl(port, ptr, rust_vec_len, data_len), - 18 => wire__crate__api__simple__local_store_clear_impl(port, ptr, rust_vec_len, data_len), - 19 => wire__crate__api__simple__local_store_get_impl(port, ptr, rust_vec_len, data_len), - 20 => wire__crate__api__simple__local_store_insert_impl(port, ptr, rust_vec_len, data_len), + 20 => wire__crate__api__simple__local_db_get_tags_impl(port, ptr, rust_vec_len, data_len), + 21 => wire__crate__api__simple__local_db_new_impl(port, ptr, rust_vec_len, data_len), + 22 => wire__crate__api__simple__local_store_clear_impl(port, ptr, rust_vec_len, data_len), + 23 => wire__crate__api__simple__local_store_get_impl(port, ptr, rust_vec_len, data_len), + 24 => wire__crate__api__simple__local_store_insert_impl(port, ptr, rust_vec_len, data_len), _ => unreachable!(), } } @@ -1448,27 +1704,27 @@ fn pde_ffi_dispatcher_sync_impl( ) -> flutter_rust_bridge::for_generated::WireSyncRust2DartSse { // Codec=Pde (Serialization + dispatch), see doc to use other codecs match func_id { - 3 => wire__crate__api__player__AnnixPlayer_is_playing_impl(ptr, rust_vec_len, data_len), - 4 => wire__crate__api__player__AnnixPlayer_new_impl(ptr, rust_vec_len, data_len), - 13 => wire__crate__api__simple__get_theme_color_impl(ptr, rust_vec_len, data_len), - 21 => wire__crate__api__simple__local_store_new_impl(ptr, rust_vec_len, data_len), - 22 => { + 5 => wire__crate__api__player__AnnixPlayer_is_playing_impl(ptr, rust_vec_len, data_len), + 6 => wire__crate__api__player__AnnixPlayer_new_impl(ptr, rust_vec_len, data_len), + 17 => wire__crate__api__simple__get_theme_color_impl(ptr, rust_vec_len, data_len), + 25 => wire__crate__api__simple__local_store_new_impl(ptr, rust_vec_len, data_len), + 26 => { wire__crate__api__simple__native_preference_store_get_impl(ptr, rust_vec_len, data_len) } - 23 => { + 27 => { wire__crate__api__simple__native_preference_store_new_impl(ptr, rust_vec_len, data_len) } - 24 => wire__crate__api__simple__native_preference_store_remove_impl( + 28 => wire__crate__api__simple__native_preference_store_remove_impl( ptr, rust_vec_len, data_len, ), - 25 => wire__crate__api__simple__native_preference_store_remove_prefix_impl( + 29 => wire__crate__api__simple__native_preference_store_remove_prefix_impl( ptr, rust_vec_len, data_len, ), - 26 => { + 30 => { wire__crate__api__simple__native_preference_store_set_impl(ptr, rust_vec_len, data_len) } _ => unreachable!(), @@ -1492,6 +1748,29 @@ impl flutter_rust_bridge::IntoIntoDart> for AnnixPlayer } } +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for FrbWrapper { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + match self.0 { + crate::api::player::AudioQuality::Low => 0.into_dart(), + crate::api::player::AudioQuality::Medium => 1.into_dart(), + crate::api::player::AudioQuality::High => 2.into_dart(), + crate::api::player::AudioQuality::Lossless => 3.into_dart(), + _ => unreachable!(), + } + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for FrbWrapper +{ +} +impl flutter_rust_bridge::IntoIntoDart> + for crate::api::player::AudioQuality +{ + fn into_into_dart(self) -> FrbWrapper { + self.into() + } +} // Codec=Dco (DartCObject based), see doc to use other codecs impl flutter_rust_bridge::IntoDart for crate::api::simple::LocalDb { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { @@ -1701,6 +1980,24 @@ impl SseEncode for uuid::Uuid { } } +impl SseEncode for crate::api::player::AudioQuality { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + ::sse_encode( + match self { + crate::api::player::AudioQuality::Low => 0, + crate::api::player::AudioQuality::Medium => 1, + crate::api::player::AudioQuality::High => 2, + crate::api::player::AudioQuality::Lossless => 3, + _ => { + unimplemented!(""); + } + }, + serializer, + ); + } +} + impl SseEncode for bool { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 91bf8ce4..93606027 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -1,3 +1,2 @@ pub mod api; mod frb_generated; /* AUTO INJECTED BY flutter_rust_bridge. This line may not be accurate, and you can change it according to your needs. */ -mod player; diff --git a/rust/src/player/mod.rs b/rust/src/player/mod.rs deleted file mode 100644 index cd7fe427..00000000 --- a/rust/src/player/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub mod player; -pub mod playlist; diff --git a/rust/src/player/player.rs b/rust/src/player/player.rs deleted file mode 100644 index 1114a120..00000000 --- a/rust/src/player/player.rs +++ /dev/null @@ -1,33 +0,0 @@ -use std::{ops::Deref, sync::mpsc::Receiver, thread}; - -use anni_playback::{types::PlayerEvent, Controls, Decoder}; - -pub struct Player { - controls: Controls, -} - -impl Player { - pub fn new() -> (Player, Receiver) { - let (sender, receiver) = std::sync::mpsc::channel(); - let controls = Controls::new(sender); - let thread_killer = crossbeam::channel::unbounded(); - - thread::spawn({ - let controls = controls.clone(); - move || { - let decoder = Decoder::new(controls, thread_killer.1.clone()); - decoder.start(); - } - }); - - (Player { controls }, receiver) - } -} - -impl Deref for Player { - type Target = Controls; - - fn deref(&self) -> &Self::Target { - &self.controls - } -} diff --git a/rust/src/player/playlist.rs b/rust/src/player/playlist.rs deleted file mode 100644 index e69de29b..00000000