Various improvements to Vocaloid data formats and editors

This commit is contained in:
Michael Becker 2014-10-17 15:58:47 -04:00
parent c4db684305
commit 2701bf1015
12 changed files with 769 additions and 71 deletions

View File

@ -0,0 +1,299 @@
namespace UniversalEditor.Editors.Multimedia.Audio.Voicebank
{
partial class VoicebankIndexEditor
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.tbsTabs = new System.Windows.Forms.TabControl();
this.tabPhonemes = new System.Windows.Forms.TabPage();
this.tabPhonemeGroups = new System.Windows.Forms.TabPage();
this.cmdPhonemeAdd = new System.Windows.Forms.Button();
this.cmdPhonemeModify = new System.Windows.Forms.Button();
this.cmdPhonemeRemove = new System.Windows.Forms.Button();
this.cmdPhonemeClear = new System.Windows.Forms.Button();
this.lvPhonemes = new System.Windows.Forms.ListView();
this.chPhonemeName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.chPhonemeData = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.tvPhonemeGroups = new System.Windows.Forms.TreeView();
this.mnuContextPhonemeGroups = new AwesomeControls.CommandBars.CBContextMenu(this.components);
this.mnuContextPhonemeGroupsNew = new System.Windows.Forms.ToolStripMenuItem();
this.mnuContextPhonemeGroupsAddGroup = new System.Windows.Forms.ToolStripMenuItem();
this.mnuContextPhonemeGroupsAddPhoneme = new System.Windows.Forms.ToolStripMenuItem();
this.mnuContextPhonemeGroupsSep1 = new System.Windows.Forms.ToolStripSeparator();
this.mnuContextPhonemeGroupsCut = new System.Windows.Forms.ToolStripMenuItem();
this.mnuContextPhonemeGroupsCopy = new System.Windows.Forms.ToolStripMenuItem();
this.mnuContextPhonemeGroupsPaste = new System.Windows.Forms.ToolStripMenuItem();
this.mnuContextPhonemeGroupsDelete = new System.Windows.Forms.ToolStripMenuItem();
this.mnuContextPhonemeGroupsSep2 = new System.Windows.Forms.ToolStripSeparator();
this.mnuContextPhonemeGroupsProperties = new System.Windows.Forms.ToolStripMenuItem();
this.tbsTabs.SuspendLayout();
this.tabPhonemes.SuspendLayout();
this.tabPhonemeGroups.SuspendLayout();
this.mnuContextPhonemeGroups.SuspendLayout();
this.SuspendLayout();
//
// tbsTabs
//
this.tbsTabs.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tbsTabs.Controls.Add(this.tabPhonemes);
this.tbsTabs.Controls.Add(this.tabPhonemeGroups);
this.tbsTabs.Location = new System.Drawing.Point(3, 3);
this.tbsTabs.Name = "tbsTabs";
this.tbsTabs.SelectedIndex = 0;
this.tbsTabs.Size = new System.Drawing.Size(490, 303);
this.tbsTabs.TabIndex = 0;
//
// tabPhonemes
//
this.tabPhonemes.Controls.Add(this.lvPhonemes);
this.tabPhonemes.Controls.Add(this.cmdPhonemeClear);
this.tabPhonemes.Controls.Add(this.cmdPhonemeRemove);
this.tabPhonemes.Controls.Add(this.cmdPhonemeModify);
this.tabPhonemes.Controls.Add(this.cmdPhonemeAdd);
this.tabPhonemes.Location = new System.Drawing.Point(4, 22);
this.tabPhonemes.Name = "tabPhonemes";
this.tabPhonemes.Padding = new System.Windows.Forms.Padding(3);
this.tabPhonemes.Size = new System.Drawing.Size(482, 277);
this.tabPhonemes.TabIndex = 0;
this.tabPhonemes.Text = "Phonemes";
this.tabPhonemes.UseVisualStyleBackColor = true;
//
// tabPhonemeGroups
//
this.tabPhonemeGroups.Controls.Add(this.tvPhonemeGroups);
this.tabPhonemeGroups.Location = new System.Drawing.Point(4, 22);
this.tabPhonemeGroups.Name = "tabPhonemeGroups";
this.tabPhonemeGroups.Padding = new System.Windows.Forms.Padding(3);
this.tabPhonemeGroups.Size = new System.Drawing.Size(482, 277);
this.tabPhonemeGroups.TabIndex = 1;
this.tabPhonemeGroups.Text = "Phoneme Groups";
this.tabPhonemeGroups.UseVisualStyleBackColor = true;
//
// cmdPhonemeAdd
//
this.cmdPhonemeAdd.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.cmdPhonemeAdd.Location = new System.Drawing.Point(6, 6);
this.cmdPhonemeAdd.Name = "cmdPhonemeAdd";
this.cmdPhonemeAdd.Size = new System.Drawing.Size(75, 23);
this.cmdPhonemeAdd.TabIndex = 0;
this.cmdPhonemeAdd.Text = "&Add";
this.cmdPhonemeAdd.UseVisualStyleBackColor = true;
//
// cmdPhonemeModify
//
this.cmdPhonemeModify.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.cmdPhonemeModify.Location = new System.Drawing.Point(87, 6);
this.cmdPhonemeModify.Name = "cmdPhonemeModify";
this.cmdPhonemeModify.Size = new System.Drawing.Size(75, 23);
this.cmdPhonemeModify.TabIndex = 0;
this.cmdPhonemeModify.Text = "&Modify";
this.cmdPhonemeModify.UseVisualStyleBackColor = true;
//
// cmdPhonemeRemove
//
this.cmdPhonemeRemove.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.cmdPhonemeRemove.Location = new System.Drawing.Point(168, 6);
this.cmdPhonemeRemove.Name = "cmdPhonemeRemove";
this.cmdPhonemeRemove.Size = new System.Drawing.Size(75, 23);
this.cmdPhonemeRemove.TabIndex = 0;
this.cmdPhonemeRemove.Text = "&Remove";
this.cmdPhonemeRemove.UseVisualStyleBackColor = true;
//
// cmdPhonemeClear
//
this.cmdPhonemeClear.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.cmdPhonemeClear.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.cmdPhonemeClear.Location = new System.Drawing.Point(401, 6);
this.cmdPhonemeClear.Name = "cmdPhonemeClear";
this.cmdPhonemeClear.Size = new System.Drawing.Size(75, 23);
this.cmdPhonemeClear.TabIndex = 0;
this.cmdPhonemeClear.Text = "&Clear";
this.cmdPhonemeClear.UseVisualStyleBackColor = true;
//
// lvPhonemes
//
this.lvPhonemes.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lvPhonemes.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.chPhonemeName,
this.chPhonemeData});
this.lvPhonemes.FullRowSelect = true;
this.lvPhonemes.GridLines = true;
this.lvPhonemes.HideSelection = false;
this.lvPhonemes.Location = new System.Drawing.Point(6, 35);
this.lvPhonemes.Name = "lvPhonemes";
this.lvPhonemes.Size = new System.Drawing.Size(470, 236);
this.lvPhonemes.TabIndex = 1;
this.lvPhonemes.UseCompatibleStateImageBehavior = false;
this.lvPhonemes.View = System.Windows.Forms.View.Details;
//
// chPhonemeName
//
this.chPhonemeName.Text = "Name";
this.chPhonemeName.Width = 396;
//
// chPhonemeData
//
this.chPhonemeData.Text = "Data1";
//
// tvPhonemeGroups
//
this.tvPhonemeGroups.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tvPhonemeGroups.ContextMenuStrip = this.mnuContextPhonemeGroups;
this.tvPhonemeGroups.Location = new System.Drawing.Point(6, 6);
this.tvPhonemeGroups.Name = "tvPhonemeGroups";
this.tvPhonemeGroups.Size = new System.Drawing.Size(470, 265);
this.tvPhonemeGroups.TabIndex = 6;
//
// mnuContextPhonemeGroups
//
this.mnuContextPhonemeGroups.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.mnuContextPhonemeGroupsNew,
this.mnuContextPhonemeGroupsSep1,
this.mnuContextPhonemeGroupsCut,
this.mnuContextPhonemeGroupsCopy,
this.mnuContextPhonemeGroupsPaste,
this.mnuContextPhonemeGroupsDelete,
this.mnuContextPhonemeGroupsSep2,
this.mnuContextPhonemeGroupsProperties});
this.mnuContextPhonemeGroups.Name = "mnuContextPhonemeGroups";
this.mnuContextPhonemeGroups.Size = new System.Drawing.Size(137, 148);
//
// mnuContextPhonemeGroupsNew
//
this.mnuContextPhonemeGroupsNew.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.mnuContextPhonemeGroupsAddGroup,
this.mnuContextPhonemeGroupsAddPhoneme});
this.mnuContextPhonemeGroupsNew.Name = "mnuContextPhonemeGroupsNew";
this.mnuContextPhonemeGroupsNew.Size = new System.Drawing.Size(136, 22);
this.mnuContextPhonemeGroupsNew.Text = "Ne&w";
//
// mnuContextPhonemeGroupsAddGroup
//
this.mnuContextPhonemeGroupsAddGroup.Name = "mnuContextPhonemeGroupsAddGroup";
this.mnuContextPhonemeGroupsAddGroup.Size = new System.Drawing.Size(161, 22);
this.mnuContextPhonemeGroupsAddGroup.Text = "Phoneme &Group";
//
// mnuContextPhonemeGroupsAddPhoneme
//
this.mnuContextPhonemeGroupsAddPhoneme.Name = "mnuContextPhonemeGroupsAddPhoneme";
this.mnuContextPhonemeGroupsAddPhoneme.Size = new System.Drawing.Size(161, 22);
this.mnuContextPhonemeGroupsAddPhoneme.Text = "&Phoneme";
//
// mnuContextPhonemeGroupsSep1
//
this.mnuContextPhonemeGroupsSep1.Name = "mnuContextPhonemeGroupsSep1";
this.mnuContextPhonemeGroupsSep1.Size = new System.Drawing.Size(133, 6);
//
// mnuContextPhonemeGroupsCut
//
this.mnuContextPhonemeGroupsCut.Enabled = false;
this.mnuContextPhonemeGroupsCut.Name = "mnuContextPhonemeGroupsCut";
this.mnuContextPhonemeGroupsCut.Size = new System.Drawing.Size(136, 22);
this.mnuContextPhonemeGroupsCut.Text = "Cu&t";
//
// mnuContextPhonemeGroupsCopy
//
this.mnuContextPhonemeGroupsCopy.Enabled = false;
this.mnuContextPhonemeGroupsCopy.Name = "mnuContextPhonemeGroupsCopy";
this.mnuContextPhonemeGroupsCopy.Size = new System.Drawing.Size(136, 22);
this.mnuContextPhonemeGroupsCopy.Text = "&Copy";
//
// mnuContextPhonemeGroupsPaste
//
this.mnuContextPhonemeGroupsPaste.Enabled = false;
this.mnuContextPhonemeGroupsPaste.Name = "mnuContextPhonemeGroupsPaste";
this.mnuContextPhonemeGroupsPaste.Size = new System.Drawing.Size(136, 22);
this.mnuContextPhonemeGroupsPaste.Text = "&Paste";
//
// mnuContextPhonemeGroupsDelete
//
this.mnuContextPhonemeGroupsDelete.Enabled = false;
this.mnuContextPhonemeGroupsDelete.Name = "mnuContextPhonemeGroupsDelete";
this.mnuContextPhonemeGroupsDelete.Size = new System.Drawing.Size(136, 22);
this.mnuContextPhonemeGroupsDelete.Text = "&Delete";
this.mnuContextPhonemeGroupsDelete.Visible = false;
//
// mnuContextPhonemeGroupsSep2
//
this.mnuContextPhonemeGroupsSep2.Name = "mnuContextPhonemeGroupsSep2";
this.mnuContextPhonemeGroupsSep2.Size = new System.Drawing.Size(133, 6);
//
// mnuContextPhonemeGroupsProperties
//
this.mnuContextPhonemeGroupsProperties.Enabled = false;
this.mnuContextPhonemeGroupsProperties.Name = "mnuContextPhonemeGroupsProperties";
this.mnuContextPhonemeGroupsProperties.Size = new System.Drawing.Size(136, 22);
this.mnuContextPhonemeGroupsProperties.Text = "P&roperties...";
//
// VoicebankIndexEditor
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.tbsTabs);
this.Name = "VoicebankIndexEditor";
this.Size = new System.Drawing.Size(496, 309);
this.tbsTabs.ResumeLayout(false);
this.tabPhonemes.ResumeLayout(false);
this.tabPhonemeGroups.ResumeLayout(false);
this.mnuContextPhonemeGroups.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TabControl tbsTabs;
private System.Windows.Forms.TabPage tabPhonemes;
private System.Windows.Forms.TabPage tabPhonemeGroups;
private System.Windows.Forms.Button cmdPhonemeClear;
private System.Windows.Forms.Button cmdPhonemeRemove;
private System.Windows.Forms.Button cmdPhonemeModify;
private System.Windows.Forms.Button cmdPhonemeAdd;
private System.Windows.Forms.ListView lvPhonemes;
private System.Windows.Forms.ColumnHeader chPhonemeName;
private System.Windows.Forms.ColumnHeader chPhonemeData;
private System.Windows.Forms.TreeView tvPhonemeGroups;
private AwesomeControls.CommandBars.CBContextMenu mnuContextPhonemeGroups;
private System.Windows.Forms.ToolStripMenuItem mnuContextPhonemeGroupsNew;
private System.Windows.Forms.ToolStripMenuItem mnuContextPhonemeGroupsAddGroup;
private System.Windows.Forms.ToolStripMenuItem mnuContextPhonemeGroupsAddPhoneme;
private System.Windows.Forms.ToolStripSeparator mnuContextPhonemeGroupsSep1;
private System.Windows.Forms.ToolStripMenuItem mnuContextPhonemeGroupsCut;
private System.Windows.Forms.ToolStripMenuItem mnuContextPhonemeGroupsCopy;
private System.Windows.Forms.ToolStripMenuItem mnuContextPhonemeGroupsPaste;
private System.Windows.Forms.ToolStripMenuItem mnuContextPhonemeGroupsDelete;
private System.Windows.Forms.ToolStripSeparator mnuContextPhonemeGroupsSep2;
private System.Windows.Forms.ToolStripMenuItem mnuContextPhonemeGroupsProperties;
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using UniversalEditor.UserInterface;
using UniversalEditor.UserInterface.WindowsForms;
using UniversalEditor.ObjectModels.Multimedia.Audio.VoicebankIndex;
using UniversalEditor.ObjectModels.Multimedia.Audio.Voicebank;
namespace UniversalEditor.Editors.Multimedia.Audio.Voicebank
{
public partial class VoicebankIndexEditor : Editor
{
public VoicebankIndexEditor()
{
InitializeComponent();
}
private static EditorReference _er = null;
public override EditorReference MakeReference()
{
if (_er == null)
{
_er = base.MakeReference();
_er.SupportedObjectModels.Add(typeof(VoicebankIndexObjectModel));
}
return _er;
}
protected override void OnObjectModelChanged(EventArgs e)
{
base.OnObjectModelChanged(e);
lvPhonemes.Items.Clear();
tvPhonemeGroups.Nodes.Clear();
VoicebankIndexObjectModel dbse = (base.ObjectModel as VoicebankIndexObjectModel);
if (dbse == null) return;
foreach (Phoneme p in dbse.Phonemes)
{
ListViewItem lvi = new ListViewItem();
lvi.Text = p.Title;
lvi.Tag = p;
lvPhonemes.Items.Add(lvi);
}
foreach (PhonemeGroup pg in dbse.Groups)
{
TreeNode tn = new TreeNode();
tn.Text = pg.Title;
tn.Tag = pg;
foreach (Phoneme p in pg.Phonemes)
{
TreeNode tn1 = new TreeNode();
tn1.Text = p.Title;
tn1.Tag = p;
tn.Nodes.Add(tn1);
}
tvPhonemeGroups.Nodes.Add(tn);
}
}
}
}

View File

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="mnuContextPhonemeGroups.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>6, 3</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>34</value>
</metadata>
</root>

View File

@ -33,9 +33,11 @@
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.Design" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Controls\Multimedia\Audio\Synthesized\PianoRoll\PianoRollControl.cs">
@ -106,6 +108,12 @@
<Compile Include="Editors\Multimedia\Audio\Voicebank\VoicebankEditor.Designer.cs">
<DependentUpon>VoicebankEditor.cs</DependentUpon>
</Compile>
<Compile Include="Editors\Multimedia\Audio\Voicebank\VoicebankIndexEditor.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Editors\Multimedia\Audio\Voicebank\VoicebankIndexEditor.Designer.cs">
<DependentUpon>VoicebankIndexEditor.cs</DependentUpon>
</Compile>
<Compile Include="Editors\Multimedia\Audio\Waveform\WaveformAudioEditor.cs">
<SubType>UserControl</SubType>
</Compile>
@ -175,6 +183,9 @@
<EmbeddedResource Include="Editors\Multimedia\Audio\Voicebank\VoicebankEditor.resx">
<DependentUpon>VoicebankEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Editors\Multimedia\Audio\Voicebank\VoicebankIndexEditor.resx">
<DependentUpon>VoicebankIndexEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Editors\Multimedia\Audio\Waveform\WaveformAudioEditor.resx">
<DependentUpon>WaveformAudioEditor.cs</DependentUpon>
</EmbeddedResource>

View File

@ -1,64 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UniversalEditor.IO;
namespace UniversalEditor.DataFormats.Multimedia.Audio.Voicebank.Vocaloid
{
public class VocaloidIndexDataFormat : DataFormat
{
protected override void LoadInternal(ref ObjectModel objectModel)
{
Reader reader = base.Accessor.Reader;
// Bruno Clara
uint unknown1 = reader.ReadUInt32(); // 0
uint unknown2 = reader.ReadUInt32();
string chunkName = reader.ReadFixedLengthString(4); // DBSe
uint unknown3 = reader.ReadUInt32();
uint unknown4 = reader.ReadUInt32(); // 1
uint unknown5 = reader.ReadUInt32();
uint unknown6 = reader.ReadUInt32(); // 3, subchunk count?
string chunkNamePHDC = reader.ReadFixedLengthString(4);
uint chunkSizePHDC = reader.ReadUInt32(); // total size of PHDC chunk (3927 in Bruno)
uint unknown7 = reader.ReadUInt32(); // 4
uint phonemeCount = reader.ReadUInt32(); // 32
for (uint i = 0; i < phonemeCount; i++)
{
string phonemeName = reader.ReadFixedLengthString(30);
byte phonemeData = reader.ReadByte();
}
string chunkNamePHG2 = reader.ReadFixedLengthString(4);
uint chunkSizePHG2 = reader.ReadUInt32(); // total size of PHG2 chunk (515 in Bruno)
uint groupCount = reader.ReadUInt32(); // 9
for (uint i = 0; i < groupCount; i++)
{
uint groupNameLength = reader.ReadUInt32();
string groupName = reader.ReadFixedLengthString(groupNameLength);
uint groupPhonemeCount = reader.ReadUInt32();
for (uint j = 0; j < phonemeCount; j++)
{
uint unknown8 = reader.ReadUInt32(); // unknown (possibly index into PHDC table?)
uint groupPhonemeNameLength = reader.ReadUInt32();
string groupPhonemeName = reader.ReadFixedLengthString(groupPhonemeNameLength);
}
uint unknown9 = reader.ReadUInt32();
}
// whenever we get to "TDB " chunk
}
protected override void SaveInternal(ObjectModel objectModel)
{
throw new NotImplementedException();
}
}
}

View File

@ -0,0 +1,155 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UniversalEditor.IO;
using UniversalEditor.ObjectModels.Multimedia.Audio.Voicebank;
using UniversalEditor.ObjectModels.Multimedia.Audio.VoicebankIndex;
namespace UniversalEditor.DataFormats.Multimedia.Audio.VoicebankIndex.Vocaloid
{
public class VocaloidIndexDataFormat : DataFormat
{
private static DataFormatReference _dfr = null;
public override DataFormatReference MakeReference()
{
if (_dfr == null)
{
_dfr = base.MakeReference();
_dfr.Capabilities.Add(typeof(VoicebankIndexObjectModel), DataFormatCapabilities.All);
_dfr.Filters.Add("Vocaloid voicebank index", new byte?[][] { new byte?[] { null, null, null, null, null, null, null, null, (byte)'D', (byte)'B', (byte)'S', (byte)'e' } }, new string[] { "*.ddi" });
}
return _dfr;
}
protected override void LoadInternal(ref ObjectModel objectModel)
{
VoicebankIndexObjectModel dbse = (objectModel as VoicebankIndexObjectModel);
if (dbse == null) throw new ObjectModelNotSupportedException();
Reader reader = base.Accessor.Reader;
// Bruno Clara
uint unknown1 = reader.ReadUInt32(); // 0
uint unknown2 = reader.ReadUInt32();
string chunkName = reader.ReadFixedLengthString(4); // DBSe
uint unknown3 = reader.ReadUInt32();
uint unknown4 = reader.ReadUInt32(); // 1
uint unknown5 = reader.ReadUInt32();
uint unknown6 = reader.ReadUInt32(); // 3, subchunk count?
long offsetToPHDC = reader.Accessor.Position;
string chunkNamePHDC = reader.ReadFixedLengthString(4);
uint chunkSizePHDC = reader.ReadUInt32(); // total size of PHDC chunk (3927 in Bruno)
uint offsetToGuid = (uint)(chunkSizePHDC + offsetToPHDC);
uint unknown7 = reader.ReadUInt32(); // 4
uint phonemeCount = reader.ReadUInt32(); // 32
for (uint i = 0; i < phonemeCount; i++)
{
string phonemeName = reader.ReadFixedLengthString(30).TrimNull();
byte phonemeData = reader.ReadByte();
Phoneme p = new Phoneme();
p.Title = phonemeName;
dbse.Phonemes.Add(p);
}
string chunkNamePHG2 = reader.ReadFixedLengthString(4);
uint chunkSizePHG2 = reader.ReadUInt32(); // total size of PHG2 chunk (515 in Bruno)
uint groupCount = reader.ReadUInt32(); // 9
for (uint i = 0; i < groupCount; i++)
{
uint groupNameLength = reader.ReadUInt32();
string groupName = reader.ReadFixedLengthString(groupNameLength);
uint groupPhonemeCount = reader.ReadUInt32();
PhonemeGroup pg = new PhonemeGroup();
pg.Title = groupName;
for (uint j = 0; j < groupPhonemeCount; j++)
{
uint unknown8 = reader.ReadUInt32(); // unknown (possibly index into PHDC table?)
uint groupPhonemeNameLength = reader.ReadUInt32();
string groupPhonemeName = reader.ReadFixedLengthString(groupPhonemeNameLength);
Phoneme p = new Phoneme();
p.Title = groupPhonemeName;
pg.Phonemes.Add(p);
}
uint unknown9 = reader.ReadUInt32();
dbse.Groups.Add(pg);
}
// I do not know how to read the rest of the PHDC chunk, but I do know how to skip it...
base.Accessor.Seek(offsetToGuid, SeekOrigin.Begin);
dbse.Title = reader.ReadFixedLengthString(260).TrimNull();
uint unknown10 = reader.ReadUInt32();
uint unknown11 = reader.ReadUInt32();
uint unknown12 = reader.ReadUInt32();
string chunkNameTDB = reader.ReadFixedLengthString(4);
uint unknown13 = reader.ReadUInt32(); // 0
uint unknown14 = reader.ReadUInt32(); // 1
uint unknown15 = reader.ReadUInt32(); // 0
uint chunkCountTMM = reader.ReadUInt32();
uint unknown16 = reader.ReadUInt32();
uint unknown17 = reader.ReadUInt32();
for (uint i = 0; i < chunkCountTMM; i++)
{
string chunkNameTMM = reader.ReadFixedLengthString(4);
uint unknown18 = reader.ReadUInt32(); // 0
uint unknown19 = reader.ReadUInt32(); // 1
uint unknown20 = reader.ReadUInt32(); // 0
uint phonemeIndex = reader.ReadUInt32(); // is this right?
uint chunkCountARR = reader.ReadUInt32();
uint unknown21 = reader.ReadUInt32();
uint unknown22 = reader.ReadUInt32();
for (uint j = 0; j < chunkCountARR; j++)
{
DDIParameter param = new DDIParameter();
string chunkNameARR = reader.ReadFixedLengthString(4);
uint unknown23 = reader.ReadUInt32(); // 0
uint unknown24 = reader.ReadUInt32(); // 1
uint unknown25 = reader.ReadUInt32(); // 0
uint unknown26 = reader.ReadUInt32();
uint paramNameLength = reader.ReadUInt32();
param.ParameterName = reader.ReadFixedLengthString(paramNameLength);
int phonemeNameLength = reader.ReadInt32();
string phonemeName = null;
if (phonemeNameLength > -1)
{
phonemeName = reader.ReadFixedLengthString(phonemeNameLength);
}
param.PhonemeName = phonemeName;
uint unknown28 = reader.ReadUInt32();
}
uint unknown29 = reader.ReadUInt32();
}
}
protected override void SaveInternal(ObjectModel objectModel)
{
VoicebankIndexObjectModel dbse = (objectModel as VoicebankIndexObjectModel);
if (dbse == null) throw new ObjectModelNotSupportedException();
Writer writer = base.Accessor.Writer;
writer.WriteUInt32(0);
writer.WriteUInt32(0);
writer.WriteFixedLengthString("DBSe");
writer.Flush();
}
}
}

View File

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace UniversalEditor.DataFormats.Multimedia.Audio.VoicebankIndex.Vocaloid
{
public struct DDIParameter
{
public string ParameterName;
public string PhonemeName;
public override string ToString()
{
StringBuilder sb = new StringBuilder();
if (PhonemeName != null)
{
sb.Append(PhonemeName);
sb.Append(":");
}
if (ParameterName != null) sb.Append(ParameterName);
return sb.ToString();
}
}
}

View File

@ -5,7 +5,7 @@ using System.Text;
namespace UniversalEditor.ObjectModels.Multimedia.Audio.Voicebank
{
public class Phoneme
public class Phoneme : ICloneable
{
public class PhonemeCollection
: System.Collections.ObjectModel.Collection<Phoneme>
@ -15,5 +15,12 @@ namespace UniversalEditor.ObjectModels.Multimedia.Audio.Voicebank
private string mvarTitle = String.Empty;
public string Title { get { return mvarTitle; } set { mvarTitle = value; } }
public object Clone()
{
Phoneme clone = new Phoneme();
clone.Title = (mvarTitle.Clone() as string);
return clone;
}
}
}

View File

@ -5,7 +5,7 @@ using System.Text;
namespace UniversalEditor.ObjectModels.Multimedia.Audio.Voicebank
{
public class PhonemeGroup
public class PhonemeGroup : ICloneable
{
public class PhonemeGroupCollection
: System.Collections.ObjectModel.Collection<PhonemeGroup>
@ -18,5 +18,16 @@ namespace UniversalEditor.ObjectModels.Multimedia.Audio.Voicebank
private Phoneme.PhonemeCollection mvarPhonemes = new Phoneme.PhonemeCollection();
public Phoneme.PhonemeCollection Phonemes { get { return mvarPhonemes; } }
public object Clone()
{
PhonemeGroup clone = new PhonemeGroup();
clone.Title = (mvarTitle.Clone() as string);
foreach (Phoneme p in mvarPhonemes)
{
clone.Phonemes.Add(p);
}
return clone;
}
}
}

View File

@ -10,12 +10,16 @@ namespace UniversalEditor.ObjectModels.Multimedia.Audio.Voicebank
{
}
private static ObjectModelReference _omr = null;
public override ObjectModelReference MakeReference()
{
ObjectModelReference omr = base.MakeReference();
omr.Title = "Synthesized audio voice bank";
omr.Path = new string[] { "Multimedia", "Audio", "Voicebank" };
return omr;
if (_omr == null)
{
_omr = base.MakeReference();
_omr.Title = "Synthesized audio voice bank";
_omr.Path = new string[] { "Multimedia", "Audio", "Voicebank" };
}
return _omr;
}
public override void Clear()

View File

@ -0,0 +1,53 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UniversalEditor.ObjectModels.Multimedia.Audio.Voicebank;
namespace UniversalEditor.ObjectModels.Multimedia.Audio.VoicebankIndex
{
public class VoicebankIndexObjectModel : ObjectModel
{
private static ObjectModelReference _omr = null;
public override ObjectModelReference MakeReference()
{
if (_omr == null)
{
_omr = base.MakeReference();
_omr.Path = new string[] { "Multimedia", "Audio", "Voicebank index" };
_omr.Title = "Voicebank index";
}
return _omr;
}
private string mvarTitle = String.Empty;
public string Title { get { return mvarTitle; } set { mvarTitle = value; } }
private Phoneme.PhonemeCollection mvarPhonemes = new Phoneme.PhonemeCollection();
public Phoneme.PhonemeCollection Phonemes { get { return mvarPhonemes; } }
private PhonemeGroup.PhonemeGroupCollection mvarGroups = new PhonemeGroup.PhonemeGroupCollection();
public PhonemeGroup.PhonemeGroupCollection Groups { get { return mvarGroups; } }
public override void Clear()
{
mvarTitle = String.Empty;
mvarPhonemes.Clear();
mvarGroups.Clear();
}
public override void CopyTo(ObjectModel where)
{
VoicebankIndexObjectModel clone = (where as VoicebankIndexObjectModel);
clone.Title = (mvarTitle.Clone() as string);
foreach (Phoneme p in mvarPhonemes)
{
clone.Phonemes.Add(p.Clone() as Phoneme);
}
foreach (PhonemeGroup pg in mvarGroups)
{
clone.Groups.Add(pg.Clone() as PhonemeGroup);
}
}
}
}

View File

@ -76,8 +76,9 @@
<Compile Include="DataFormats\Multimedia\Audio\Synthesized\SPC\SPC700ID666Tag.cs" />
<Compile Include="DataFormats\Multimedia\Audio\Synthesized\SPC\SPC700Memory.cs" />
<Compile Include="DataFormats\Multimedia\Audio\Synthesized\SPC\SPC700Registers.cs" />
<Compile Include="DataFormats\Multimedia\Audio\VoicebankIndex\Vocaloid\DDIParameter.cs" />
<Compile Include="DataFormats\Multimedia\Audio\VoicebankPhonemeDictionary\PhonemeDictionaryXMLDataFormat.cs" />
<Compile Include="DataFormats\Multimedia\Audio\Voicebank\Vocaloid\VocaloidIndexDataFormat.cs" />
<Compile Include="DataFormats\Multimedia\Audio\VoicebankIndex\Vocaloid\DDIDataFormat.cs" />
<Compile Include="DataFormats\Multimedia\Audio\Voicebank\Vocaloid\VocaloidVoicebankDataFormat.cs" />
<Compile Include="DataFormats\Multimedia\Palette\Adobe\ACODataFormat.cs" />
<Compile Include="DataFormats\Multimedia\Palette\Adobe\ASEDataFormat.cs" />
@ -186,6 +187,7 @@
<Compile Include="ObjectModels\Multimedia\Audio\Synthesized\SynthesizedAudioVibratoType.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="ObjectModels\Multimedia\Audio\VoicebankIndex\VoicebankIndexObjectModel.cs" />
<Compile Include="ObjectModels\Multimedia\Audio\VoicebankPhonemeDictionary\Phoneme.cs" />
<Compile Include="ObjectModels\Multimedia\Audio\VoicebankPhonemeDictionary\PhonemeDictionaryObjectModel.cs" />
<Compile Include="ObjectModels\Multimedia\Audio\VoicebankPhonemeDictionary\PhonemeList.cs" />