jacquesh / foo_openlyrics

An open-source lyric display panel for foobar2000
MIT License
449 stars 26 forks source link

Add support for title formatting in "Tags to which lyrics will be saved" #405

Open FPChaim opened 2 months ago

FPChaim commented 2 months ago

Title formatting would allow for automating the prefered tag to where the lyrics are saved based on the current playing song according to the user necessities while not changing the default behavior for "casual" users. Also I believe this shouldn't be too difficult to implement because it should be similar to the "File name format" in the "Local files" settings and the "Skip filter" in the "Search" settings.

The reason I want this is because my music library is shared between foobar2000, Mp3tag and Poweramp and to get the maximum compatibility between then I have to change the tagging field according to the tagging standard each time I change between songs that use different tagging standards. For example, Mp3tag reads the USLT ID3v2.x frame for a mp3 file, which means I have to use UNSYNCED LYRICS in foobar2000, while I have to use LYRICS for m4a files and UNSYNCEDLYRICS for flac, ogg and opus for the lyrics to appear as a standard field in Mp3tag. Visually: File type Tag field
m4a LYRICS
mp3 UNSYNCED LYRICS
everthing else (flac, ogg, opus) UNSYNCEDLYRICS

So, in this case I would use a code that's something like this in the "Tags to which lyrics will be saved" preference page: $puts(lyrics_type,UNSYNCEDLYRICS)$if($stricmp($ext(%filename_ext%),m4a),$puts(lyrics_type,LYRICS))$if($stricmp($ext(%filename_ext%),mp3),$puts(lyrics_type,UNSYNCED LYRICS))$get(lyrics_type) This would set the tag according to the file type while fallbacking to UNSYNCEDLYRICS for safety.

Current preference page for "Metadata tags": preferences_current Proposed (concept): preferences_after

Thanks in advance!