Menu

MIDI looping

2009-01-21
2013-04-26
  • Jorge Giner Cordero

    Hi, first of all, congratulations for this great project.

    I write regarding a problem in playing a midi with loop. Currently midi music don't loop. The file microemu-midp/src/main/java/javax/microedition/media/MidiAudioPlayer.java is not implementing this correctly. MIDP says that calling setLoopCount() with a value of -1 should make the music to loop. The changes to allow this are easy; in that file, change this:

        public void meta( MetaMessage event )
        {
            if (event.getType() == 47) //End of Track type
            {
                iLoopCount--;
                if( iLoopCount > 0 )
                {
               

    by this

        public void meta( MetaMessage event )
        {
            if (event.getType() == 47) //End of Track type
            {
            if (iLoopCount > 0)
                    iLoopCount--;
                if( iLoopCount > 0 || iLoopCount == -1)
               
    and it will work :)

    Thank you.

     
    • Bartek Teodorczyk

      Thanks for the fix, it is commited to the SVN trunk.

       

Log in to post a comment.