Mirage Source
Don't Restart Music (1/5) - Printable Version

+- Mirage Source (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: Source Code Development (https://mirage-engine.uk/forums/forumdisplay.php?fid=51)
+----- Forum: Mirage Source 4 (Visual Basic 6) (https://mirage-engine.uk/forums/forumdisplay.php?fid=44)
+------ Forum: Tutorials (https://mirage-engine.uk/forums/forumdisplay.php?fid=13)
+------ Thread: Don't Restart Music (1/5) (/showthread.php?tid=2512)



Don't Restart Music (1/5) - timster0 - 21-01-2009

Very Short and Easy C/P tut.

This will make it so if you change maps with the same music it won't restart the song.

In modDirectMusic7 add this under 'DirectMusic Variables:
Code:
Public CurrentSong As String

In your PlayMidi sub add this at the top:
Code:
If CurrentSong  FileName Then
CurrentSong = FileName

Don't forget to add an "End If" at the bottom.

In your StopMidi sub add this at the top:
Code:
CurrentSong = ""

I've tested this and it works.


Re: Don't Restart Music (1/5) - timster0 - 03-02-2009

Thank you. Smile