-module(rockbox@types). -compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). -define(FILEPATH, "src/rockbox/types.gleam"). -export([playback_status_from_int/1, playback_status_to_int/1, repeat_mode_to_int/1, channel_config_to_int/1, insert_position_to_int/1, is_directory/1, track_decoder/0, album_decoder/0, artist_decoder/0, search_results_decoder/0, playlist_decoder/0, saved_playlist_decoder/0, saved_playlist_folder_decoder/0, smart_playlist_decoder/0, track_stats_decoder/0, bluetooth_device_decoder/0, volume_info_decoder/0, device_decoder/0, entry_decoder/0, system_status_decoder/0, eq_band_setting_decoder/0, replaygain_settings_decoder/0, compressor_settings_decoder/0, user_settings_decoder/0]). -export_type([playback_status/0, repeat_mode/0, channel_config/0, replaygain_type/0, insert_position/0, track/0, album/0, artist/0, search_results/0, playlist/0, saved_playlist/0, saved_playlist_folder/0, smart_playlist/0, track_stats/0, bluetooth_device/0, volume_info/0, device/0, entry/0, system_status/0, eq_band_setting/0, replaygain_settings/0, compressor_settings/0, user_settings/0]). -if(?OTP_RELEASE >= 27). -define(MODULEDOC(Str), -moduledoc(Str)). -define(DOC(Str), -doc(Str)). -else. -define(MODULEDOC(Str), -compile([])). -define(DOC(Str), -compile([])). -endif. ?MODULEDOC(" Domain types and JSON decoders shared across the SDK.\n"). -type playback_status() :: stopped | playing | paused | {unknown_status, integer()}. -type repeat_mode() :: repeat_off | repeat_all | repeat_one | repeat_shuffle | repeat_a_b. -type channel_config() :: stereo | stereo_narrow | mono | left_mix | right_mix | karaoke. -type replaygain_type() :: replaygain_track | replaygain_album | replaygain_shuffle. -type insert_position() :: next | after_current | last | first. -type track() :: {track, gleam@option:option(binary()), binary(), binary(), binary(), binary(), binary(), binary(), binary(), binary(), binary(), binary(), binary(), integer(), integer(), integer(), integer(), integer(), integer(), integer(), integer(), integer(), binary(), gleam@option:option(binary()), gleam@option:option(binary()), gleam@option:option(binary()), gleam@option:option(binary())}. -type album() :: {album, binary(), binary(), binary(), integer(), binary(), gleam@option:option(binary()), binary(), binary(), gleam@option:option(binary()), list(track())}. -type artist() :: {artist, binary(), binary(), gleam@option:option(binary()), gleam@option:option(binary()), list(track()), list(album())}. -type search_results() :: {search_results, list(artist()), list(album()), list(track()), list(track()), list(album())}. -type playlist() :: {playlist, integer(), integer(), integer(), integer(), integer(), integer(), integer(), list(track())}. -type saved_playlist() :: {saved_playlist, binary(), binary(), gleam@option:option(binary()), gleam@option:option(binary()), gleam@option:option(binary()), integer(), integer(), integer()}. -type saved_playlist_folder() :: {saved_playlist_folder, binary(), binary(), integer(), integer()}. -type smart_playlist() :: {smart_playlist, binary(), binary(), gleam@option:option(binary()), gleam@option:option(binary()), gleam@option:option(binary()), boolean(), binary(), integer(), integer()}. -type track_stats() :: {track_stats, binary(), integer(), integer(), gleam@option:option(integer()), gleam@option:option(integer()), integer()}. -type bluetooth_device() :: {bluetooth_device, binary(), binary(), boolean(), boolean(), boolean(), gleam@option:option(integer())}. -type volume_info() :: {volume_info, integer(), integer(), integer()}. -type device() :: {device, binary(), binary(), binary(), binary(), integer(), binary(), binary(), boolean(), gleam@option:option(binary()), boolean(), boolean(), boolean()}. -type entry() :: {entry, binary(), integer(), integer(), integer(), gleam@option:option(binary())}. -type system_status() :: {system_status, integer(), integer(), integer(), integer(), integer(), integer(), integer(), integer(), integer(), integer()}. -type eq_band_setting() :: {eq_band_setting, integer(), integer(), integer()}. -type replaygain_settings() :: {replaygain_settings, boolean(), integer(), integer()}. -type compressor_settings() :: {compressor_settings, integer(), integer(), integer(), integer(), integer(), integer()}. -type user_settings() :: {user_settings, binary(), integer(), integer(), integer(), integer(), integer(), integer(), boolean(), integer(), list(eq_band_setting()), replaygain_settings(), compressor_settings(), integer(), integer(), integer(), integer(), integer(), integer(), boolean(), integer(), integer(), integer(), integer(), integer(), boolean(), boolean(), boolean(), binary()}. -file("src/rockbox/types.gleam", 17). -spec playback_status_from_int(integer()) -> playback_status(). playback_status_from_int(Value) -> case Value of 0 -> stopped; 1 -> playing; 3 -> paused; Other -> {unknown_status, Other} end. -file("src/rockbox/types.gleam", 26). -spec playback_status_to_int(playback_status()) -> integer(). playback_status_to_int(Status) -> case Status of stopped -> 0; playing -> 1; paused -> 3; {unknown_status, N} -> N end. -file("src/rockbox/types.gleam", 43). -spec repeat_mode_to_int(repeat_mode()) -> integer(). repeat_mode_to_int(Mode) -> case Mode of repeat_off -> 0; repeat_all -> 1; repeat_one -> 2; repeat_shuffle -> 3; repeat_a_b -> 4 end. -file("src/rockbox/types.gleam", 62). -spec channel_config_to_int(channel_config()) -> integer(). channel_config_to_int(Config) -> case Config of stereo -> 0; stereo_narrow -> 1; mono -> 2; left_mix -> 3; right_mix -> 4; karaoke -> 5 end. -file("src/rockbox/types.gleam", 91). -spec insert_position_to_int(insert_position()) -> integer(). insert_position_to_int(Position) -> case Position of next -> 0; after_current -> 1; last -> 2; first -> 3 end. -file("src/rockbox/types.gleam", 287). ?DOC(" True when a directory bit (0x10) is set on the entry's attribute mask.\n"). -spec is_directory(entry()) -> boolean(). is_directory(Entry) -> ((erlang:element(3, Entry) div 16) rem 2) =:= 1. -file("src/rockbox/types.gleam", 362). -spec opt_string() -> gleam@dynamic@decode:decoder(gleam@option:option(binary())). opt_string() -> gleam@dynamic@decode:optional( {decoder, fun gleam@dynamic@decode:decode_string/1} ). -file("src/rockbox/types.gleam", 366). -spec opt_int() -> gleam@dynamic@decode:decoder(gleam@option:option(integer())). opt_int() -> gleam@dynamic@decode:optional( {decoder, fun gleam@dynamic@decode:decode_int/1} ). -file("src/rockbox/types.gleam", 370). -spec track_decoder() -> gleam@dynamic@decode:decoder(track()). track_decoder() -> gleam@dynamic@decode:optional_field( <<"id"/utf8>>, none, opt_string(), fun(Id) -> gleam@dynamic@decode:optional_field( <<"title"/utf8>>, <<""/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Title) -> gleam@dynamic@decode:optional_field( <<"artist"/utf8>>, <<""/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Artist) -> gleam@dynamic@decode:optional_field( <<"album"/utf8>>, <<""/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Album) -> gleam@dynamic@decode:optional_field( <<"genre"/utf8>>, <<""/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Genre) -> gleam@dynamic@decode:optional_field( <<"disc"/utf8>>, <<""/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Disc) -> gleam@dynamic@decode:optional_field( <<"trackString"/utf8>>, <<""/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Track_string) -> gleam@dynamic@decode:optional_field( <<"yearString"/utf8>>, <<""/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Year_string) -> gleam@dynamic@decode:optional_field( <<"composer"/utf8>>, <<""/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun( Composer ) -> gleam@dynamic@decode:optional_field( <<"comment"/utf8>>, <<""/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun( Comment ) -> gleam@dynamic@decode:optional_field( <<"albumArtist"/utf8>>, <<""/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun( Album_artist ) -> gleam@dynamic@decode:optional_field( <<"grouping"/utf8>>, <<""/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun( Grouping ) -> gleam@dynamic@decode:optional_field( <<"discnum"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun( Discnum ) -> gleam@dynamic@decode:optional_field( <<"tracknum"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun( Tracknum ) -> gleam@dynamic@decode:optional_field( <<"layer"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun( Layer ) -> gleam@dynamic@decode:optional_field( <<"year"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun( Year ) -> gleam@dynamic@decode:optional_field( <<"bitrate"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun( Bitrate ) -> gleam@dynamic@decode:optional_field( <<"frequency"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun( Frequency ) -> gleam@dynamic@decode:optional_field( <<"filesize"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun( Filesize ) -> gleam@dynamic@decode:optional_field( <<"length"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun( Length ) -> gleam@dynamic@decode:optional_field( <<"elapsed"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun( Elapsed ) -> gleam@dynamic@decode:optional_field( <<"path"/utf8>>, <<""/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun( Path ) -> gleam@dynamic@decode:optional_field( <<"albumId"/utf8>>, none, opt_string( ), fun( Album_id ) -> gleam@dynamic@decode:optional_field( <<"artistId"/utf8>>, none, opt_string( ), fun( Artist_id ) -> gleam@dynamic@decode:optional_field( <<"genreId"/utf8>>, none, opt_string( ), fun( Genre_id ) -> gleam@dynamic@decode:optional_field( <<"albumArt"/utf8>>, none, opt_string( ), fun( Album_art ) -> gleam@dynamic@decode:success( {track, Id, Title, Artist, Album, Genre, Disc, Track_string, Year_string, Composer, Comment, Album_artist, Grouping, Discnum, Tracknum, Layer, Year, Bitrate, Frequency, Filesize, Length, Elapsed, Path, Album_id, Artist_id, Genre_id, Album_art} ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ). -file("src/rockbox/types.gleam", 427). -spec album_decoder() -> gleam@dynamic@decode:decoder(album()). album_decoder() -> gleam@dynamic@decode:field( <<"id"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Id) -> gleam@dynamic@decode:optional_field( <<"title"/utf8>>, <<""/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Title) -> gleam@dynamic@decode:optional_field( <<"artist"/utf8>>, <<""/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Artist) -> gleam@dynamic@decode:optional_field( <<"year"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Year) -> gleam@dynamic@decode:optional_field( <<"yearString"/utf8>>, <<""/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Year_string) -> gleam@dynamic@decode:optional_field( <<"albumArt"/utf8>>, none, opt_string(), fun(Album_art) -> gleam@dynamic@decode:optional_field( <<"md5"/utf8>>, <<""/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Md5) -> gleam@dynamic@decode:optional_field( <<"artistId"/utf8>>, <<""/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Artist_id) -> gleam@dynamic@decode:optional_field( <<"copyrightMessage"/utf8>>, none, opt_string( ), fun( Copyright_message ) -> gleam@dynamic@decode:optional_field( <<"tracks"/utf8>>, [], gleam@dynamic@decode:list( track_decoder( ) ), fun( Tracks ) -> gleam@dynamic@decode:success( {album, Id, Title, Artist, Year, Year_string, Album_art, Md5, Artist_id, Copyright_message, Tracks} ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ). -file("src/rockbox/types.gleam", 456). -spec artist_decoder() -> gleam@dynamic@decode:decoder(artist()). artist_decoder() -> gleam@dynamic@decode:field( <<"id"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Id) -> gleam@dynamic@decode:optional_field( <<"name"/utf8>>, <<""/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Name) -> gleam@dynamic@decode:optional_field( <<"bio"/utf8>>, none, opt_string(), fun(Bio) -> gleam@dynamic@decode:optional_field( <<"image"/utf8>>, none, opt_string(), fun(Image) -> gleam@dynamic@decode:optional_field( <<"tracks"/utf8>>, [], gleam@dynamic@decode:list( track_decoder() ), fun(Tracks) -> gleam@dynamic@decode:optional_field( <<"albums"/utf8>>, [], gleam@dynamic@decode:list( album_decoder() ), fun(Albums) -> gleam@dynamic@decode:success( {artist, Id, Name, Bio, Image, Tracks, Albums} ) end ) end ) end ) end ) end ) end ). -file("src/rockbox/types.gleam", 466). -spec search_results_decoder() -> gleam@dynamic@decode:decoder(search_results()). search_results_decoder() -> gleam@dynamic@decode:optional_field( <<"artists"/utf8>>, [], gleam@dynamic@decode:list(artist_decoder()), fun(Artists) -> gleam@dynamic@decode:optional_field( <<"albums"/utf8>>, [], gleam@dynamic@decode:list(album_decoder()), fun(Albums) -> gleam@dynamic@decode:optional_field( <<"tracks"/utf8>>, [], gleam@dynamic@decode:list(track_decoder()), fun(Tracks) -> gleam@dynamic@decode:optional_field( <<"likedTracks"/utf8>>, [], gleam@dynamic@decode:list(track_decoder()), fun(Liked_tracks) -> gleam@dynamic@decode:optional_field( <<"likedAlbums"/utf8>>, [], gleam@dynamic@decode:list( album_decoder() ), fun(Liked_albums) -> gleam@dynamic@decode:success( {search_results, Artists, Albums, Tracks, Liked_tracks, Liked_albums} ) end ) end ) end ) end ) end ). -file("src/rockbox/types.gleam", 497). -spec playlist_decoder() -> gleam@dynamic@decode:decoder(playlist()). playlist_decoder() -> gleam@dynamic@decode:optional_field( <<"amount"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Amount) -> gleam@dynamic@decode:optional_field( <<"index"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Index) -> gleam@dynamic@decode:optional_field( <<"maxPlaylistSize"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Max_playlist_size) -> gleam@dynamic@decode:optional_field( <<"firstIndex"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(First_index) -> gleam@dynamic@decode:optional_field( <<"lastInsertPos"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Last_insert_pos) -> gleam@dynamic@decode:optional_field( <<"seed"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Seed) -> gleam@dynamic@decode:optional_field( <<"lastShuffledStart"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Last_shuffled_start) -> gleam@dynamic@decode:optional_field( <<"tracks"/utf8>>, [], gleam@dynamic@decode:list( track_decoder( ) ), fun(Tracks) -> gleam@dynamic@decode:success( {playlist, Amount, Index, Max_playlist_size, First_index, Last_insert_pos, Seed, Last_shuffled_start, Tracks} ) end ) end ) end ) end ) end ) end ) end ) end ). -file("src/rockbox/types.gleam", 526). -spec saved_playlist_decoder() -> gleam@dynamic@decode:decoder(saved_playlist()). saved_playlist_decoder() -> gleam@dynamic@decode:field( <<"id"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Id) -> gleam@dynamic@decode:field( <<"name"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Name) -> gleam@dynamic@decode:optional_field( <<"description"/utf8>>, none, opt_string(), fun(Description) -> gleam@dynamic@decode:optional_field( <<"image"/utf8>>, none, opt_string(), fun(Image) -> gleam@dynamic@decode:optional_field( <<"folderId"/utf8>>, none, opt_string(), fun(Folder_id) -> gleam@dynamic@decode:optional_field( <<"trackCount"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Track_count) -> gleam@dynamic@decode:optional_field( <<"createdAt"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Created_at) -> gleam@dynamic@decode:optional_field( <<"updatedAt"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Updated_at) -> gleam@dynamic@decode:success( {saved_playlist, Id, Name, Description, Image, Folder_id, Track_count, Created_at, Updated_at} ) end ) end ) end ) end ) end ) end ) end ) end ). -file("src/rockbox/types.gleam", 547). -spec saved_playlist_folder_decoder() -> gleam@dynamic@decode:decoder(saved_playlist_folder()). saved_playlist_folder_decoder() -> gleam@dynamic@decode:field( <<"id"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Id) -> gleam@dynamic@decode:field( <<"name"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Name) -> gleam@dynamic@decode:optional_field( <<"createdAt"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Created_at) -> gleam@dynamic@decode:optional_field( <<"updatedAt"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Updated_at) -> gleam@dynamic@decode:success( {saved_playlist_folder, Id, Name, Created_at, Updated_at} ) end ) end ) end ) end ). -file("src/rockbox/types.gleam", 555). -spec smart_playlist_decoder() -> gleam@dynamic@decode:decoder(smart_playlist()). smart_playlist_decoder() -> gleam@dynamic@decode:field( <<"id"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Id) -> gleam@dynamic@decode:field( <<"name"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Name) -> gleam@dynamic@decode:optional_field( <<"description"/utf8>>, none, opt_string(), fun(Description) -> gleam@dynamic@decode:optional_field( <<"image"/utf8>>, none, opt_string(), fun(Image) -> gleam@dynamic@decode:optional_field( <<"folderId"/utf8>>, none, opt_string(), fun(Folder_id) -> gleam@dynamic@decode:optional_field( <<"isSystem"/utf8>>, false, {decoder, fun gleam@dynamic@decode:decode_bool/1}, fun(Is_system) -> gleam@dynamic@decode:optional_field( <<"rules"/utf8>>, <<""/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Rules) -> gleam@dynamic@decode:optional_field( <<"createdAt"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Created_at) -> gleam@dynamic@decode:optional_field( <<"updatedAt"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun( Updated_at ) -> gleam@dynamic@decode:success( {smart_playlist, Id, Name, Description, Image, Folder_id, Is_system, Rules, Created_at, Updated_at} ) end ) end ) end ) end ) end ) end ) end ) end ) end ). -file("src/rockbox/types.gleam", 578). -spec track_stats_decoder() -> gleam@dynamic@decode:decoder(track_stats()). track_stats_decoder() -> gleam@dynamic@decode:field( <<"trackId"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Track_id) -> gleam@dynamic@decode:optional_field( <<"playCount"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Play_count) -> gleam@dynamic@decode:optional_field( <<"skipCount"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Skip_count) -> gleam@dynamic@decode:optional_field( <<"lastPlayed"/utf8>>, none, opt_int(), fun(Last_played) -> gleam@dynamic@decode:optional_field( <<"lastSkipped"/utf8>>, none, opt_int(), fun(Last_skipped) -> gleam@dynamic@decode:optional_field( <<"updatedAt"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Updated_at) -> gleam@dynamic@decode:success( {track_stats, Track_id, Play_count, Skip_count, Last_played, Last_skipped, Updated_at} ) end ) end ) end ) end ) end ) end ). -file("src/rockbox/types.gleam", 595). -spec bluetooth_device_decoder() -> gleam@dynamic@decode:decoder(bluetooth_device()). bluetooth_device_decoder() -> gleam@dynamic@decode:field( <<"address"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Address) -> gleam@dynamic@decode:optional_field( <<"name"/utf8>>, <<""/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Name) -> gleam@dynamic@decode:optional_field( <<"paired"/utf8>>, false, {decoder, fun gleam@dynamic@decode:decode_bool/1}, fun(Paired) -> gleam@dynamic@decode:optional_field( <<"trusted"/utf8>>, false, {decoder, fun gleam@dynamic@decode:decode_bool/1}, fun(Trusted) -> gleam@dynamic@decode:optional_field( <<"connected"/utf8>>, false, {decoder, fun gleam@dynamic@decode:decode_bool/1}, fun(Connected) -> gleam@dynamic@decode:optional_field( <<"rssi"/utf8>>, none, opt_int(), fun(Rssi) -> gleam@dynamic@decode:success( {bluetooth_device, Address, Name, Paired, Trusted, Connected, Rssi} ) end ) end ) end ) end ) end ) end ). -file("src/rockbox/types.gleam", 612). -spec volume_info_decoder() -> gleam@dynamic@decode:decoder(volume_info()). volume_info_decoder() -> gleam@dynamic@decode:field( <<"volume"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Volume) -> gleam@dynamic@decode:field( <<"min"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Min) -> gleam@dynamic@decode:field( <<"max"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Max) -> gleam@dynamic@decode:success( {volume_info, Volume, Min, Max} ) end ) end ) end ). -file("src/rockbox/types.gleam", 619). -spec device_decoder() -> gleam@dynamic@decode:decoder(device()). device_decoder() -> gleam@dynamic@decode:field( <<"id"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Id) -> gleam@dynamic@decode:optional_field( <<"name"/utf8>>, <<""/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Name) -> gleam@dynamic@decode:optional_field( <<"host"/utf8>>, <<""/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Host) -> gleam@dynamic@decode:optional_field( <<"ip"/utf8>>, <<""/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Ip) -> gleam@dynamic@decode:optional_field( <<"port"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Port) -> gleam@dynamic@decode:optional_field( <<"service"/utf8>>, <<""/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Service) -> gleam@dynamic@decode:optional_field( <<"app"/utf8>>, <<""/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(App) -> gleam@dynamic@decode:optional_field( <<"isConnected"/utf8>>, false, {decoder, fun gleam@dynamic@decode:decode_bool/1}, fun( Is_connected ) -> gleam@dynamic@decode:optional_field( <<"baseUrl"/utf8>>, none, opt_string( ), fun( Base_url ) -> gleam@dynamic@decode:optional_field( <<"isCastDevice"/utf8>>, false, {decoder, fun gleam@dynamic@decode:decode_bool/1}, fun( Is_cast_device ) -> gleam@dynamic@decode:optional_field( <<"isSourceDevice"/utf8>>, false, {decoder, fun gleam@dynamic@decode:decode_bool/1}, fun( Is_source_device ) -> gleam@dynamic@decode:optional_field( <<"isCurrentDevice"/utf8>>, false, {decoder, fun gleam@dynamic@decode:decode_bool/1}, fun( Is_current_device ) -> gleam@dynamic@decode:success( {device, Id, Name, Host, Ip, Port, Service, App, Is_connected, Base_url, Is_cast_device, Is_source_device, Is_current_device} ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ). -file("src/rockbox/types.gleam", 660). -spec entry_decoder() -> gleam@dynamic@decode:decoder(entry()). entry_decoder() -> gleam@dynamic@decode:field( <<"name"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Name) -> gleam@dynamic@decode:optional_field( <<"attr"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Attr) -> gleam@dynamic@decode:optional_field( <<"timeWrite"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Time_write) -> gleam@dynamic@decode:optional_field( <<"customaction"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Customaction) -> gleam@dynamic@decode:optional_field( <<"displayName"/utf8>>, none, opt_string(), fun(Display_name) -> gleam@dynamic@decode:success( {entry, Name, Attr, Time_write, Customaction, Display_name} ) end ) end ) end ) end ) end ). -file("src/rockbox/types.gleam", 669). -spec system_status_decoder() -> gleam@dynamic@decode:decoder(system_status()). system_status_decoder() -> gleam@dynamic@decode:optional_field( <<"resumeIndex"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Resume_index) -> gleam@dynamic@decode:optional_field( <<"resumeCrc32"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Resume_crc32) -> gleam@dynamic@decode:optional_field( <<"resumeElapsed"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Resume_elapsed) -> gleam@dynamic@decode:optional_field( <<"resumeOffset"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Resume_offset) -> gleam@dynamic@decode:optional_field( <<"runtime"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Runtime) -> gleam@dynamic@decode:optional_field( <<"topruntime"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Topruntime) -> gleam@dynamic@decode:optional_field( <<"dircacheSize"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Dircache_size) -> gleam@dynamic@decode:optional_field( <<"lastScreen"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Last_screen) -> gleam@dynamic@decode:optional_field( <<"viewerIconCount"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun( Viewer_icon_count ) -> gleam@dynamic@decode:optional_field( <<"lastVolumeChange"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun( Last_volume_change ) -> gleam@dynamic@decode:success( {system_status, Resume_index, Resume_crc32, Resume_elapsed, Resume_offset, Runtime, Topruntime, Dircache_size, Last_screen, Viewer_icon_count, Last_volume_change} ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ). -file("src/rockbox/types.gleam", 702). -spec eq_band_setting_decoder() -> gleam@dynamic@decode:decoder(eq_band_setting()). eq_band_setting_decoder() -> gleam@dynamic@decode:field( <<"cutoff"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Cutoff) -> gleam@dynamic@decode:field( <<"q"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Q) -> gleam@dynamic@decode:field( <<"gain"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Gain) -> gleam@dynamic@decode:success( {eq_band_setting, Cutoff, Q, Gain} ) end ) end ) end ). -file("src/rockbox/types.gleam", 709). -spec replaygain_settings_decoder() -> gleam@dynamic@decode:decoder(replaygain_settings()). replaygain_settings_decoder() -> gleam@dynamic@decode:field( <<"noclip"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_bool/1}, fun(Noclip) -> gleam@dynamic@decode:field( <<"type"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Type_) -> gleam@dynamic@decode:field( <<"preamp"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Preamp) -> gleam@dynamic@decode:success( {replaygain_settings, Noclip, Type_, Preamp} ) end ) end ) end ). -file("src/rockbox/types.gleam", 716). -spec compressor_settings_decoder() -> gleam@dynamic@decode:decoder(compressor_settings()). compressor_settings_decoder() -> gleam@dynamic@decode:field( <<"threshold"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Threshold) -> gleam@dynamic@decode:field( <<"makeupGain"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Makeup_gain) -> gleam@dynamic@decode:field( <<"ratio"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Ratio) -> gleam@dynamic@decode:field( <<"knee"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Knee) -> gleam@dynamic@decode:field( <<"releaseTime"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Release_time) -> gleam@dynamic@decode:field( <<"attackTime"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Attack_time) -> gleam@dynamic@decode:success( {compressor_settings, Threshold, Makeup_gain, Ratio, Knee, Release_time, Attack_time} ) end ) end ) end ) end ) end ) end ). -file("src/rockbox/types.gleam", 733). -spec user_settings_decoder() -> gleam@dynamic@decode:decoder(user_settings()). user_settings_decoder() -> gleam@dynamic@decode:optional_field( <<"musicDir"/utf8>>, <<""/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Music_dir) -> gleam@dynamic@decode:optional_field( <<"volume"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Volume) -> gleam@dynamic@decode:optional_field( <<"balance"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Balance) -> gleam@dynamic@decode:optional_field( <<"bass"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Bass) -> gleam@dynamic@decode:optional_field( <<"treble"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Treble) -> gleam@dynamic@decode:optional_field( <<"channelConfig"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Channel_config) -> gleam@dynamic@decode:optional_field( <<"stereoWidth"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Stereo_width) -> gleam@dynamic@decode:optional_field( <<"eqEnabled"/utf8>>, false, {decoder, fun gleam@dynamic@decode:decode_bool/1}, fun(Eq_enabled) -> gleam@dynamic@decode:optional_field( <<"eqPrecut"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun( Eq_precut ) -> gleam@dynamic@decode:optional_field( <<"eqBandSettings"/utf8>>, [], gleam@dynamic@decode:list( eq_band_setting_decoder( ) ), fun( Eq_band_settings ) -> gleam@dynamic@decode:field( <<"replaygainSettings"/utf8>>, replaygain_settings_decoder( ), fun( Replaygain_settings ) -> gleam@dynamic@decode:field( <<"compressorSettings"/utf8>>, compressor_settings_decoder( ), fun( Compressor_settings ) -> gleam@dynamic@decode:optional_field( <<"crossfadeEnabled"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun( Crossfade_enabled ) -> gleam@dynamic@decode:optional_field( <<"crossfadeFadeInDelay"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun( Crossfade_fade_in_delay ) -> gleam@dynamic@decode:optional_field( <<"crossfadeFadeInDuration"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun( Crossfade_fade_in_duration ) -> gleam@dynamic@decode:optional_field( <<"crossfadeFadeOutDelay"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun( Crossfade_fade_out_delay ) -> gleam@dynamic@decode:optional_field( <<"crossfadeFadeOutDuration"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun( Crossfade_fade_out_duration ) -> gleam@dynamic@decode:optional_field( <<"crossfadeFadeOutMixmode"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun( Crossfade_fade_out_mixmode ) -> gleam@dynamic@decode:optional_field( <<"crossfeedEnabled"/utf8>>, false, {decoder, fun gleam@dynamic@decode:decode_bool/1}, fun( Crossfeed_enabled ) -> gleam@dynamic@decode:optional_field( <<"crossfeedDirectGain"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun( Crossfeed_direct_gain ) -> gleam@dynamic@decode:optional_field( <<"crossfeedCrossGain"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun( Crossfeed_cross_gain ) -> gleam@dynamic@decode:optional_field( <<"crossfeedHfAttenuation"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun( Crossfeed_hf_attenuation ) -> gleam@dynamic@decode:optional_field( <<"crossfeedHfCutoff"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun( Crossfeed_hf_cutoff ) -> gleam@dynamic@decode:optional_field( <<"repeatMode"/utf8>>, 0, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun( Repeat_mode ) -> gleam@dynamic@decode:optional_field( <<"singleMode"/utf8>>, false, {decoder, fun gleam@dynamic@decode:decode_bool/1}, fun( Single_mode ) -> gleam@dynamic@decode:optional_field( <<"partyMode"/utf8>>, false, {decoder, fun gleam@dynamic@decode:decode_bool/1}, fun( Party_mode ) -> gleam@dynamic@decode:optional_field( <<"shuffle"/utf8>>, false, {decoder, fun gleam@dynamic@decode:decode_bool/1}, fun( Shuffle ) -> gleam@dynamic@decode:optional_field( <<"playerName"/utf8>>, <<""/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun( Player_name ) -> gleam@dynamic@decode:success( {user_settings, Music_dir, Volume, Balance, Bass, Treble, Channel_config, Stereo_width, Eq_enabled, Eq_precut, Eq_band_settings, Replaygain_settings, Compressor_settings, Crossfade_enabled, Crossfade_fade_in_delay, Crossfade_fade_in_duration, Crossfade_fade_out_delay, Crossfade_fade_out_duration, Crossfade_fade_out_mixmode, Crossfeed_enabled, Crossfeed_direct_gain, Crossfeed_cross_gain, Crossfeed_hf_attenuation, Crossfeed_hf_cutoff, Repeat_mode, Single_mode, Party_mode, Shuffle, Player_name} ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ).