The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: shingoushori on August 12, 2019, 08:21:44 AM

Title: can't replaying midi files which finished play using AVF_core-audio_midi
Post by: shingoushori on August 12, 2019, 08:21:44 AM
Hello
I found the little inconvenient thing, can't replaying midi files which finished play, at least using AVF_core-audio_midi.

So then, I submit fixing plans, they are 2 versions. on both of these, fixing by using setCurrentPosition method.
and differ points are timing,
・setCurrentPosintion at all time of when replay command occurs
・setCurrentPosintion only when replay command occurs and the time of current position exceeds the duration of target midi file

I hope this post is useful. thanks for reading.
Title: Re: can't replaying midi files which finished play using AVF_core-audio_midi
Post by: THLeaderH on August 12, 2019, 09:09:22 AM
Thank you, shingoushori. I'm using Mac and have a same problem. (Note that this problem occurs only on Mac.)

I'm not sure how it behaves on Windows and other operating systems, I like the former option of the two.
Title: Re: can't replaying midi files which finished play using AVF_core-audio_midi
Post by: prissi on August 17, 2019, 03:23:49 AM
Since I do not have a MAC, to be clear: Version 1 works well? I submitted this version.
Title: Re: can't replaying midi files which finished play using AVF_core-audio_midi
Post by: shingoushori on August 25, 2019, 10:17:54 AM
Thanks for consideration !

At least it will be improved so that it can be playing again.

But, the play command needs to be executed twice in order to actually playing again.
This is because it doesn't really play to the end during playback (This is another bug or Inevitable fate of core audio).
However, I think it is important to solve the problem of not playing again,
so I would appreciate it if you could adopt this plan for the time being.
Title: Re: can't replaying midi files which finished play using AVF_core-audio_midi
Post by: prissi on August 25, 2019, 01:00:49 PM
Please keep answer simple. I do not have a MAC, so I rely on your guys to submit patches. What change do you suggest?
Title: Re: can't replaying midi files which finished play using AVF_core-audio_midi
Post by: shingoushori on August 25, 2019, 01:28:46 PM
ok, Version 1 works well.
I'd like to suggest it.
Title: Re: can't replaying midi files which finished play using AVF_core-audio_midi
Post by: prissi on August 28, 2019, 01:50:24 PM
I though I submit it a while ago?
Title: Re: can't replaying midi files which finished play using AVF_core-audio_midi
Post by: shingoushori on September 03, 2019, 12:37:42 AM
However, it is not merged on
https://github.com/aburch/simutrans/blob/master/music/AVF_core-audio_midi.mm r8811
, as far as I can see.

Sorry if I have misunderstood.
Title: Re: can't replaying midi files which finished play using AVF_core-audio_midi
Post by: DrSuperGood on September 03, 2019, 01:27:08 AM
It appears that neither of the supplied diff files were submitted to the SVN on the 17th of August. Since another commit fixing random midi selection at startup was submitted then it is possible some confusion or an error occurred.
Title: Re: can't replaying midi files which finished play using AVF_core-audio_midi
Post by: prissi on September 16, 2019, 01:57:39 PM
Sorry, svn silently ignored it due to line ending issues after patching. Should now be in.