Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Added support for passing the thumbnail as an array of bytes #10

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions packages/smtc_windows/lib/src/bridge_generated.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// AUTO GENERATED FILE, DO NOT EDIT.
// Generated by `flutter_rust_bridge`@ 1.82.1.
// Generated by `flutter_rust_bridge`@ 1.82.6.
// ignore_for_file: non_constant_identifier_names, unused_element, duplicate_ignore, directives_ordering, curly_braces_in_flow_control_structures, unnecessary_lambdas, slash_for_doc_comments, prefer_const_literals_to_create_immutables, implicit_dynamic_list_literal, duplicate_import, unused_import, unnecessary_import, prefer_single_quotes, prefer_const_constructors, use_super_parameters, always_use_package_imports, annotate_overrides, invalid_use_of_protected_member, constant_identifier_names, invalid_use_of_internal_member, prefer_is_empty, unnecessary_const

import 'dart:convert';
Expand Down Expand Up @@ -92,13 +92,15 @@ class MusicMetadata {
final String? album;
final String? albumArtist;
final String? thumbnail;
final Uint8List? thumbnailStream;

const MusicMetadata({
this.title,
this.artist,
this.album,
this.albumArtist,
this.thumbnail,
this.thumbnailStream,
});
}

Expand Down Expand Up @@ -386,7 +388,7 @@ class SmtcWindowsImpl implements SmtcWindows {
return _platform.executeStream(FlutterRustBridgeTask(
callFfi: (port_) => _platform.inner.wire_smtc_button_press_event(port_, arg0),
parseSuccessData: _wire2api_String,
parseErrorData: null,
parseErrorData: _wire2api_FrbAnyhowException,
constMeta: kSmtcButtonPressEventConstMeta,
argValues: [
internal
Expand All @@ -407,7 +409,7 @@ class SmtcWindowsImpl implements SmtcWindows {
return _platform.executeStream(FlutterRustBridgeTask(
callFfi: (port_) => _platform.inner.wire_smtc_position_change_request_event(port_, arg0),
parseSuccessData: _wire2api_i64,
parseErrorData: null,
parseErrorData: _wire2api_FrbAnyhowException,
constMeta: kSmtcPositionChangeRequestEventConstMeta,
argValues: [
internal
Expand All @@ -428,7 +430,7 @@ class SmtcWindowsImpl implements SmtcWindows {
return _platform.executeStream(FlutterRustBridgeTask(
callFfi: (port_) => _platform.inner.wire_smtc_shuffle_request_event(port_, arg0),
parseSuccessData: _wire2api_bool,
parseErrorData: null,
parseErrorData: _wire2api_FrbAnyhowException,
constMeta: kSmtcShuffleRequestEventConstMeta,
argValues: [
internal
Expand All @@ -449,7 +451,7 @@ class SmtcWindowsImpl implements SmtcWindows {
return _platform.executeStream(FlutterRustBridgeTask(
callFfi: (port_) => _platform.inner.wire_smtc_repeat_mode_request_event(port_, arg0),
parseSuccessData: _wire2api_String,
parseErrorData: null,
parseErrorData: _wire2api_FrbAnyhowException,
constMeta: kSmtcRepeatModeRequestEventConstMeta,
argValues: [
internal
Expand Down Expand Up @@ -599,6 +601,11 @@ class SmtcWindowsPlatform extends FlutterRustBridgeBase<SmtcWindowsWire> {
return raw == null ? ffi.nullptr : api2wire_box_autoadd_i64(raw);
}

@protected
ffi.Pointer<wire_uint_8_list> api2wire_opt_uint_8_list(Uint8List? raw) {
return raw == null ? ffi.nullptr : api2wire_uint_8_list(raw);
}

@protected
ffi.Pointer<wire_uint_8_list> api2wire_uint_8_list(Uint8List raw) {
final ans = inner.new_uint_8_list_0(raw.length);
Expand Down Expand Up @@ -633,6 +640,7 @@ class SmtcWindowsPlatform extends FlutterRustBridgeBase<SmtcWindowsWire> {
wireObj.album = api2wire_opt_String(apiObj.album);
wireObj.album_artist = api2wire_opt_String(apiObj.albumArtist);
wireObj.thumbnail = api2wire_opt_String(apiObj.thumbnail);
wireObj.thumbnail_stream = api2wire_opt_uint_8_list(apiObj.thumbnailStream);
}

void _api_fill_to_wire_playback_timeline(PlaybackTimeline apiObj, wire_PlaybackTimeline wireObj) {
Expand Down Expand Up @@ -1063,6 +1071,8 @@ final class wire_MusicMetadata extends ffi.Struct {
external ffi.Pointer<wire_uint_8_list> album_artist;

external ffi.Pointer<wire_uint_8_list> thumbnail;

external ffi.Pointer<wire_uint_8_list> thumbnail_stream;
}

final class wire_PlaybackTimeline extends ffi.Struct {
Expand Down
Loading