1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980(*****************************************************************************)(* *)(* Copyright (C) 2026 Yves Ndiaye *)(* *)(* This Source Code Form is subject to the terms of the Mozilla Public *)(* License, v. 2.0. If a copy of the MPL was not distributed with this *)(* file, You can obtain one at https://mozilla.org/MPL/2.0/. *)(* *)(*****************************************************************************)(** Operations on fields. *)(** type of the fields. *)typet=|FTitle|FArtist|FAlbum|FTitleSort|FAlbumArtist|FArtistSort|FAlbumSort|FTrack|FYear|FDisc|FCover|FGenre|FComment(** [compare lhs rhs] is [Stdlib.compare lhs rhs]. *)letcompare:t->t->int=Stdlib.compare(** [equal lhs rhs] is [Stdlib.( = ) lhs rhs]. *)letequal:t->t->bool=(=)(** [to_string f] is the string representation of [f]. *)letto_string=function|FTitle->"title"|FArtist->"artist"|FAlbum->"album"|FAlbumArtist->"album-artist"|FTitleSort->"title-sort"|FArtistSort->"artist-sort"|FAlbumSort->"album-sort"|FTrack->"track"|FYear->"year"|FDisc->"disc"|FCover->"cover"|FGenre->"genre"|FComment->"comment"(** [choices] is all fields associated with their string representation. *)letchoices=[("title",FTitle);("artist",FArtist);("album",FAlbum);("album-artist",FAlbumArtist);("title-sort",FTitleSort);("artist-sort",FArtistSort);("album-sort",FAlbumSort);("track",FTrack);("year",FYear);("disc",FDisc);("cover",FCover);("genre",FGenre);("comment",FComment);]