• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

My Midiplayer isn't looping

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can only figure it has something to do with the methods I'm using. The music would play, then when it reaches the end of the track, the looping method picks that up.

But for some reason, it executes both the if and else blocks.

In other words, the music plays, then when its supposed to loop again, it stops and terminates.


Here are the codes. This is the client class where the looping fails.




And this is the utility class.

 
Bartender
Posts: 4179
22
IntelliJ IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the utility class where you control the looping, you simply call sequence.start(). The start method API says this:

Since the playback has just completed, the current position would be at the end of your MIDI sequence. You need to re-set the sequence. I think the best way to do that is to use:

But I wonder why you don't use the MIDI Sequencer's inbuilt looping?
reply
    Bookmark Topic Watch Topic
  • New Topic