Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add #NEXTSONG kind of directive #28

Open
bazz1tv opened this issue Jun 18, 2017 · 0 comments
Open

Add #NEXTSONG kind of directive #28

bazz1tv opened this issue Jun 18, 2017 · 0 comments

Comments

@bazz1tv
Copy link
Owner

bazz1tv commented Jun 18, 2017

As of now, only the #SONG n directive exists, which requires a hard-coded index for each and every song. I don't like it. For my coding style I need something less explicit and more dynamic and automated.

With this dynamic style, if songs (which in itself is a misleading directive name, as you could put any audio there including SFX. so yeah, I might actually rename the whole directive to something like ENTRY) were to be "un-included" based on the existence of definitions, then a song list can still be created "without gaps"

I would like to create the option to dynamically set the song indices. In fact, simply adding support for the #SONG directive without an argument would be sufficient

#SONG 1
#INCLUDE "song1.mml"
#SONG
#INCLUDE "song2.mml"

#SONG 50
#INCLUDE "sfx.mml"
#SONG
#INCLUDE "sfx2.mml"

In this case, song2 would be given the index of 2, and sfx2 would have an index of 51

Implementation Notes

  • have song_index state variable, set to 1 at startup
  • if a #SONG directive is encountered with an argument, set the song_index to that argument
  • if a #SONG directive is encountered without an argument, increment the song_index and set that song's index to the incremented value.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant