Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
0
        public LayerPage()
        {
            this.InitializeComponent();
            Self = this;
            m_EffectInfoFrame = MainPage.Self.EffectInfoFrame;

            Layers = new ObservableCollection <LayerModel>();
            LayerListView.ItemsSource = Layers;
            LayerBackgroundItemsControl.ItemsSource = Layers;
            Layers.CollectionChanged += LayersChanged;
            InitializeCursor();
            playerModel = new PlayerModel();

            TimeTextBlockCollection = new List <TextBlock>();
            TimelineScaleInitialize();
            LayerZoomSlider.Value = 2;
        }