Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- track_player.h
- supports per font (or common) track player function
- note: for each font where you want their own tracks to play, please make sure
- your preset has a font search path, and that you add the track folder like so:
- ;font/tracks
- then create your tracks folder under that font, and populate it with 00xx.wav files
- note: if you want to share common tracks between fonts, try something like this:
- ;common/tracks
- */
- // track_player uses its own button to start playing trackXX.wav files
- // found anywhere in the font search path (see install info above)
- // TRIGGER + POINT UP to play NEXT track, TRIGGER + POINT DOWN to play PREV track
- // the original music trigger button STOPS the new track_player
- // and will also start/stop the original track player
- // another mode
- // check when track is finished, start the other track
- // until all are played through, then stop
- // next and previous track
- if (pointing_down_)
- {
- // PREV track
- playNumber--;
- if (playNumber <1)
- {
- playNumber=10;
- ::CommandParser::DoParse("play", "next.wav");
- }
- else
- ::CommandParser::DoParse("play", "prev.wav");
- }
- else
- {
- // NEXT track
- playNumber++;
- if (playNumber >10)
- {
- playNumber=1;
- ::CommandParser::DoParse("play", "prev.wav");
- }
- else
- ::CommandParser::DoParse("play", "next.wav");
- }
- // track selection
- if (playNumber > 9)
- {
- playFile = "track10.wav";
- }
- else if (playNumber > 8)
- {
- playFile = "track09.wav";
- }
- else if (playNumber > 7)
- {
- playFile = "track08.wav";
- }
- else if (playNumber > 6)
- {
- playFile = "track07.wav";
- }
- else if (playNumber > 5)
- {
- playFile = "track06.wav";
- }
- else if (playNumber > 4)
- {
- playFile = "track05.wav";
- }
- else if (playNumber > 3)
- {
- playFile = "track04.wav";
- }
- else if (playNumber > 2)
- {
- playFile = "track03.wav";
- }
- else if (playNumber > 1)
- {
- playFile = "track02.wav";
- }
- else
- {
- playFile = "track01.wav";
- }
- // play sequential track
- ::CommandParser::DoParse("play_track", playFile);
Advertisement
Add Comment
Please, Sign In to add comment