thebigg73 / OpenSongTablet

Android port of OpenSong. Use your mobile device as a portable song book. Gareth Evans
GNU General Public License v3.0
32 stars 23 forks source link

App crashes if using pads and song key is Hm #256

Closed dr953 closed 5 months ago

dr953 commented 7 months ago

If pads are used and a song is in a key of H minor (probably the same for major) the app crashes instantly and each time.

Probably because it does not recognize the key of H, but only B.

The fix could be maybe as simple as adding a line in Pad.java: private AssetFileDescriptor getAssetPad(String key) key = key.replace("H","B");

To work with custom pads also, I guess the same should be added to Pad.java: private String keyToFlat(String key) .replace("H","B")

In the latter case, a function rename would make sense as H->B has nothing to do with flats.

thebigg73 commented 5 months ago

Has the key been set to H or Hmin in the desktop version of the app? OpenSongApp shouldn't allow this to be set as the key (although it should deal with H/H min chords) and only allows standard (non B/H) keys to be set using the dropdowns.

I've added in these changes for the next version, although they may not behave as expected. https://github.com/thebigg73/OpenSongTablet/commit/8e0e0517144c18249d036652eeb076c078abcd19