Beispiel #1
0
        private void TitleScrollViewer_ViewChanged(object sender, ScrollViewerViewChangedEventArgs e)
        {
            ScrollViewer sv = sender as ScrollViewer;

            TrackScrollViewer.ChangeView(null, sv.VerticalOffset, null, true);
            BackgroundScrollViewer.ChangeView(null, sv.VerticalOffset, null, true);
        }
Beispiel #2
0
        private async void PlayButton_Click(object sender, RoutedEventArgs e)
        {
            if (playerModel.Position >= RightmostPosition)
            {
                return;
            }

            Log.Debug("[PlayButton] Clicked");
            StorageFolder localfolder  = ApplicationData.Current.LocalFolder;
            string        scriptString = MainPage.Self.GetLastScript();

            StorageFile lastScriptSF = await localfolder.CreateFileAsync("LastScript.xml", Windows.Storage.CreationCollisionOption.ReplaceExisting);

            await Windows.Storage.FileIO.WriteTextAsync(lastScriptSF, scriptString);

            StorageFile playSF = await localfolder.CreateFileAsync("LastPlayScript.xml", Windows.Storage.CreationCollisionOption.ReplaceExisting);

            await Windows.Storage.FileIO.WriteTextAsync(playSF, scriptString);

            Log.Debug("[PlayButton] Save LastScript successfully : " + lastScriptSF.Path);

            long StartTime = (long)PositionToTime(playerModel.Position);

            Log.Debug("[PlayButton] Bef AuraEditorTrigger");
            Log.Debug("[PlayButton] StartTime : " + StartTime.ToString());
            await(new ServiceViewModel()).AuraEditorTrigger(StartTime);
            Log.Debug("[PlayButton] Aft AuraEditorTrigger");

            //ScrollWindowToBeginning();

            playerModel.IsPlaying = true;

            TrackScrollViewer.HorizontalScrollBarVisibility = ScrollBarVisibility.Hidden;
            TrackScrollViewer.HorizontalScrollMode          = ScrollMode.Disabled;

            if (playerModel.Position < TrackScrollViewer.HorizontalOffset)
            {
                TrackScrollViewer.ChangeView(playerModel.Position, null, null, true);
                playerModel.playerOffset = playerModel.Position + TrackScrollViewer.ActualWidth;
            }
            else
            {
                playerModel.playerOffset = TrackScrollViewer.HorizontalOffset + TrackScrollViewer.ActualWidth;
            }

            double from     = playerModel.Position;
            double to       = RightmostPosition;
            double duration = LayerPage.PositionToTime(to) - LayerPage.PositionToTime(from);

            StartCursorStoryboard(duration, from, to);
        }
Beispiel #3
0
        private async void CursorStoryboardCompleted(object sender, object e)
        {
            Log.Debug("[Player] Completed");
            playerModel.IsPlaying = false;
            playerModel.Position  = 0;

            // Blank mode
            StorageFolder localfolder = ApplicationData.Current.LocalFolder;
            StorageFile   localsf     = await localfolder.CreateFileAsync("LastScript.xml", Windows.Storage.CreationCollisionOption.ReplaceExisting);

            await Windows.Storage.FileIO.WriteTextAsync(localsf, "<root><header>AURA_Creator</header><version>1.0</version><effectProvider><period key=\"true\">0</period><queue /></effectProvider><viewport /><effectList /></root>");

            long StartTime = (long)PositionToTime(playerModel.Position);

            TrackScrollViewer.HorizontalScrollBarVisibility = ScrollBarVisibility.Visible;
            TrackScrollViewer.HorizontalScrollMode          = ScrollMode.Enabled;
            TrackScrollViewer.ChangeView(0, null, null, true);

            Log.Debug("[CursorStoryboardCompleted] Bef AuraEditorTrigger");
            await(new ServiceViewModel()).AuraEditorTrigger(0);
            Log.Debug("[CursorStoryboardCompleted] Aft AuraEditorTrigger");
        }
Beispiel #4
0
 private void ScrollWindowToBeginning()
 {
     TrackScrollViewer.ChangeView(0, null, null, true);
     ScaleScrollViewer.ChangeView(0, null, null, true);
 }