Skip to content

Conversation

@nift4
Copy link
Contributor

@nift4 nift4 commented Oct 10, 2025

*
* <p>b010 = audiophile
*/
public final byte field1Name;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to perfectly match the spec here - it might be a clearer API to have an IntDef that reflects the three possible values of unset, radio & audiophile.

Similarly, maybe a nested type structure would be clearer than name1A, name1B, name2A etc.

Something like:

public final class Mp3InfoReplayGain {

  public static final class GainField {
    public final @Name int name;
    public final @Originator int originator;
    public final int gain;
  }
  public final float peak;
  public final GainField field1;
  public final GainField field2;
}

public final long dataSize;

/** Whether this frame is the LAME variant of a Xing frame, and hence has ReplayGain data. */
public final boolean hasReplayGain;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar comment here, instead of a boolean controlling the presence of all the other fields, move them into a type that can then be nullable.

Maybe you can even re-use the Metadata.Entry subclass here? Instead of duplicating all the fields.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants