public SeekableTrackInfoDisplay()
        {
            Spacing = 3;

            Children.Add (cover_art = new CoverArtDisplay ());
            Children.Add (new StackPanel () {
                Orientation = Orientation.Vertical,
                Spacing = 4,
                Children = {
                    (title = new TextBlock () { Opacity = text_opacity }),
                    (seek_bar = new Slider ()),
                    (time_bar = new StackPanel () {
                        Spacing = 10,
                        Children = {
                            (elapsed = new TextBlock ()   { HorizontalAlignment = 0.0, Opacity = text_opacity + 0.25 }),
                            (seek_to = new TextBlock ()   { HorizontalAlignment = 0.5, Opacity = text_opacity + 0.25 }),
                            (remaining = new TextBlock () { HorizontalAlignment = 1.0, Opacity = text_opacity })
                        }
                    })
                }
            });

            seek_to.Opacity = 0;
            seek_to_animation = new DoubleAnimation ("Opacity");
            seek_to_animation.Repeat (1);

            seek_bar.PendingValueChanged += (o, e) => OnSeekPendingValueChanged (seek_bar.PendingValue);
            seek_bar.ValueChanged += (o, e) => OnSeekValueChanged (seek_bar.Value);

            UpdateMetadataDisplay ();
            BuildTransitionAnimation ();
        }
Exemple #2
0
        public SeekableTrackInfoDisplay()
        {
            Spacing = 3;

            Children.Add(cover_art = new CoverArtDisplay());
            Children.Add(new StackPanel()
            {
                Orientation = Orientation.Vertical,
                Spacing     = 4,
                Children    =
                {
                    (title                          = new TextBlock()
                    {
                        Opacity                     = text_opacity
                    }),
                    (seek_bar                       = new Slider()),
                    (time_bar                       = new StackPanel()
                    {
                        Spacing                     =          10,
                        Children                    =
                        {
                            (elapsed                = new TextBlock()
                            {
                                HorizontalAlignment =         0.0, Opacity = text_opacity + 0.25
                            }),
                            (seek_to                = new TextBlock()
                            {
                                HorizontalAlignment =         0.5, Opacity = text_opacity + 0.25
                            }),
                            (remaining              = new TextBlock()
                            {
                                HorizontalAlignment =         1.0, Opacity = text_opacity
                            })
                        }
                    })
                }
            });

            seek_to.Opacity          = 0;
            seek_to_animation        = new Animation();//"Opacity");
            seek_to_animation.Repeat = 1;

            seek_bar.PendingValueChanged += (o, e) => OnSeekPendingValueChanged(seek_bar.PendingValue);
            seek_bar.ValueChanged        += (o, e) => OnSeekValueChanged(seek_bar.Value);

            UpdateMetadataDisplay();
            BuildTransitionAnimation();
        }
 private void UpdateCoverArtDisplay ()
 {
     if (ShowCoverArt.Get ()) {
         if (cover_art_display == null && source_box != null) {
             cover_art_display = new CoverArtDisplay () { Visible = true };
             source_box.SizeAllocated += OnSourceBoxSizeAllocated;
             cover_art_display.HeightRequest = SourceViewWidth.Get ();
             source_box.PackStart (cover_art_container = TrackInfoDisplay.GetEditable (cover_art_display), false, false, 4);
             source_box.ShowAll ();
         }
     } else if (cover_art_display != null) {
         cover_art_display.Hide ();
         source_box.Remove (cover_art_container);
         source_box.SizeAllocated -= OnSourceBoxSizeAllocated;
         cover_art_display.Dispose ();
         cover_art_display = null;
     }
 }