public EditPlaylistElementProperties(Window parent, IPlaylistElement element)
        {
            TransientFor = parent;
            this.Build ();

            sizegroupLeft = new SizeGroup (SizeGroupMode.Horizontal);
            sizegroupLeft.IgnoreHidden = false;
            foreach (Widget w in vbox2.Children) {
                foreach (Widget t in (w as Table).Children) {
                    if ((t is Label)) {
                        t.ModifyFont (FontDescription.FromString (App.Current.Style.Font + " 10"));
                        sizegroupLeft.AddWidget (t);
                    }
                }
            }

            sizegroupRight = new SizeGroup (SizeGroupMode.Horizontal);
            sizegroupRight.IgnoreHidden = false;
            foreach (Widget w in vbox2.Children) {
                foreach (Widget t in (w as Table).Children) {
                    if (!(t is Label)) {
                        sizegroupRight.AddWidget (t);
                    }
                }
            }

            PlaylistElement = element;
            durationspinbutton.ValueChanged += HandleDurationChanged;
            nameentry.Changed += HandleNameChanged;
        }
Exemplo n.º 2
0
 void AddImage(IPlaylistElement element, bool prepend)
 {
     Pixbuf pix = Helpers.Misc.OpenImage (widget);
     if (pix != null) {
         var image = new Image (pix);
         PlaylistImage plimage = new PlaylistImage (image, new Time (5000));
         int index = playlist.Elements.IndexOf (element);
         if (!prepend) {
             index++;
         }
         playlist.Elements.Insert (index, plimage);
     }
 }
Exemplo n.º 3
0
 public void EmitPlaylistElementSelected(Playlist playlist, IPlaylistElement element)
 {
     if (PlaylistElementSelectedEvent != null)
         PlaylistElementSelectedEvent (playlist, element);
 }
Exemplo n.º 4
0
        public void SetActive(IPlaylistElement play)
        {
            int newIndex;

            newIndex = Elements.IndexOf (play);
            if (newIndex >= 0) {
                indexSelection = Elements.IndexOf (play);
            }
        }
Exemplo n.º 5
0
 public bool Remove(IPlaylistElement plNode)
 {
     bool ret = Elements.Remove (plNode);
     if (CurrentIndex >= Elements.Count)
         indexSelection --;
     return ret;
 }
Exemplo n.º 6
0
 void HandlePlaylistElementSelectedEvent(Playlist playlist, IPlaylistElement element)
 {
     playlisttreeview1.QueueDraw ();
 }
Exemplo n.º 7
0
 void AddVideo(IPlaylistElement element, bool prepend)
 {
     MediaFile file = Helpers.Misc.OpenFile (widget);
     if (file != null) {
         PlaylistVideo video = new PlaylistVideo (file);
         int index = playlist.Elements.IndexOf (element);
         if (!prepend) {
             index++;
         }
         playlist.Elements.Insert (index, video);
     }
 }
Exemplo n.º 8
0
 Menu CreateExternalsMenu(IPlaylistElement element, bool prepend)
 {
     Menu addMenu = new Menu ();
     MenuItem video = new MenuItem (Catalog.GetString ("External video"));
     video.Activated += (sender, e) => AddVideo (element, prepend);
     addMenu.Append (video);
     MenuItem stillImage = new MenuItem (Catalog.GetString ("External image"));
     stillImage.Activated += (sender, e) => AddImage (element, prepend);
     addMenu.Append (stillImage);
     return addMenu;
 }
Exemplo n.º 9
0
        public static void Render(object item, LMProject project, int count, bool isExpanded, IDrawingToolkit tk,
                                  IContext context, Area backgroundArea, Area cellArea, CellState state)
        {
            //Get the offset to properly calulate if needs tooltip or redraw
            offsetX = backgroundArea.Right - cellArea.Right;
            offsetY = cellArea.Top - backgroundArea.Top;

            // HACK: to be remove when all treeviews are migrated to user VM's
            if (item is TimelineEventVM)
            {
                item = ((TimelineEventVM)item).Model;
            }
            else if (item is EventTypeTimelineVM)
            {
                var vm = item as EventTypeTimelineVM;
                RenderAnalysisCategory(vm, count, isExpanded, tk,
                                       context, backgroundArea, cellArea, state);
                return;
            }
            else if (item is PlaylistElementVM)
            {
                item = ((PlaylistElementVM)item).Model;
            }
            else if (item is PlaylistVM)
            {
                item = ((PlaylistVM)item).Model;
            }
            else if (item is PlayerVM)
            {
                item = ((PlayerVM)item).Model;
            }
            else if (item is PlayerTimelineVM)
            {
                item = ((PlayerTimelineVM)item).Model;
            }

            // FIXME: This first if case must be deleted when presentations is migrated to MVVMC
            if (item is EventType)
            {
                RenderAnalysisCategory(item as EventType, count, isExpanded, tk,
                                       context, backgroundArea, cellArea);
            }
            else if (item is SubstitutionEvent)
            {
                SubstitutionEvent s = item as SubstitutionEvent;
                RenderSubstitution(s.Color, s.EventTime, s.In, s.Out, s.Playing, isExpanded, tk, context,
                                   backgroundArea, cellArea, state);
            }
            else if (item is TimelineEvent)
            {
                LMTimelineEvent p = item as LMTimelineEvent;
                // always add local first.
                RenderPlay(p.Color, p.Miniature, p.Players, p.Teams, p.Playing, p.Description, count, isExpanded, tk,
                           context, backgroundArea, cellArea, state);
            }
            else if (item is Player)
            {
                RenderPlayer(item as LMPlayer, count, isExpanded, tk, context, backgroundArea, cellArea);
            }
            else if (item is Playlist)
            {
                RenderPlaylist(item as Playlist, count, isExpanded, tk, context, backgroundArea, cellArea, state);
            }
            else if (item is PlaylistPlayElement)
            {
                PlaylistPlayElement p = item as PlaylistPlayElement;
                RenderPlay(p.Play.EventType.Color, p.Miniature, null, null, p.Playing, p.Description, count, isExpanded, tk,
                           context, backgroundArea, cellArea, state);
            }
            else if (item is IPlaylistElement)
            {
                IPlaylistElement p = item as IPlaylistElement;
                RenderPlay(App.Current.Style.ThemeContrastDisabled, p.Miniature, null, null, p.Playing, p.Description,
                           count, isExpanded, tk, context, backgroundArea, cellArea, state);
            }
            else
            {
                Log.Error("No renderer for type " + item?.GetType());
            }
        }
Exemplo n.º 10
0
 void HandlePlaylistElementSelectedEvent(Playlist playlist, IPlaylistElement element)
 {
     if (element is PlaylistPlayElement) {
         loadedPlay = (element as PlaylistPlayElement).Play;
     } else {
         loadedPlay = null;
     }
 }
Exemplo n.º 11
0
 void HandlePlaylistElementSelectedEvent(Playlist playlist, IPlaylistElement element)
 {
     playlisttreeview1.QueueDraw();
 }
Exemplo n.º 12
0
 void ShowPlaylistElementMenu(Playlist playlist, IPlaylistElement element)
 {
     PlaylistElementMenu menu = new PlaylistElementMenu (this, playlist, new List<IPlaylistElement> { element });
     menu.Popup ();
 }
Exemplo n.º 13
0
        void FillElementAndPlaylist(TreeIter iter, out Playlist playlist, out IPlaylistElement element)
        {
            TreeIter parent;

            var obj = Model.GetValue (iter, 0);
            if (obj is IPlaylistElement) {
                Model.IterParent (out parent, iter);
                element = obj as IPlaylistElement;
                playlist = Model.GetValue (parent, 0) as Playlist;
            } else {
                element = null;
                playlist = obj as Playlist;
            }
        }
Exemplo n.º 14
0
        void ShowPlaylistElementMenu(Playlist playlist, IPlaylistElement element, TreeIter parent)
        {
            Menu menu;
            MenuItem edit, delete, prepend, append;

            menu = new Menu ();

            if (element is PlaylistPlayElement || element == null) {
                PlaylistPlayElement pl = element as PlaylistPlayElement;

                edit = new MenuItem (Catalog.GetString ("Edit name"));
                edit.Activated += (sender, e) => {
                    string name = Config.GUIToolkit.QueryMessage (Catalog.GetString ("Name:"), null,
                                      pl.Title);
                    if (!String.IsNullOrEmpty (name)) {
                        pl.Title = name;
                    }
                };
                menu.Append (edit);
            }

            prepend = new MenuItem (Catalog.GetString ("Insert before"));
            prepend.Submenu = CreateExternalsMenu (playlist, element, true, parent);
            menu.Append (prepend);

            append = new MenuItem (Catalog.GetString ("Insert after"));
            append.Submenu = CreateExternalsMenu (playlist, element, false, parent);
            menu.Append (append);

            delete = new MenuItem (Catalog.GetString ("Delete"));
            delete.Activated += (sender, e) => {
                playlist.Remove (element);
                (Model as TreeStore).Remove (ref selectedIter);
                Config.EventsBroker.EmitPlaylistsChanged (this);
            };
            menu.Append (delete);

            menu.ShowAll ();
            menu.Popup ();
        }
Exemplo n.º 15
0
 void AddVideo(Playlist playlist, IPlaylistElement element, bool prepend, TreeIter parent)
 {
     MediaFile file = LongoMatch.Gui.Helpers.Misc.OpenFile (this);
     if (file != null) {
         PlaylistVideo video = new PlaylistVideo (file);
         int index = playlist.Elements.IndexOf (element);
         if (!prepend) {
             index++;
         }
         playlist.Elements.Insert (index, video);
         (Model as TreeStore).InsertWithValues (parent, index, video);
     }
 }
Exemplo n.º 16
0
 void AddImage(Playlist playlist, IPlaylistElement element, bool prepend, TreeIter parent)
 {
     Pixbuf pix = LongoMatch.Gui.Helpers.Misc.OpenImage (this);
     if (pix != null) {
         var image = new LongoMatch.Core.Common.Image (pix);
         PlaylistImage plimage = new PlaylistImage (image, new Time (5000));
         int index = playlist.Elements.IndexOf (element);
         if (!prepend) {
             index++;
         }
         playlist.Elements.Insert (index, plimage);
         (Model as TreeStore).InsertWithValues (parent, index, plimage);
     }
 }