Exemplo n.º 1
0
        private void BuildNowPlaying()
        {
            var box = new MeeGoHeaderBox()
            {
                Title = Catalog.GetString("Now Playing")
            };

            var seek_slider = new ConnectedSeekSlider(SeekSliderLayout.Horizontal);

            seek_slider.StreamPositionLabel.FormatString = "<small>{0}</small>";

            track_info_display = new MeeGoTrackInfoDisplay()
            {
                HeightRequest = 64,
                NoShowAll     = true
            };

            track_view = new TerseTrackListView()
            {
                Name         = "meego-panel-tracks",
                WidthRequest = 220
            };
            track_view.ColumnController.Insert(new Column(null, "indicator",
                                                          new ColumnCellStatusIndicator(null), 0.05, true, 20, 20), 0);

            box.PackStartHighlighted(track_info_display, false, false, 0, MeeGoHeaderBox.HighlightFlags.Background);
            box.PackStartHighlighted(seek_slider, false, false, 0, MeeGoHeaderBox.HighlightFlags.Background);
            box.PackStart(SetupView(track_view), true, true, 0);
            box.PackStartHighlighted(new PlaybackBox(), false, false, 0, MeeGoHeaderBox.HighlightFlags.TopLine);

            Attach(box, 1, 2, 1, 2,
                   AttachOptions.Shrink,
                   AttachOptions.Expand | AttachOptions.Fill,
                   0, 0);
        }
Exemplo n.º 2
0
        public TrackInfoPopup() : base(Gtk.WindowType.Popup)
        {
            BorderWidth  = 8;
            AppPaintable = true;
            Resizable    = false;
            TypeHint     = Gdk.WindowTypeHint.Notification;

            VBox box = new VBox();

            box.Spacing = 4;

            header = new ClassicTrackInfoDisplay();
            header.SetSizeRequest(320, 64);

            seek_slider = new ConnectedSeekSlider(SeekSliderLayout.Horizontal);
            seek_slider.StreamPositionLabel.FormatString = "<small>{0}</small>";
            seek_slider.LeftPadding  = 0;
            seek_slider.RightPadding = 0;

            box.PackStart(header, true, true, 0);
            box.PackStart(seek_slider, false, false, 0);

            Add(box);
            box.ShowAll();
        }
Exemplo n.º 3
0
        public SeekDialog() : base("SeekDialog")
        {
            seek_slider = new ConnectedSeekSlider();
            seek_slider.StreamPositionLabel.FormatString = "<big>{0}</big>";

            seek_box.PackStart(seek_slider, false, false, 0);
            seek_box.ShowAll();

            Dialog.SetSizeRequest(300, -1);
        }
Exemplo n.º 4
0
        public PlaybackBox()
        {
            var action_service = ServiceManager.Get <InterfaceActionService> ();

            PackStart(action_service.PlaybackActions["PreviousAction"].CreateToolItem(), false, false, 0);
            PackStart(action_service.PlaybackActions["PlayPauseAction"].CreateToolItem(), false, false, 0);
            PackStart(new NextButton(action_service), false, false, 0);

            var seek_slider = new ConnectedSeekSlider();

            seek_slider.Show();
            PackStart(seek_slider, false, false, 0);
        }
Exemplo n.º 5
0
        private void BuildHeader()
        {
            header_table = new Table(2, 2, false);
            header_table.Show();
            primary_vbox.PackStart(header_table, false, false, 0);

            main_menu = new MainMenu();
            main_menu.Show();

            header_table.Attach(main_menu, 0, 1, 0, 1,
                                AttachOptions.Expand | AttachOptions.Fill,
                                AttachOptions.Shrink, 0, 0);

            Alignment toolbar_alignment = new Alignment(0.0f, 0.0f, 1.0f, 1.0f);

            toolbar_alignment.TopPadding    = 3;
            toolbar_alignment.BottomPadding = 3;

            header_toolbar              = (Toolbar)ActionService.UIManager.GetWidget("/HeaderToolbar");
            header_toolbar.ShowArrow    = false;
            header_toolbar.ToolbarStyle = ToolbarStyle.BothHoriz;

            toolbar_alignment.Add(header_toolbar);
            toolbar_alignment.ShowAll();

            header_table.Attach(toolbar_alignment, 0, 2, 1, 2,
                                AttachOptions.Expand | AttachOptions.Fill,
                                AttachOptions.Shrink, 0, 0);

            Widget next_button = new NextButton(ActionService);

            next_button.Show();
            ActionService.PopulateToolbarPlaceholder(header_toolbar, "/HeaderToolbar/NextArrowButton", next_button);

            ConnectedSeekSlider seek_slider = new ConnectedSeekSlider();

            seek_slider.Show();
            ActionService.PopulateToolbarPlaceholder(header_toolbar, "/HeaderToolbar/SeekSlider", seek_slider);

            TrackInfoDisplay track_info_display = new ClassicTrackInfoDisplay();

            track_info_display.Show();
            ActionService.PopulateToolbarPlaceholder(header_toolbar, "/HeaderToolbar/TrackInfoDisplay", track_info_display, true);

            ConnectedVolumeButton volume_button = new ConnectedVolumeButton();

            volume_button.Show();
            ActionService.PopulateToolbarPlaceholder(header_toolbar, "/HeaderToolbar/VolumeButton", volume_button);
        }
Exemplo n.º 6
0
        public SeekDialog () : base (Catalog.GetString ("Seek to Position"))
        {
            var seek_slider = new ConnectedSeekSlider () {
                RightPadding = 0,
                LeftPadding = 0
            };
            seek_slider.StreamPositionLabel.FormatString = "<big>{0}</big>";
            seek_slider.ShowAll ();

            VBox.PackStart (seek_slider, true, true, 0);
            AddDefaultCloseButton ();

            // FIXME: We shouldn't have to set a minimum height here
            SetSizeRequest (300, 120);
        }
        public SeekDialog() : base(Catalog.GetString("Seek to Position"))
        {
            var seek_slider = new ConnectedSeekSlider()
            {
                RightPadding = 0,
                LeftPadding  = 0
            };

            seek_slider.StreamPositionLabel.FormatString = "<big>{0}</big>";
            seek_slider.ShowAll();

            VBox.PackStart(seek_slider, false, false, 0);
            AddDefaultCloseButton();

            SetSizeRequest(300, -1);
        }
Exemplo n.º 8
0
        private void BuildTrackInfo()
        {
            TrackInfoDisplay track_info_display = new MuinsheeTrackInfoDisplay();

            if (track_info_display.HeightRequest < info_height)
            {
                track_info_display.HeightRequest = info_height;
            }
            track_info_display.Show();
            content_vbox.PackStart(track_info_display, false, false, 0);

            ConnectedSeekSlider seek_slider = new ConnectedSeekSlider(SeekSliderLayout.Horizontal);

            seek_slider.LeftPadding = seek_slider.RightPadding = 0;
            content_vbox.PackStart(seek_slider, false, false, 0);
        }
Exemplo n.º 9
0
        private void BuildInterface()
        {
            HBox box = new HBox();

            volume_button = new ConnectedVolumeButton();

            box.PackStart(action_service.PlaybackActions["PreviousAction"].CreateToolItem(), false, false, 0);
            box.PackStart(action_service.PlaybackActions["PlayPauseAction"].CreateToolItem(), false, false, 0);
            box.PackStart(new NextButton(action_service), false, false, 0);
            box.PackStart(new RepeatActionButton(true), false, false, 0);
            box.PackStart(slider = new ConnectedSeekSlider(SeekSliderLayout.Horizontal), true, true, 0);
            box.PackStart(volume_button, false, false, 0);

            Button exit = new Button(Stock.LeaveFullscreen);

            exit.Relief   = ReliefStyle.None;
            exit.Clicked += delegate { TransientFor.Hide(); };
            box.PackStart(exit, false, false, 0);

            Add(box);
            box.ShowAll();
        }
Exemplo n.º 10
0
        private void BuildHeader()
        {
            header_table = new Table(2, 2, false);
            header_table.Show();
            primary_vbox.PackStart(header_table, false, false, 0);

            main_menu = new MainMenu();

            if (!PlatformDetection.IsMac && !PlatformDetection.IsMeeGo)
            {
                main_menu.Show();
                header_table.Attach(main_menu, 0, 1, 0, 1,
                                    AttachOptions.Expand | AttachOptions.Fill,
                                    AttachOptions.Shrink, 0, 0);
            }

            Alignment toolbar_alignment = new Alignment(0.0f, 0.0f, 1.0f, 1.0f);

            toolbar_alignment.TopPadding    = PlatformDetection.IsMeeGo ? 0u : 3u;
            toolbar_alignment.BottomPadding = PlatformDetection.IsMeeGo ? 0u : 3u;

            header_toolbar              = (Toolbar)ActionService.UIManager.GetWidget("/HeaderToolbar");
            header_toolbar.ShowArrow    = false;
            header_toolbar.ToolbarStyle = ToolbarStyle.BothHoriz;
            header_toolbar.Show();

            if (PlatformDetection.IsMeeGo)
            {
                header_toolbar.IconSize = IconSize.LargeToolbar;
                header_toolbar.Name     = "meego-toolbar";
            }

            toolbar_alignment.Add(header_toolbar);
            toolbar_alignment.Show();

            header_table.Attach(toolbar_alignment, 0, 2, 1, 2,
                                AttachOptions.Expand | AttachOptions.Fill,
                                AttachOptions.Shrink, 0, 0);

            var next_button = new NextButton(ActionService, PlatformDetection.IsMeeGo);

            next_button.Show();
            ActionService.PopulateToolbarPlaceholder(header_toolbar, "/HeaderToolbar/NextArrowButton", next_button);

            seek_slider = new ConnectedSeekSlider()
            {
                Resizable = ShowSeekSliderResizer.Get()
            };
            seek_slider.SeekSlider.WidthRequest   = SeekSliderWidth.Get();
            seek_slider.SeekSlider.SizeAllocated += (o, a) => {
                SeekSliderWidth.Set(seek_slider.SeekSlider.Allocation.Width);
            };
            seek_slider.ShowAll();
            ActionService.PopulateToolbarPlaceholder(header_toolbar, "/HeaderToolbar/SeekSlider", seek_slider);

            var track_info_display = new ClassicTrackInfoDisplay();

            track_info_display.Show();
            track_info_container = TrackInfoDisplay.GetEditable(track_info_display);
            track_info_container.Show();
            ActionService.PopulateToolbarPlaceholder(header_toolbar, "/HeaderToolbar/TrackInfoDisplay", track_info_container, true);

            if (PlatformDetection.IsMeeGo)
            {
                track_info_display.ArtworkSpacing = 5;
                seek_slider.LeftPadding           = 20;
                seek_slider.RightPadding          = 20;

                var menu        = (Menu)(ActionService.UIManager.GetWidget("/ToolbarMenu"));
                var menu_button = new Hyena.Widgets.MenuButton(new Image(Stock.Preferences, IconSize.LargeToolbar), menu, true);
                menu_button.Show();
                ActionService.PopulateToolbarPlaceholder(header_toolbar, "/HeaderToolbar/ToolbarMenuPlaceholder", menu_button);

                var close_button = new Button(Image.NewFromIconName("window-close", IconSize.LargeToolbar))
                {
                    TooltipText = Catalog.GetString("Close")
                };

                close_button.Clicked += (o, e) => {
                    if (ServiceManager.PlayerEngine.IsPlaying() &&
                        (ServiceManager.PlayerEngine.CurrentState != PlayerState.Paused) &&
                        ServiceManager.PlayerEngine.CurrentTrack.HasAttribute(TrackMediaAttributes.VideoStream))
                    {
                        ServiceManager.PlayerEngine.Pause();
                    }
                    Hide();
                };
                close_button.ShowAll();
                ActionService.PopulateToolbarPlaceholder(header_toolbar, "/HeaderToolbar/ClosePlaceholder", close_button);
            }
            else
            {
                var volume_button = new ConnectedVolumeButton();
                volume_button.Show();
                ActionService.PopulateToolbarPlaceholder(header_toolbar, "/HeaderToolbar/VolumeButton", volume_button);
            }
        }
        private void Build()
        {
            var vbox = new VBox()
            {
                Spacing = 12
            };
            var top = new HBox()
            {
                Spacing = 6
            };
            var bot = new HBox()
            {
                Spacing = 6
            };

            vbox.PackStart(top, false, false, 0);
            vbox.PackStart(bot, false, false, 0);

            // Top row: playback buttons, seek slider, full-mode button, volume
            Widget     previous_button  = ActionService.PlaybackActions["PreviousAction"].CreateToolItem();
            Widget     playpause_button = ActionService.PlaybackActions["PlayPauseAction"].CreateToolItem();
            Widget     button           = ActionService.PlaybackActions["NextAction"].CreateToolItem();
            Menu       menu             = ActionService.PlaybackActions.ShuffleActions.CreateMenu();
            MenuButton next_button      = new MenuButton(button, menu, true);

            top.PackStart(previous_button, false, false, 0);
            top.PackStart(playpause_button, false, false, 0);
            top.PackStart(next_button, false, false, 0);

            seek_slider = new ConnectedSeekSlider();
            top.PackStart(seek_slider, true, true, 0);

            var fullmode_button = new Button()
            {
                Label  = Catalog.GetString("Full Mode"),
                Image  = new Image(Stock.LeaveFullscreen, Gtk.IconSize.Button),
                Relief = Gtk.ReliefStyle.None
            };

            fullmode_button.Clicked += OnFullmode;
            top.PackStart(fullmode_button, false, false, 0);

            volume_button = new ConnectedVolumeButton();
            top.PackStart(volume_button, false, false, 0);

            // Bottom row: source dropdown, track info display (cover art, etc), repeat mode button
            source_combo_box = new SourceComboBox();
            bot.PackStart(source_combo_box, false, false, 0);

            track_info_display = new ClassicTrackInfoDisplay();
            track_info_display.WidthRequest = 250;
            bot.PackStart(track_info_display, true, true, 0);

            var repeat_align         = new Alignment(1, 1, 1, 1);
            var repeat_toggle_button = new RepeatActionButton(true);

            repeat_align.Add(repeat_toggle_button);
            bot.PackEnd(repeat_align, false, false, 0);

            SetTip(fullmode_button, Catalog.GetString("Switch back to full mode"));
            SetTip(repeat_toggle_button, Catalog.GetString("Change repeat playback mode"));

            Add(vbox);
        }
Exemplo n.º 12
0
        private void BuildHeader()
        {
            header_table = new Table(2, 2, false);
            header_table.Show();
            header_table.Vexpand = false;
            primary_vbox.PackStart(header_table, false, false, 0);

            main_menu = new MainMenu();

            if (!PlatformDetection.IsMac)
            {
                main_menu.Show();
                header_table.Attach(main_menu, 0, 1, 0, 1,
                                    AttachOptions.Expand | AttachOptions.Fill,
                                    AttachOptions.Shrink, 0, 0);
            }

            Alignment toolbar_alignment = new Alignment(0.0f, 0.0f, 1.0f, 1.0f);

            toolbar_alignment.TopPadding    = 3u;
            toolbar_alignment.BottomPadding = 3u;

            header_toolbar              = (Toolbar)ActionService.UIManager.GetWidget("/HeaderToolbar");
            header_toolbar.ShowArrow    = false;
            header_toolbar.ToolbarStyle = ToolbarStyle.BothHoriz;
            header_toolbar.Show();

            toolbar_alignment.Add(header_toolbar);
            toolbar_alignment.Show();

            header_table.Attach(toolbar_alignment, 0, 2, 1, 2,
                                AttachOptions.Expand | AttachOptions.Fill,
                                AttachOptions.Shrink, 0, 0);

            var next_button = new NextButton(ActionService);

            next_button.Show();
            ActionService.PopulateToolbarPlaceholder(header_toolbar, "/HeaderToolbar/NextArrowButton", next_button);

            seek_slider = new ConnectedSeekSlider()
            {
                Resizable = ShowSeekSliderResizer.Get()
            };
            seek_slider.SeekSlider.WidthRequest   = SeekSliderWidth.Get();
            seek_slider.SeekSlider.SizeAllocated += (o, a) => {
                SeekSliderWidth.Set(seek_slider.SeekSlider.Allocation.Width);
            };
            seek_slider.ShowAll();
            ActionService.PopulateToolbarPlaceholder(header_toolbar, "/HeaderToolbar/SeekSlider", seek_slider);

            var track_info_display = new ClassicTrackInfoDisplay();

            track_info_display.Show();
            track_info_container = TrackInfoDisplay.GetEditable(track_info_display);
            track_info_container.Show();
            ActionService.PopulateToolbarPlaceholder(header_toolbar, "/HeaderToolbar/TrackInfoDisplay", track_info_container, true);

            var volume_button = new ConnectedVolumeButton();

            volume_button.Show();
            ActionService.PopulateToolbarPlaceholder(header_toolbar, "/HeaderToolbar/VolumeButton", volume_button);
        }
Exemplo n.º 13
0
        Grid _Toolbar()
        {
            var grid = new Grid {
                ColumnHomogeneous = true, MarginLeft = 10, MarginRight = 10
            };

            var task_status = new TaskStatusIcon {
                ShowOnlyBackgroundTasks = false
            };

            var toolbar = (Toolbar)ActionService.UIManager.GetWidget("/ControlToolbar");

            toolbar.ShowArrow    = false;
            toolbar.ToolbarStyle = ToolbarStyle.Icons;
            toolbar.IconSize     = IconSize.SmallToolbar;
            toolbar.Margin       = 0;

            var next_button = new NextButton(ActionService)
            {
                IconSize = IconSize.SmallToolbar
            };

            ActionService.PopulateToolbarPlaceholder(toolbar, "/ControlToolbar/NextArrowButton", next_button);

            var repeat_button = new RepeatButton {
                Relief = ReliefStyle.None
            };

            ActionService.PopulateToolbarPlaceholder(toolbar, "/ControlToolbar/RepeatButton", repeat_button);

            var seek_slider = new ConnectedSeekSlider();

            var tools_align = new Alignment(0.5f, 0.5f, 0f, 0f);

            tools_align.Child = toolbar;

            var search_align = new Alignment(0.5f, 0.5f, 0f, 0f);

            search_align.Child = _view_container.SearchEntry;

            var lbox = new HBox();

            lbox.PackStart(task_status, false, false, 0);
            lbox.PackStart(tools_align, true, true, 0);

            var rbox = new HBox();

            rbox.PackEnd(search_align, true, true, 0);

            grid.Attach(lbox, 0, 0, 1, 1);
            grid.Attach(seek_slider, 1, 0, 1, 1);
            grid.Attach(rbox, 2, 0, 1, 1);

            _ready.Add(() => {
                task_status.Show();
                next_button.Show();
                repeat_button.Show();
                tools_align.Show();
                search_align.Show();

                lbox.Show();
                seek_slider.Show();
                rbox.Show();
            });

            return(grid);
        }
Exemplo n.º 14
0
        public MiniMode(BaseClientWindow defaultMainWindow) : base(Catalog.GetString("Banshee Media Player"), "minimode", 0, 0)
        {
            default_main_window = defaultMainWindow;

            glade = new Glade.XML(System.Reflection.Assembly.GetExecutingAssembly(), "minimode.glade", "MiniModeWindow", null);
            glade.Autoconnect(this);

            Widget child = glade["mini_mode_contents"];

            (child.Parent as Container).Remove(child);
            Add(child);
            BorderWidth = 12;
            Resizable   = false;

            // Playback Buttons
            Widget previous_button = ActionService.PlaybackActions["PreviousAction"].CreateToolItem();

            Widget playpause_button = ActionService.PlaybackActions["PlayPauseAction"].CreateToolItem();

            Widget     button      = ActionService.PlaybackActions["NextAction"].CreateToolItem();
            Menu       menu        = ActionService.PlaybackActions.ShuffleActions.CreateMenu();
            MenuButton next_button = new MenuButton(button, menu, true);

            PlaybackBox.PackStart(previous_button, false, false, 0);
            PlaybackBox.PackStart(playpause_button, false, false, 0);
            PlaybackBox.PackStart(next_button, false, false, 0);
            PlaybackBox.ShowAll();

            // Seek Slider/Position Label
            seek_slider = new ConnectedSeekSlider();

            SeekContainer.PackStart(seek_slider, false, false, 0);
            SeekContainer.ShowAll();

            // Volume button
            volume_button = new ConnectedVolumeButton();
            VolumeContainer.PackStart(volume_button, false, false, 0);
            volume_button.Show();

            // Source combobox
            source_combo_box = new SourceComboBox();
            SourceBox.PackStart(source_combo_box, true, true, 0);
            source_combo_box.Show();

            // Track info
            track_info_display = new ClassicTrackInfoDisplay();
            track_info_display.Show();
            CoverBox.PackStart(track_info_display, true, true, 0);

            // Repeat button
            RepeatActionButton repeat_toggle_button = new RepeatActionButton();

            LowerButtonsBox.PackEnd(repeat_toggle_button, false, false, 0);
            LowerButtonsBox.ShowAll();

            tooltip_host = TooltipSetter.CreateHost();

            SetTip(fullmode_button, Catalog.GetString("Switch back to full mode"));
            SetTip(repeat_toggle_button, Catalog.GetString("Change repeat playback mode"));

            // Hook up everything
            ServiceManager.PlayerEngine.ConnectEvent(OnPlayerEvent,
                                                     PlayerEvent.Error |
                                                     PlayerEvent.StateChange |
                                                     PlayerEvent.TrackInfoUpdated);

            SetHeightLimit();
        }