Game Development Community

VMPlayer and FullScreen Bug

by Kevin Epps · in Torque Game Builder · 03/28/2007 (8:41 pm) · 9 replies

Has anyone else experience a bug using VMPlayer when they toggle Fullscreen? I can't control the volume or switch songs when I toggle Fullscreen. Any ideas on a fix?

#1
03/28/2007 (9:22 pm)
Kevin, does this only happen when SWITCHING from windowed mode to fullscreen, or does this occur even if the game starts in fullscreen?

BTW, I posted the same question to my resource, but it would probably be best to keep this conversation to this thread, until we find a solution.
#2
03/28/2007 (9:24 pm)
Oh ok, yeah I just replied to the resource as well.

Yeah it only happens when I switch.
#3
03/28/2007 (9:26 pm)
Hmmm, ok. I'll take a look at this this weekend and see what I can come up with.
#4
03/28/2007 (9:27 pm)
Ok, Great! Thanks, Robert!
#5
04/01/2007 (4:31 pm)
Kevin, I'm having troubles re-producing this issue. Can you give me a little more info on what you're seeing on your end?

1) Does VMPlayer switch songs automatically but not manually, or does no other songs play after the current song ends?

2) If you manually try to switch songs by typing $VMPlayer.SkipForward(); into the console, does any error messages appear, or does the command appear to execute successfully?

3) If you type echo($VMPlayer.SkipForward()); does it print 1 to the screen or 0?

4) Do you experience the same issue if you manually create a VMPlayer instance with playlists through the console, rather than automated through scripts?
#6
04/01/2007 (5:37 pm)
This is what I did.

I set 'isLooping' to true because I get a better loop out of the music. I commented out the following in the CheckSongPosition function:

if (alxIsPlaying(%musicplayer.CurrentMusicChannel.AudioHandle))
   {
      %end_pos = %musicplayer.GetSongDuration();

      // Events, fading, crossfading doesn't work on non-streaming files.
      if (%musicplayer.Streaming == true)
      {
         // See if we need to switch tracks
         if (%pos >= %musicplayer.GetSongDuration())
         {
            %musicplayer.Stop();
            VMPlayerNextTrack(%musicplayer);
            return;
         }

         // See if we need to fade/cross fade
         if (%musicplayer.IsPlaylistLoaded() && %musicplayer.IsCrossFadeEnabled() && (%musicplayer.NextTrackIndex + 1 < %musicplayer.NextTracks.GetCount() || %musicplayer.IsRepeatEnabled()) && %end_pos - %pos <= %musicplayer.FadeDuration)
         {
            %musicplayer.NextTrackPause = false;
            VMPlayerScheduleNextTrack(%musicplayer);
            return;
         }
         else if (%musicplayer.IsFadeEnabled() && %end_pos - %pos <= %musicplayer.FadeDuration)
         {
            %musicplayer.NextTrackPause = false;
            VMPlayerScheduleNextTrack(%musicplayer);
            return;
         }
      }
      
      %musicplayer.CheckSongPosHandle = schedule($VMPlayerCheckSongPosIntervalMS, 0, VMPlayerCheckSongPosition, %musicplayer);
   }
   else
   {
      // Since we aren't playing we DEFINATELY need to switch tracks
      %musicplayer.Stop();
      %musicplayer.NextTrackPause = false;
      VMPlayerNextTrack(%musicplayer);
   }

Because I didn't want it automatically going to the next song, rather I select the track to use using the PlayTrack() function.

When I go fullscreen, and I try to PlayTrack(), it will either:

Just keep playing the same song
Fade out like it should, start some of the next song, then go back to previous song where it left off
I have a slider to control the volume, that won't work either.
When I echo out the function calls, I get a 1

The reason I've done what I've done because I really like the fadein and fadeout functions and would like to continue using those. But, I don't like the way the song repeats, hence why I set 'isLooping' to true, and commented out that line of code.
#7
04/03/2007 (10:19 am)
Ok, I'll try doing the same and see if I can duplicate your issue. Unfortunately, I'm away on business for the rest of this week, so it will need to wait until I get back this weekend.
#8
04/03/2007 (10:21 am)
Oh ok, great! I'll be busy this week, too. So when you get back is fine with me.
#9
04/05/2007 (10:03 pm)
I came up with a workaround for it.

If it's playing, I just pretty much, get the current track and song position, then change to fullscreen, after the fullscreen function, I stop the player, reinitialize it and set it to it's current track and position. If it's paused, I get the current track, and after toggling screens, I set it to that track and pause it.

Everything works fine.