Пример #1
0
        /// <summary>
        /// Event Handler for SelectedCaption.PropertyChanged. Updates controls when the selected
        /// Caption is changed from other parts of the program.
        /// </summary>
        /// <param name="sender">Sender</param>
        /// <param name="e">Event Args</param>
        private void SelectedCaption_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            //Switch based on property name
            switch (e.PropertyName)
            {
            case Caption.PropertyNames.Alignment:     break;

            case Caption.PropertyNames.Begin:         break;

            case Caption.PropertyNames.End:           break;

            case Caption.PropertyNames.Location: SetGB_Location(SelectedCaption.Location); break;

            case Caption.PropertyNames.Duration:      break;

            case Caption.PropertyNames.Speaker:       break;

            case Caption.PropertyNames.Text: CaptionTextBox.Text = SelectedCaption.Text; break;

            case Caption.PropertyNames.Words:         break;

            default: throw new ArgumentException(string.Format("Property Name '{0}' isn't a valid property",
                                                               e.PropertyName), "e");
            }

            //Update Caption in CaptionView
            CaptionView.Invalidate();
            //Update Timeline
            Timeline.Redraw();
        }
Пример #2
0
        public MainPage()
        {
            InitializeComponent();
            players = new ComposerControlHelper();

            jwSkinPackage            = new JwSkinPackage();
            jwSkinPackage.SkinReady += JwSkinPackageSkinPackageReady;

            Player.MouseLeftButtonUp += Player_MouseLeftButtonUp;
            Player.Cursor             = Cursors.Hand;

            bridge = new HtmlInteraction(this);
            bridge.AddBinding(Player);

            if (!String.IsNullOrEmpty(srcPlaylist))
            {
                Player.LoadPlaylist(srcPlaylist);
            }

            AddBinding(Player);
            ControlBarView.AddBinding(Player);
            DisplayView.AddBinding(Player);
            DockView.AddBinding(Player);
            PlaylistView.AddBinding(Player);
            CaptionView.AddBinding(Player);

            DockView.CaptionVisibilityChanged += DockView_CaptionVisibilityChanged;

            controlBarFader = new OpacityFader(ControlBarView);
            dockFader       = new OpacityFader(DockView);
            SetFadeTimer();
            CaptionView.Margin = new Thickness(0, 0, 0, 75);            // we don't know the height until images are all loaded... take a guess for now!
        }
Пример #3
0
        /// <summary>
        /// Handles the CaptionTimestampChanged Event. Updates the captions in CaptionView.
        /// </summary>
        /// <param name="sender">Sender</param>
        /// <param name="e">Event Args</param>
        private void Timeline_CaptionTimestampChanged(object sender, TimelineCaptionTimestampChangedEventArgs e)
        {
            //Console.WriteLine("Caption Timestamp Changed!");

            //Force Captionview to be repainted
            CaptionView.Invalidate();
        }
Пример #4
0
 /// <summary>
 /// Adds a row to the CaptionView.
 /// </summary>
 /// <param name="sender">Sender</param>
 /// <param name="e">Event Args</param>
 private void addCaptionToolStripMenuItem_Click(object sender, EventArgs e)
 {
     CaptionView.AddRow();
 }
Пример #5
0
 /// <summary>
 /// Moves the currently selected caption one row down in CaptionView
 /// </summary>
 /// <param name="sender">Sender</param>
 /// <param name="e">Event Args</param>
 private void Button_MoveRowDown_Click(object sender, EventArgs e)
 {
     CaptionView.MoveRowDown();
 }
Пример #6
0
 /// <summary>
 /// Deletes the currently selected rows.
 /// </summary>
 /// <param name="sender">Sender</param>
 /// <param name="e">Event Args</param>
 private void Button_DeleteRow_Click(object sender, EventArgs e)
 {
     CaptionView.DeleteSelectedRows();
 }
Пример #7
0
 /// <summary>
 /// Inserts a new row below the selected caption in CaptionView.
 /// </summary>
 /// <param name="sender">Sender</param>
 /// <param name="e">Event Args</param>
 private void Button_InsertRow_Click(object sender, EventArgs e)
 {
     CaptionView.AddRow();
 }
Пример #8
0
 /// <summary>
 /// Initializes the CaptionView. Everything related to CaptionView initialization should
 /// go in this method.
 /// </summary>
 private void InitCaptionView()
 {
     CaptionView.InitColumns();  //Set up columns
     CaptionView.SpeakerSet = SpeakerSet;
     CaptionView.CaptionSource = CaptionList;
 }
Пример #9
0
 /// <summary>
 /// Handles the CaptionMoved Event. Updates the captions in CaptionView.
 /// </summary>
 /// <param name="sender">Sender</param>
 /// <param name="e">Event Args</param>
 private void Timeline_CaptionMoved(object sender, EventArgs e)
 {
     //Force Captionview to be repainted
     CaptionView.Invalidate();
 }