Skip to content

MusicPlus core: Song length, position seeking, and fading

mazmazz requested to merge public-musicplus-core into next

New music features to support other in-game features.

  • Song length and position seeking
  • Fading

Implementation

  • New #ifdef MUSICRATE 1000 to specify positioning in-code because musicland works in milliseconds, not tics
  • The position/seeking methods depend on a new music tag LENGTHMS=milliseconds
    • This tag is necessary because SDL Mixer can't detect song length.
    • This tag ensures that the position counter works correctly by not seeking past end of song.
    • The game spits a warning in DEVMODE 2 (detailed) if this tag is not present.
    • OGG, FLAC, and MP3 are supported. GME and MOD do not need this tag. MIDI cannot use this tag.

Music Length Tagger

In order for position seeking to work properly, music lumps must be tagged with LENGTHMS=. Use this utility to automatically tag each music in a given WADfile.

musicplus-demo on Windows does not need this because it uses SDL Mixer X to tell song length. Individual branches -- and any branch on Linux -- need this tag.

Edited by mazmazz

Merge request reports