Skip to content

Instantly share code, notes, and snippets.

@Oleksiy-Yakovenko
Last active October 5, 2016 09:22
Show Gist options
  • Save Oleksiy-Yakovenko/e5fdbb56bd3b9ac7191843bffc17725b to your computer and use it in GitHub Desktop.
Save Oleksiy-Yakovenko/e5fdbb56bd3b9ac7191843bffc17725b to your computer and use it in GitHub Desktop.
ReplayGain Scanner Temp Data Storage

The Problem

After the scanner finished, the user may decide to close the scan results window, and write the calculated RG info to the file tags later, via the context menu.

This requires storing the data in some temporary storage.

E.g. store as hidden fields in track metadata, and transfer from there to the "real" RG info storage when applied.

There are complications here:

  1. The tags could be written from 2 places: from the Scan Results window, and from the context menu
  2. Multiple scanner instances may be running on the same tracks in parallel, and may overwrite the temp storage

Possible workarounds

Prevent scanning the same tracks in multiple scanner instances. We have the list of all scanners, and it is possible to make sure there's no overlap, before starting a new scanner.

Writing existing data from context menu should also start a scanner instance, but in a special mode "no scan, just write tags".

To make sure tag writing for all scanned tracks is unified, another method should be added to the rg_scanner API, working on the same ddb_rg_scanner_settings_t.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment