preliminary implementation (load filenames only) of playlist editor

This commit is contained in:
Michael Becker 2019-11-30 03:48:33 -05:00
parent 5b520674e6
commit 0a75cc0a3c
No known key found for this signature in database
GPG Key ID: 389DFF5D73781A12
5 changed files with 184 additions and 0 deletions

View File

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<object class="GtkWindow" id="PlaylistEditor">
<property name="can_focus">False</property>
<child>
<placeholder/>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkTreeView" id="lvPlaylist">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="model"/>
<property name="search_column">0</property>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
</child>
<child>
<object class="GtkTreeViewColumn" id="colFileName">
<property name="resizable">True</property>
<property name="title" translatable="yes">File name</property>
<property name="clickable">True</property>
<property name="reorderable">True</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
</child>
</object>
<object class="GtkTreeStore" id="tmPlaylist">
<columns>
<!-- column-name File name -->
<column type="gchararray"/>
</columns>
</object>
</interface>

View File

@ -653,6 +653,7 @@
<Content Include="Extensions\GameDeveloper\Associations\FileSystem\CRI\AFS.uexml" />
<Content Include="Extensions\GameDeveloper\Associations\FileSystem\CRI\CPK.uexml" />
<Content Include="Extensions\GameDeveloper\Associations\Database\CRI\UTF.uexml" />
<Content Include="Editors\Multimedia\Playlist\PlaylistEditor.glade" />
</ItemGroup>
<ItemGroup>
<Content Include="Configuration\Application.upl" />

View File

@ -0,0 +1,39 @@
//
// PlaylistEditor.Designer.cs
//
// Author:
// Mike Becker <alcexhim@gmail.com>
//
// 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 <http://www.gnu.org/licenses/>.
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;
}
}
}

View File

@ -0,0 +1,87 @@
//
// PlaylistEditor.cs
//
// Author:
// Mike Becker <alcexhim@gmail.com>
//
// 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 <http://www.gnu.org/licenses/>.
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<PlaylistEntry>("entry", playlist.Entries[i]);
tmPlaylist.Rows.Add(row);
}
}
protected override void OnCreated(EventArgs e)
{
base.OnCreated(e);
lvPlaylist.Model = tmPlaylist;
}
}
}

View File

@ -42,6 +42,8 @@
<Compile Include="PictureObjectModelExtensions.cs" />
<Compile Include="Editors\Multimedia\Palette\PaletteEditor.cs" />
<Compile Include="Editors\Multimedia\Palette\PaletteEditor.Designer.cs" />
<Compile Include="Editors\Multimedia\Playlist\PlaylistEditor.cs" />
<Compile Include="Editors\Multimedia\Playlist\PlaylistEditor.Designer.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="Editors\" />
@ -56,6 +58,7 @@
<Folder Include="Editors\Multimedia\Audio\Synthesized\PianoRoll\Views\" />
<Folder Include="Editors\Multimedia\Audio\Synthesized\PianoRoll\Dialogs\" />
<Folder Include="Editors\Multimedia\Palette\" />
<Folder Include="Editors\Multimedia\Playlist\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Libraries\UniversalEditor.Core\UniversalEditor.Core.csproj">