MobileSheets Forums

Full Version: (ChordPro) Scrolling to sections
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
In ChordPro, song parts may be identified as sections, e.g.

{start_of_verse Verse1}
...lyrics and chords
{start_of_chorus Chorus}

Would it be possible (i.e. implementable with not too much effort) to use these sections as jump locations?
What I have in mind is a kind of scroll function that, when pressing the pedal, moves the next section to the top of the page.

As usual, an image tells more than 1000 words.


Rationale is that I think it is easier to keep track of where you are on the page, especially if someone else is pressing the pedal for you.

Foreseeable complications:
  • Only applies to ChordPro files that have sections.
  • Selectable per song?
  • Scroll to the next section only if this section is already (partly) visible.

What do you think?
Just at a high level, yes, I think it should be possible to make that work. I currently store position information for every single word/chord on the screen, so I should already have the position information for the sections (although I may need to add some additional code to store the section headers separately so that I can easily reference them). When using the vertical scrolling display mode, I already have a method that I can invoke to scroll the page to a certain pixel position. So I would just need to invoke that method with the position of the next section header along with a little bit of a margin so that the word isn't aligned with the very top of the screen. I would also have to add some code to figure out, based on the current scroll position and page number, what the next section header is, which actually would probably be the most amount of work. The other thing I'd have to handle is how to process things when using other display modes (single page, two page, half page), as I should probably still turn pages even if scrolling isn't possible. With the single page display mode, scrolling may be possible if the user has zoomed in or is using the half page display mode. So I'd just have to make sure to support this feature in all modes in whatever way makes sense.

Sounds interesting.

In addition (or instead) we could add a special directive to designate a jump location, e.g.

{mark: label}

'Official' defintion: Marks a location in the song. It is up to the viewing and rendering programs to do something sensible with this information.