Exemplo n.º 1
0
 /// <summary>
 /// Constructor to create a new DataStore for saving
 /// </summary>
 /// <param name="timeline">The current timeline</param>
 /// <param name="statusbar">The current StatusBar</param>
 /// <param name="pictureExplorer">The current picture explorer</param>
 /// <param name="musicExplorer">The current music explorer</param>
 /// <param name="exportData">The Settings of the export window</param>
 public DataStore(TimelineControl timeline, StatusbarControl statusbar, PictureExplorerControl pictureExplorer, MusicExplorerControl musicExplorer, ExportData exportData)
 {
     _timeline        = timeline;
     _statusBar       = statusbar;
     _pictureExplorer = pictureExplorer;
     _musicExplorer   = musicExplorer;
     ExportData       = exportData;
 }
        /// <summary>
        /// Changes the display time
        /// </summary>
        /// <param name="sender">event sender</param>
        /// <param name="e">event args</param>
        private void DisplayTime_ValueChanged(object sender, RoutedPropertyChangedEventArgs <object> e)
        {
            TimelineControl timeline = ((MainWindow)Application.Current.MainWindow).timeline;

            if (timeline == null)
            {
                return;
            }
            timeline.Marked.ResizeAndPush(timeline.Marked.StartTime + ((DisplayTime.Value ?? 0) / 10));
        }
        /// <summary>
        /// Transition time changed
        /// </summary>
        /// <param name="sender">event sender</param>
        /// <param name="e">event args</param>
        private void TransitionTime_ValueChanged(object sender, RoutedPropertyChangedEventArgs <object> e)
        {
            TimelineControl timeline = ((MainWindow)Application.Current.MainWindow).timeline;

            if (timeline == null)
            {
                return;
            }
            if (timeline.Marked.Transition != null)
            {
                timeline.Marked.Transition.ExecutionTime = TransitionTime.Value ?? 1000;
            }
        }
Exemplo n.º 4
0
 public TlMusikElementEnde(TimelineControl timeline, TimelineMusicElementControl start)
 {
     InitializeComponent();
     DataContext   = this;
     this.timeline = timeline;
     StartTime     = start.EndTime;
     EndTime       = start.EndTime + 20;
     MusicPath     = start.MusicPath;
     timeline.MainCanvas.Children.Add(this);
     Updateheight();
     update();
     Text.ToolTip = Path.GetFileName(start.MusicPath);
 }
        /// <summary>
        /// Delete this element
        /// </summary>
        /// <param name="sender">event sender</param>
        /// <param name="e">event args</param>
        private void Delete_Click(object sender, RoutedEventArgs e)
        {
            _loadingImg = null;
            if (loadWorker != null && loadWorker.IsBusy)
            {
                loadWorker.CancelAsync();
                loadWorker = null;
            }

            timeline.RemovePictureElement(this);
            timeline  = null;
            Thumbnail = null;
        }
        /// <summary>
        /// New object of the music element
        /// </summary>
        /// <param name="timeline">timeline the new element to be added</param>
        /// <param name="startTime">start time of the music element</param>
        /// <param name="endTime">end time of the music element</param>
        /// <param name="musicPath">path of the music element</param>
        public TimelineMusicElementControl(TimelineControl timeline, double startTime, double endTime, string musicPath)
        {
            InitializeComponent();
            DataContext    = this;
            this.timeline  = timeline;
            this.StartTime = startTime;
            this.EndTime   = endTime;
            this.MusicPath = musicPath;

            timeline.MainCanvas.Children.Add(this);
            updateHeight();
            update();
            Text.ToolTip = Path.GetFileName(musicPath);
        }
        /// <summary>
        /// Initializing new picture element
        /// </summary>
        /// <param name="timeline">added element to timeline</param>
        /// <param name="startTime">element start time</param>
        /// <param name="endTime">element end time</param>
        /// <param name="thumbnail">element thumbnail path</param>
        public TimelinePictureElementControl(TimelineControl timeline, double startTime, double endTime, string thumbnail)
        {
            InitializeComponent();
            this.timeline  = timeline;
            this.StartTime = startTime;
            this.EndTime   = endTime;
            this.Thumbnail = thumbnail;

            timeline.MainCanvas.Children.Add(this);
            UpdateHeight();
            Update();

            loadWorker                     = new BackgroundWorker();
            loadWorker.DoWork             += loadWorker_work;
            loadWorker.RunWorkerCompleted += loadWorker_completed;
            loadWorker.RunWorkerAsync();
        }
        /// <summary>
        /// Changes the selected transition
        /// </summary>
        /// <param name="sender">event sender</param>
        /// <param name="e">event args</param>
        private void Transition_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            TimelineControl timeline = ((MainWindow)Application.Current.MainWindow).timeline;

            if (timeline == null)
            {
                return;
            }
            Transition possibleNewTransition = SlideshowCreator.Transition.getByID(Transition.SelectedIndex);
            int        oldTime = timeline.Marked.Transition == null ? -1 : timeline.Marked.Transition.ExecutionTime;

            if (timeline.Marked.Transition == null || possibleNewTransition == null || timeline.Marked.Transition.GetType() != possibleNewTransition.GetType())
            {
                timeline.Marked.Transition = possibleNewTransition;
                if (oldTime > 0 && possibleNewTransition != null)
                {
                    timeline.Marked.Transition.ExecutionTime = oldTime;
                }
            }

            TransitionTime.IsEnabled = timeline.Marked.Transition != null;
        }