Help - Search - Members - Calendar
Full Version: Storing replaygain metadata in tags
Hydrogenaudio Forums > Hosted Forums > foobar2000 > Development - (fb2k)
oshah
I'm creating a component for an input format. This format has the ability to store metadata tags directly within the file (as XML). To retrieve the metadata, I'm using the get_info function. For storing it, I'm using retag_set_info, and for actually writing the file, I use retag_commit.

While I can retrieve/store the meta and info parts quite easily, I'm having trouble retrieving/storing the replaygain_info. It seems to be a separate object, consisting of a number of methods.

What parts of the replaygain_info should I store in the file? And how would I set the replaygain info when the file is reloaded?
foosion
QUOTE(oshah @ May 8 2006, 01:50) *
While I can retrieve/store the meta and info parts quite easily, I'm having trouble retrieving/storing the replaygain_info. It seems to be a separate object, consisting of a number of methods.
In the end, there are only four values contained in a replaygain_info struct: album gain, album peak, track gain, and track peak. The various methods are used to get, set or check the validity of those four values.

QUOTE(oshah @ May 8 2006, 01:50) *
What parts of the replaygain_info should I store in the file?
You should store all parts that are present, and wipe the parts that are not present from your file.

QUOTE(oshah @ May 8 2006, 01:50) *
And how would I set the replaygain info when the file is reloaded?
The file_info object passed to the input_info_reader::get_info() method contains a method set_replaygain() which you should use for this purpose.
oshah
Oh, okay. Just one more question...
There's a function called replaygain_info::set_from_meta. Will I be able to use this function to move replaygain info to the meta section?
foosion
I'm not sure what you mean, but the source code of this method is included in the SDK, so you can read it and decide if it does what you want.
oshah
QUOTE(foosion @ May 8 2006, 11:50) *

I'm not sure what you mean, but the source code of this method is included in the SDK, so you can read it and decide if it does what you want.

I'm primarily interested in this function because it may allow me to integrate the replaygain data into the meta part of file_info. That way I can just use meta_enum_* to save both replaygain and metadata info in one go.

On another note, if I forget to call set_replaygain to fill out the replaygain stuff, will the core make use of replaygain_info.set_from_meta to get the replaygain info from the meta section?
oshah
QUOTE(oshah @ May 8 2006, 12:25) *

On another note, if I forget to call set_replaygain to fill out the replaygain stuff, will the core make use of replaygain_info.set_from_meta to get the replaygain info from the meta section?

Never mind, I've coded my component so it doesn't have to rely on what the core does.
Thank you all.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.