Esempio n. 1
0
        public static void PlaySongThenResumeCurrent(Song toPlay, bool songUsesGlobalContent)
        {
            mPreviousSong = mCurrentSong;
            mPreviousSongUsesGlobalContent = mIsSongUsingGlobalContent;

            mCurrentSong = toPlay;
            mIsSongUsingGlobalContent = songUsesGlobalContent;
            try
            {
                PlaySong(toPlay, false, songUsesGlobalContent);

#if WINDOWS_8 || UWP
                MethodInfo playMethod = typeof(AudioManager).GetMethod("PlaySong", new Type[1] {
                    typeof(Song)
                });
#else
                MethodInfo playMethod = typeof(AudioManager).GetMethod("PlaySong", BindingFlags.Public | BindingFlags.Static, null, new Type[1] {
                    typeof(Song)
                }, null);
#endif
                InstructionManager.Add(new StaticMethodInstruction(playMethod,
                                                                   new object[1] {
                    mPreviousSong
                },
                                                                   TimeManager.CurrentTime + toPlay.Duration.TotalSeconds));
            }
            catch
            {
                // stupid DRM
            }
        }
Esempio n. 2
0
        private void HandleCurrentFrameRecordClick(object sender, RoutedEventArgs e)
        {
            if (Renderer.RecordRenderBreaks)
            {
                ViewModel.RecordCurrentFrameRenderBreaks();
            }
            else
            {
                Renderer.RecordRenderBreaks = true;

                var   instruction = new DelegateInstruction(ViewModel.RecordCurrentFrameRenderBreaks);
                float delay       = .3f;
                instruction.TimeToExecute = FlatRedBall.TimeManager.CurrentTime + delay;

                InstructionManager.Add(instruction);
            }
        }
Esempio n. 3
0
        public void GetRenderBreaksFromEngine()
        {
            if (FlatRedBall.Graphics.Renderer.RecordRenderBreaks)
            {
                GetRenderBreaksFromEngineInternal();
            }
            else
            {
                FlatRedBall.Graphics.Renderer.RecordRenderBreaks = true;

                var   instruction = new DelegateInstruction(GetRenderBreaksFromEngineInternal);
                float delay       = .3f;
                instruction.TimeToExecute = FlatRedBall.TimeManager.CurrentTime + delay;


                InstructionManager.Add(instruction);
            }
        }