From 0a75cc0a3c95cdce33c15df38fb8f003779ac36e Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Sat, 30 Nov 2019 03:48:33 -0500 Subject: [PATCH] preliminary implementation (load filenames only) of playlist editor --- .../Multimedia/Playlist/PlaylistEditor.glade | 54 ++++++++++++ ...lEditor.Content.PlatformIndependent.csproj | 1 + .../Playlist/PlaylistEditor.Designer.cs | 39 +++++++++ .../Multimedia/Playlist/PlaylistEditor.cs | 87 +++++++++++++++++++ ...or.Plugins.Multimedia.UserInterface.csproj | 3 + 5 files changed, 184 insertions(+) create mode 100644 CSharp/Content/UniversalEditor.Content.PlatformIndependent/Editors/Multimedia/Playlist/PlaylistEditor.glade create mode 100644 CSharp/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Playlist/PlaylistEditor.Designer.cs create mode 100644 CSharp/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Playlist/PlaylistEditor.cs diff --git a/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Editors/Multimedia/Playlist/PlaylistEditor.glade b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Editors/Multimedia/Playlist/PlaylistEditor.glade new file mode 100644 index 00000000..2922d53d --- /dev/null +++ b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Editors/Multimedia/Playlist/PlaylistEditor.glade @@ -0,0 +1,54 @@ + + + + + + False + + + + + + True + False + vertical + + + True + True + + 0 + + + + + + True + File name + True + True + + + + 0 + + + + + + + True + True + 0 + + + + + + + + + + + + diff --git a/CSharp/Content/UniversalEditor.Content.PlatformIndependent/UniversalEditor.Content.PlatformIndependent.csproj b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/UniversalEditor.Content.PlatformIndependent.csproj index 421a30ff..6a3e0bab 100644 --- a/CSharp/Content/UniversalEditor.Content.PlatformIndependent/UniversalEditor.Content.PlatformIndependent.csproj +++ b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/UniversalEditor.Content.PlatformIndependent.csproj @@ -653,6 +653,7 @@ + diff --git a/CSharp/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Playlist/PlaylistEditor.Designer.cs b/CSharp/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Playlist/PlaylistEditor.Designer.cs new file mode 100644 index 00000000..06f125fe --- /dev/null +++ b/CSharp/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Playlist/PlaylistEditor.Designer.cs @@ -0,0 +1,39 @@ +// +// PlaylistEditor.Designer.cs +// +// Author: +// Mike Becker +// +// Copyright (c) 2019 Mike Becker +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +using System; +using MBS.Framework.UserInterface; +using MBS.Framework.UserInterface.Controls; +using UniversalEditor.UserInterface; + +namespace UniversalEditor.Plugins.Multimedia.UserInterface.Editors.Multimedia.Playlist +{ + [ContainerLayout("~/Editors/Multimedia/Playlist/PlaylistEditor.glade", "GtkWindow")] + partial class PlaylistEditor : Editor + { + private ListView lvPlaylist = null; + private DefaultTreeModel tmPlaylist = null; + + private void InitializeComponent() + { + lvPlaylist.Model = tmPlaylist; + } + } +} diff --git a/CSharp/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Playlist/PlaylistEditor.cs b/CSharp/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Playlist/PlaylistEditor.cs new file mode 100644 index 00000000..e666be58 --- /dev/null +++ b/CSharp/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Playlist/PlaylistEditor.cs @@ -0,0 +1,87 @@ +// +// PlaylistEditor.cs +// +// Author: +// Mike Becker +// +// Copyright (c) 2019 Mike Becker +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +using System; +using MBS.Framework.UserInterface; +using UniversalEditor.ObjectModels.Multimedia.Playlist; +using UniversalEditor.UserInterface; + +namespace UniversalEditor.Plugins.Multimedia.UserInterface.Editors.Multimedia.Playlist +{ + public partial class PlaylistEditor + { + public PlaylistEditor() + { + InitializeComponent(); + + // fuckkkk + for (int i = 0; i < tmPlaylist.Columns.Count; i++) + { + lvPlaylist.Columns[i].Column = tmPlaylist.Columns[i]; + } + } + + private static EditorReference _er = null; + public override EditorReference MakeReference() + { + if (_er == null) + { + _er = base.MakeReference(); + _er.SupportedObjectModels.Add(typeof(PlaylistObjectModel)); + } + return _er; + } + + public override void UpdateSelections() + { + throw new NotImplementedException(); + } + + protected override EditorSelection CreateSelectionInternal(object content) + { + throw new NotImplementedException(); + } + + protected override void OnObjectModelChanged(EventArgs e) + { + base.OnObjectModelChanged(e); + + tmPlaylist.Rows.Clear(); + + PlaylistObjectModel playlist = (ObjectModel as PlaylistObjectModel); + if (playlist == null) return; + + for (int i = 0; i < playlist.Entries.Count; i++) + { + TreeModelRow row = new TreeModelRow(); + row.RowColumns.Add(new TreeModelRowColumn(tmPlaylist.Columns[0], playlist.Entries[i].FileName)); + row.SetExtraData("entry", playlist.Entries[i]); + + tmPlaylist.Rows.Add(row); + } + } + + protected override void OnCreated(EventArgs e) + { + base.OnCreated(e); + lvPlaylist.Model = tmPlaylist; + } + } +} diff --git a/CSharp/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface.csproj b/CSharp/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface.csproj index 190ac369..ff1e922b 100644 --- a/CSharp/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface.csproj +++ b/CSharp/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface.csproj @@ -42,6 +42,8 @@ + + @@ -56,6 +58,7 @@ +