diff --git a/Release/AcbEditor.exe b/Release/AcbEditor.exe
index 2218493..6280685 100644
Binary files a/Release/AcbEditor.exe and b/Release/AcbEditor.exe differ
diff --git a/Release/CsbBuilder.exe b/Release/CsbBuilder.exe
new file mode 100644
index 0000000..62f2027
Binary files /dev/null and b/Release/CsbBuilder.exe differ
diff --git a/Release/CsbEditor.exe b/Release/CsbEditor.exe
index 2605829..1ae559d 100644
Binary files a/Release/CsbEditor.exe and b/Release/CsbEditor.exe differ
diff --git a/Release/NAudio.dll b/Release/NAudio.dll
new file mode 100644
index 0000000..553425e
Binary files /dev/null and b/Release/NAudio.dll differ
diff --git a/Release/SonicAudioLib.dll b/Release/SonicAudioLib.dll
index 140bf48..5570e86 100644
Binary files a/Release/SonicAudioLib.dll and b/Release/SonicAudioLib.dll differ
diff --git a/SonicAudioTools.sln b/SonicAudioTools.sln
index 3035499..87fd3d2 100644
--- a/SonicAudioTools.sln
+++ b/SonicAudioTools.sln
@@ -11,7 +11,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AcbEditor", "Source\AcbEdit
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CsbEditor", "Source\CsbEditor\CsbEditor.csproj", "{91F6B6A6-5D95-4C7A-B22E-A35BD32DB67A}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CsbBuilder", "Source\CsbBuilder\CsbBuilder.csproj", "{4CF49665-3DFD-4A5C-B231-B97842F091B9}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CsbBuilder", "Source\CsbBuilder\CsbBuilder.csproj", "{70A6A571-23EC-4B2C-A579-1E6812DDC34E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -34,9 +34,10 @@ Global
{91F6B6A6-5D95-4C7A-B22E-A35BD32DB67A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{91F6B6A6-5D95-4C7A-B22E-A35BD32DB67A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{91F6B6A6-5D95-4C7A-B22E-A35BD32DB67A}.Release|Any CPU.Build.0 = Release|Any CPU
- {4CF49665-3DFD-4A5C-B231-B97842F091B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {4CF49665-3DFD-4A5C-B231-B97842F091B9}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {4CF49665-3DFD-4A5C-B231-B97842F091B9}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {70A6A571-23EC-4B2C-A579-1E6812DDC34E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {70A6A571-23EC-4B2C-A579-1E6812DDC34E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {70A6A571-23EC-4B2C-A579-1E6812DDC34E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {70A6A571-23EC-4B2C-A579-1E6812DDC34E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/Source/AcbEditor/Properties/AssemblyInfo.cs b/Source/AcbEditor/Properties/AssemblyInfo.cs
index c031983..dbd24b1 100644
--- a/Source/AcbEditor/Properties/AssemblyInfo.cs
+++ b/Source/AcbEditor/Properties/AssemblyInfo.cs
@@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AcbEditor")]
-[assembly: AssemblyCopyright("Copyright © 2016")]
+[assembly: AssemblyCopyright("Copyright © blueskythlikesclouds 2014-2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -32,5 +32,4 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: AssemblyVersion("0.3.*")]
diff --git a/Source/CsbBuilder/App.config b/Source/CsbBuilder/App.config
index 88fa402..bbfefd3 100644
--- a/Source/CsbBuilder/App.config
+++ b/Source/CsbBuilder/App.config
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/Source/CsbBuilder/Audio/AdxConverter.cs b/Source/CsbBuilder/Audio/AdxConverter.cs
new file mode 100644
index 0000000..c31654c
--- /dev/null
+++ b/Source/CsbBuilder/Audio/AdxConverter.cs
@@ -0,0 +1,238 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.IO;
+
+using SonicAudioLib.IO;
+using NAudio.Wave;
+
+namespace CsbBuilder.Audio
+{
+ public struct AdxHeader
+ {
+ public ushort Identifier;
+ public ushort DataPosition;
+ public byte EncodeType;
+ public byte BlockLength;
+ public byte SampleBitdepth;
+ public byte ChannelCount;
+ public uint SampleRate;
+ public uint SampleCount;
+ public ushort CutoffFrequency;
+ public byte Version;
+ public byte Flags;
+ public bool LoopEnabled;
+ public uint LoopBeginSampleIndex;
+ public uint LoopBeginByteIndex;
+ public uint LoopEndSampleIndex;
+ public uint LoopEndByteIndex;
+ }
+
+ public static class AdxConverter
+ {
+ public static void ConvertToWav(string sourceFileName)
+ {
+ ConvertToWav(sourceFileName, Path.ChangeExtension(sourceFileName, "wav"));
+ }
+
+ public static void ConvertToWav(string sourceFileName, string destinationFileName)
+ {
+ BufferedWaveProvider provider = Decode(sourceFileName, 1.0, 0.0);
+
+ using (WaveFileWriter writer = new WaveFileWriter(destinationFileName, provider.WaveFormat))
+ {
+ int num;
+
+ byte[] buffer = new byte[32767];
+ while ((num = provider.Read(buffer, 0, buffer.Length)) != 0)
+ {
+ writer.Write(buffer, 0, num);
+ }
+ }
+
+ provider.ClearBuffer();
+ }
+
+ public static AdxHeader LoadHeader(string sourceFileName)
+ {
+ using (Stream source = File.OpenRead(sourceFileName))
+ {
+ return ReadHeader(source);
+ }
+ }
+
+ public static AdxHeader ReadHeader(Stream source)
+ {
+ AdxHeader header = new AdxHeader();
+ header.Identifier = EndianStream.ReadUInt16BE(source);
+ header.DataPosition = EndianStream.ReadUInt16BE(source);
+ header.EncodeType = EndianStream.ReadByte(source);
+ header.BlockLength = EndianStream.ReadByte(source);
+ header.SampleBitdepth = EndianStream.ReadByte(source);
+ header.ChannelCount = EndianStream.ReadByte(source);
+ header.SampleRate = EndianStream.ReadUInt32BE(source);
+ header.SampleCount = EndianStream.ReadUInt32BE(source);
+ header.CutoffFrequency = EndianStream.ReadUInt16BE(source);
+ header.Version = EndianStream.ReadByte(source);
+ header.Flags = EndianStream.ReadByte(source);
+ source.Seek(4, SeekOrigin.Current);
+ header.LoopEnabled = EndianStream.ReadUInt32BE(source) > 0;
+ header.LoopBeginSampleIndex = EndianStream.ReadUInt32BE(source);
+ header.LoopBeginByteIndex = EndianStream.ReadUInt32BE(source);
+ header.LoopEndSampleIndex = EndianStream.ReadUInt32BE(source);
+ header.LoopEndByteIndex = EndianStream.ReadUInt32BE(source);
+ return header;
+ }
+
+ public static BufferedWaveProvider Decode(string sourceFileName, double volume, double pitch)
+ {
+ using (Stream source = File.OpenRead(sourceFileName))
+ {
+ return Decode(source, volume, pitch);
+ }
+ }
+
+ private static void CalculateCoefficients(double cutoffFrequency, double sampleRate, out short coef1, out short coef2)
+ {
+ double a = Math.Sqrt(2.0);
+ double b = a - Math.Cos(cutoffFrequency * 6.2831855 / sampleRate);
+ double c = (b - Math.Sqrt((b - (a - 1.0)) * (a - 1.0 + b))) / (a - 1.0);
+
+ coef1 = (short)(8192.0 * c);
+ coef2 = (short)(c * c * -4096.0);
+ }
+
+ // https://wiki.multimedia.cx/index.php/CRI_ADX_ADPCM
+ public static BufferedWaveProvider Decode(Stream source, double volume, double pitch)
+ {
+ AdxHeader header = ReadHeader(source);
+
+ WaveFormat waveFormat = new WaveFormat((int)header.SampleRate, 16, header.ChannelCount);
+ BufferedWaveProvider provider = new BufferedWaveProvider(waveFormat);
+ provider.BufferLength = (int)(header.SampleCount * header.ChannelCount * 2);
+
+ provider.ReadFully = false;
+ provider.DiscardOnBufferOverflow = true;
+
+ short firstHistory1 = 0;
+ short firstHistory2 = 0;
+ short secondHistory1 = 0;
+ short secondHistory2 = 0;
+
+ short coef1 = 0;
+ short coef2 = 0;
+
+ CalculateCoefficients(header.CutoffFrequency, header.SampleRate, out coef1, out coef2);
+
+ source.Seek(header.DataPosition + 4, SeekOrigin.Begin);
+
+ if (header.ChannelCount == 1)
+ {
+ for (int i = 0; i < header.SampleCount / 32; i++)
+ {
+ byte[] block = EndianStream.ReadBytes(source, header.BlockLength);
+ foreach (short sampleShort in DecodeBlock(block, ref firstHistory1, ref firstHistory2, coef1, coef2))
+ {
+ double sample = (double)sampleShort * volume;
+
+ if (sample > short.MaxValue)
+ {
+ sample = short.MaxValue;
+ }
+
+ if (sample < short.MinValue)
+ {
+ sample = short.MinValue;
+ }
+
+ provider.AddSamples(BitConverter.GetBytes((short)sample), 0, 2);
+ }
+ }
+ }
+
+ else if (header.ChannelCount == 2)
+ {
+ for (int i = 0; i < header.SampleCount / 32; i++)
+ {
+ byte[] blockLeft = EndianStream.ReadBytes(source, header.BlockLength);
+ byte[] blockRight = EndianStream.ReadBytes(source, header.BlockLength);
+
+ short[] samplesLeft = DecodeBlock(blockLeft, ref firstHistory1, ref firstHistory2, coef1, coef2);
+ short[] samplesRight = DecodeBlock(blockRight, ref secondHistory1, ref secondHistory2, coef1, coef2);
+
+ for (int j = 0; j < 32; j++)
+ {
+ double newSampleLeft = samplesLeft[j] * volume;
+ double newSampleRight = samplesRight[j] * volume;
+
+ if (newSampleLeft > short.MaxValue)
+ {
+ newSampleLeft = short.MaxValue;
+ }
+
+ if (newSampleLeft < short.MinValue)
+ {
+ newSampleLeft = short.MinValue;
+ }
+
+ if (newSampleRight > short.MaxValue)
+ {
+ newSampleRight = short.MaxValue;
+ }
+
+ if (newSampleRight < short.MinValue)
+ {
+ newSampleRight = short.MinValue;
+ }
+
+ samplesLeft[j] = (short)newSampleLeft;
+ samplesRight[j] = (short)newSampleRight;
+
+ byte[] sampleLeft = BitConverter.GetBytes(samplesLeft[j]);
+ byte[] sampleRight = BitConverter.GetBytes(samplesRight[j]);
+
+ provider.AddSamples(new byte[] { sampleLeft[0], sampleLeft[1], sampleRight[0], sampleRight[1] }, 0, 4);
+ }
+ }
+ }
+
+ return provider;
+ }
+
+ public static short[] DecodeBlock(byte[] block, ref short history1, ref short history2, short coef1, short coef2)
+ {
+ int scale = (block[0] << 8 | block[1]) + 1;
+
+ short[] samples = new short[32];
+
+ for (int i = 0; i < 32; i++)
+ {
+ int sampleByte = block[2 + i / 2];
+ int sampleNibble = ((i & 1) != 0 ? (sampleByte & 7) - (sampleByte & 8) : ((sampleByte & 0x70) - (sampleByte & 0x80)) >> 4);
+ int sampleDelta = sampleNibble * scale;
+ int predictedSample12 = coef1 * history1 + coef2 * history2;
+ int predictedSample = predictedSample12 >> 12;
+
+ int sampleRaw = predictedSample + sampleDelta;
+
+ if (sampleRaw > short.MaxValue)
+ {
+ sampleRaw = short.MaxValue;
+ }
+
+ else if (sampleRaw < short.MinValue)
+ {
+ sampleRaw = short.MinValue;
+ }
+
+ samples[i] = (short)sampleRaw;
+
+ history2 = history1;
+ history1 = (short)sampleRaw;
+ }
+
+ return samples;
+ }
+ }
+}
diff --git a/Source/CsbBuilder/Builder/CsbBuilder.cs b/Source/CsbBuilder/Builder/CsbBuilder.cs
new file mode 100644
index 0000000..4e5e2f0
--- /dev/null
+++ b/Source/CsbBuilder/Builder/CsbBuilder.cs
@@ -0,0 +1,323 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.IO;
+
+using CsbBuilder.Project;
+using CsbBuilder.BuilderNode;
+using CsbBuilder.Serialization;
+
+using SonicAudioLib.CriMw;
+using SonicAudioLib.CriMw.Serialization;
+using SonicAudioLib.Archive;
+
+namespace CsbBuilder.Builder
+{
+ public static class CsbBuilder
+ {
+ public static void Build(CsbProject project, string outputFileName)
+ {
+ CriCpkArchive cpkArchive = new CriCpkArchive();
+
+ DirectoryInfo outputDirectory = new DirectoryInfo(Path.GetDirectoryName(outputFileName));
+
+ List cueSheetTables = new List();
+
+ SerializationVersionInfoTable versionInfoTable = new SerializationVersionInfoTable();
+ cueSheetTables.Add(new SerializationCueSheetTable
+ {
+ TableData = CriTableSerializer.Serialize(new List() { versionInfoTable }, CriTableWriterSettings.AdxSettings),
+ Name = "INFO",
+ TableType = 7,
+ });
+
+ // Serialize cues.
+ List cueTables = new List();
+ foreach (BuilderCueNode cueNode in project.CueNodes)
+ {
+ cueTables.Add(new SerializationCueTable
+ {
+ Name = cueNode.Name,
+ Id = cueNode.Identifier,
+ UserData = cueNode.UserComment,
+ Flags = cueNode.Flags,
+ SynthPath = cueNode.SynthReference,
+ });
+ }
+
+ cueSheetTables.Add(new SerializationCueSheetTable
+ {
+ TableData = CriTableSerializer.Serialize(cueTables, CriTableWriterSettings.AdxSettings),
+ Name = "CUE",
+ TableType = 1,
+ });
+
+ // Serialize synth tables.
+ List synthTables = new List();
+ foreach (BuilderSynthNode synthNode in project.SynthNodes)
+ {
+ SerializationSynthTable synthTable = new SerializationSynthTable
+ {
+ SynthName = synthNode.Name,
+ SynthType = (byte)synthNode.Type,
+ ComplexType = (byte)synthNode.PlaybackType,
+ Volume = synthNode.Volume,
+ Pitch = synthNode.Pitch,
+ DelayTime = synthNode.DelayTime,
+ SControl = synthNode.SControl,
+ EgDelay = synthNode.EgDelay,
+ EgAttack = synthNode.EgAttack,
+ EgHold = synthNode.EgHold,
+ EgDecay = synthNode.EgDecay,
+ EgRelease = synthNode.EgRelease,
+ EgSustain = synthNode.EgSustain,
+ FType = synthNode.FilterType,
+ FCof1 = synthNode.FilterCutoff1,
+ FCof2 = synthNode.FilterCutoff2,
+ FReso = synthNode.FilterReso,
+ FReleaseOffset = synthNode.FilterReleaseOffset,
+ DryOName = synthNode.DryOName,
+ Mtxrtr = synthNode.Mtxrtr,
+ Dry0 = synthNode.Dry0,
+ Dry1 = synthNode.Dry1,
+ Dry2 = synthNode.Dry2,
+ Dry3 = synthNode.Dry3,
+ Dry4 = synthNode.Dry4,
+ Dry5 = synthNode.Dry5,
+ Dry6 = synthNode.Dry6,
+ Dry7 = synthNode.Dry7,
+ WetOName = synthNode.WetOName,
+ Wet0 = synthNode.Wet0,
+ Wet1 = synthNode.Wet1,
+ Wet2 = synthNode.Wet2,
+ Wet3 = synthNode.Wet3,
+ Wet4 = synthNode.Wet4,
+ Wet5 = synthNode.Wet5,
+ Wet6 = synthNode.Wet6,
+ Wet7 = synthNode.Wet7,
+ Wcnct0 = synthNode.Wcnct0,
+ Wcnct1 = synthNode.Wcnct1,
+ Wcnct2 = synthNode.Wcnct2,
+ Wcnct3 = synthNode.Wcnct3,
+ Wcnct4 = synthNode.Wcnct4,
+ Wcnct5 = synthNode.Wcnct5,
+ Wcnct6 = synthNode.Wcnct6,
+ Wcnct7 = synthNode.Wcnct7,
+ VoiceLimitGroupName = synthNode.VoiceLimitGroupReference,
+ VoiceLimitType = synthNode.VoiceLimitType,
+ VoiceLimitPriority = synthNode.VoiceLimitPriority,
+ VoiceLimitPhTime = synthNode.VoiceLimitProhibitionTime,
+ VoiceLimitPcdlt = synthNode.VoiceLimitPcdlt,
+ Pan3dVolumeOffset = synthNode.Pan3dVolumeOffset,
+ Pan3dVolumeGain = synthNode.Pan3dVolumeGain,
+ Pan3dAngleOffset = synthNode.Pan3dAngleOffset,
+ Pan3dAngleGain = synthNode.Pan3dAngleGain,
+ Pan3dDistanceOffset = synthNode.Pan3dDistanceOffset,
+ Pan3dDistanceGain = synthNode.Pan3dDistanceGain,
+ Dry0g = synthNode.Dry0g,
+ Dry1g = synthNode.Dry1g,
+ Dry2g = synthNode.Dry2g,
+ Dry3g = synthNode.Dry3g,
+ Dry4g = synthNode.Dry4g,
+ Dry5g = synthNode.Dry5g,
+ Dry6g = synthNode.Dry6g,
+ Dry7g = synthNode.Dry7g,
+ Wet0g = synthNode.Wet0g,
+ Wet1g = synthNode.Wet1g,
+ Wet2g = synthNode.Wet2g,
+ Wet3g = synthNode.Wet3g,
+ Wet4g = synthNode.Wet4g,
+ Wet5g = synthNode.Wet5g,
+ Wet6g = synthNode.Wet6g,
+ Wet7g = synthNode.Wet7g,
+ F1Type = synthNode.Filter1Type,
+ F1CofOffset = synthNode.Filter1CutoffOffset,
+ F1CofGain = synthNode.Filter1CutoffGain,
+ F1ResoOffset = synthNode.Filter1ResoOffset,
+ F1ResoGain = synthNode.Filter1ResoGain,
+ F2Type = synthNode.Filter2Type,
+ F2CofLowOffset = synthNode.Filter2CutoffLowerOffset,
+ F2CofLowGain = synthNode.Filter2CutoffLowerGain,
+ F2CofHighOffset = synthNode.Filter2CutoffHigherOffset,
+ F2CofHighGain = synthNode.Filter2CutoffHigherGain,
+ Probability = synthNode.PlaybackProbability,
+ NumberLmtChildren = synthNode.NLmtChildren,
+ Repeat = synthNode.Repeat,
+ ComboTime = synthNode.ComboTime,
+ ComboLoopBack = synthNode.ComboLoopBack,
+ };
+
+ if (synthNode.Type == BuilderSynthType.Single)
+ {
+ synthTable.LinkName = synthNode.SoundElementReference;
+ }
+
+ else if (synthNode.Type == BuilderSynthType.WithChildren)
+ {
+ foreach (string trackReference in synthNode.Children)
+ {
+ synthTable.LinkName += trackReference + (char)0x0A;
+ }
+ }
+
+ if (!string.IsNullOrEmpty(synthNode.AisacReference))
+ {
+ BuilderAisacNode aisacNode = project.AisacNodes.First(aisac => aisac.Name == synthNode.AisacReference);
+ synthTable.AisacSetName = aisacNode.AisacName + "::" + aisacNode.Name + (char)0x0A;
+ }
+
+ synthTables.Add(synthTable);
+ }
+
+ cueSheetTables.Add(new SerializationCueSheetTable
+ {
+ TableData = CriTableSerializer.Serialize(synthTables, CriTableWriterSettings.AdxSettings),
+ Name = "SYNTH",
+ TableType = 2,
+ });
+
+ List junks = new List();
+
+ // Serialize the sound elements.
+ List soundElementTables = new List();
+ foreach (BuilderSoundElementNode soundElementNode in project.SoundElementNodes)
+ {
+ CriAaxArchive aaxArchive = new CriAaxArchive();
+
+ if (!string.IsNullOrEmpty(soundElementNode.Intro))
+ {
+ aaxArchive.Add(new CriAaxEntry
+ {
+ Flag = CriAaxEntryFlag.Intro,
+ FilePath = new FileInfo(Path.Combine(project.AudioDirectory.FullName, soundElementNode.Intro)),
+ });
+ }
+
+ if (!string.IsNullOrEmpty(soundElementNode.Loop))
+ {
+ aaxArchive.Add(new CriAaxEntry
+ {
+ Flag = CriAaxEntryFlag.Loop,
+ FilePath = new FileInfo(Path.Combine(project.AudioDirectory.FullName, soundElementNode.Loop)),
+ });
+ }
+
+ byte[] data = new byte[0];
+
+ if (soundElementNode.Streaming)
+ {
+ CriCpkEntry entry = new CriCpkEntry();
+ entry.Name = Path.GetFileName(soundElementNode.Name);
+ entry.DirectoryName = Path.GetDirectoryName(soundElementNode.Name);
+ entry.Id = (uint)cpkArchive.Count;
+ entry.UpdateDateTime = DateTime.Now;
+ entry.FilePath = new FileInfo(Path.GetTempFileName());
+ cpkArchive.Add(entry);
+
+ aaxArchive.Save(entry.FilePath.FullName);
+ junks.Add(entry.FilePath);
+ }
+
+ else
+ {
+ data = aaxArchive.Save();
+ }
+
+ soundElementTables.Add(new SerializationSoundElementTable
+ {
+ Name = soundElementNode.Name,
+ Data = data,
+ FormatType = 0,
+ SoundFrequency = soundElementNode.SampleRate,
+ NumberChannels = soundElementNode.ChannelCount,
+ Streaming = soundElementNode.Streaming,
+ NumberSamples = soundElementNode.SampleCount,
+ });
+ }
+
+ cueSheetTables.Add(new SerializationCueSheetTable
+ {
+ TableData = CriTableSerializer.Serialize(soundElementTables, CriTableWriterSettings.AdxSettings),
+ Name = "SOUND_ELEMENT",
+ TableType = 4,
+ });
+
+ // Serialize the aisacs.
+ List aisacTables = new List();
+ foreach (BuilderAisacNode aisacNode in project.AisacNodes)
+ {
+ List graphTables = new List();
+ foreach (BuilderAisacGraphNode graphNode in aisacNode.Graphs)
+ {
+ List pointTables = new List();
+ foreach (BuilderAisacPointNode pointNode in graphNode.Points)
+ {
+ pointTables.Add(new SerializationAisacPointTable
+ {
+ In = pointNode.X,
+ Out = pointNode.Y,
+ });
+ }
+
+ graphTables.Add(new SerializationAisacGraphTable
+ {
+ Points = CriTableSerializer.Serialize(pointTables, CriTableWriterSettings.AdxSettings),
+ Type = graphNode.Type,
+ InMax = graphNode.MaximumX,
+ InMin = graphNode.MinimumX,
+ OutMax = graphNode.MaximumY,
+ OutMin = graphNode.MinimumY,
+ });
+ }
+
+ aisacTables.Add(new SerializationAisacTable
+ {
+ Graph = CriTableSerializer.Serialize(graphTables, CriTableWriterSettings.AdxSettings),
+ Name = aisacNode.AisacName,
+ PathName = aisacNode.Name,
+ Type = aisacNode.Type,
+ RandomRange = aisacNode.RandomRange,
+ });
+ }
+
+ cueSheetTables.Add(new SerializationCueSheetTable
+ {
+ TableData = CriTableSerializer.Serialize(aisacTables, CriTableWriterSettings.AdxSettings),
+ Name = "ISAAC",
+ TableType = 5,
+ });
+
+ // Serialize the voice limit groups.
+ List voiceLimitGroupTables = new List();
+ foreach (BuilderVoiceLimitGroupNode voiceLimitGroupNode in project.VoiceLimitGroupNodes)
+ {
+ voiceLimitGroupTables.Add(new SerializationVoiceLimitGroupTable
+ {
+ VoiceLimitGroupName = voiceLimitGroupNode.Name,
+ VoiceLimitGroupNum = voiceLimitGroupNode.MaxAmountOfInstances,
+ });
+ }
+
+ cueSheetTables.Add(new SerializationCueSheetTable
+ {
+ TableData = CriTableSerializer.Serialize(voiceLimitGroupTables, CriTableWriterSettings.AdxSettings),
+ Name = "VOICE_LIMIT_GROUP",
+ TableType = 6,
+ });
+
+ // Finally, serialize the CSB file.
+ CriTableSerializer.Serialize(outputFileName, cueSheetTables, CriTableWriterSettings.AdxSettings);
+
+ if (cpkArchive.Count > 0)
+ {
+ cpkArchive.Save(Path.ChangeExtension(outputFileName, "cpk"));
+ }
+
+ foreach (FileInfo junk in junks)
+ {
+ junk.Delete();
+ }
+ }
+ }
+}
diff --git a/Source/CsbBuilder/BuilderNode/BuilderAisacGraphNode.cs b/Source/CsbBuilder/BuilderNode/BuilderAisacGraphNode.cs
new file mode 100644
index 0000000..f39a9cd
--- /dev/null
+++ b/Source/CsbBuilder/BuilderNode/BuilderAisacGraphNode.cs
@@ -0,0 +1,41 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.ComponentModel;
+
+namespace CsbBuilder.BuilderNode
+{
+ public class BuilderAisacGraphNode : BuilderBaseNode
+ {
+ [Category("General")]
+ [Description("The type of this Graph. Currently, none of the types are known.")]
+ public byte Type { get; set; }
+
+ [Category("Vector"), DisplayName("Maximum X")]
+ [Description("The maximum range that the X values in this Graph can reach.")]
+ public float MaximumX { get; set; }
+
+ [Category("Vector"), DisplayName("Minimum X")]
+ [Description("The minimum range that the X values in this Graph can reach.")]
+ public float MinimumX { get; set; }
+
+ [Category("Vector"), DisplayName("Maximum Y")]
+ [Description("The maximum range that the Y values in this Graph can reach.")]
+ public float MaximumY { get; set; }
+
+ [Category("Vector"), DisplayName("Minimum Y")]
+ [Description("The minimum range that the Y values in this Graph can reach.")]
+ public float MinimumY { get; set; }
+
+ [Category("Vector"), DisplayName("Points")]
+ [Description("The points of this Graph.")]
+ public List Points { get; set; }
+
+ public BuilderAisacGraphNode()
+ {
+ Points = new List();
+ }
+ }
+}
diff --git a/Source/CsbBuilder/BuilderNode/BuilderAisacNode.cs b/Source/CsbBuilder/BuilderNode/BuilderAisacNode.cs
new file mode 100644
index 0000000..86cf513
--- /dev/null
+++ b/Source/CsbBuilder/BuilderNode/BuilderAisacNode.cs
@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.ComponentModel;
+
+namespace CsbBuilder.BuilderNode
+{
+ public class BuilderAisacNode : BuilderBaseNode
+ {
+ [Category("General"), DisplayName("Aisac Name")]
+ [Description("The name of this Aisac. (Shouldn't be seen as the node name.)")]
+ public string AisacName { get; set; }
+
+ [Category("General")]
+ [Description("The type of this Aisac. Currently, none of the types are known.")]
+ public byte Type { get; set; }
+
+ [Category("Graph")]
+ [Description("The Graph's of this Aisac.")]
+ public List Graphs { get; set; }
+
+ [Category("Graph"), DisplayName("Random Range (Unknown)")]
+ public byte RandomRange { get; set; }
+
+ public BuilderAisacNode()
+ {
+ Graphs = new List();
+ }
+ }
+}
diff --git a/Source/CsbBuilder/BuilderNode/BuilderAisacPointNode.cs b/Source/CsbBuilder/BuilderNode/BuilderAisacPointNode.cs
new file mode 100644
index 0000000..e7c6a78
--- /dev/null
+++ b/Source/CsbBuilder/BuilderNode/BuilderAisacPointNode.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.ComponentModel;
+
+namespace CsbBuilder.BuilderNode
+{
+ public class BuilderAisacPointNode : BuilderBaseNode
+ {
+ [Category("Vector"), DisplayName("X")]
+ [Description("The X dimension of this Point, relative to the Graph it's in.")]
+ public ushort X { get; set; }
+
+ [Category("Vector"), DisplayName("Y")]
+ [Description("The Y dimension of this Point, relative to the Graph it's in.")]
+ public ushort Y { get; set; }
+ }
+}
diff --git a/Source/CsbBuilder/BuilderNode/BuilderBaseNode.cs b/Source/CsbBuilder/BuilderNode/BuilderBaseNode.cs
new file mode 100644
index 0000000..10ec999
--- /dev/null
+++ b/Source/CsbBuilder/BuilderNode/BuilderBaseNode.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.ComponentModel;
+using System.Globalization;
+
+namespace CsbBuilder.BuilderNode
+{
+ public abstract class BuilderBaseNode : ICloneable
+ {
+ [Category("General"), ReadOnly(true)]
+ [Description("The name of this node. Shift JIS encoding is used for this in the Cue Sheet Binary, so try to avoid using special characters that this codec does not support.")]
+ public string Name { get; set; }
+
+ public object Clone()
+ {
+ return MemberwiseClone();
+ }
+ }
+}
diff --git a/Source/CsbBuilder/BuilderNode/BuilderCueNode.cs b/Source/CsbBuilder/BuilderNode/BuilderCueNode.cs
new file mode 100644
index 0000000..1ca49f6
--- /dev/null
+++ b/Source/CsbBuilder/BuilderNode/BuilderCueNode.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.ComponentModel;
+
+namespace CsbBuilder.BuilderNode
+{
+ public class BuilderCueNode : BuilderBaseNode
+ {
+ [Category("General"), DisplayName("Identifier")]
+ [Description("The identifier of this Cue. Must be unique for this Cue Sheet.")]
+ public uint Identifier { get; set; }
+
+ [ReadOnly(true)]
+ [Category("General"), DisplayName("Synth Reference Path")]
+ [Description("The full path of the Synth (can be Track or Sound) that this Cue is referenced to. When this Cue is called to play in game, the referenced Synth will be played.")]
+ public string SynthReference { get; set; }
+
+ [Category("General"), DisplayName("User Comment")]
+ [Description("User comment of this Cue. Shift JIS encoding is used for this in the Cue Sheet Binary, so try to avoid using special characters that this codec does not support.")]
+ public string UserComment { get; set; }
+
+ [Category("General")]
+ [Description("Currently, none of the flags are known. However, value '1' seems to mute the Cue in-game.")]
+ public byte Flags { get; set; }
+ }
+}
diff --git a/Source/CsbBuilder/BuilderNode/BuilderSoundElementNode.cs b/Source/CsbBuilder/BuilderNode/BuilderSoundElementNode.cs
new file mode 100644
index 0000000..418f8f5
--- /dev/null
+++ b/Source/CsbBuilder/BuilderNode/BuilderSoundElementNode.cs
@@ -0,0 +1,41 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.IO;
+using System.ComponentModel;
+
+namespace CsbBuilder.BuilderNode
+{
+ public class BuilderSoundElementNode : BuilderBaseNode
+ {
+ [ReadOnly(true)]
+ [Category("General")]
+ [Description("The name of the audio in Project/Audio directory, which is going to play before the loop audio starts to play. Can be left empty, so that there will be no audio to play.")]
+ public string Intro { get; set; }
+
+ [ReadOnly(true)]
+ [Category("General")]
+ [Description("The name of the audio in Project/Audio directory, which is going to be looped. Can be left empty, so that there will be no audio to loop in-game.")]
+ public string Loop { get; set; }
+
+ [ReadOnly(true)]
+ [Category("General"), DisplayName("Channel Count")]
+ [Description("The channel count of BOTH Intro and Loop audio files. If they do not match, this will most likely result issues in-game, because the game ignores the channel count information in the audio file itself, but uses this info.")]
+ public byte ChannelCount { get; set; }
+
+ [Category("General"), DisplayName("Streamed")]
+ [Description("Determines whether the audio files specified here are going to be streamed from a .CPK file, which is outside the .CSB file. Otherwise, it will be played from the memory. That's the best to be 'true', if the specified audio files are large.")]
+ public bool Streaming { get; set; }
+
+ [ReadOnly(true)]
+ [Category("General"), DisplayName("Sample Rate")]
+ [Description("The sample rate of BOTH Intro and Loop audio files. If they do not match, this will most likely result issues in-game, because the game ignores the sample rate information in the audio file itself, but uses this info.")]
+ public uint SampleRate { get; set; }
+
+ [ReadOnly(true)]
+ [Category("General"), DisplayName("Sample Count")]
+ [Description("The sample count of Intro and Loop files, added together.")]
+ public uint SampleCount { get; set; }
+ }
+}
diff --git a/Source/CsbBuilder/BuilderNode/BuilderSynthNode.cs b/Source/CsbBuilder/BuilderNode/BuilderSynthNode.cs
new file mode 100644
index 0000000..c2f9035
--- /dev/null
+++ b/Source/CsbBuilder/BuilderNode/BuilderSynthNode.cs
@@ -0,0 +1,436 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.ComponentModel;
+using System.Reflection;
+
+namespace CsbBuilder.BuilderNode
+{
+ public enum BuilderSynthType
+ {
+ Single,
+ WithChildren,
+ }
+
+ public enum BuilderSynthPlaybackType
+ {
+ [Browsable(false)]
+ Normal = -1,
+ Polyphonic = 0,
+ RandomNoRepeat = 1,
+ Sequential = 2,
+ Random = 3,
+ }
+
+ public class BuilderSynthNode : BuilderBaseNode
+ {
+ private BuilderSynthPlaybackType playbackType = BuilderSynthPlaybackType.Polyphonic;
+ private Random random = new Random();
+ private List indices = new List();
+ private int nextChild = -1;
+ private byte playbackProbability = 100;
+
+ [Browsable(false)]
+ public BuilderSynthType Type { get; set; }
+
+ [Category("General"), DisplayName("Playback Type")]
+ [Description("The playback type of this Synth.")]
+ public BuilderSynthPlaybackType PlaybackType
+ {
+ get
+ {
+ if (Type == BuilderSynthType.Single)
+ {
+ return BuilderSynthPlaybackType.Normal;
+ }
+
+ return playbackType;
+ }
+
+ set
+ {
+ if (Type == BuilderSynthType.Single || value == BuilderSynthPlaybackType.Normal)
+ {
+ return;
+ }
+
+ playbackType = value;
+ }
+ }
+
+ [ReadOnly(true)]
+ [Category("General"), DisplayName("Sound Element Reference Path")]
+ [Description("The Sound that this Synth is referenced to. This will be empty if this Synth represents a Track.")]
+ public string SoundElementReference { get; set; }
+
+ [Browsable(false)]
+ public List Children { get; set; }
+
+ [ReadOnly(true)]
+ [Category("General"), DisplayName("Aisac Reference Path")]
+ [Description("The Aisac that this Synth is referenced to.")]
+ public string AisacReference { get; set; }
+
+ [Category("General")]
+ [Description("The volume of this Synth.")]
+ public short Volume { get; set; }
+
+ [Category("General")]
+ [Description("The pitch of this Synth.")]
+ public short Pitch { get; set; }
+
+ [Category("General"), DisplayName("Delay Time")]
+ [Description("The delay of this Synth. The time is in miliseconds.")]
+ public uint DelayTime { get; set; }
+
+ [Category("Unknown"), DisplayName("S Control")]
+ public byte SControl { get; set; }
+
+ [Category("EG"), DisplayName("EG Delay")]
+ public ushort EgDelay { get; set; }
+
+ [Category("EG"), DisplayName("EG Attack")]
+ public ushort EgAttack { get; set; }
+
+ [Category("EG"), DisplayName("EG Hold")]
+ public ushort EgHold { get; set; }
+
+ [Category("EG"), DisplayName("EG Decay")]
+ public ushort EgDecay { get; set; }
+
+ [Category("EG"), DisplayName("EG Release")]
+ public ushort EgRelease { get; set; }
+
+ [Category("EG"), DisplayName("EG Sustain")]
+ public ushort EgSustain { get; set; }
+
+ [Category("Filter (Unknown)"), DisplayName("Filter Type")]
+ public byte FilterType { get; set; }
+
+ [Category("Filter (Unknown)"), DisplayName("Filter Cutoff 1")]
+ public ushort FilterCutoff1 { get; set; }
+
+ [Category("Filter (Unknown)"), DisplayName("Filter Cutoff 2")]
+ public ushort FilterCutoff2 { get; set; }
+
+ [Category("Filter (Unknown)"), DisplayName("Filter RESO (Unknown)")]
+ public ushort FilterReso { get; set; }
+
+ [Category("Filter (Unknown)"), DisplayName("Filter Release Offset")]
+ public byte FilterReleaseOffset { get; set; }
+
+ [Category("Dryness"), DisplayName("Dry O Name (Unknown)")]
+ public string DryOName { get; set; }
+
+ [Category("Unknown")]
+ public string Mtxrtr { get; set; }
+
+ [Category("Dryness"), DisplayName("Dry 0")]
+ public ushort Dry0 { get; set; }
+
+ [Category("Dryness"), DisplayName("Dry 1")]
+ public ushort Dry1 { get; set; }
+
+ [Category("Dryness"), DisplayName("Dry 2")]
+ public ushort Dry2 { get; set; }
+
+ [Category("Dryness"), DisplayName("Dry 3")]
+ public ushort Dry3 { get; set; }
+
+ [Category("Dryness"), DisplayName("Dry 4")]
+ public ushort Dry4 { get; set; }
+
+ [Category("Dryness"), DisplayName("Dry 5")]
+ public ushort Dry5 { get; set; }
+
+ [Category("Dryness"), DisplayName("Dry 6")]
+ public ushort Dry6 { get; set; }
+
+ [Category("Dryness"), DisplayName("Dry 7")]
+ public ushort Dry7 { get; set; }
+
+ [Category("Wetness"), DisplayName("Wet O Name (Unknown)")]
+ public string WetOName { get; set; }
+
+ [Category("Wetness"), DisplayName("Wet 0")]
+ public ushort Wet0 { get; set; }
+
+ [Category("Wetness"), DisplayName("Wet 1")]
+ public ushort Wet1 { get; set; }
+
+ [Category("Wetness"), DisplayName("Wet 2")]
+ public ushort Wet2 { get; set; }
+
+ [Category("Wetness"), DisplayName("Wet 3")]
+ public ushort Wet3 { get; set; }
+
+ [Category("Wetness"), DisplayName("Wet 4")]
+ public ushort Wet4 { get; set; }
+
+ [Category("Wetness"), DisplayName("Wet 5")]
+ public ushort Wet5 { get; set; }
+
+ [Category("Wetness"), DisplayName("Wet 6")]
+ public ushort Wet6 { get; set; }
+
+ [Category("Wetness"), DisplayName("Wet 7")]
+ public ushort Wet7 { get; set; }
+
+ [Category("Wcnct (Unknown)"), DisplayName("Wcnct 0")]
+ public string Wcnct0 { get; set; }
+
+ [Category("Wcnct (Unknown)"), DisplayName("Wcnct 1")]
+ public string Wcnct1 { get; set; }
+
+ [Category("Wcnct (Unknown)"), DisplayName("Wcnct 2")]
+ public string Wcnct2 { get; set; }
+
+ [Category("Wcnct (Unknown)"), DisplayName("Wcnct 3")]
+ public string Wcnct3 { get; set; }
+
+ [Category("Wcnct (Unknown)"), DisplayName("Wcnct 4")]
+ public string Wcnct4 { get; set; }
+
+ [Category("Wcnct (Unknown)"), DisplayName("Wcnct 5")]
+ public string Wcnct5 { get; set; }
+
+ [Category("Wcnct (Unknown)"), DisplayName("Wcnct 6")]
+ public string Wcnct6 { get; set; }
+
+ [Category("Wcnct (Unknown)"), DisplayName("Wcnct 7")]
+ public string Wcnct7 { get; set; }
+
+ [ReadOnly(true)]
+ [Category("Voice Limit"), DisplayName("Voice Limit Group Reference")]
+ public string VoiceLimitGroupReference { get; set; }
+
+ [Category("Voice Limit"), DisplayName("Voice Limit Type")]
+ public byte VoiceLimitType { get; set; }
+
+ [Category("Voice Limit"), DisplayName("Voice Limit Priority")]
+ public byte VoiceLimitPriority { get; set; }
+
+ [Category("Voice Limit"), DisplayName("Voice Limit Prohibition Time")]
+ public ushort VoiceLimitProhibitionTime { get; set; }
+
+ [Category("Voice Limit"), DisplayName("Voice Limit Pcdlt (Unknown)")]
+ public sbyte VoiceLimitPcdlt { get; set; }
+
+ [Category("Pan 3D"), DisplayName("Pan 3D Volume Offset")]
+ public short Pan3dVolumeOffset { get; set; }
+
+ [Category("Pan 3D"), DisplayName("Pan 3D Volume Gain")]
+ public short Pan3dVolumeGain { get; set; }
+
+ [Category("Pan 3D"), DisplayName("Pan 3D Angle Offset")]
+ public short Pan3dAngleOffset { get; set; }
+
+ [Category("Pan 3D"), DisplayName("Pan 3D Angle Gain")]
+ public short Pan3dAngleGain { get; set; }
+
+ [Category("Pan 3D"), DisplayName("Pan 3D Distance Offset")]
+ public short Pan3dDistanceOffset { get; set; }
+
+ [Category("Pan 3D"), DisplayName("Pan 3D Distance Gain")]
+ public short Pan3dDistanceGain { get; set; }
+
+ [Category("Dryness"), DisplayName("Dry 0 Gain")]
+ public byte Dry0g { get; set; }
+
+ [Category("Dryness"), DisplayName("Dry 1 Gain")]
+ public byte Dry1g { get; set; }
+
+ [Category("Dryness"), DisplayName("Dry 2 Gain")]
+ public byte Dry2g { get; set; }
+
+ [Category("Dryness"), DisplayName("Dry 3 Gain")]
+ public byte Dry3g { get; set; }
+
+ [Category("Dryness"), DisplayName("Dry 4 Gain")]
+ public byte Dry4g { get; set; }
+
+ [Category("Dryness"), DisplayName("Dry 5 Gain")]
+ public byte Dry5g { get; set; }
+
+ [Category("Dryness"), DisplayName("Dry 6 Gain")]
+ public byte Dry6g { get; set; }
+
+ [Category("Dryness"), DisplayName("Dry 7 Gain")]
+ public byte Dry7g { get; set; }
+
+ [Category("Wetness"), DisplayName("Wet 0 Gain")]
+ public byte Wet0g { get; set; }
+
+ [Category("Wetness"), DisplayName("Wet 1 Gain")]
+ public byte Wet1g { get; set; }
+
+ [Category("Wetness"), DisplayName("Wet 2 Gain")]
+ public byte Wet2g { get; set; }
+
+ [Category("Wetness"), DisplayName("Wet 3 Gain")]
+ public byte Wet3g { get; set; }
+
+ [Category("Wetness"), DisplayName("Wet 4 Gain")]
+ public byte Wet4g { get; set; }
+
+ [Category("Wetness"), DisplayName("Wet 5 Gain")]
+ public byte Wet5g { get; set; }
+
+ [Category("Wetness"), DisplayName("Wet 6 Gain")]
+ public byte Wet6g { get; set; }
+
+ [Category("Wetness"), DisplayName("Wet 7 Gain")]
+ public byte Wet7g { get; set; }
+
+ [Category("Filter 1 (Unknown)"), DisplayName("Filter 1 Type")]
+ public byte Filter1Type { get; set; }
+
+ [Category("Filter 1 (Unknown)"), DisplayName("Filter 1 Cutoff Offset")]
+ public ushort Filter1CutoffOffset { get; set; }
+
+ [Category("Filter 1 (Unknown)"), DisplayName("Filter 1 Cutoff Gain")]
+ public ushort Filter1CutoffGain { get; set; }
+
+ [Category("Filter 1 (Unknown)"), DisplayName("Filter 1 RESO (Unknown) Offset")]
+ public ushort Filter1ResoOffset { get; set; }
+
+ [Category("Filter 1 (Unknown)"), DisplayName("Filter 1 RESO (Unknown) Gain")]
+ public ushort Filter1ResoGain { get; set; }
+
+ [Category("Filter 2 (Unknown)"), DisplayName("Filter 2 Type")]
+ public byte Filter2Type { get; set; }
+
+ [Category("Filter 2 (Unknown)"), DisplayName("Filter 2 Cutoff Lower Offset")]
+ public ushort Filter2CutoffLowerOffset { get; set; }
+
+ [Category("Filter 2 (Unknown)"), DisplayName("Filter 2 Cutoff Lower Gain")]
+ public ushort Filter2CutoffLowerGain { get; set; }
+
+ [Category("Filter 2 (Unknown)"), DisplayName("Filter 2 Cutoff Higher Offset")]
+ public ushort Filter2CutoffHigherOffset { get; set; }
+
+ [Category("Filter 2 (Unknown)"), DisplayName("Filter 2 Cutoff Higher Gain")]
+ public ushort Filter2CutoffHigherGain { get; set; }
+
+ [Category("General"), DisplayName("Playback Probability")]
+ [Description("The probability of this Synth being played. A random number (max 100) will be chosen and if this number is lower than this parameter (or equals), it will be played. This does not do anything if this Synth represents a Track.")]
+ public byte PlaybackProbability
+ {
+ get
+ {
+ if (Type == BuilderSynthType.WithChildren)
+ {
+ return 0;
+ }
+
+ return playbackProbability;
+ }
+
+ set
+ {
+ playbackProbability = value > 100 ? (byte)100 : value;
+ }
+ }
+
+ [Category("Unknown"), DisplayName("N LMT Children")]
+ public byte NLmtChildren { get; set; }
+
+ [Category("General"), DisplayName("Repeat")]
+ public byte Repeat { get; set; }
+
+ [Category("General"), DisplayName("Combo Time")]
+ public uint ComboTime { get; set; }
+
+ [Category("General"), DisplayName("Combo Loop Back")]
+ public byte ComboLoopBack { get; set; }
+
+ [Browsable(false)]
+ public bool PlayThisTurn
+ {
+ get
+ {
+ return random.Next(100) <= PlaybackProbability;
+ }
+ }
+
+ [Browsable(false)]
+ public int RandomChildNode
+ {
+ get
+ {
+ if (playbackType == BuilderSynthPlaybackType.RandomNoRepeat)
+ {
+ if (indices.Count == Children.Count)
+ {
+ indices.Clear();
+ }
+
+ int nextChild = random.Next(Children.Count);
+
+ while (indices.Contains(nextChild))
+ {
+ nextChild = random.Next(Children.Count);
+ }
+
+ indices.Add(nextChild);
+ return nextChild;
+ }
+
+ return random.Next(Children.Count);
+ }
+ }
+
+ [Browsable(false)]
+ public int NextChildNode
+ {
+ get
+ {
+ if (nextChild + 1 == Children.Count)
+ {
+ nextChild = -1;
+ }
+
+ return ++nextChild;
+ }
+ }
+
+ public BuilderSynthNode()
+ {
+ Children = new List();
+
+ Volume = 1000;
+
+ EgSustain = 1000;
+
+ Dry0g = 255;
+ Dry1g = 255;
+ Dry2g = 255;
+ Dry3g = 255;
+ Dry4g = 255;
+ Dry5g = 255;
+ Dry6g = 255;
+ Dry7g = 255;
+
+ Wet0g = 255;
+ Wet1g = 255;
+ Wet2g = 255;
+ Wet3g = 255;
+ Wet4g = 255;
+ Wet5g = 255;
+ Wet6g = 255;
+ Wet7g = 255;
+
+ Pan3dAngleGain = 1000;
+ Pan3dDistanceGain = 1000;
+ Pan3dDistanceOffset = 1000;
+ Pan3dVolumeGain = 1000;
+ Pan3dVolumeOffset = 1000;
+
+ Filter2CutoffHigherGain = 1000;
+ Filter2CutoffHigherOffset = 1000;
+ Filter2CutoffLowerGain = 1000;
+ }
+ }
+}
diff --git a/Source/CsbBuilder/BuilderNode/BuilderVoiceLimitGroupNode.cs b/Source/CsbBuilder/BuilderNode/BuilderVoiceLimitGroupNode.cs
new file mode 100644
index 0000000..ba32ff9
--- /dev/null
+++ b/Source/CsbBuilder/BuilderNode/BuilderVoiceLimitGroupNode.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.ComponentModel;
+
+namespace CsbBuilder.BuilderNode
+{
+ public class BuilderVoiceLimitGroupNode : BuilderBaseNode
+ {
+ [Category("General"), DisplayName("Max Amount of Instances")]
+ public uint MaxAmountOfInstances { get; set; }
+ }
+}
diff --git a/Source/CsbBuilder/CreateNewProjectForm.Designer.cs b/Source/CsbBuilder/CreateNewProjectForm.Designer.cs
new file mode 100644
index 0000000..e640133
--- /dev/null
+++ b/Source/CsbBuilder/CreateNewProjectForm.Designer.cs
@@ -0,0 +1,171 @@
+namespace CsbBuilder
+{
+ partial class CreateNewProjectForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.groupBox1 = new System.Windows.Forms.GroupBox();
+ this.button1 = new System.Windows.Forms.Button();
+ this.maskedTextBox2 = new System.Windows.Forms.MaskedTextBox();
+ this.label2 = new System.Windows.Forms.Label();
+ this.label1 = new System.Windows.Forms.Label();
+ this.maskedTextBox1 = new System.Windows.Forms.MaskedTextBox();
+ this.button3 = new System.Windows.Forms.Button();
+ this.button2 = new System.Windows.Forms.Button();
+ this.groupBox1.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // groupBox1
+ //
+ this.groupBox1.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.groupBox1.Controls.Add(this.button1);
+ this.groupBox1.Controls.Add(this.maskedTextBox2);
+ this.groupBox1.Controls.Add(this.label2);
+ this.groupBox1.Controls.Add(this.label1);
+ this.groupBox1.Controls.Add(this.maskedTextBox1);
+ this.groupBox1.FlatStyle = System.Windows.Forms.FlatStyle.System;
+ this.groupBox1.Location = new System.Drawing.Point(12, 12);
+ this.groupBox1.Name = "groupBox1";
+ this.groupBox1.Size = new System.Drawing.Size(529, 102);
+ this.groupBox1.TabIndex = 0;
+ this.groupBox1.TabStop = false;
+ this.groupBox1.Text = "Project";
+ //
+ // button1
+ //
+ this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.button1.FlatStyle = System.Windows.Forms.FlatStyle.System;
+ this.button1.Location = new System.Drawing.Point(448, 68);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(75, 23);
+ this.button1.TabIndex = 4;
+ this.button1.Text = "Browse";
+ this.button1.UseVisualStyleBackColor = true;
+ this.button1.Click += new System.EventHandler(this.button1_Click);
+ //
+ // maskedTextBox2
+ //
+ this.maskedTextBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.maskedTextBox2.ImeMode = System.Windows.Forms.ImeMode.NoControl;
+ this.maskedTextBox2.Location = new System.Drawing.Point(6, 70);
+ this.maskedTextBox2.Name = "maskedTextBox2";
+ this.maskedTextBox2.Size = new System.Drawing.Size(436, 20);
+ this.maskedTextBox2.TabIndex = 3;
+ this.maskedTextBox2.TextChanged += new System.EventHandler(this.maskedTextBox2_TextChanged);
+ //
+ // label2
+ //
+ this.label2.AutoSize = true;
+ this.label2.Location = new System.Drawing.Point(3, 55);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(32, 13);
+ this.label2.TabIndex = 2;
+ this.label2.Text = "Path:";
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(3, 16);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(38, 13);
+ this.label1.TabIndex = 1;
+ this.label1.Text = "Name:";
+ //
+ // maskedTextBox1
+ //
+ this.maskedTextBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.maskedTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.maskedTextBox1.ImeMode = System.Windows.Forms.ImeMode.NoControl;
+ this.maskedTextBox1.Location = new System.Drawing.Point(6, 32);
+ this.maskedTextBox1.Name = "maskedTextBox1";
+ this.maskedTextBox1.Size = new System.Drawing.Size(517, 20);
+ this.maskedTextBox1.TabIndex = 0;
+ this.maskedTextBox1.TextChanged += new System.EventHandler(this.maskedTextBox1_TextChanged);
+ //
+ // button3
+ //
+ this.button3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.button3.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+ this.button3.FlatStyle = System.Windows.Forms.FlatStyle.System;
+ this.button3.Location = new System.Drawing.Point(466, 120);
+ this.button3.Name = "button3";
+ this.button3.Size = new System.Drawing.Size(75, 23);
+ this.button3.TabIndex = 6;
+ this.button3.Text = "Cancel";
+ this.button3.UseVisualStyleBackColor = true;
+ //
+ // button2
+ //
+ this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.button2.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.button2.FlatStyle = System.Windows.Forms.FlatStyle.System;
+ this.button2.Location = new System.Drawing.Point(385, 120);
+ this.button2.Name = "button2";
+ this.button2.Size = new System.Drawing.Size(75, 23);
+ this.button2.TabIndex = 5;
+ this.button2.Text = "OK";
+ this.button2.UseVisualStyleBackColor = true;
+ //
+ // CreateNewProjectForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(553, 148);
+ this.Controls.Add(this.button2);
+ this.Controls.Add(this.button3);
+ this.Controls.Add(this.groupBox1);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
+ this.MaximizeBox = false;
+ this.MaximumSize = new System.Drawing.Size(928, 187);
+ this.MinimizeBox = false;
+ this.MinimumSize = new System.Drawing.Size(464, 187);
+ this.Name = "CreateNewProjectForm";
+ this.ShowIcon = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+ this.Text = "Create New Project";
+ this.groupBox1.ResumeLayout(false);
+ this.groupBox1.PerformLayout();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.GroupBox groupBox1;
+ private System.Windows.Forms.Button button3;
+ private System.Windows.Forms.Button button2;
+ private System.Windows.Forms.Button button1;
+ private System.Windows.Forms.MaskedTextBox maskedTextBox2;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.MaskedTextBox maskedTextBox1;
+ }
+}
\ No newline at end of file
diff --git a/Source/CsbBuilder/CreateNewProjectForm.cs b/Source/CsbBuilder/CreateNewProjectForm.cs
new file mode 100644
index 0000000..6006d22
--- /dev/null
+++ b/Source/CsbBuilder/CreateNewProjectForm.cs
@@ -0,0 +1,77 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using System.IO;
+
+using CsbBuilder.Project;
+
+namespace CsbBuilder
+{
+ public partial class CreateNewProjectForm : Form
+ {
+ private CsbProject project = new CsbProject();
+
+ public CsbProject Project
+ {
+ get
+ {
+ return project;
+ }
+ }
+
+ public CreateNewProjectForm(string name) : this()
+ {
+ maskedTextBox1.Text = Path.GetFileNameWithoutExtension(name);
+
+ string directoryName = Path.GetDirectoryName(name);
+ maskedTextBox2.Text = !string.IsNullOrEmpty(directoryName) ? Path.ChangeExtension(name, null) : Path.Combine(Program.ProjectsPath, name);
+ }
+
+ public CreateNewProjectForm()
+ {
+ InitializeComponent();
+
+ maskedTextBox1.Text = project.Name;
+ maskedTextBox2.Text = project.Directory.FullName;
+ }
+
+ private void maskedTextBox1_TextChanged(object sender, EventArgs e)
+ {
+ if (string.IsNullOrEmpty(maskedTextBox1.Text))
+ {
+ MessageBox.Show("Name cannot be empty.", "CSB Builder", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ return;
+ }
+
+ project.Name = maskedTextBox1.Text;
+ }
+
+ private void button1_Click(object sender, EventArgs e)
+ {
+ using (FolderBrowserDialog selectFolder = new FolderBrowserDialog())
+ {
+ if (selectFolder.ShowDialog() == DialogResult.OK)
+ {
+ maskedTextBox2.Text = selectFolder.SelectedPath;
+ }
+ }
+ }
+
+ private void maskedTextBox2_TextChanged(object sender, EventArgs e)
+ {
+ if (string.IsNullOrEmpty(maskedTextBox2.Text))
+ {
+ MessageBox.Show("Path cannot be empty.", "CSB Builder", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ return;
+ }
+
+ project.Directory = new DirectoryInfo(maskedTextBox2.Text);
+ }
+ }
+}
diff --git a/Source/CsbBuilder/CreateNewProjectForm.resx b/Source/CsbBuilder/CreateNewProjectForm.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/Source/CsbBuilder/CreateNewProjectForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Source/CsbBuilder/CriTableAax.cs b/Source/CsbBuilder/CriTableAax.cs
deleted file mode 100644
index eecf69e..0000000
--- a/Source/CsbBuilder/CriTableAax.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-using System.IO;
-using SonicAudioLib.CriMw.Serialization;
-
-using System;
-using System.Xml.Serialization;
-
-namespace CsbBuilder
-{
- [CriSerializable("AAX")]
- [Serializable]
- public class CriTableAax
- {
- public enum EnumLoopFlag : byte
- {
- Intro = 0,
- Loop = 1,
- };
-
- private byte[] _data = new byte[0];
- private EnumLoopFlag _lpflg = EnumLoopFlag.Intro;
-
- [CriField("data", 0)]
- public byte[] Data
- {
- get
- {
- return _data;
- }
- set
- {
- _data = value;
- }
- }
-
- [CriField("lpflg", 1)]
- public EnumLoopFlag LoopFlag
- {
- get
- {
- return _lpflg;
- }
- set
- {
- _lpflg = value;
- }
- }
- }
-}
diff --git a/Source/CsbBuilder/CriTableAisacGraph.cs b/Source/CsbBuilder/CriTableAisacGraph.cs
deleted file mode 100644
index f69cca0..0000000
--- a/Source/CsbBuilder/CriTableAisacGraph.cs
+++ /dev/null
@@ -1,104 +0,0 @@
-using System.Collections.Generic;
-using System.IO;
-using SonicAudioLib.CriMw;
-using SonicAudioLib.CriMw.Serialization;
-
-using System;
-using System.Xml.Serialization;
-
-namespace CsbBuilder
-{
- [Serializable]
- [CriSerializable("TBLIGR")]
- public class CriTableAisacGraph
- {
- private byte _type = 0;
- private float _imax = 0;
- private float _imin = 0;
- private float _omax = 0;
- private float _omin = 0;
-
- [CriField("type", 0)]
- public byte Type
- {
- get
- {
- return _type;
- }
- set
- {
- _type = value;
- }
- }
-
- [CriField("imax", 1)]
- public float InMaximum
- {
- get
- {
- return _imax;
- }
- set
- {
- _imax = value;
- }
- }
-
- [CriField("imin", 2)]
- public float InMinimum
- {
- get
- {
- return _imin;
- }
- set
- {
- _imin = value;
- }
- }
-
- [CriField("omax", 3)]
- public float OutMaximum
- {
- get
- {
- return _omax;
- }
- set
- {
- _omax = value;
- }
- }
-
- [CriField("omin", 4)]
- public float OutMinimum
- {
- get
- {
- return _omin;
- }
- set
- {
- _omin = value;
- }
- }
-
- [CriIgnore]
- public List PointsList { get; set; }
-
- [XmlIgnore]
- [CriField("points", 5)]
- public byte[] Points
- {
- get
- {
- return CriTableSerializer.Serialize(PointsList, CriTableWriterSettings.AdxSettings);
- }
-
- set
- {
- PointsList = CriTableSerializer.Deserialize(value);
- }
- }
- }
-}
diff --git a/Source/CsbBuilder/CriTableCueSheet.cs b/Source/CsbBuilder/CriTableCueSheet.cs
deleted file mode 100644
index daf5920..0000000
--- a/Source/CsbBuilder/CriTableCueSheet.cs
+++ /dev/null
@@ -1,134 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.IO;
-using SonicAudioLib.CriMw;
-using SonicAudioLib.CriMw.Serialization;
-using System.Linq;
-
-using System.Xml.Serialization;
-
-namespace CsbBuilder
-{
- [Serializable]
- [CriSerializable("TBLCSB")]
- public class CriTableCueSheet
- {
- public enum EnumTableType : byte
- {
- None = 0,
- Cue = 1,
- Synth = 2,
- SoundElement = 4,
- Aisac = 5,
- VoiceLimitGroup = 6,
- VersionInfo = 7,
- };
-
- private string _name = string.Empty;
- private EnumTableType _ttype = EnumTableType.None;
-
- [CriField("name", 0)]
- public string Name
- {
- get
- {
- return _name;
- }
- set
- {
- _name = value;
- }
- }
-
- [CriField("ttype", 1)]
- public EnumTableType TableType
- {
- get
- {
- return _ttype;
- }
- set
- {
- _ttype = value;
- }
- }
-
- [CriIgnore]
- [XmlArray]
- [XmlArrayItem(typeof(CriTableCue))]
- [XmlArrayItem(typeof(CriTableSynth))]
- [XmlArrayItem(typeof(CriTableSoundElement))]
- [XmlArrayItem(typeof(CriTableAisac))]
- [XmlArrayItem(typeof(CriTableVoiceLimitGroup))]
- [XmlArrayItem(typeof(CriTableVersionInfo))]
- public ArrayList DataList { get; set; }
-
- [XmlIgnore]
- [CriField("utf", 2)]
- public byte[] Data
- {
- get
- {
- switch (_ttype)
- {
- case EnumTableType.None:
- return new byte[0];
-
- case EnumTableType.Cue:
- return CriTableSerializer.Serialize(DataList.OfType().ToList(), CriTableWriterSettings.AdxSettings);
-
- case EnumTableType.Synth:
- return CriTableSerializer.Serialize(DataList.OfType().ToList(), CriTableWriterSettings.AdxSettings);
-
- case EnumTableType.SoundElement:
- return CriTableSerializer.Serialize(DataList.OfType().ToList(), CriTableWriterSettings.AdxSettings);
-
- case EnumTableType.Aisac:
- return CriTableSerializer.Serialize(DataList.OfType().ToList(), CriTableWriterSettings.AdxSettings);
-
- case EnumTableType.VoiceLimitGroup:
- return CriTableSerializer.Serialize(DataList.OfType().ToList(), CriTableWriterSettings.AdxSettings);
-
- case EnumTableType.VersionInfo:
- return CriTableSerializer.Serialize(DataList.OfType().ToList(), CriTableWriterSettings.AdxSettings);
- }
-
- throw new ArgumentException($"Unknown table type {_ttype}, please report the error with the file.", "_ttype");
- }
-
- set
- {
- switch (_ttype)
- {
- case EnumTableType.Cue:
- DataList = CriTableSerializer.Deserialize(value, typeof(CriTableCue));
- break;
-
- case EnumTableType.Synth:
- DataList = CriTableSerializer.Deserialize(value, typeof(CriTableSynth));
- break;
-
- case EnumTableType.SoundElement:
- DataList = CriTableSerializer.Deserialize(value, typeof(CriTableSoundElement));
- break;
-
- case EnumTableType.Aisac:
- DataList = CriTableSerializer.Deserialize(value, typeof(CriTableAisac));
- break;
-
- case EnumTableType.VoiceLimitGroup:
- DataList = CriTableSerializer.Deserialize(value, typeof(CriTableVoiceLimitGroup));
- break;
-
- case EnumTableType.VersionInfo:
- DataList = CriTableSerializer.Deserialize(value, typeof(CriTableVersionInfo));
- break;
-
- default:
- throw new ArgumentException($"Unknown table type {_ttype}, please report the error with the file.", "_ttype");
- }
- }
- }
- }
-}
diff --git a/Source/CsbBuilder/CriTableSoundElement.cs b/Source/CsbBuilder/CriTableSoundElement.cs
deleted file mode 100644
index b60e24e..0000000
--- a/Source/CsbBuilder/CriTableSoundElement.cs
+++ /dev/null
@@ -1,127 +0,0 @@
-using System.Collections.Generic;
-using System.IO;
-using SonicAudioLib.CriMw;
-using SonicAudioLib.CriMw.Serialization;
-
-using System;
-using System.Xml.Serialization;
-
-namespace CsbBuilder
-{
- [Serializable]
- [CriSerializable("TBLSDL")]
- public class CriTableSoundElement
- {
- public enum EnumFormat : byte
- {
- Adx = 0,
- Dsp = 4,
- };
-
- private string _name = string.Empty;
- private EnumFormat _fmt = EnumFormat.Adx;
- private byte _nch = 0;
- private bool _stmflg = false;
- private uint _sfreq = 0;
- private uint _nsmpl = 0;
-
- [CriField("name", 0)]
- public string Name
- {
- get
- {
- return _name;
- }
- set
- {
- _name = value;
- }
- }
-
- [CriIgnore]
- public List DataList { get; set; }
-
- [XmlIgnore]
- [CriField("data", 1)]
- public byte[] Data
- {
- get
- {
- return CriTableSerializer.Serialize(DataList, CriTableWriterSettings.AdxSettings);
- }
-
- set
- {
- if (value.Length > 0)
- {
- DataList = CriTableSerializer.Deserialize(value);
- }
- }
- }
-
- [CriField("fmt", 2)]
- public EnumFormat Format
- {
- get
- {
- return _fmt;
- }
- set
- {
- _fmt = value;
- }
- }
-
- [CriField("nch", 3)]
- public byte NumberChannels
- {
- get
- {
- return _nch;
- }
- set
- {
- _nch = value;
- }
- }
-
- [CriField("stmflg", 4)]
- public bool Streaming
- {
- get
- {
- return _stmflg;
- }
- set
- {
- _stmflg = value;
- }
- }
-
- [CriField("sfreq", 5)]
- public uint SoundFrequence
- {
- get
- {
- return _sfreq;
- }
- set
- {
- _sfreq = value;
- }
- }
-
- [CriField("nsmpl", 6)]
- public uint NumberSamples
- {
- get
- {
- return _nsmpl;
- }
- set
- {
- _nsmpl = value;
- }
- }
- }
-}
diff --git a/Source/CsbBuilder/CsbBuilder.csproj b/Source/CsbBuilder/CsbBuilder.csproj
index 50fcbb5..5239c59 100644
--- a/Source/CsbBuilder/CsbBuilder.csproj
+++ b/Source/CsbBuilder/CsbBuilder.csproj
@@ -4,8 +4,8 @@
Debug
AnyCPU
- {4CF49665-3DFD-4A5C-B231-B97842F091B9}
- Exe
+ {70A6A571-23EC-4B2C-A579-1E6812DDC34E}
+ WinExe
Properties
CsbBuilder
CsbBuilder
@@ -32,39 +32,123 @@
prompt
4
+
+
+
+
+ ..\..\packages\NAudio.1.8.0\lib\net35\NAudio.dll
+ True
+
-
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+ Form
+
+
+ ExceptionForm.cs
+
+
+ Form
+
+
+ CreateNewProjectForm.cs
+
+
+
+
+
+ Form
+
+
+ SetAudioForm.cs
+
+
+ Form
+
+
+ MainForm.cs
+
+
+
+
+
+
+
+
+
+
+
+
+ Form
+
+
+ SetReferenceForm.cs
+
+
+ ExceptionForm.cs
+
+
+ CreateNewProjectForm.cs
+
+
+ SetAudioForm.cs
+
+
+ MainForm.cs
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+ Designer
+
True
- True
Resources.resx
+ True
+
+
+ SetReferenceForm.cs
+
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+ True
+ Settings.settings
+ True
+
+
+
{63138773-1f47-474c-9345-15eb6183ecc6}
@@ -72,10 +156,70 @@
-
- ResXFileCodeGenerator
- Resources.Designer.cs
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Source/CsbBuilder/Extensions.cs b/Source/CsbBuilder/Extensions.cs
new file mode 100644
index 0000000..e1e703f
--- /dev/null
+++ b/Source/CsbBuilder/Extensions.cs
@@ -0,0 +1,86 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace CsbBuilder
+{
+ public static class Extensions
+ {
+ public static TreeNode CreateNodesByFullPath(this TreeView treeView, string path)
+ {
+ string fullPath = string.Empty;
+ TreeNode currentNode = null;
+
+ foreach (string node in path.Split('/'))
+ {
+ fullPath += node;
+
+ TreeNode treeNode = treeView.FindNodeByFullPath(fullPath);
+ bool notFound = treeNode == null;
+
+ if (notFound)
+ {
+ treeNode = new TreeNode(node);
+ treeNode.Name = treeNode.Text;
+ }
+
+ if (currentNode != null && notFound)
+ {
+ currentNode.Nodes.Add(treeNode);
+ }
+
+ else if (currentNode == null && notFound)
+ {
+ treeView.Nodes.Add(treeNode);
+ }
+
+ currentNode = treeNode;
+ fullPath += '/';
+ }
+
+ return currentNode;
+ }
+
+
+ public static TreeNode FindNodeByFullPath(this TreeNode treeNode, string path)
+ {
+ foreach (TreeNode node in treeNode.Nodes)
+ {
+ if (node.FullPath == path)
+ {
+ return node;
+ }
+
+ TreeNode childNode = node.FindNodeByFullPath(path);
+ if (childNode != null)
+ {
+ return childNode;
+ }
+ }
+
+ return null;
+ }
+
+ public static TreeNode FindNodeByFullPath(this TreeView treeView, string path)
+ {
+ foreach (TreeNode node in treeView.Nodes)
+ {
+ if (node.FullPath == path)
+ {
+ return node;
+ }
+
+ TreeNode childNode = node.FindNodeByFullPath(path);
+ if (childNode != null)
+ {
+ return childNode;
+ }
+ }
+
+ return null;
+ }
+ }
+}
diff --git a/Source/CsbBuilder/Importer/CsbImporter.cs b/Source/CsbBuilder/Importer/CsbImporter.cs
new file mode 100644
index 0000000..a44ee0a
--- /dev/null
+++ b/Source/CsbBuilder/Importer/CsbImporter.cs
@@ -0,0 +1,305 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.IO;
+using System.ComponentModel;
+
+using CsbBuilder.Audio;
+using CsbBuilder.Project;
+using CsbBuilder.BuilderNode;
+using CsbBuilder.Serialization;
+
+using SonicAudioLib.IO;
+using SonicAudioLib.CriMw.Serialization;
+using SonicAudioLib.Archive;
+
+using System.Windows.Forms;
+
+namespace CsbBuilder.Importer
+{
+ public static class CsbImporter
+ {
+ public static void Import(string path, CsbProject project)
+ {
+ // Find the CPK first
+ string cpkPath = Path.ChangeExtension(path, "cpk");
+ bool exists = File.Exists(cpkPath);
+
+ CriCpkArchive cpkArchive = new CriCpkArchive();
+
+ // First, deserialize the main tables
+ List cueSheets = CriTableSerializer.Deserialize(path);
+
+ /* Deserialize all the tables we need to import.
+ * None = 0,
+ * Cue = 1,
+ * Synth = 2,
+ * SoundElement = 4,
+ * Aisac = 5,
+ * VoiceLimitGroup = 6,
+ * VersionInfo = 7,
+ */
+
+ List cueTables = CriTableSerializer.Deserialize(cueSheets.FirstOrDefault(table => table.TableType == 1).TableData);
+ List synthTables = CriTableSerializer.Deserialize(cueSheets.FirstOrDefault(table => table.TableType == 2).TableData);
+ List soundElementTables = CriTableSerializer.Deserialize(cueSheets.FirstOrDefault(table => table.TableType == 4).TableData);
+ List aisacTables = CriTableSerializer.Deserialize(cueSheets.FirstOrDefault(table => table.TableType == 5).TableData);
+
+ // voice limit groups appeared in the later versions, so check if it exists.
+ List voiceLimitGroupTables = new List();
+
+ if (cueSheets.Exists(table => table.TableType == 6))
+ {
+ voiceLimitGroupTables = CriTableSerializer.Deserialize(cueSheets.FirstOrDefault(table => table.TableType == 6).TableData);
+ }
+
+ // Deserialize Sound Element tables
+
+ // BUT BEFORE THAT, see if there's any sound element with Streamed on
+ if (soundElementTables.Exists(soundElementTable => soundElementTable.Streaming))
+ {
+ if (!exists)
+ {
+ throw new Exception("Cannot find CPK file for this CSB file. Please ensure that the CPK file is in the directory where the CSB file is, and has the same name as the CSB file, but with .CPK extension.");
+ }
+
+ cpkArchive.Load(cpkPath);
+ }
+
+ foreach (SerializationSoundElementTable soundElementTable in soundElementTables)
+ {
+ BuilderSoundElementNode soundElementNode = new BuilderSoundElementNode();
+ soundElementNode.Name = soundElementTable.Name;
+ soundElementNode.ChannelCount = soundElementTable.NumberChannels;
+ soundElementNode.SampleRate = soundElementTable.SoundFrequency;
+ soundElementNode.Streaming = soundElementTable.Streaming;
+
+ CriAaxArchive aaxArchive = new CriAaxArchive();
+
+ byte[] aaxData = soundElementTable.Data;
+
+ if (exists && soundElementNode.Streaming)
+ {
+ using (Stream source = File.OpenRead(cpkPath))
+ using (Stream entrySource = cpkArchive.GetByPath(soundElementTable.Name).Open(source))
+ {
+ aaxData = ((Substream)entrySource).ToArray();
+ }
+ }
+
+ aaxArchive.Load(aaxData);
+
+ foreach (CriAaxEntry entry in aaxArchive)
+ {
+ byte[] data = new byte[entry.Length];
+ Array.Copy(aaxData, entry.Position, data, 0, data.Length);
+
+ string outputFileName = Path.Combine(project.AudioDirectory.FullName, soundElementTable.Name.Replace('/', '_'));
+ if (entry.Flag == CriAaxEntryFlag.Intro)
+ {
+ outputFileName += "_Intro.adx";
+ soundElementNode.Intro = Path.GetFileName(outputFileName);
+ }
+
+ else if (entry.Flag == CriAaxEntryFlag.Loop)
+ {
+ outputFileName += "_Loop.adx";
+ soundElementNode.Loop = Path.GetFileName(outputFileName);
+ }
+
+ File.WriteAllBytes(outputFileName, data);
+
+ // Read the samples just in case
+ soundElementNode.SampleCount += AdxConverter.LoadHeader(outputFileName).SampleCount;
+ }
+
+ project.SoundElementNodes.Add(soundElementNode);
+ }
+
+ // Deserialize Voice Limit Group tables
+ foreach (SerializationVoiceLimitGroupTable voiceLimitGroupTable in voiceLimitGroupTables)
+ {
+ project.VoiceLimitGroupNodes.Add(new BuilderVoiceLimitGroupNode
+ {
+ Name = voiceLimitGroupTable.VoiceLimitGroupName,
+ MaxAmountOfInstances = voiceLimitGroupTable.VoiceLimitGroupNum,
+ });
+ }
+
+ // Deserialize Aisac tables
+ foreach (SerializationAisacTable aisacTable in aisacTables)
+ {
+ BuilderAisacNode aisacNode = new BuilderAisacNode();
+ aisacNode.Name = aisacTable.PathName;
+ aisacNode.AisacName = aisacTable.Name;
+ aisacNode.Type = aisacTable.Type;
+ aisacNode.RandomRange = aisacTable.RandomRange;
+
+ // Deserialize the graphs
+ List graphTables = CriTableSerializer.Deserialize(aisacTable.Graph);
+ foreach (SerializationAisacGraphTable graphTable in graphTables)
+ {
+ BuilderAisacGraphNode graphNode = new BuilderAisacGraphNode();
+ graphNode.Name = $"Graph{aisacNode.Graphs.Count}";
+ graphNode.Type = graphTable.Type;
+ graphNode.MaximumX = graphTable.InMax;
+ graphNode.MinimumX = graphTable.InMin;
+ graphNode.MaximumY = graphTable.OutMax;
+ graphNode.MinimumY = graphTable.OutMin;
+
+ // Deserialize the points
+ List pointTables = CriTableSerializer.Deserialize(graphTable.Points);
+ foreach (SerializationAisacPointTable pointTable in pointTables)
+ {
+ BuilderAisacPointNode pointNode = new BuilderAisacPointNode();
+ pointNode.Name = $"Point{graphNode.Points.Count}";
+ pointNode.X = pointTable.In;
+ pointNode.Y = pointTable.Out;
+ graphNode.Points.Add(pointNode);
+ }
+
+ aisacNode.Graphs.Add(graphNode);
+ }
+
+ project.AisacNodes.Add(aisacNode);
+ }
+
+ // Deserialize Synth tables
+ foreach (SerializationSynthTable synthTable in synthTables)
+ {
+ BuilderSynthNode synthNode = new BuilderSynthNode();
+ synthNode.Name = synthTable.SynthName;
+ synthNode.Type = (BuilderSynthType)synthTable.SynthType;
+ synthNode.PlaybackType = (BuilderSynthPlaybackType)synthTable.ComplexType;
+ synthNode.Volume = synthTable.Volume;
+ synthNode.Pitch = synthTable.Pitch;
+ synthNode.DelayTime = synthTable.DelayTime;
+ synthNode.SControl = synthTable.SControl;
+ synthNode.EgDelay = synthTable.EgDelay;
+ synthNode.EgAttack = synthTable.EgAttack;
+ synthNode.EgHold = synthTable.EgHold;
+ synthNode.EgDecay = synthTable.EgDecay;
+ synthNode.EgRelease = synthTable.EgRelease;
+ synthNode.EgSustain = synthTable.EgSustain;
+ synthNode.FilterType = synthTable.FType;
+ synthNode.FilterCutoff1 = synthTable.FCof1;
+ synthNode.FilterCutoff2 = synthTable.FCof2;
+ synthNode.FilterReso = synthTable.FReso;
+ synthNode.FilterReleaseOffset = synthTable.FReleaseOffset;
+ synthNode.DryOName = synthTable.DryOName;
+ synthNode.Mtxrtr = synthTable.Mtxrtr;
+ synthNode.Dry0 = synthTable.Dry0;
+ synthNode.Dry1 = synthTable.Dry1;
+ synthNode.Dry2 = synthTable.Dry2;
+ synthNode.Dry3 = synthTable.Dry3;
+ synthNode.Dry4 = synthTable.Dry4;
+ synthNode.Dry5 = synthTable.Dry5;
+ synthNode.Dry6 = synthTable.Dry6;
+ synthNode.Dry7 = synthTable.Dry7;
+ synthNode.WetOName = synthTable.WetOName;
+ synthNode.Wet0 = synthTable.Wet0;
+ synthNode.Wet1 = synthTable.Wet1;
+ synthNode.Wet2 = synthTable.Wet2;
+ synthNode.Wet3 = synthTable.Wet3;
+ synthNode.Wet4 = synthTable.Wet4;
+ synthNode.Wet5 = synthTable.Wet5;
+ synthNode.Wet6 = synthTable.Wet6;
+ synthNode.Wet7 = synthTable.Wet7;
+ synthNode.Wcnct0 = synthTable.Wcnct0;
+ synthNode.Wcnct1 = synthTable.Wcnct1;
+ synthNode.Wcnct2 = synthTable.Wcnct2;
+ synthNode.Wcnct3 = synthTable.Wcnct3;
+ synthNode.Wcnct4 = synthTable.Wcnct4;
+ synthNode.Wcnct5 = synthTable.Wcnct5;
+ synthNode.Wcnct6 = synthTable.Wcnct6;
+ synthNode.Wcnct7 = synthTable.Wcnct7;
+ synthNode.VoiceLimitType = synthTable.VoiceLimitType;
+ synthNode.VoiceLimitPriority = synthTable.VoiceLimitPriority;
+ synthNode.VoiceLimitProhibitionTime = synthTable.VoiceLimitPhTime;
+ synthNode.VoiceLimitPcdlt = synthTable.VoiceLimitPcdlt;
+ synthNode.Pan3dVolumeOffset = synthTable.Pan3dVolumeOffset;
+ synthNode.Pan3dVolumeGain = synthTable.Pan3dVolumeGain;
+ synthNode.Pan3dAngleOffset = synthTable.Pan3dAngleOffset;
+ synthNode.Pan3dAngleGain = synthTable.Pan3dAngleGain;
+ synthNode.Pan3dDistanceOffset = synthTable.Pan3dDistanceOffset;
+ synthNode.Pan3dDistanceGain = synthTable.Pan3dDistanceGain;
+ synthNode.Dry0g = synthTable.Dry0g;
+ synthNode.Dry1g = synthTable.Dry1g;
+ synthNode.Dry2g = synthTable.Dry2g;
+ synthNode.Dry3g = synthTable.Dry3g;
+ synthNode.Dry4g = synthTable.Dry4g;
+ synthNode.Dry5g = synthTable.Dry5g;
+ synthNode.Dry6g = synthTable.Dry6g;
+ synthNode.Dry7g = synthTable.Dry7g;
+ synthNode.Wet0g = synthTable.Wet0g;
+ synthNode.Wet1g = synthTable.Wet1g;
+ synthNode.Wet2g = synthTable.Wet2g;
+ synthNode.Wet3g = synthTable.Wet3g;
+ synthNode.Wet4g = synthTable.Wet4g;
+ synthNode.Wet5g = synthTable.Wet5g;
+ synthNode.Wet6g = synthTable.Wet6g;
+ synthNode.Wet7g = synthTable.Wet7g;
+ synthNode.Filter1Type = synthTable.F1Type;
+ synthNode.Filter1CutoffOffset = synthTable.F1CofOffset;
+ synthNode.Filter1CutoffGain = synthTable.F1CofGain;
+ synthNode.Filter1ResoOffset = synthTable.F1ResoOffset;
+ synthNode.Filter1ResoGain = synthTable.F1ResoGain;
+ synthNode.Filter2Type = synthTable.F2Type;
+ synthNode.Filter2CutoffLowerOffset = synthTable.F2CofLowOffset;
+ synthNode.Filter2CutoffLowerGain = synthTable.F2CofLowGain;
+ synthNode.Filter2CutoffHigherOffset = synthTable.F2CofHighOffset;
+ synthNode.Filter2CutoffHigherGain = synthTable.F2CofHighGain;
+ synthNode.PlaybackProbability = synthTable.Probability;
+ synthNode.NLmtChildren = synthTable.NumberLmtChildren;
+ synthNode.Repeat = synthTable.Repeat;
+ synthNode.ComboTime = synthTable.ComboTime;
+ synthNode.ComboLoopBack = synthTable.ComboLoopBack;
+
+ project.SynthNodes.Add(synthNode);
+ }
+
+ // Convert the cue tables
+ foreach (SerializationCueTable cueTable in cueTables)
+ {
+ BuilderCueNode cueNode = new BuilderCueNode();
+ cueNode.Name = cueTable.Name;
+ cueNode.Identifier = cueTable.Id;
+ cueNode.UserComment = cueTable.UserData;
+ cueNode.Flags = cueTable.Flags;
+ cueNode.SynthReference = cueTable.SynthPath;
+ project.CueNodes.Add(cueNode);
+ }
+
+ // Fix links
+ for (int i = 0; i < synthTables.Count; i++)
+ {
+ SerializationSynthTable synthTable = synthTables[i];
+ BuilderSynthNode synthNode = project.SynthNodes[i];
+
+ if (synthNode.Type == BuilderSynthType.Single)
+ {
+ synthNode.SoundElementReference = synthTable.LinkName;
+ }
+
+ // Polyphonic
+ else if (synthNode.Type == BuilderSynthType.WithChildren)
+ {
+ synthNode.Children = synthTable.LinkName.Split(new char[] { (char)0x0A }, StringSplitOptions.RemoveEmptyEntries).ToList();
+ }
+
+ if (!string.IsNullOrEmpty(synthTable.AisacSetName))
+ {
+ string[] aisacs = synthTable.AisacSetName.Split(new char[] { (char)0x0A }, StringSplitOptions.RemoveEmptyEntries);
+ string[] name = aisacs[0].Split(new string[] { "::" }, StringSplitOptions.None);
+ synthNode.AisacReference = name[1]; // will add support for multiple aisacs (I'm actually not even sure if csbs support multiple aisacs...)
+ }
+
+ if (!string.IsNullOrEmpty(synthTable.VoiceLimitGroupName))
+ {
+ synthNode.VoiceLimitGroupReference = synthTable.VoiceLimitGroupName;
+ }
+ }
+ }
+ }
+}
diff --git a/Source/CsbBuilder/MainForm.Designer.cs b/Source/CsbBuilder/MainForm.Designer.cs
new file mode 100644
index 0000000..59b216a
--- /dev/null
+++ b/Source/CsbBuilder/MainForm.Designer.cs
@@ -0,0 +1,1799 @@
+namespace CsbBuilder
+{
+ partial class MainForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.components = new System.ComponentModel.Container();
+ this.mainMenu = new System.Windows.Forms.MenuStrip();
+ this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.newProjectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.loadProjectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.saveProjectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.saveProjectAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.mergeProjectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
+ this.ımportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.ımportAndMergeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
+ this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.buildToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.buildCurrentProjectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.buildCurrentProjectAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.propertyGrid = new System.Windows.Forms.PropertyGrid();
+ this.splitContainer1 = new System.Windows.Forms.SplitContainer();
+ this.tabControl2 = new System.Windows.Forms.TabControl();
+ this.tabPage3 = new System.Windows.Forms.TabPage();
+ this.cueTree = new System.Windows.Forms.TreeView();
+ this.nodeTreeMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
+ this.createToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator14 = new System.Windows.Forms.ToolStripSeparator();
+ this.toolStripMenuItem17 = new System.Windows.Forms.ToolStripMenuItem();
+ this.imageList = new System.Windows.Forms.ImageList(this.components);
+ this.tabControl3 = new System.Windows.Forms.TabControl();
+ this.tabPage4 = new System.Windows.Forms.TabPage();
+ this.synthTree = new System.Windows.Forms.TreeView();
+ this.synthFolderTreeMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
+ this.toolStripMenuItem13 = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripMenuItem15 = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripMenuItem14 = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator15 = new System.Windows.Forms.ToolStripSeparator();
+ this.toolStripMenuItem27 = new System.Windows.Forms.ToolStripMenuItem();
+ this.folderTreeMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
+ this.createToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
+ this.createFolderToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator12 = new System.Windows.Forms.ToolStripSeparator();
+ this.pasteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.splitContainer2 = new System.Windows.Forms.SplitContainer();
+ this.tabControl4 = new System.Windows.Forms.TabControl();
+ this.tabPage5 = new System.Windows.Forms.TabPage();
+ this.soundElementTree = new System.Windows.Forms.TreeView();
+ this.tabControl1 = new System.Windows.Forms.TabControl();
+ this.tabPage1 = new System.Windows.Forms.TabPage();
+ this.aisacTree = new System.Windows.Forms.TreeView();
+ this.aisacTreeMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
+ this.toolStripMenuItem45 = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripMenuItem46 = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator24 = new System.Windows.Forms.ToolStripSeparator();
+ this.toolStripMenuItem48 = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator25 = new System.Windows.Forms.ToolStripSeparator();
+ this.toolStripMenuItem47 = new System.Windows.Forms.ToolStripMenuItem();
+ this.tabPage2 = new System.Windows.Forms.TabPage();
+ this.voiceLimitGroupTree = new System.Windows.Forms.TreeView();
+ this.nodeMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
+ this.createToolStripMenuItem4 = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator16 = new System.Windows.Forms.ToolStripSeparator();
+ this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripMenuItem28 = new System.Windows.Forms.ToolStripMenuItem();
+ this.removeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.folderMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
+ this.createToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
+ this.createFolderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator11 = new System.Windows.Forms.ToolStripSeparator();
+ this.toolStripMenuItem18 = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripMenuItem19 = new System.Windows.Forms.ToolStripMenuItem();
+ this.removeToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
+ this.trackMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
+ this.toolStripMenuItem16 = new System.Windows.Forms.ToolStripMenuItem();
+ this.createToolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator10 = new System.Windows.Forms.ToolStripSeparator();
+ this.toolStripMenuItem20 = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripMenuItem21 = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
+ this.selectAisacReferenceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.selectVoiceLimitGroupReferenceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
+ this.setAisacReferenceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.setVoiceLimitGroupReferenceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.cueReferenceMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
+ this.toolStripMenuItem32 = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator17 = new System.Windows.Forms.ToolStripSeparator();
+ this.toolStripMenuItem22 = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripMenuItem29 = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
+ this.selectReferenceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator();
+ this.setReferenceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.trackItemMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
+ this.toolStripMenuItem33 = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator18 = new System.Windows.Forms.ToolStripSeparator();
+ this.toolStripMenuItem23 = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripMenuItem30 = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripMenuItem4 = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();
+ this.selectSoundElementReferenceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripMenuItem5 = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripMenuItem6 = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();
+ this.setSoundElementReferenceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripMenuItem7 = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripMenuItem8 = new System.Windows.Forms.ToolStripMenuItem();
+ this.soundElementMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
+ this.toolStripMenuItem34 = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator19 = new System.Windows.Forms.ToolStripSeparator();
+ this.toolStripMenuItem24 = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripMenuItem31 = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator();
+ this.setAudioToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.synthFolderMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
+ this.toolStripMenuItem12 = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripMenuItem9 = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripMenuItem10 = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator13 = new System.Windows.Forms.ToolStripSeparator();
+ this.toolStripMenuItem25 = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripMenuItem26 = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripMenuItem11 = new System.Windows.Forms.ToolStripMenuItem();
+ this.statusStrip = new System.Windows.Forms.StatusStrip();
+ this.playButton = new System.Windows.Forms.ToolStripSplitButton();
+ this.stopButton = new System.Windows.Forms.ToolStripSplitButton();
+ this.statusLabel = new System.Windows.Forms.ToolStripStatusLabel();
+ this.aisacNodeMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
+ this.toolStripMenuItem35 = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator20 = new System.Windows.Forms.ToolStripSeparator();
+ this.loadTemplateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.saveTemplateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator21 = new System.Windows.Forms.ToolStripSeparator();
+ this.toolStripMenuItem36 = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripMenuItem37 = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripMenuItem38 = new System.Windows.Forms.ToolStripMenuItem();
+ this.aisacFolderMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
+ this.toolStripMenuItem39 = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripMenuItem40 = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator22 = new System.Windows.Forms.ToolStripSeparator();
+ this.toolStripMenuItem44 = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator23 = new System.Windows.Forms.ToolStripSeparator();
+ this.toolStripMenuItem41 = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripMenuItem42 = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripMenuItem43 = new System.Windows.Forms.ToolStripMenuItem();
+ this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.mainMenu.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
+ this.splitContainer1.Panel1.SuspendLayout();
+ this.splitContainer1.Panel2.SuspendLayout();
+ this.splitContainer1.SuspendLayout();
+ this.tabControl2.SuspendLayout();
+ this.tabPage3.SuspendLayout();
+ this.nodeTreeMenu.SuspendLayout();
+ this.tabControl3.SuspendLayout();
+ this.tabPage4.SuspendLayout();
+ this.synthFolderTreeMenu.SuspendLayout();
+ this.folderTreeMenu.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
+ this.splitContainer2.Panel1.SuspendLayout();
+ this.splitContainer2.Panel2.SuspendLayout();
+ this.splitContainer2.SuspendLayout();
+ this.tabControl4.SuspendLayout();
+ this.tabPage5.SuspendLayout();
+ this.tabControl1.SuspendLayout();
+ this.tabPage1.SuspendLayout();
+ this.aisacTreeMenu.SuspendLayout();
+ this.tabPage2.SuspendLayout();
+ this.nodeMenu.SuspendLayout();
+ this.folderMenu.SuspendLayout();
+ this.trackMenu.SuspendLayout();
+ this.cueReferenceMenu.SuspendLayout();
+ this.trackItemMenu.SuspendLayout();
+ this.soundElementMenu.SuspendLayout();
+ this.synthFolderMenu.SuspendLayout();
+ this.statusStrip.SuspendLayout();
+ this.aisacNodeMenu.SuspendLayout();
+ this.aisacFolderMenu.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // mainMenu
+ //
+ this.mainMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.fileToolStripMenuItem,
+ this.buildToolStripMenuItem,
+ this.aboutToolStripMenuItem});
+ this.mainMenu.Location = new System.Drawing.Point(0, 0);
+ this.mainMenu.Name = "mainMenu";
+ this.mainMenu.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
+ this.mainMenu.Size = new System.Drawing.Size(878, 24);
+ this.mainMenu.TabIndex = 0;
+ this.mainMenu.Text = "menuStrip1";
+ //
+ // fileToolStripMenuItem
+ //
+ this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.newProjectToolStripMenuItem,
+ this.loadProjectToolStripMenuItem,
+ this.saveProjectToolStripMenuItem,
+ this.saveProjectAsToolStripMenuItem,
+ this.mergeProjectToolStripMenuItem,
+ this.toolStripSeparator1,
+ this.ımportToolStripMenuItem,
+ this.ımportAndMergeToolStripMenuItem,
+ this.toolStripSeparator2,
+ this.exitToolStripMenuItem});
+ this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
+ this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
+ this.fileToolStripMenuItem.Text = "File";
+ //
+ // newProjectToolStripMenuItem
+ //
+ this.newProjectToolStripMenuItem.Image = global::CsbBuilder.Properties.Resources.NewProject;
+ this.newProjectToolStripMenuItem.Name = "newProjectToolStripMenuItem";
+ this.newProjectToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N)));
+ this.newProjectToolStripMenuItem.Size = new System.Drawing.Size(183, 22);
+ this.newProjectToolStripMenuItem.Text = "New Project";
+ this.newProjectToolStripMenuItem.ToolTipText = "Create a new project and close the current one if opened.";
+ this.newProjectToolStripMenuItem.Click += new System.EventHandler(this.CreateNewProject);
+ //
+ // loadProjectToolStripMenuItem
+ //
+ this.loadProjectToolStripMenuItem.Image = global::CsbBuilder.Properties.Resources.LoadProject;
+ this.loadProjectToolStripMenuItem.Name = "loadProjectToolStripMenuItem";
+ this.loadProjectToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O)));
+ this.loadProjectToolStripMenuItem.Size = new System.Drawing.Size(183, 22);
+ this.loadProjectToolStripMenuItem.Text = "Load Project";
+ this.loadProjectToolStripMenuItem.ToolTipText = "Load a project and close the current one if opened.\r\n";
+ this.loadProjectToolStripMenuItem.Click += new System.EventHandler(this.LoadProject);
+ //
+ // saveProjectToolStripMenuItem
+ //
+ this.saveProjectToolStripMenuItem.Enabled = false;
+ this.saveProjectToolStripMenuItem.Image = global::CsbBuilder.Properties.Resources.Save;
+ this.saveProjectToolStripMenuItem.Name = "saveProjectToolStripMenuItem";
+ this.saveProjectToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S)));
+ this.saveProjectToolStripMenuItem.Size = new System.Drawing.Size(183, 22);
+ this.saveProjectToolStripMenuItem.Text = "Save Project";
+ this.saveProjectToolStripMenuItem.ToolTipText = "Save the current project.";
+ this.saveProjectToolStripMenuItem.Click += new System.EventHandler(this.SaveProject);
+ //
+ // saveProjectAsToolStripMenuItem
+ //
+ this.saveProjectAsToolStripMenuItem.Enabled = false;
+ this.saveProjectAsToolStripMenuItem.Image = global::CsbBuilder.Properties.Resources.SaveAs;
+ this.saveProjectAsToolStripMenuItem.Name = "saveProjectAsToolStripMenuItem";
+ this.saveProjectAsToolStripMenuItem.Size = new System.Drawing.Size(183, 22);
+ this.saveProjectAsToolStripMenuItem.Text = "Save Project As";
+ this.saveProjectAsToolStripMenuItem.ToolTipText = "Save the current project to a different directory.";
+ this.saveProjectAsToolStripMenuItem.Click += new System.EventHandler(this.SaveProjectAs);
+ //
+ // mergeProjectToolStripMenuItem
+ //
+ this.mergeProjectToolStripMenuItem.Enabled = false;
+ this.mergeProjectToolStripMenuItem.Image = global::CsbBuilder.Properties.Resources.Merge;
+ this.mergeProjectToolStripMenuItem.Name = "mergeProjectToolStripMenuItem";
+ this.mergeProjectToolStripMenuItem.Size = new System.Drawing.Size(183, 22);
+ this.mergeProjectToolStripMenuItem.Text = "Merge Project";
+ this.mergeProjectToolStripMenuItem.ToolTipText = "Load and merge a project with the current project.";
+ this.mergeProjectToolStripMenuItem.Click += new System.EventHandler(this.MergeProject);
+ //
+ // toolStripSeparator1
+ //
+ this.toolStripSeparator1.Name = "toolStripSeparator1";
+ this.toolStripSeparator1.Size = new System.Drawing.Size(180, 6);
+ //
+ // ımportToolStripMenuItem
+ //
+ this.ımportToolStripMenuItem.Image = global::CsbBuilder.Properties.Resources.Import;
+ this.ımportToolStripMenuItem.Name = "ımportToolStripMenuItem";
+ this.ımportToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.I)));
+ this.ımportToolStripMenuItem.Size = new System.Drawing.Size(183, 22);
+ this.ımportToolStripMenuItem.Text = "Import";
+ this.ımportToolStripMenuItem.ToolTipText = "Import a Cue Sheet Binary as a project and close the current project if opened.";
+ this.ımportToolStripMenuItem.Click += new System.EventHandler(this.ImportCsbFile);
+ //
+ // ımportAndMergeToolStripMenuItem
+ //
+ this.ımportAndMergeToolStripMenuItem.Enabled = false;
+ this.ımportAndMergeToolStripMenuItem.Image = global::CsbBuilder.Properties.Resources.ImportAndMerge;
+ this.ımportAndMergeToolStripMenuItem.Name = "ımportAndMergeToolStripMenuItem";
+ this.ımportAndMergeToolStripMenuItem.Size = new System.Drawing.Size(183, 22);
+ this.ımportAndMergeToolStripMenuItem.Text = "Import And Merge";
+ this.ımportAndMergeToolStripMenuItem.ToolTipText = "Import and merge a Cue Sheet Binary with the current project.";
+ this.ımportAndMergeToolStripMenuItem.Click += new System.EventHandler(this.ImportAndMergeProject);
+ //
+ // toolStripSeparator2
+ //
+ this.toolStripSeparator2.Name = "toolStripSeparator2";
+ this.toolStripSeparator2.Size = new System.Drawing.Size(180, 6);
+ //
+ // exitToolStripMenuItem
+ //
+ this.exitToolStripMenuItem.Image = global::CsbBuilder.Properties.Resources.Exit;
+ this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
+ this.exitToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F4)));
+ this.exitToolStripMenuItem.Size = new System.Drawing.Size(183, 22);
+ this.exitToolStripMenuItem.Text = "Exit";
+ this.exitToolStripMenuItem.ToolTipText = "Exit the application.";
+ this.exitToolStripMenuItem.Click += new System.EventHandler(this.Exit);
+ //
+ // buildToolStripMenuItem
+ //
+ this.buildToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.buildCurrentProjectToolStripMenuItem,
+ this.buildCurrentProjectAsToolStripMenuItem});
+ this.buildToolStripMenuItem.Name = "buildToolStripMenuItem";
+ this.buildToolStripMenuItem.Size = new System.Drawing.Size(46, 20);
+ this.buildToolStripMenuItem.Text = "Build";
+ //
+ // buildCurrentProjectToolStripMenuItem
+ //
+ this.buildCurrentProjectToolStripMenuItem.Enabled = false;
+ this.buildCurrentProjectToolStripMenuItem.Image = global::CsbBuilder.Properties.Resources.Build;
+ this.buildCurrentProjectToolStripMenuItem.Name = "buildCurrentProjectToolStripMenuItem";
+ this.buildCurrentProjectToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.B)));
+ this.buildCurrentProjectToolStripMenuItem.Size = new System.Drawing.Size(225, 22);
+ this.buildCurrentProjectToolStripMenuItem.Text = "Build Current Project";
+ this.buildCurrentProjectToolStripMenuItem.ToolTipText = "Build the current project as Cue Sheet Binary.";
+ this.buildCurrentProjectToolStripMenuItem.Click += new System.EventHandler(this.BuildProject);
+ //
+ // buildCurrentProjectAsToolStripMenuItem
+ //
+ this.buildCurrentProjectAsToolStripMenuItem.Enabled = false;
+ this.buildCurrentProjectAsToolStripMenuItem.Image = global::CsbBuilder.Properties.Resources.Build;
+ this.buildCurrentProjectAsToolStripMenuItem.Name = "buildCurrentProjectAsToolStripMenuItem";
+ this.buildCurrentProjectAsToolStripMenuItem.Size = new System.Drawing.Size(225, 22);
+ this.buildCurrentProjectAsToolStripMenuItem.Text = "Build Current Project As";
+ this.buildCurrentProjectAsToolStripMenuItem.ToolTipText = "Build the current project as Cue Sheet Binary in a different path.";
+ this.buildCurrentProjectAsToolStripMenuItem.Click += new System.EventHandler(this.BuildProjectAs);
+ //
+ // propertyGrid
+ //
+ this.propertyGrid.AllowDrop = true;
+ this.propertyGrid.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.propertyGrid.Enabled = false;
+ this.propertyGrid.Location = new System.Drawing.Point(252, 24);
+ this.propertyGrid.Name = "propertyGrid";
+ this.propertyGrid.Size = new System.Drawing.Size(374, 556);
+ this.propertyGrid.TabIndex = 1;
+ this.propertyGrid.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.OnPropertyChange);
+ //
+ // splitContainer1
+ //
+ this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)));
+ this.splitContainer1.Enabled = false;
+ this.splitContainer1.Location = new System.Drawing.Point(0, 24);
+ this.splitContainer1.Name = "splitContainer1";
+ this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
+ //
+ // splitContainer1.Panel1
+ //
+ this.splitContainer1.Panel1.Controls.Add(this.tabControl2);
+ //
+ // splitContainer1.Panel2
+ //
+ this.splitContainer1.Panel2.Controls.Add(this.tabControl3);
+ this.splitContainer1.Size = new System.Drawing.Size(250, 556);
+ this.splitContainer1.SplitterDistance = 247;
+ this.splitContainer1.TabIndex = 2;
+ //
+ // tabControl2
+ //
+ this.tabControl2.Controls.Add(this.tabPage3);
+ this.tabControl2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tabControl2.ImeMode = System.Windows.Forms.ImeMode.NoControl;
+ this.tabControl2.Location = new System.Drawing.Point(0, 0);
+ this.tabControl2.Name = "tabControl2";
+ this.tabControl2.SelectedIndex = 0;
+ this.tabControl2.Size = new System.Drawing.Size(250, 247);
+ this.tabControl2.TabIndex = 0;
+ //
+ // tabPage3
+ //
+ this.tabPage3.Controls.Add(this.cueTree);
+ this.tabPage3.Location = new System.Drawing.Point(4, 22);
+ this.tabPage3.Name = "tabPage3";
+ this.tabPage3.Padding = new System.Windows.Forms.Padding(3);
+ this.tabPage3.Size = new System.Drawing.Size(242, 221);
+ this.tabPage3.TabIndex = 0;
+ this.tabPage3.Text = "Cue";
+ this.tabPage3.UseVisualStyleBackColor = true;
+ //
+ // cueTree
+ //
+ this.cueTree.AllowDrop = true;
+ this.cueTree.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ this.cueTree.ContextMenuStrip = this.nodeTreeMenu;
+ this.cueTree.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.cueTree.HideSelection = false;
+ this.cueTree.ImageIndex = 0;
+ this.cueTree.ImageList = this.imageList;
+ this.cueTree.LabelEdit = true;
+ this.cueTree.Location = new System.Drawing.Point(3, 3);
+ this.cueTree.Name = "cueTree";
+ this.cueTree.PathSeparator = "/";
+ this.cueTree.SelectedImageIndex = 0;
+ this.cueTree.Size = new System.Drawing.Size(236, 215);
+ this.cueTree.TabIndex = 0;
+ this.cueTree.AfterLabelEdit += new System.Windows.Forms.NodeLabelEditEventHandler(this.OnRenameEnd);
+ this.cueTree.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.AfterNodeSelect);
+ this.cueTree.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.OnNodeClick);
+ this.cueTree.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.RenameNode);
+ this.cueTree.KeyDown += new System.Windows.Forms.KeyEventHandler(this.OnKeyDown);
+ //
+ // nodeTreeMenu
+ //
+ this.nodeTreeMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.createToolStripMenuItem,
+ this.toolStripSeparator14,
+ this.toolStripMenuItem17});
+ this.nodeTreeMenu.Name = "cueAndVoiceLimitGroupTreeMenu";
+ this.nodeTreeMenu.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
+ this.nodeTreeMenu.Size = new System.Drawing.Size(109, 54);
+ //
+ // createToolStripMenuItem
+ //
+ this.createToolStripMenuItem.Image = global::CsbBuilder.Properties.Resources.Create;
+ this.createToolStripMenuItem.Name = "createToolStripMenuItem";
+ this.createToolStripMenuItem.Size = new System.Drawing.Size(108, 22);
+ this.createToolStripMenuItem.Text = "Create";
+ this.createToolStripMenuItem.ToolTipText = "Create a new node.";
+ this.createToolStripMenuItem.Click += new System.EventHandler(this.CreateNode);
+ //
+ // toolStripSeparator14
+ //
+ this.toolStripSeparator14.Name = "toolStripSeparator14";
+ this.toolStripSeparator14.Size = new System.Drawing.Size(105, 6);
+ //
+ // toolStripMenuItem17
+ //
+ this.toolStripMenuItem17.Image = global::CsbBuilder.Properties.Resources.Paste;
+ this.toolStripMenuItem17.Name = "toolStripMenuItem17";
+ this.toolStripMenuItem17.Size = new System.Drawing.Size(108, 22);
+ this.toolStripMenuItem17.Text = "Paste";
+ this.toolStripMenuItem17.ToolTipText = "Paste the copied node.";
+ this.toolStripMenuItem17.Click += new System.EventHandler(this.PasteNodeOnTree);
+ //
+ // imageList
+ //
+ this.imageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
+ this.imageList.ImageSize = new System.Drawing.Size(16, 16);
+ this.imageList.TransparentColor = System.Drawing.Color.Transparent;
+ //
+ // tabControl3
+ //
+ this.tabControl3.Controls.Add(this.tabPage4);
+ this.tabControl3.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tabControl3.Location = new System.Drawing.Point(0, 0);
+ this.tabControl3.Name = "tabControl3";
+ this.tabControl3.SelectedIndex = 0;
+ this.tabControl3.Size = new System.Drawing.Size(250, 305);
+ this.tabControl3.TabIndex = 0;
+ //
+ // tabPage4
+ //
+ this.tabPage4.Controls.Add(this.synthTree);
+ this.tabPage4.Location = new System.Drawing.Point(4, 22);
+ this.tabPage4.Name = "tabPage4";
+ this.tabPage4.Padding = new System.Windows.Forms.Padding(3);
+ this.tabPage4.Size = new System.Drawing.Size(242, 279);
+ this.tabPage4.TabIndex = 0;
+ this.tabPage4.Text = "Synth";
+ this.tabPage4.UseVisualStyleBackColor = true;
+ //
+ // synthTree
+ //
+ this.synthTree.AllowDrop = true;
+ this.synthTree.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ this.synthTree.ContextMenuStrip = this.synthFolderTreeMenu;
+ this.synthTree.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.synthTree.HideSelection = false;
+ this.synthTree.ImageIndex = 0;
+ this.synthTree.ImageList = this.imageList;
+ this.synthTree.LabelEdit = true;
+ this.synthTree.Location = new System.Drawing.Point(3, 3);
+ this.synthTree.Name = "synthTree";
+ this.synthTree.PathSeparator = "/";
+ this.synthTree.SelectedImageIndex = 0;
+ this.synthTree.Size = new System.Drawing.Size(236, 273);
+ this.synthTree.TabIndex = 0;
+ this.synthTree.AfterLabelEdit += new System.Windows.Forms.NodeLabelEditEventHandler(this.OnRenameEnd);
+ this.synthTree.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.AfterNodeSelect);
+ this.synthTree.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.OnNodeClick);
+ this.synthTree.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.RenameNode);
+ this.synthTree.KeyDown += new System.Windows.Forms.KeyEventHandler(this.OnKeyDown);
+ //
+ // synthFolderTreeMenu
+ //
+ this.synthFolderTreeMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.toolStripMenuItem13,
+ this.toolStripMenuItem15,
+ this.toolStripMenuItem14,
+ this.toolStripSeparator15,
+ this.toolStripMenuItem27});
+ this.synthFolderTreeMenu.Name = "contextMenuStrip1";
+ this.synthFolderTreeMenu.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
+ this.synthFolderTreeMenu.Size = new System.Drawing.Size(146, 98);
+ //
+ // toolStripMenuItem13
+ //
+ this.toolStripMenuItem13.Image = global::CsbBuilder.Properties.Resources.Create;
+ this.toolStripMenuItem13.Name = "toolStripMenuItem13";
+ this.toolStripMenuItem13.Size = new System.Drawing.Size(145, 22);
+ this.toolStripMenuItem13.Text = "Create Track";
+ this.toolStripMenuItem13.ToolTipText = "Create a new track (or block) node.";
+ this.toolStripMenuItem13.Click += new System.EventHandler(this.CreateNode);
+ //
+ // toolStripMenuItem15
+ //
+ this.toolStripMenuItem15.Image = global::CsbBuilder.Properties.Resources.Sound;
+ this.toolStripMenuItem15.Name = "toolStripMenuItem15";
+ this.toolStripMenuItem15.Size = new System.Drawing.Size(145, 22);
+ this.toolStripMenuItem15.Text = "Create Sound";
+ this.toolStripMenuItem15.ToolTipText = "Create a new sound node.";
+ this.toolStripMenuItem15.Click += new System.EventHandler(this.CreateSound);
+ //
+ // toolStripMenuItem14
+ //
+ this.toolStripMenuItem14.Image = global::CsbBuilder.Properties.Resources.Folder;
+ this.toolStripMenuItem14.Name = "toolStripMenuItem14";
+ this.toolStripMenuItem14.Size = new System.Drawing.Size(145, 22);
+ this.toolStripMenuItem14.Text = "Create Folder";
+ this.toolStripMenuItem14.ToolTipText = "Create a new folder.";
+ this.toolStripMenuItem14.Click += new System.EventHandler(this.CreateFolder);
+ //
+ // toolStripSeparator15
+ //
+ this.toolStripSeparator15.Name = "toolStripSeparator15";
+ this.toolStripSeparator15.Size = new System.Drawing.Size(142, 6);
+ //
+ // toolStripMenuItem27
+ //
+ this.toolStripMenuItem27.Image = global::CsbBuilder.Properties.Resources.Paste;
+ this.toolStripMenuItem27.Name = "toolStripMenuItem27";
+ this.toolStripMenuItem27.Size = new System.Drawing.Size(145, 22);
+ this.toolStripMenuItem27.Text = "Paste";
+ this.toolStripMenuItem27.ToolTipText = "Paste the copied node.";
+ this.toolStripMenuItem27.Click += new System.EventHandler(this.PasteNodeOnTree);
+ //
+ // folderTreeMenu
+ //
+ this.folderTreeMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.createToolStripMenuItem2,
+ this.createFolderToolStripMenuItem1,
+ this.toolStripSeparator12,
+ this.pasteToolStripMenuItem});
+ this.folderTreeMenu.Name = "contextMenuStrip1";
+ this.folderTreeMenu.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
+ this.folderTreeMenu.Size = new System.Drawing.Size(145, 76);
+ //
+ // createToolStripMenuItem2
+ //
+ this.createToolStripMenuItem2.Image = global::CsbBuilder.Properties.Resources.Create;
+ this.createToolStripMenuItem2.Name = "createToolStripMenuItem2";
+ this.createToolStripMenuItem2.Size = new System.Drawing.Size(144, 22);
+ this.createToolStripMenuItem2.Text = "Create";
+ this.createToolStripMenuItem2.ToolTipText = "Create a new node.";
+ this.createToolStripMenuItem2.Click += new System.EventHandler(this.CreateNode);
+ //
+ // createFolderToolStripMenuItem1
+ //
+ this.createFolderToolStripMenuItem1.Image = global::CsbBuilder.Properties.Resources.Folder;
+ this.createFolderToolStripMenuItem1.Name = "createFolderToolStripMenuItem1";
+ this.createFolderToolStripMenuItem1.Size = new System.Drawing.Size(144, 22);
+ this.createFolderToolStripMenuItem1.Text = "Create Folder";
+ this.createFolderToolStripMenuItem1.ToolTipText = "Create a new folder.";
+ this.createFolderToolStripMenuItem1.Click += new System.EventHandler(this.CreateFolder);
+ //
+ // toolStripSeparator12
+ //
+ this.toolStripSeparator12.Name = "toolStripSeparator12";
+ this.toolStripSeparator12.Size = new System.Drawing.Size(141, 6);
+ //
+ // pasteToolStripMenuItem
+ //
+ this.pasteToolStripMenuItem.Image = global::CsbBuilder.Properties.Resources.Paste;
+ this.pasteToolStripMenuItem.Name = "pasteToolStripMenuItem";
+ this.pasteToolStripMenuItem.Size = new System.Drawing.Size(144, 22);
+ this.pasteToolStripMenuItem.Text = "Paste";
+ this.pasteToolStripMenuItem.ToolTipText = "Paste the copied node.";
+ this.pasteToolStripMenuItem.Click += new System.EventHandler(this.PasteNodeOnTree);
+ //
+ // splitContainer2
+ //
+ this.splitContainer2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.splitContainer2.Enabled = false;
+ this.splitContainer2.Location = new System.Drawing.Point(628, 24);
+ this.splitContainer2.Name = "splitContainer2";
+ this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal;
+ //
+ // splitContainer2.Panel1
+ //
+ this.splitContainer2.Panel1.Controls.Add(this.tabControl4);
+ //
+ // splitContainer2.Panel2
+ //
+ this.splitContainer2.Panel2.Controls.Add(this.tabControl1);
+ this.splitContainer2.Size = new System.Drawing.Size(250, 556);
+ this.splitContainer2.SplitterDistance = 247;
+ this.splitContainer2.TabIndex = 3;
+ //
+ // tabControl4
+ //
+ this.tabControl4.Controls.Add(this.tabPage5);
+ this.tabControl4.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tabControl4.Location = new System.Drawing.Point(0, 0);
+ this.tabControl4.Name = "tabControl4";
+ this.tabControl4.SelectedIndex = 0;
+ this.tabControl4.Size = new System.Drawing.Size(250, 247);
+ this.tabControl4.TabIndex = 0;
+ //
+ // tabPage5
+ //
+ this.tabPage5.Controls.Add(this.soundElementTree);
+ this.tabPage5.Location = new System.Drawing.Point(4, 22);
+ this.tabPage5.Name = "tabPage5";
+ this.tabPage5.Padding = new System.Windows.Forms.Padding(3);
+ this.tabPage5.Size = new System.Drawing.Size(242, 221);
+ this.tabPage5.TabIndex = 0;
+ this.tabPage5.Text = "Sound Element";
+ this.tabPage5.UseVisualStyleBackColor = true;
+ //
+ // soundElementTree
+ //
+ this.soundElementTree.AllowDrop = true;
+ this.soundElementTree.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ this.soundElementTree.ContextMenuStrip = this.folderTreeMenu;
+ this.soundElementTree.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.soundElementTree.HideSelection = false;
+ this.soundElementTree.ImageIndex = 0;
+ this.soundElementTree.ImageList = this.imageList;
+ this.soundElementTree.LabelEdit = true;
+ this.soundElementTree.Location = new System.Drawing.Point(3, 3);
+ this.soundElementTree.Name = "soundElementTree";
+ this.soundElementTree.PathSeparator = "/";
+ this.soundElementTree.SelectedImageIndex = 0;
+ this.soundElementTree.Size = new System.Drawing.Size(236, 215);
+ this.soundElementTree.TabIndex = 0;
+ this.soundElementTree.AfterLabelEdit += new System.Windows.Forms.NodeLabelEditEventHandler(this.OnRenameEnd);
+ this.soundElementTree.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.AfterNodeSelect);
+ this.soundElementTree.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.OnNodeClick);
+ this.soundElementTree.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.RenameNode);
+ this.soundElementTree.KeyDown += new System.Windows.Forms.KeyEventHandler(this.OnKeyDown);
+ //
+ // tabControl1
+ //
+ this.tabControl1.Controls.Add(this.tabPage1);
+ this.tabControl1.Controls.Add(this.tabPage2);
+ this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tabControl1.Location = new System.Drawing.Point(0, 0);
+ this.tabControl1.Name = "tabControl1";
+ this.tabControl1.SelectedIndex = 0;
+ this.tabControl1.Size = new System.Drawing.Size(250, 305);
+ this.tabControl1.TabIndex = 0;
+ //
+ // tabPage1
+ //
+ this.tabPage1.Controls.Add(this.aisacTree);
+ this.tabPage1.Location = new System.Drawing.Point(4, 22);
+ this.tabPage1.Name = "tabPage1";
+ this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
+ this.tabPage1.Size = new System.Drawing.Size(242, 279);
+ this.tabPage1.TabIndex = 0;
+ this.tabPage1.Text = "AISAC";
+ this.tabPage1.UseVisualStyleBackColor = true;
+ //
+ // aisacTree
+ //
+ this.aisacTree.AllowDrop = true;
+ this.aisacTree.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ this.aisacTree.ContextMenuStrip = this.aisacTreeMenu;
+ this.aisacTree.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.aisacTree.HideSelection = false;
+ this.aisacTree.ImageIndex = 0;
+ this.aisacTree.ImageList = this.imageList;
+ this.aisacTree.LabelEdit = true;
+ this.aisacTree.Location = new System.Drawing.Point(3, 3);
+ this.aisacTree.Name = "aisacTree";
+ this.aisacTree.PathSeparator = "/";
+ this.aisacTree.SelectedImageIndex = 0;
+ this.aisacTree.Size = new System.Drawing.Size(236, 273);
+ this.aisacTree.TabIndex = 0;
+ this.aisacTree.AfterLabelEdit += new System.Windows.Forms.NodeLabelEditEventHandler(this.OnRenameEnd);
+ this.aisacTree.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.AfterNodeSelect);
+ this.aisacTree.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.OnNodeClick);
+ this.aisacTree.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.RenameNode);
+ this.aisacTree.KeyDown += new System.Windows.Forms.KeyEventHandler(this.OnKeyDown);
+ //
+ // aisacTreeMenu
+ //
+ this.aisacTreeMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.toolStripMenuItem45,
+ this.toolStripMenuItem46,
+ this.toolStripSeparator24,
+ this.toolStripMenuItem48,
+ this.toolStripSeparator25,
+ this.toolStripMenuItem47});
+ this.aisacTreeMenu.Name = "contextMenuStrip1";
+ this.aisacTreeMenu.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
+ this.aisacTreeMenu.Size = new System.Drawing.Size(189, 104);
+ //
+ // toolStripMenuItem45
+ //
+ this.toolStripMenuItem45.Image = global::CsbBuilder.Properties.Resources.Create;
+ this.toolStripMenuItem45.Name = "toolStripMenuItem45";
+ this.toolStripMenuItem45.Size = new System.Drawing.Size(188, 22);
+ this.toolStripMenuItem45.Text = "Create";
+ this.toolStripMenuItem45.ToolTipText = "Create a new node.";
+ this.toolStripMenuItem45.Click += new System.EventHandler(this.CreateNode);
+ //
+ // toolStripMenuItem46
+ //
+ this.toolStripMenuItem46.Image = global::CsbBuilder.Properties.Resources.Folder;
+ this.toolStripMenuItem46.Name = "toolStripMenuItem46";
+ this.toolStripMenuItem46.Size = new System.Drawing.Size(188, 22);
+ this.toolStripMenuItem46.Text = "Create Folder";
+ this.toolStripMenuItem46.ToolTipText = "Create a new folder.";
+ this.toolStripMenuItem46.Click += new System.EventHandler(this.CreateFolder);
+ //
+ // toolStripSeparator24
+ //
+ this.toolStripSeparator24.Name = "toolStripSeparator24";
+ this.toolStripSeparator24.Size = new System.Drawing.Size(185, 6);
+ //
+ // toolStripMenuItem48
+ //
+ this.toolStripMenuItem48.Image = global::CsbBuilder.Properties.Resources.Template;
+ this.toolStripMenuItem48.Name = "toolStripMenuItem48";
+ this.toolStripMenuItem48.Size = new System.Drawing.Size(188, 22);
+ this.toolStripMenuItem48.Text = "Load AISAC Template";
+ this.toolStripMenuItem48.Click += new System.EventHandler(this.LoadTemplate);
+ //
+ // toolStripSeparator25
+ //
+ this.toolStripSeparator25.Name = "toolStripSeparator25";
+ this.toolStripSeparator25.Size = new System.Drawing.Size(185, 6);
+ //
+ // toolStripMenuItem47
+ //
+ this.toolStripMenuItem47.Image = global::CsbBuilder.Properties.Resources.Paste;
+ this.toolStripMenuItem47.Name = "toolStripMenuItem47";
+ this.toolStripMenuItem47.Size = new System.Drawing.Size(188, 22);
+ this.toolStripMenuItem47.Text = "Paste";
+ this.toolStripMenuItem47.ToolTipText = "Paste the copied node.";
+ this.toolStripMenuItem47.Click += new System.EventHandler(this.PasteNodeOnTree);
+ //
+ // tabPage2
+ //
+ this.tabPage2.Controls.Add(this.voiceLimitGroupTree);
+ this.tabPage2.Location = new System.Drawing.Point(4, 22);
+ this.tabPage2.Name = "tabPage2";
+ this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
+ this.tabPage2.Size = new System.Drawing.Size(242, 279);
+ this.tabPage2.TabIndex = 1;
+ this.tabPage2.Text = "Voice Limit Group";
+ this.tabPage2.UseVisualStyleBackColor = true;
+ //
+ // voiceLimitGroupTree
+ //
+ this.voiceLimitGroupTree.AllowDrop = true;
+ this.voiceLimitGroupTree.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ this.voiceLimitGroupTree.ContextMenuStrip = this.nodeTreeMenu;
+ this.voiceLimitGroupTree.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.voiceLimitGroupTree.HideSelection = false;
+ this.voiceLimitGroupTree.ImageIndex = 0;
+ this.voiceLimitGroupTree.ImageList = this.imageList;
+ this.voiceLimitGroupTree.LabelEdit = true;
+ this.voiceLimitGroupTree.Location = new System.Drawing.Point(3, 3);
+ this.voiceLimitGroupTree.Name = "voiceLimitGroupTree";
+ this.voiceLimitGroupTree.PathSeparator = "/";
+ this.voiceLimitGroupTree.SelectedImageIndex = 0;
+ this.voiceLimitGroupTree.Size = new System.Drawing.Size(236, 273);
+ this.voiceLimitGroupTree.TabIndex = 0;
+ this.voiceLimitGroupTree.AfterLabelEdit += new System.Windows.Forms.NodeLabelEditEventHandler(this.OnRenameEnd);
+ this.voiceLimitGroupTree.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.AfterNodeSelect);
+ this.voiceLimitGroupTree.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.OnNodeClick);
+ this.voiceLimitGroupTree.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.RenameNode);
+ this.voiceLimitGroupTree.KeyDown += new System.Windows.Forms.KeyEventHandler(this.OnKeyDown);
+ //
+ // nodeMenu
+ //
+ this.nodeMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.createToolStripMenuItem4,
+ this.toolStripSeparator16,
+ this.copyToolStripMenuItem,
+ this.toolStripMenuItem28,
+ this.removeToolStripMenuItem});
+ this.nodeMenu.Name = "cueAndVoiceLimitGroupMenu";
+ this.nodeMenu.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
+ this.nodeMenu.Size = new System.Drawing.Size(118, 98);
+ //
+ // createToolStripMenuItem4
+ //
+ this.createToolStripMenuItem4.Image = global::CsbBuilder.Properties.Resources.Create;
+ this.createToolStripMenuItem4.Name = "createToolStripMenuItem4";
+ this.createToolStripMenuItem4.Size = new System.Drawing.Size(117, 22);
+ this.createToolStripMenuItem4.Text = "Create";
+ this.createToolStripMenuItem4.ToolTipText = "Create a new node after the selected node.";
+ this.createToolStripMenuItem4.Click += new System.EventHandler(this.CreateAndInsertNode);
+ //
+ // toolStripSeparator16
+ //
+ this.toolStripSeparator16.Name = "toolStripSeparator16";
+ this.toolStripSeparator16.Size = new System.Drawing.Size(114, 6);
+ //
+ // copyToolStripMenuItem
+ //
+ this.copyToolStripMenuItem.Image = global::CsbBuilder.Properties.Resources.Copy;
+ this.copyToolStripMenuItem.Name = "copyToolStripMenuItem";
+ this.copyToolStripMenuItem.Size = new System.Drawing.Size(117, 22);
+ this.copyToolStripMenuItem.Text = "Copy";
+ this.copyToolStripMenuItem.ToolTipText = "Copy the selected node.";
+ this.copyToolStripMenuItem.Click += new System.EventHandler(this.CopyNode);
+ //
+ // toolStripMenuItem28
+ //
+ this.toolStripMenuItem28.Image = global::CsbBuilder.Properties.Resources.Paste;
+ this.toolStripMenuItem28.Name = "toolStripMenuItem28";
+ this.toolStripMenuItem28.Size = new System.Drawing.Size(117, 22);
+ this.toolStripMenuItem28.Text = "Paste";
+ this.toolStripMenuItem28.ToolTipText = "Paste the copied node after the selected node.";
+ this.toolStripMenuItem28.Click += new System.EventHandler(this.PasteAndInsertNode);
+ //
+ // removeToolStripMenuItem
+ //
+ this.removeToolStripMenuItem.Image = global::CsbBuilder.Properties.Resources.Remove;
+ this.removeToolStripMenuItem.Name = "removeToolStripMenuItem";
+ this.removeToolStripMenuItem.Size = new System.Drawing.Size(117, 22);
+ this.removeToolStripMenuItem.Text = "Remove";
+ this.removeToolStripMenuItem.ToolTipText = "Remove the selected node.";
+ this.removeToolStripMenuItem.Click += new System.EventHandler(this.RemoveNode);
+ //
+ // folderMenu
+ //
+ this.folderMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.createToolStripMenuItem1,
+ this.createFolderToolStripMenuItem,
+ this.toolStripSeparator11,
+ this.toolStripMenuItem18,
+ this.toolStripMenuItem19,
+ this.removeToolStripMenuItem1});
+ this.folderMenu.Name = "synthSoundElementAndAisacMenu";
+ this.folderMenu.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
+ this.folderMenu.Size = new System.Drawing.Size(145, 120);
+ //
+ // createToolStripMenuItem1
+ //
+ this.createToolStripMenuItem1.Image = global::CsbBuilder.Properties.Resources.Create;
+ this.createToolStripMenuItem1.Name = "createToolStripMenuItem1";
+ this.createToolStripMenuItem1.Size = new System.Drawing.Size(144, 22);
+ this.createToolStripMenuItem1.Text = "Create";
+ this.createToolStripMenuItem1.ToolTipText = "Create a new child node.";
+ this.createToolStripMenuItem1.Click += new System.EventHandler(this.CreateChildNode);
+ //
+ // createFolderToolStripMenuItem
+ //
+ this.createFolderToolStripMenuItem.Image = global::CsbBuilder.Properties.Resources.Folder;
+ this.createFolderToolStripMenuItem.Name = "createFolderToolStripMenuItem";
+ this.createFolderToolStripMenuItem.Size = new System.Drawing.Size(144, 22);
+ this.createFolderToolStripMenuItem.Text = "Create Folder";
+ this.createFolderToolStripMenuItem.ToolTipText = "Create a new child folder.";
+ this.createFolderToolStripMenuItem.Click += new System.EventHandler(this.CreateChildFolder);
+ //
+ // toolStripSeparator11
+ //
+ this.toolStripSeparator11.Name = "toolStripSeparator11";
+ this.toolStripSeparator11.Size = new System.Drawing.Size(141, 6);
+ //
+ // toolStripMenuItem18
+ //
+ this.toolStripMenuItem18.Image = global::CsbBuilder.Properties.Resources.Copy;
+ this.toolStripMenuItem18.Name = "toolStripMenuItem18";
+ this.toolStripMenuItem18.Size = new System.Drawing.Size(144, 22);
+ this.toolStripMenuItem18.Text = "Copy";
+ this.toolStripMenuItem18.ToolTipText = "Copy the selected node.";
+ this.toolStripMenuItem18.Click += new System.EventHandler(this.CopyNode);
+ //
+ // toolStripMenuItem19
+ //
+ this.toolStripMenuItem19.Image = global::CsbBuilder.Properties.Resources.Paste;
+ this.toolStripMenuItem19.Name = "toolStripMenuItem19";
+ this.toolStripMenuItem19.Size = new System.Drawing.Size(144, 22);
+ this.toolStripMenuItem19.Text = "Paste";
+ this.toolStripMenuItem19.ToolTipText = "Paste the copied node as child.";
+ this.toolStripMenuItem19.Click += new System.EventHandler(this.PasteNode);
+ //
+ // removeToolStripMenuItem1
+ //
+ this.removeToolStripMenuItem1.Image = global::CsbBuilder.Properties.Resources.Remove;
+ this.removeToolStripMenuItem1.Name = "removeToolStripMenuItem1";
+ this.removeToolStripMenuItem1.Size = new System.Drawing.Size(144, 22);
+ this.removeToolStripMenuItem1.Text = "Remove";
+ this.removeToolStripMenuItem1.ToolTipText = "Remove the selected node.";
+ this.removeToolStripMenuItem1.Click += new System.EventHandler(this.RemoveNode);
+ //
+ // trackMenu
+ //
+ this.trackMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.toolStripMenuItem16,
+ this.createToolStripMenuItem3,
+ this.toolStripSeparator10,
+ this.toolStripMenuItem20,
+ this.toolStripMenuItem21,
+ this.toolStripMenuItem1,
+ this.toolStripSeparator3,
+ this.selectAisacReferenceToolStripMenuItem,
+ this.selectVoiceLimitGroupReferenceToolStripMenuItem,
+ this.toolStripSeparator4,
+ this.setAisacReferenceToolStripMenuItem,
+ this.setVoiceLimitGroupReferenceToolStripMenuItem});
+ this.trackMenu.Name = "cueAndVoiceLimitGroupMenu";
+ this.trackMenu.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
+ this.trackMenu.Size = new System.Drawing.Size(258, 220);
+ //
+ // toolStripMenuItem16
+ //
+ this.toolStripMenuItem16.Image = global::CsbBuilder.Properties.Resources.Create;
+ this.toolStripMenuItem16.Name = "toolStripMenuItem16";
+ this.toolStripMenuItem16.Size = new System.Drawing.Size(257, 22);
+ this.toolStripMenuItem16.Text = "Create Block";
+ this.toolStripMenuItem16.ToolTipText = "Create a new child block node.";
+ this.toolStripMenuItem16.Click += new System.EventHandler(this.CreateChildTrackNode);
+ //
+ // createToolStripMenuItem3
+ //
+ this.createToolStripMenuItem3.Image = global::CsbBuilder.Properties.Resources.Sound;
+ this.createToolStripMenuItem3.Name = "createToolStripMenuItem3";
+ this.createToolStripMenuItem3.Size = new System.Drawing.Size(257, 22);
+ this.createToolStripMenuItem3.Text = "Create Sound";
+ this.createToolStripMenuItem3.ToolTipText = "Create a new child sound node.";
+ this.createToolStripMenuItem3.Click += new System.EventHandler(this.CreateChildNode);
+ //
+ // toolStripSeparator10
+ //
+ this.toolStripSeparator10.Name = "toolStripSeparator10";
+ this.toolStripSeparator10.Size = new System.Drawing.Size(254, 6);
+ //
+ // toolStripMenuItem20
+ //
+ this.toolStripMenuItem20.Image = global::CsbBuilder.Properties.Resources.Copy;
+ this.toolStripMenuItem20.Name = "toolStripMenuItem20";
+ this.toolStripMenuItem20.Size = new System.Drawing.Size(257, 22);
+ this.toolStripMenuItem20.Text = "Copy";
+ this.toolStripMenuItem20.ToolTipText = "Copy the selected node.";
+ this.toolStripMenuItem20.Click += new System.EventHandler(this.CopyNode);
+ //
+ // toolStripMenuItem21
+ //
+ this.toolStripMenuItem21.Image = global::CsbBuilder.Properties.Resources.Paste;
+ this.toolStripMenuItem21.Name = "toolStripMenuItem21";
+ this.toolStripMenuItem21.Size = new System.Drawing.Size(257, 22);
+ this.toolStripMenuItem21.Text = "Paste";
+ this.toolStripMenuItem21.ToolTipText = "Paste the copied node as child.";
+ this.toolStripMenuItem21.Click += new System.EventHandler(this.PasteNode);
+ //
+ // toolStripMenuItem1
+ //
+ this.toolStripMenuItem1.Image = global::CsbBuilder.Properties.Resources.Remove;
+ this.toolStripMenuItem1.Name = "toolStripMenuItem1";
+ this.toolStripMenuItem1.Size = new System.Drawing.Size(257, 22);
+ this.toolStripMenuItem1.Text = "Remove";
+ this.toolStripMenuItem1.ToolTipText = "Remove the selected node.";
+ this.toolStripMenuItem1.Click += new System.EventHandler(this.RemoveNode);
+ //
+ // toolStripSeparator3
+ //
+ this.toolStripSeparator3.Name = "toolStripSeparator3";
+ this.toolStripSeparator3.Size = new System.Drawing.Size(254, 6);
+ //
+ // selectAisacReferenceToolStripMenuItem
+ //
+ this.selectAisacReferenceToolStripMenuItem.Image = global::CsbBuilder.Properties.Resources.Select;
+ this.selectAisacReferenceToolStripMenuItem.Name = "selectAisacReferenceToolStripMenuItem";
+ this.selectAisacReferenceToolStripMenuItem.Size = new System.Drawing.Size(257, 22);
+ this.selectAisacReferenceToolStripMenuItem.Text = "Select AISAC Reference";
+ this.selectAisacReferenceToolStripMenuItem.ToolTipText = "Select the referenced AISAC node from the AISAC tree.";
+ this.selectAisacReferenceToolStripMenuItem.Click += new System.EventHandler(this.SelectAisacReference);
+ //
+ // selectVoiceLimitGroupReferenceToolStripMenuItem
+ //
+ this.selectVoiceLimitGroupReferenceToolStripMenuItem.Image = global::CsbBuilder.Properties.Resources.Select;
+ this.selectVoiceLimitGroupReferenceToolStripMenuItem.Name = "selectVoiceLimitGroupReferenceToolStripMenuItem";
+ this.selectVoiceLimitGroupReferenceToolStripMenuItem.Size = new System.Drawing.Size(257, 22);
+ this.selectVoiceLimitGroupReferenceToolStripMenuItem.Text = "Select Voice Limit Group Reference";
+ this.selectVoiceLimitGroupReferenceToolStripMenuItem.ToolTipText = "Select the referenced Voice Limit Group node from the Voice Limit Group tree.";
+ this.selectVoiceLimitGroupReferenceToolStripMenuItem.Click += new System.EventHandler(this.SelectVoiceLimitGroupReference);
+ //
+ // toolStripSeparator4
+ //
+ this.toolStripSeparator4.Name = "toolStripSeparator4";
+ this.toolStripSeparator4.Size = new System.Drawing.Size(254, 6);
+ //
+ // setAisacReferenceToolStripMenuItem
+ //
+ this.setAisacReferenceToolStripMenuItem.Image = global::CsbBuilder.Properties.Resources.SetReference;
+ this.setAisacReferenceToolStripMenuItem.Name = "setAisacReferenceToolStripMenuItem";
+ this.setAisacReferenceToolStripMenuItem.Size = new System.Drawing.Size(257, 22);
+ this.setAisacReferenceToolStripMenuItem.Text = "Set AISAC Reference";
+ this.setAisacReferenceToolStripMenuItem.ToolTipText = "Set the AISAC reference from the AISAC tree.";
+ this.setAisacReferenceToolStripMenuItem.Click += new System.EventHandler(this.SetAisacReference);
+ //
+ // setVoiceLimitGroupReferenceToolStripMenuItem
+ //
+ this.setVoiceLimitGroupReferenceToolStripMenuItem.Image = global::CsbBuilder.Properties.Resources.SetReference;
+ this.setVoiceLimitGroupReferenceToolStripMenuItem.Name = "setVoiceLimitGroupReferenceToolStripMenuItem";
+ this.setVoiceLimitGroupReferenceToolStripMenuItem.Size = new System.Drawing.Size(257, 22);
+ this.setVoiceLimitGroupReferenceToolStripMenuItem.Text = "Set Voice Limit Group Reference";
+ this.setVoiceLimitGroupReferenceToolStripMenuItem.ToolTipText = "Set the Voice Limit Group reference from the Voice Limit Group tree.";
+ this.setVoiceLimitGroupReferenceToolStripMenuItem.Click += new System.EventHandler(this.SetVoiceLimitGroupReference);
+ //
+ // cueReferenceMenu
+ //
+ this.cueReferenceMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.toolStripMenuItem32,
+ this.toolStripSeparator17,
+ this.toolStripMenuItem22,
+ this.toolStripMenuItem29,
+ this.toolStripMenuItem2,
+ this.toolStripSeparator5,
+ this.selectReferenceToolStripMenuItem,
+ this.toolStripSeparator8,
+ this.setReferenceToolStripMenuItem});
+ this.cueReferenceMenu.Name = "cueAndVoiceLimitGroupMenu";
+ this.cueReferenceMenu.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
+ this.cueReferenceMenu.Size = new System.Drawing.Size(161, 154);
+ //
+ // toolStripMenuItem32
+ //
+ this.toolStripMenuItem32.Image = global::CsbBuilder.Properties.Resources.Create;
+ this.toolStripMenuItem32.Name = "toolStripMenuItem32";
+ this.toolStripMenuItem32.Size = new System.Drawing.Size(160, 22);
+ this.toolStripMenuItem32.Text = "Create";
+ this.toolStripMenuItem32.ToolTipText = "Create a new node.";
+ this.toolStripMenuItem32.Click += new System.EventHandler(this.CreateAndInsertNode);
+ //
+ // toolStripSeparator17
+ //
+ this.toolStripSeparator17.Name = "toolStripSeparator17";
+ this.toolStripSeparator17.Size = new System.Drawing.Size(157, 6);
+ //
+ // toolStripMenuItem22
+ //
+ this.toolStripMenuItem22.Image = global::CsbBuilder.Properties.Resources.Copy;
+ this.toolStripMenuItem22.Name = "toolStripMenuItem22";
+ this.toolStripMenuItem22.Size = new System.Drawing.Size(160, 22);
+ this.toolStripMenuItem22.Text = "Copy";
+ this.toolStripMenuItem22.ToolTipText = "Copy the selected node.";
+ this.toolStripMenuItem22.Click += new System.EventHandler(this.CopyNode);
+ //
+ // toolStripMenuItem29
+ //
+ this.toolStripMenuItem29.Image = global::CsbBuilder.Properties.Resources.Paste;
+ this.toolStripMenuItem29.Name = "toolStripMenuItem29";
+ this.toolStripMenuItem29.Size = new System.Drawing.Size(160, 22);
+ this.toolStripMenuItem29.Text = "Paste";
+ this.toolStripMenuItem29.ToolTipText = "Paste the copied node after the selected node.";
+ this.toolStripMenuItem29.Click += new System.EventHandler(this.PasteAndInsertNode);
+ //
+ // toolStripMenuItem2
+ //
+ this.toolStripMenuItem2.Image = global::CsbBuilder.Properties.Resources.Remove;
+ this.toolStripMenuItem2.Name = "toolStripMenuItem2";
+ this.toolStripMenuItem2.Size = new System.Drawing.Size(160, 22);
+ this.toolStripMenuItem2.Text = "Remove";
+ this.toolStripMenuItem2.ToolTipText = "Remove the selected node.";
+ this.toolStripMenuItem2.Click += new System.EventHandler(this.RemoveNode);
+ //
+ // toolStripSeparator5
+ //
+ this.toolStripSeparator5.Name = "toolStripSeparator5";
+ this.toolStripSeparator5.Size = new System.Drawing.Size(157, 6);
+ //
+ // selectReferenceToolStripMenuItem
+ //
+ this.selectReferenceToolStripMenuItem.Image = global::CsbBuilder.Properties.Resources.Select;
+ this.selectReferenceToolStripMenuItem.Name = "selectReferenceToolStripMenuItem";
+ this.selectReferenceToolStripMenuItem.Size = new System.Drawing.Size(160, 22);
+ this.selectReferenceToolStripMenuItem.Text = "Select Reference";
+ this.selectReferenceToolStripMenuItem.ToolTipText = "Select the Synth reference from the Synth tree.";
+ this.selectReferenceToolStripMenuItem.Click += new System.EventHandler(this.SelectSynthReference);
+ //
+ // toolStripSeparator8
+ //
+ this.toolStripSeparator8.Name = "toolStripSeparator8";
+ this.toolStripSeparator8.Size = new System.Drawing.Size(157, 6);
+ //
+ // setReferenceToolStripMenuItem
+ //
+ this.setReferenceToolStripMenuItem.Image = global::CsbBuilder.Properties.Resources.SetReference;
+ this.setReferenceToolStripMenuItem.Name = "setReferenceToolStripMenuItem";
+ this.setReferenceToolStripMenuItem.Size = new System.Drawing.Size(160, 22);
+ this.setReferenceToolStripMenuItem.Text = "Set Reference";
+ this.setReferenceToolStripMenuItem.ToolTipText = "Set the Synth reference from the Synth tree.";
+ this.setReferenceToolStripMenuItem.Click += new System.EventHandler(this.SetSynthReference);
+ //
+ // trackItemMenu
+ //
+ this.trackItemMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.toolStripMenuItem33,
+ this.toolStripSeparator18,
+ this.toolStripMenuItem23,
+ this.toolStripMenuItem30,
+ this.toolStripMenuItem4,
+ this.toolStripSeparator6,
+ this.selectSoundElementReferenceToolStripMenuItem,
+ this.toolStripMenuItem5,
+ this.toolStripMenuItem6,
+ this.toolStripSeparator7,
+ this.setSoundElementReferenceToolStripMenuItem,
+ this.toolStripMenuItem7,
+ this.toolStripMenuItem8});
+ this.trackItemMenu.Name = "cueAndVoiceLimitGroupMenu";
+ this.trackItemMenu.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
+ this.trackItemMenu.Size = new System.Drawing.Size(258, 242);
+ //
+ // toolStripMenuItem33
+ //
+ this.toolStripMenuItem33.Image = global::CsbBuilder.Properties.Resources.Create;
+ this.toolStripMenuItem33.Name = "toolStripMenuItem33";
+ this.toolStripMenuItem33.Size = new System.Drawing.Size(257, 22);
+ this.toolStripMenuItem33.Text = "Create";
+ this.toolStripMenuItem33.ToolTipText = "Create a new node.";
+ this.toolStripMenuItem33.Click += new System.EventHandler(this.CreateAndInsertSoundNode);
+ //
+ // toolStripSeparator18
+ //
+ this.toolStripSeparator18.Name = "toolStripSeparator18";
+ this.toolStripSeparator18.Size = new System.Drawing.Size(254, 6);
+ //
+ // toolStripMenuItem23
+ //
+ this.toolStripMenuItem23.Image = global::CsbBuilder.Properties.Resources.Copy;
+ this.toolStripMenuItem23.Name = "toolStripMenuItem23";
+ this.toolStripMenuItem23.Size = new System.Drawing.Size(257, 22);
+ this.toolStripMenuItem23.Text = "Copy";
+ this.toolStripMenuItem23.ToolTipText = "Copy the selected node.";
+ this.toolStripMenuItem23.Click += new System.EventHandler(this.CopyNode);
+ //
+ // toolStripMenuItem30
+ //
+ this.toolStripMenuItem30.Image = global::CsbBuilder.Properties.Resources.Paste;
+ this.toolStripMenuItem30.Name = "toolStripMenuItem30";
+ this.toolStripMenuItem30.Size = new System.Drawing.Size(257, 22);
+ this.toolStripMenuItem30.Text = "Paste";
+ this.toolStripMenuItem30.ToolTipText = "Paste the copied node after the selected node.";
+ this.toolStripMenuItem30.Click += new System.EventHandler(this.PasteAndInsertNode);
+ //
+ // toolStripMenuItem4
+ //
+ this.toolStripMenuItem4.Image = global::CsbBuilder.Properties.Resources.Remove;
+ this.toolStripMenuItem4.Name = "toolStripMenuItem4";
+ this.toolStripMenuItem4.Size = new System.Drawing.Size(257, 22);
+ this.toolStripMenuItem4.Text = "Remove";
+ this.toolStripMenuItem4.ToolTipText = "Remove the selected node.";
+ this.toolStripMenuItem4.Click += new System.EventHandler(this.RemoveNode);
+ //
+ // toolStripSeparator6
+ //
+ this.toolStripSeparator6.Name = "toolStripSeparator6";
+ this.toolStripSeparator6.Size = new System.Drawing.Size(254, 6);
+ //
+ // selectSoundElementReferenceToolStripMenuItem
+ //
+ this.selectSoundElementReferenceToolStripMenuItem.Image = global::CsbBuilder.Properties.Resources.Select;
+ this.selectSoundElementReferenceToolStripMenuItem.Name = "selectSoundElementReferenceToolStripMenuItem";
+ this.selectSoundElementReferenceToolStripMenuItem.Size = new System.Drawing.Size(257, 22);
+ this.selectSoundElementReferenceToolStripMenuItem.Text = "Select Sound Element Reference";
+ this.selectSoundElementReferenceToolStripMenuItem.ToolTipText = "Select the referenced Sound Element node from the Sound Element tree.";
+ this.selectSoundElementReferenceToolStripMenuItem.Click += new System.EventHandler(this.SelectSoundElementReference);
+ //
+ // toolStripMenuItem5
+ //
+ this.toolStripMenuItem5.Image = global::CsbBuilder.Properties.Resources.Select;
+ this.toolStripMenuItem5.Name = "toolStripMenuItem5";
+ this.toolStripMenuItem5.Size = new System.Drawing.Size(257, 22);
+ this.toolStripMenuItem5.Text = "Select AISAC Reference";
+ this.toolStripMenuItem5.ToolTipText = "Select the referenced AISAC node from the AISAC tree.";
+ this.toolStripMenuItem5.Click += new System.EventHandler(this.SelectAisacReference);
+ //
+ // toolStripMenuItem6
+ //
+ this.toolStripMenuItem6.Image = global::CsbBuilder.Properties.Resources.Select;
+ this.toolStripMenuItem6.Name = "toolStripMenuItem6";
+ this.toolStripMenuItem6.Size = new System.Drawing.Size(257, 22);
+ this.toolStripMenuItem6.Text = "Select Voice Limit Group Reference";
+ this.toolStripMenuItem6.ToolTipText = "Select the referenced Voice Limit Group node from the Voice Limit Group tree.";
+ this.toolStripMenuItem6.Click += new System.EventHandler(this.SelectVoiceLimitGroupReference);
+ //
+ // toolStripSeparator7
+ //
+ this.toolStripSeparator7.Name = "toolStripSeparator7";
+ this.toolStripSeparator7.Size = new System.Drawing.Size(254, 6);
+ //
+ // setSoundElementReferenceToolStripMenuItem
+ //
+ this.setSoundElementReferenceToolStripMenuItem.Image = global::CsbBuilder.Properties.Resources.SetReference;
+ this.setSoundElementReferenceToolStripMenuItem.Name = "setSoundElementReferenceToolStripMenuItem";
+ this.setSoundElementReferenceToolStripMenuItem.Size = new System.Drawing.Size(257, 22);
+ this.setSoundElementReferenceToolStripMenuItem.Text = "Set Sound Element Reference";
+ this.setSoundElementReferenceToolStripMenuItem.ToolTipText = "Set the Sound Element reference from the Sound Element tree.";
+ this.setSoundElementReferenceToolStripMenuItem.Click += new System.EventHandler(this.SetSoundElementReference);
+ //
+ // toolStripMenuItem7
+ //
+ this.toolStripMenuItem7.Image = global::CsbBuilder.Properties.Resources.SetReference;
+ this.toolStripMenuItem7.Name = "toolStripMenuItem7";
+ this.toolStripMenuItem7.Size = new System.Drawing.Size(257, 22);
+ this.toolStripMenuItem7.Text = "Set AISAC Reference";
+ this.toolStripMenuItem7.ToolTipText = "Set the AISAC reference from the AISAC tree.";
+ this.toolStripMenuItem7.Click += new System.EventHandler(this.SetAisacReference);
+ //
+ // toolStripMenuItem8
+ //
+ this.toolStripMenuItem8.Image = global::CsbBuilder.Properties.Resources.SetReference;
+ this.toolStripMenuItem8.Name = "toolStripMenuItem8";
+ this.toolStripMenuItem8.Size = new System.Drawing.Size(257, 22);
+ this.toolStripMenuItem8.Text = "Set Voice Limit Group Reference";
+ this.toolStripMenuItem8.ToolTipText = "Set the Voice Limit Group reference from the Voice Limit Group tree.";
+ this.toolStripMenuItem8.Click += new System.EventHandler(this.SetVoiceLimitGroupReference);
+ //
+ // soundElementMenu
+ //
+ this.soundElementMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.toolStripMenuItem34,
+ this.toolStripSeparator19,
+ this.toolStripMenuItem24,
+ this.toolStripMenuItem31,
+ this.toolStripMenuItem3,
+ this.toolStripSeparator9,
+ this.setAudioToolStripMenuItem});
+ this.soundElementMenu.Name = "cueAndVoiceLimitGroupMenu";
+ this.soundElementMenu.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
+ this.soundElementMenu.Size = new System.Drawing.Size(126, 126);
+ //
+ // toolStripMenuItem34
+ //
+ this.toolStripMenuItem34.Image = global::CsbBuilder.Properties.Resources.Create;
+ this.toolStripMenuItem34.Name = "toolStripMenuItem34";
+ this.toolStripMenuItem34.Size = new System.Drawing.Size(125, 22);
+ this.toolStripMenuItem34.Text = "Create";
+ this.toolStripMenuItem34.ToolTipText = "Create a new node.";
+ this.toolStripMenuItem34.Click += new System.EventHandler(this.CreateAndInsertNode);
+ //
+ // toolStripSeparator19
+ //
+ this.toolStripSeparator19.Name = "toolStripSeparator19";
+ this.toolStripSeparator19.Size = new System.Drawing.Size(122, 6);
+ //
+ // toolStripMenuItem24
+ //
+ this.toolStripMenuItem24.Image = global::CsbBuilder.Properties.Resources.Copy;
+ this.toolStripMenuItem24.Name = "toolStripMenuItem24";
+ this.toolStripMenuItem24.Size = new System.Drawing.Size(125, 22);
+ this.toolStripMenuItem24.Text = "Copy";
+ this.toolStripMenuItem24.ToolTipText = "Copy the selected node.";
+ this.toolStripMenuItem24.Click += new System.EventHandler(this.CopyNode);
+ //
+ // toolStripMenuItem31
+ //
+ this.toolStripMenuItem31.Image = global::CsbBuilder.Properties.Resources.Paste;
+ this.toolStripMenuItem31.Name = "toolStripMenuItem31";
+ this.toolStripMenuItem31.Size = new System.Drawing.Size(125, 22);
+ this.toolStripMenuItem31.Text = "Paste";
+ this.toolStripMenuItem31.ToolTipText = "Paste the copied node after the selected node.";
+ this.toolStripMenuItem31.Click += new System.EventHandler(this.PasteAndInsertNode);
+ //
+ // toolStripMenuItem3
+ //
+ this.toolStripMenuItem3.Image = global::CsbBuilder.Properties.Resources.Remove;
+ this.toolStripMenuItem3.Name = "toolStripMenuItem3";
+ this.toolStripMenuItem3.Size = new System.Drawing.Size(125, 22);
+ this.toolStripMenuItem3.Text = "Remove";
+ this.toolStripMenuItem3.ToolTipText = "Remove the selected node.";
+ this.toolStripMenuItem3.Click += new System.EventHandler(this.RemoveNode);
+ //
+ // toolStripSeparator9
+ //
+ this.toolStripSeparator9.Name = "toolStripSeparator9";
+ this.toolStripSeparator9.Size = new System.Drawing.Size(122, 6);
+ //
+ // setAudioToolStripMenuItem
+ //
+ this.setAudioToolStripMenuItem.Image = global::CsbBuilder.Properties.Resources.Sound;
+ this.setAudioToolStripMenuItem.Name = "setAudioToolStripMenuItem";
+ this.setAudioToolStripMenuItem.Size = new System.Drawing.Size(125, 22);
+ this.setAudioToolStripMenuItem.Text = "Set Audio";
+ this.setAudioToolStripMenuItem.ToolTipText = "Set the audio files of this Sound Element node.";
+ this.setAudioToolStripMenuItem.Click += new System.EventHandler(this.SetAudio);
+ //
+ // synthFolderMenu
+ //
+ this.synthFolderMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.toolStripMenuItem12,
+ this.toolStripMenuItem9,
+ this.toolStripMenuItem10,
+ this.toolStripSeparator13,
+ this.toolStripMenuItem25,
+ this.toolStripMenuItem26,
+ this.toolStripMenuItem11});
+ this.synthFolderMenu.Name = "synthSoundElementAndAisacMenu";
+ this.synthFolderMenu.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
+ this.synthFolderMenu.Size = new System.Drawing.Size(146, 142);
+ //
+ // toolStripMenuItem12
+ //
+ this.toolStripMenuItem12.Image = global::CsbBuilder.Properties.Resources.Create;
+ this.toolStripMenuItem12.Name = "toolStripMenuItem12";
+ this.toolStripMenuItem12.Size = new System.Drawing.Size(145, 22);
+ this.toolStripMenuItem12.Text = "Create Track";
+ this.toolStripMenuItem12.ToolTipText = "Create a new track (or block) node.";
+ this.toolStripMenuItem12.Click += new System.EventHandler(this.CreateChildNode);
+ //
+ // toolStripMenuItem9
+ //
+ this.toolStripMenuItem9.Image = global::CsbBuilder.Properties.Resources.Sound;
+ this.toolStripMenuItem9.Name = "toolStripMenuItem9";
+ this.toolStripMenuItem9.Size = new System.Drawing.Size(145, 22);
+ this.toolStripMenuItem9.Text = "Create Sound";
+ this.toolStripMenuItem9.ToolTipText = "Create a new sound node.";
+ this.toolStripMenuItem9.Click += new System.EventHandler(this.CreateChildSoundNode);
+ //
+ // toolStripMenuItem10
+ //
+ this.toolStripMenuItem10.Image = global::CsbBuilder.Properties.Resources.Folder;
+ this.toolStripMenuItem10.Name = "toolStripMenuItem10";
+ this.toolStripMenuItem10.Size = new System.Drawing.Size(145, 22);
+ this.toolStripMenuItem10.Text = "Create Folder";
+ this.toolStripMenuItem10.ToolTipText = "Create a new folder.";
+ this.toolStripMenuItem10.Click += new System.EventHandler(this.CreateChildFolder);
+ //
+ // toolStripSeparator13
+ //
+ this.toolStripSeparator13.Name = "toolStripSeparator13";
+ this.toolStripSeparator13.Size = new System.Drawing.Size(142, 6);
+ //
+ // toolStripMenuItem25
+ //
+ this.toolStripMenuItem25.Image = global::CsbBuilder.Properties.Resources.Copy;
+ this.toolStripMenuItem25.Name = "toolStripMenuItem25";
+ this.toolStripMenuItem25.Size = new System.Drawing.Size(145, 22);
+ this.toolStripMenuItem25.Text = "Copy";
+ this.toolStripMenuItem25.ToolTipText = "Copy the selected node.";
+ this.toolStripMenuItem25.Click += new System.EventHandler(this.CopyNode);
+ //
+ // toolStripMenuItem26
+ //
+ this.toolStripMenuItem26.Image = global::CsbBuilder.Properties.Resources.Paste;
+ this.toolStripMenuItem26.Name = "toolStripMenuItem26";
+ this.toolStripMenuItem26.Size = new System.Drawing.Size(145, 22);
+ this.toolStripMenuItem26.Text = "Paste";
+ this.toolStripMenuItem26.ToolTipText = "Paste the copied node as child.";
+ this.toolStripMenuItem26.Click += new System.EventHandler(this.PasteNode);
+ //
+ // toolStripMenuItem11
+ //
+ this.toolStripMenuItem11.Image = global::CsbBuilder.Properties.Resources.Remove;
+ this.toolStripMenuItem11.Name = "toolStripMenuItem11";
+ this.toolStripMenuItem11.Size = new System.Drawing.Size(145, 22);
+ this.toolStripMenuItem11.Text = "Remove";
+ this.toolStripMenuItem11.ToolTipText = "Remove the selected node.";
+ this.toolStripMenuItem11.Click += new System.EventHandler(this.RemoveNode);
+ //
+ // statusStrip
+ //
+ this.statusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.playButton,
+ this.stopButton,
+ this.statusLabel});
+ this.statusStrip.Location = new System.Drawing.Point(0, 580);
+ this.statusStrip.Name = "statusStrip";
+ this.statusStrip.Size = new System.Drawing.Size(878, 22);
+ this.statusStrip.TabIndex = 10;
+ this.statusStrip.Text = "statusStrip1";
+ //
+ // playButton
+ //
+ this.playButton.DropDownButtonWidth = 0;
+ this.playButton.Image = global::CsbBuilder.Properties.Resources.Play;
+ this.playButton.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.playButton.Name = "playButton";
+ this.playButton.Size = new System.Drawing.Size(50, 20);
+ this.playButton.Text = "Play";
+ this.playButton.ButtonClick += new System.EventHandler(this.PlaySound);
+ //
+ // stopButton
+ //
+ this.stopButton.DropDownButtonWidth = 0;
+ this.stopButton.Image = global::CsbBuilder.Properties.Resources.Stop;
+ this.stopButton.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.stopButton.Name = "stopButton";
+ this.stopButton.Size = new System.Drawing.Size(52, 20);
+ this.stopButton.Text = "Stop";
+ this.stopButton.ToolTipText = "Stop";
+ this.stopButton.ButtonClick += new System.EventHandler(this.StopSound);
+ //
+ // statusLabel
+ //
+ this.statusLabel.Name = "statusLabel";
+ this.statusLabel.Size = new System.Drawing.Size(0, 17);
+ //
+ // aisacNodeMenu
+ //
+ this.aisacNodeMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.toolStripMenuItem35,
+ this.toolStripSeparator20,
+ this.loadTemplateToolStripMenuItem,
+ this.saveTemplateToolStripMenuItem,
+ this.toolStripSeparator21,
+ this.toolStripMenuItem36,
+ this.toolStripMenuItem37,
+ this.toolStripMenuItem38});
+ this.aisacNodeMenu.Name = "cueAndVoiceLimitGroupMenu";
+ this.aisacNodeMenu.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
+ this.aisacNodeMenu.Size = new System.Drawing.Size(153, 148);
+ //
+ // toolStripMenuItem35
+ //
+ this.toolStripMenuItem35.Image = global::CsbBuilder.Properties.Resources.Create;
+ this.toolStripMenuItem35.Name = "toolStripMenuItem35";
+ this.toolStripMenuItem35.Size = new System.Drawing.Size(152, 22);
+ this.toolStripMenuItem35.Text = "Create";
+ this.toolStripMenuItem35.ToolTipText = "Create a new node after the selected node.";
+ this.toolStripMenuItem35.Click += new System.EventHandler(this.CreateAndInsertNode);
+ //
+ // toolStripSeparator20
+ //
+ this.toolStripSeparator20.Name = "toolStripSeparator20";
+ this.toolStripSeparator20.Size = new System.Drawing.Size(149, 6);
+ //
+ // loadTemplateToolStripMenuItem
+ //
+ this.loadTemplateToolStripMenuItem.Image = global::CsbBuilder.Properties.Resources.Template;
+ this.loadTemplateToolStripMenuItem.Name = "loadTemplateToolStripMenuItem";
+ this.loadTemplateToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+ this.loadTemplateToolStripMenuItem.Text = "Load Template";
+ this.loadTemplateToolStripMenuItem.Click += new System.EventHandler(this.LoadTemplate);
+ //
+ // saveTemplateToolStripMenuItem
+ //
+ this.saveTemplateToolStripMenuItem.Image = global::CsbBuilder.Properties.Resources.Template;
+ this.saveTemplateToolStripMenuItem.Name = "saveTemplateToolStripMenuItem";
+ this.saveTemplateToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+ this.saveTemplateToolStripMenuItem.Text = "Save Template";
+ this.saveTemplateToolStripMenuItem.Click += new System.EventHandler(this.SaveTemplate);
+ //
+ // toolStripSeparator21
+ //
+ this.toolStripSeparator21.Name = "toolStripSeparator21";
+ this.toolStripSeparator21.Size = new System.Drawing.Size(149, 6);
+ //
+ // toolStripMenuItem36
+ //
+ this.toolStripMenuItem36.Image = global::CsbBuilder.Properties.Resources.Copy;
+ this.toolStripMenuItem36.Name = "toolStripMenuItem36";
+ this.toolStripMenuItem36.Size = new System.Drawing.Size(152, 22);
+ this.toolStripMenuItem36.Text = "Copy";
+ this.toolStripMenuItem36.ToolTipText = "Copy the selected node.";
+ this.toolStripMenuItem36.Click += new System.EventHandler(this.CopyNode);
+ //
+ // toolStripMenuItem37
+ //
+ this.toolStripMenuItem37.Image = global::CsbBuilder.Properties.Resources.Paste;
+ this.toolStripMenuItem37.Name = "toolStripMenuItem37";
+ this.toolStripMenuItem37.Size = new System.Drawing.Size(152, 22);
+ this.toolStripMenuItem37.Text = "Paste";
+ this.toolStripMenuItem37.ToolTipText = "Paste the copied node after the selected node.";
+ this.toolStripMenuItem37.Click += new System.EventHandler(this.PasteAndInsertNode);
+ //
+ // toolStripMenuItem38
+ //
+ this.toolStripMenuItem38.Image = global::CsbBuilder.Properties.Resources.Remove;
+ this.toolStripMenuItem38.Name = "toolStripMenuItem38";
+ this.toolStripMenuItem38.Size = new System.Drawing.Size(152, 22);
+ this.toolStripMenuItem38.Text = "Remove";
+ this.toolStripMenuItem38.ToolTipText = "Remove the selected node.";
+ this.toolStripMenuItem38.Click += new System.EventHandler(this.RemoveNode);
+ //
+ // aisacFolderMenu
+ //
+ this.aisacFolderMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.toolStripMenuItem39,
+ this.toolStripMenuItem40,
+ this.toolStripSeparator22,
+ this.toolStripMenuItem44,
+ this.toolStripSeparator23,
+ this.toolStripMenuItem41,
+ this.toolStripMenuItem42,
+ this.toolStripMenuItem43});
+ this.aisacFolderMenu.Name = "synthSoundElementAndAisacMenu";
+ this.aisacFolderMenu.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
+ this.aisacFolderMenu.Size = new System.Drawing.Size(189, 148);
+ //
+ // toolStripMenuItem39
+ //
+ this.toolStripMenuItem39.Image = global::CsbBuilder.Properties.Resources.Create;
+ this.toolStripMenuItem39.Name = "toolStripMenuItem39";
+ this.toolStripMenuItem39.Size = new System.Drawing.Size(188, 22);
+ this.toolStripMenuItem39.Text = "Create";
+ this.toolStripMenuItem39.ToolTipText = "Create a new child node.";
+ this.toolStripMenuItem39.Click += new System.EventHandler(this.CreateChildNode);
+ //
+ // toolStripMenuItem40
+ //
+ this.toolStripMenuItem40.Image = global::CsbBuilder.Properties.Resources.Folder;
+ this.toolStripMenuItem40.Name = "toolStripMenuItem40";
+ this.toolStripMenuItem40.Size = new System.Drawing.Size(188, 22);
+ this.toolStripMenuItem40.Text = "Create Folder";
+ this.toolStripMenuItem40.ToolTipText = "Create a new child folder.";
+ this.toolStripMenuItem40.Click += new System.EventHandler(this.CreateChildFolder);
+ //
+ // toolStripSeparator22
+ //
+ this.toolStripSeparator22.Name = "toolStripSeparator22";
+ this.toolStripSeparator22.Size = new System.Drawing.Size(185, 6);
+ //
+ // toolStripMenuItem44
+ //
+ this.toolStripMenuItem44.Image = global::CsbBuilder.Properties.Resources.Template;
+ this.toolStripMenuItem44.Name = "toolStripMenuItem44";
+ this.toolStripMenuItem44.Size = new System.Drawing.Size(188, 22);
+ this.toolStripMenuItem44.Text = "Load AISAC Template";
+ this.toolStripMenuItem44.Click += new System.EventHandler(this.LoadTemplate);
+ //
+ // toolStripSeparator23
+ //
+ this.toolStripSeparator23.Name = "toolStripSeparator23";
+ this.toolStripSeparator23.Size = new System.Drawing.Size(185, 6);
+ //
+ // toolStripMenuItem41
+ //
+ this.toolStripMenuItem41.Image = global::CsbBuilder.Properties.Resources.Copy;
+ this.toolStripMenuItem41.Name = "toolStripMenuItem41";
+ this.toolStripMenuItem41.Size = new System.Drawing.Size(188, 22);
+ this.toolStripMenuItem41.Text = "Copy";
+ this.toolStripMenuItem41.ToolTipText = "Copy the selected node.";
+ this.toolStripMenuItem41.Click += new System.EventHandler(this.CopyNode);
+ //
+ // toolStripMenuItem42
+ //
+ this.toolStripMenuItem42.Image = global::CsbBuilder.Properties.Resources.Paste;
+ this.toolStripMenuItem42.Name = "toolStripMenuItem42";
+ this.toolStripMenuItem42.Size = new System.Drawing.Size(188, 22);
+ this.toolStripMenuItem42.Text = "Paste";
+ this.toolStripMenuItem42.ToolTipText = "Paste the copied node as child.";
+ this.toolStripMenuItem42.Click += new System.EventHandler(this.PasteNode);
+ //
+ // toolStripMenuItem43
+ //
+ this.toolStripMenuItem43.Image = global::CsbBuilder.Properties.Resources.Remove;
+ this.toolStripMenuItem43.Name = "toolStripMenuItem43";
+ this.toolStripMenuItem43.Size = new System.Drawing.Size(188, 22);
+ this.toolStripMenuItem43.Text = "Remove";
+ this.toolStripMenuItem43.ToolTipText = "Remove the selected node.";
+ this.toolStripMenuItem43.Click += new System.EventHandler(this.RemoveNode);
+ //
+ // aboutToolStripMenuItem
+ //
+ this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
+ this.aboutToolStripMenuItem.Size = new System.Drawing.Size(52, 20);
+ this.aboutToolStripMenuItem.Text = "About";
+ this.aboutToolStripMenuItem.Click += new System.EventHandler(this.ShowAbout);
+ //
+ // MainForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(878, 602);
+ this.Controls.Add(this.statusStrip);
+ this.Controls.Add(this.splitContainer2);
+ this.Controls.Add(this.splitContainer1);
+ this.Controls.Add(this.propertyGrid);
+ this.Controls.Add(this.mainMenu);
+ this.MainMenuStrip = this.mainMenu;
+ this.Name = "MainForm";
+ this.ShowIcon = false;
+ this.Text = "CSB Builder";
+ this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.OnClose);
+ this.mainMenu.ResumeLayout(false);
+ this.mainMenu.PerformLayout();
+ this.splitContainer1.Panel1.ResumeLayout(false);
+ this.splitContainer1.Panel2.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
+ this.splitContainer1.ResumeLayout(false);
+ this.tabControl2.ResumeLayout(false);
+ this.tabPage3.ResumeLayout(false);
+ this.nodeTreeMenu.ResumeLayout(false);
+ this.tabControl3.ResumeLayout(false);
+ this.tabPage4.ResumeLayout(false);
+ this.synthFolderTreeMenu.ResumeLayout(false);
+ this.folderTreeMenu.ResumeLayout(false);
+ this.splitContainer2.Panel1.ResumeLayout(false);
+ this.splitContainer2.Panel2.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
+ this.splitContainer2.ResumeLayout(false);
+ this.tabControl4.ResumeLayout(false);
+ this.tabPage5.ResumeLayout(false);
+ this.tabControl1.ResumeLayout(false);
+ this.tabPage1.ResumeLayout(false);
+ this.aisacTreeMenu.ResumeLayout(false);
+ this.tabPage2.ResumeLayout(false);
+ this.nodeMenu.ResumeLayout(false);
+ this.folderMenu.ResumeLayout(false);
+ this.trackMenu.ResumeLayout(false);
+ this.cueReferenceMenu.ResumeLayout(false);
+ this.trackItemMenu.ResumeLayout(false);
+ this.soundElementMenu.ResumeLayout(false);
+ this.synthFolderMenu.ResumeLayout(false);
+ this.statusStrip.ResumeLayout(false);
+ this.statusStrip.PerformLayout();
+ this.aisacNodeMenu.ResumeLayout(false);
+ this.aisacFolderMenu.ResumeLayout(false);
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.MenuStrip mainMenu;
+ private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem newProjectToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem loadProjectToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem saveProjectToolStripMenuItem;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
+ private System.Windows.Forms.ToolStripMenuItem ımportToolStripMenuItem;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
+ private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem buildToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem buildCurrentProjectToolStripMenuItem;
+ private System.Windows.Forms.PropertyGrid propertyGrid;
+ private System.Windows.Forms.SplitContainer splitContainer1;
+ private System.Windows.Forms.SplitContainer splitContainer2;
+ private System.Windows.Forms.TabControl tabControl2;
+ private System.Windows.Forms.TabPage tabPage3;
+ private System.Windows.Forms.TreeView cueTree;
+ private System.Windows.Forms.TabControl tabControl3;
+ private System.Windows.Forms.TabPage tabPage4;
+ private System.Windows.Forms.TreeView synthTree;
+ private System.Windows.Forms.TabControl tabControl4;
+ private System.Windows.Forms.TabPage tabPage5;
+ private System.Windows.Forms.TreeView soundElementTree;
+ private System.Windows.Forms.TabControl tabControl1;
+ private System.Windows.Forms.TabPage tabPage1;
+ private System.Windows.Forms.TabPage tabPage2;
+ private System.Windows.Forms.TreeView aisacTree;
+ private System.Windows.Forms.TreeView voiceLimitGroupTree;
+ private System.Windows.Forms.ContextMenuStrip nodeMenu;
+ private System.Windows.Forms.ToolStripMenuItem removeToolStripMenuItem;
+ private System.Windows.Forms.ContextMenuStrip folderMenu;
+ private System.Windows.Forms.ToolStripMenuItem createToolStripMenuItem1;
+ private System.Windows.Forms.ToolStripMenuItem createFolderToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem removeToolStripMenuItem1;
+ private System.Windows.Forms.ContextMenuStrip nodeTreeMenu;
+ private System.Windows.Forms.ToolStripMenuItem createToolStripMenuItem;
+ private System.Windows.Forms.ContextMenuStrip folderTreeMenu;
+ private System.Windows.Forms.ToolStripMenuItem createToolStripMenuItem2;
+ private System.Windows.Forms.ToolStripMenuItem createFolderToolStripMenuItem1;
+ private System.Windows.Forms.ImageList imageList;
+ private System.Windows.Forms.ToolStripMenuItem saveProjectAsToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem buildCurrentProjectAsToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem mergeProjectToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem ımportAndMergeToolStripMenuItem;
+ private System.Windows.Forms.ContextMenuStrip trackMenu;
+ private System.Windows.Forms.ToolStripMenuItem createToolStripMenuItem3;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1;
+ private System.Windows.Forms.ContextMenuStrip cueReferenceMenu;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2;
+ private System.Windows.Forms.ToolStripMenuItem setReferenceToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem setAisacReferenceToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem setVoiceLimitGroupReferenceToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem selectReferenceToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem selectAisacReferenceToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem selectVoiceLimitGroupReferenceToolStripMenuItem;
+ private System.Windows.Forms.ContextMenuStrip trackItemMenu;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem4;
+ private System.Windows.Forms.ToolStripMenuItem selectSoundElementReferenceToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem5;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem6;
+ private System.Windows.Forms.ToolStripMenuItem setSoundElementReferenceToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem7;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem8;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator6;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator7;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator8;
+ private System.Windows.Forms.ContextMenuStrip soundElementMenu;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem3;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator9;
+ private System.Windows.Forms.ToolStripMenuItem setAudioToolStripMenuItem;
+ private System.Windows.Forms.ContextMenuStrip synthFolderMenu;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem12;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem9;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem10;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem11;
+ private System.Windows.Forms.ContextMenuStrip synthFolderTreeMenu;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem13;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem14;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem15;
+ private System.Windows.Forms.StatusStrip statusStrip;
+ private System.Windows.Forms.ToolStripSplitButton playButton;
+ private System.Windows.Forms.ToolStripSplitButton stopButton;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator10;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator11;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator13;
+ private System.Windows.Forms.ToolStripStatusLabel statusLabel;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem16;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator12;
+ private System.Windows.Forms.ToolStripMenuItem pasteToolStripMenuItem;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator14;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem17;
+ private System.Windows.Forms.ToolStripMenuItem copyToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem18;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem19;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem20;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem21;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem22;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem23;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem24;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem25;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem26;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator15;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem27;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem28;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem29;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem30;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem31;
+ private System.Windows.Forms.ToolStripMenuItem createToolStripMenuItem4;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator16;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem32;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator17;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem33;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator18;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem34;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator19;
+ private System.Windows.Forms.ContextMenuStrip aisacNodeMenu;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem35;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator20;
+ private System.Windows.Forms.ToolStripMenuItem loadTemplateToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem saveTemplateToolStripMenuItem;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator21;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem36;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem37;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem38;
+ private System.Windows.Forms.ContextMenuStrip aisacFolderMenu;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem39;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem40;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator22;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem41;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem42;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem43;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem44;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator23;
+ private System.Windows.Forms.ContextMenuStrip aisacTreeMenu;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem45;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem46;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator24;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem47;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem48;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator25;
+ private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;
+ }
+}
+
diff --git a/Source/CsbBuilder/MainForm.cs b/Source/CsbBuilder/MainForm.cs
new file mode 100644
index 0000000..7fefd0d
--- /dev/null
+++ b/Source/CsbBuilder/MainForm.cs
@@ -0,0 +1,2253 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using System.Diagnostics;
+using System.IO;
+using System.Reflection;
+using System.Xml;
+using System.Xml.Serialization;
+
+using CsbBuilder.Builder;
+using CsbBuilder.BuilderNode;
+using CsbBuilder.Audio;
+using CsbBuilder.Importer;
+using CsbBuilder.Project;
+using CsbBuilder.Serialization;
+using CsbBuilder.Properties;
+
+using SonicAudioLib.IO;
+
+using NAudio.Wave;
+
+namespace CsbBuilder
+{
+ public partial class MainForm : Form
+ {
+ private bool enabled = false;
+ private bool saved = true;
+ private CsbProject project = null;
+
+ private TreeNode copiedNode = null;
+ private TreeView treeViewOfCopiedNode = null;
+
+ private List sounds = new List();
+
+ public MainForm()
+ {
+ InitializeComponent();
+
+ imageList.Images.Add("Node", Resources.Node);
+ imageList.Images.Add("Folder", Resources.Folder);
+ imageList.Images.Add("FolderOpen", Resources.FolderOpen);
+ imageList.Images.Add("Sound", Resources.Sound);
+ }
+
+ public void ClearTreeViews()
+ {
+ cueTree.Nodes.Clear();
+ synthTree.Nodes.Clear();
+ soundElementTree.Nodes.Clear();
+ aisacTree.Nodes.Clear();
+ voiceLimitGroupTree.Nodes.Clear();
+ }
+
+ public void ExpandAllTreeViews()
+ {
+ cueTree.ExpandAll();
+ if (cueTree.Nodes.Count > 0)
+ {
+ cueTree.Nodes[0].EnsureVisible();
+ }
+
+ synthTree.ExpandAll();
+ if (synthTree.Nodes.Count > 0)
+ {
+ synthTree.Nodes[0].EnsureVisible();
+ }
+
+ soundElementTree.ExpandAll();
+ if (soundElementTree.Nodes.Count > 0)
+ {
+ soundElementTree.Nodes[0].EnsureVisible();
+ }
+
+ aisacTree.ExpandAll();
+ if (aisacTree.Nodes.Count > 0)
+ {
+ aisacTree.Nodes[0].EnsureVisible();
+ }
+
+ voiceLimitGroupTree.ExpandAll();
+ if (voiceLimitGroupTree.Nodes.Count > 0)
+ {
+ voiceLimitGroupTree.Nodes[0].EnsureVisible();
+ }
+ }
+
+ public void ClearProject()
+ {
+ project = null;
+ ClearTreeViews();
+ Text = "CSB Builder";
+ saved = true;
+ }
+
+ public void DisplayOnTreeView()
+ {
+ foreach (BuilderCueNode cueNode in project.CueNodes)
+ {
+ TreeNode treeNode = new TreeNode();
+ treeNode.ContextMenuStrip = cueReferenceMenu;
+ treeNode.Name = cueNode.Name;
+ treeNode.Text = treeNode.Name;
+ treeNode.Tag = cueNode;
+ cueTree.Nodes.Add(treeNode);
+ }
+
+ foreach (BuilderSynthNode synthNode in project.SynthNodes)
+ {
+ TreeNode treeNode = synthTree.CreateNodesByFullPath(synthNode.Name);
+ treeNode.ContextMenuStrip = trackMenu;
+ treeNode.Tag = synthNode;
+
+ if (synthNode.Type == BuilderSynthType.Single)
+ {
+ treeNode.ContextMenuStrip = trackItemMenu;
+ treeNode.ImageIndex = 3;
+ treeNode.SelectedImageIndex = 3;
+ }
+
+ while ((treeNode = treeNode.Parent) != null)
+ {
+ if (treeNode.Tag == null)
+ {
+ treeNode.ContextMenuStrip = synthFolderMenu;
+ }
+ }
+ }
+
+ foreach (BuilderSoundElementNode soundElementNode in project.SoundElementNodes)
+ {
+ TreeNode treeNode = soundElementTree.CreateNodesByFullPath(soundElementNode.Name);
+ treeNode.ContextMenuStrip = soundElementMenu;
+ treeNode.Tag = soundElementNode;
+ treeNode.ImageIndex = 3;
+ treeNode.SelectedImageIndex = 3;
+
+ while ((treeNode = treeNode.Parent) != null)
+ {
+ if (treeNode.Tag == null)
+ {
+ treeNode.ContextMenuStrip = folderMenu;
+ }
+ }
+ }
+
+ foreach (BuilderAisacNode aisacNode in project.AisacNodes)
+ {
+ TreeNode treeNode = aisacTree.CreateNodesByFullPath(aisacNode.Name);
+ treeNode.ContextMenuStrip = aisacNodeMenu;
+ treeNode.Tag = aisacNode;
+
+ while ((treeNode = treeNode.Parent) != null)
+ {
+ if (treeNode.Tag == null)
+ {
+ treeNode.ContextMenuStrip = aisacFolderMenu;
+ }
+ }
+ }
+
+ foreach (BuilderVoiceLimitGroupNode voiceLimitGroupNode in project.VoiceLimitGroupNodes)
+ {
+ TreeNode treeNode = new TreeNode();
+ treeNode.ContextMenuStrip = nodeMenu;
+ treeNode.Name = voiceLimitGroupNode.Name;
+ treeNode.Text = treeNode.Name;
+ treeNode.Tag = voiceLimitGroupNode;
+ voiceLimitGroupTree.Nodes.Add(treeNode);
+ }
+ }
+
+ public void SetProject(CsbProject project)
+ {
+ StopSound(null, null);
+
+ if (!enabled)
+ {
+ splitContainer1.Enabled = true;
+ splitContainer2.Enabled = true;
+ propertyGrid.Enabled = true;
+ saveProjectAsToolStripMenuItem.Enabled = true;
+ saveProjectToolStripMenuItem.Enabled = true;
+ buildCurrentProjectAsToolStripMenuItem.Enabled = true;
+ buildCurrentProjectToolStripMenuItem.Enabled = true;
+ mergeProjectToolStripMenuItem.Enabled = true;
+ ımportAndMergeToolStripMenuItem.Enabled = true;
+ enabled = true;
+ }
+
+ ClearProject();
+ this.project = project;
+ project.Create();
+
+ DisplayOnTreeView();
+ UpdateAllNodes();
+ ExpandAllTreeViews();
+
+ Text += $" - {project.Name}";
+ }
+
+ private void CreateNewProject(object sender, EventArgs e)
+ {
+ if (AskForSave() == DialogResult.Cancel)
+ {
+ return;
+ }
+
+ using (CreateNewProjectForm newProject = new CreateNewProjectForm())
+ {
+ if (newProject.ShowDialog(this) == DialogResult.OK)
+ {
+ SetProject(newProject.Project);
+ project.Save();
+ }
+ }
+ }
+
+ private void ImportCsbFile(object sender, EventArgs e)
+ {
+ if (AskForSave() == DialogResult.Cancel)
+ {
+ return;
+ }
+
+ using (OpenFileDialog openCsbFile = new OpenFileDialog
+ {
+ Title = "Import CSB File",
+ DefaultExt = "csb",
+ Filter = "CSB Files|*.csb",
+ })
+ {
+ if (openCsbFile.ShowDialog() == DialogResult.OK)
+ {
+ using (CreateNewProjectForm createProject = new CreateNewProjectForm(openCsbFile.FileName))
+ {
+ if (createProject.ShowDialog(this) == DialogResult.OK)
+ {
+ createProject.Project.Create();
+ CsbImporter.Import(openCsbFile.FileName, createProject.Project);
+ SetProject(createProject.Project);
+ project.Save();
+ }
+ }
+ }
+ }
+ }
+
+ private void OnNodeClick(object sender, TreeNodeMouseClickEventArgs e)
+ {
+ e.Node.TreeView.SelectedNode = e.Node;
+ }
+
+ private TreeNode CreateCueNode(TreeNodeCollection collection, TreeNode parent, int nodeIndex = -1)
+ {
+ saved = false;
+
+ int index = 0;
+
+ while (collection.ContainsKey($"Cue_{index}"))
+ {
+ index++;
+ }
+
+ TreeNode treeNode = nodeIndex == -1 ? collection.Add($"Cue_{index}") : collection.Insert(nodeIndex, $"Cue_{index}");
+ treeNode.Name = treeNode.Text;
+ treeNode.ContextMenuStrip = cueReferenceMenu;
+ BuilderCueNode cueNode = new BuilderCueNode();
+ cueNode.Name = treeNode.FullPath;
+
+ if (project.CueNodes.Count > 0)
+ {
+ cueNode.Identifier = project.CueNodes.Max(cue => cue.Identifier) + 1;
+ }
+
+ treeNode.Tag = cueNode;
+
+ project.CueNodes.Add(cueNode);
+
+ treeNode.TreeView.SelectedNode = treeNode;
+ treeNode.EnsureVisible();
+ return treeNode;
+ }
+
+ private void RemoveNode(BuilderBaseNode node)
+ {
+ if (node is BuilderCueNode)
+ {
+ project.CueNodes.Remove((BuilderCueNode)node);
+ }
+
+ else if (node is BuilderSynthNode)
+ {
+ BuilderSynthNode synthNode = (BuilderSynthNode)node;
+ project.SynthNodes.Remove(synthNode);
+
+ project.CueNodes.Where(cue => cue.SynthReference == synthNode.Name).ToList().ForEach(cue => cue.SynthReference = string.Empty);
+ project.SynthNodes.Where(synth => synth.Children.Contains(synthNode.Name)).ToList().ForEach(synth => synth.Children.Remove(synthNode.Name));
+ }
+
+ else if (node is BuilderSoundElementNode)
+ {
+ BuilderSoundElementNode soundElementNode = (BuilderSoundElementNode)node;
+ project.SoundElementNodes.Remove(soundElementNode);
+
+ project.SynthNodes.Where(soundElement => soundElement.SoundElementReference == soundElementNode.Name).ToList().ForEach(synth => synth.SoundElementReference = string.Empty);
+ }
+
+ else if (node is BuilderAisacNode)
+ {
+ BuilderAisacNode aisacNode = (BuilderAisacNode)node;
+ project.AisacNodes.Remove(aisacNode);
+
+ project.SynthNodes.Where(synth => synth.AisacReference == aisacNode.Name).ToList().ForEach(synth => synth.AisacReference = string.Empty);
+ }
+
+ else if (node is BuilderVoiceLimitGroupNode)
+ {
+ BuilderVoiceLimitGroupNode voiceLimitGroupNode = (BuilderVoiceLimitGroupNode)node;
+ project.VoiceLimitGroupNodes.Remove(voiceLimitGroupNode);
+
+ project.SynthNodes.Where(synth => synth.VoiceLimitGroupReference == voiceLimitGroupNode.Name).ToList().ForEach(voiceLimitGroup => voiceLimitGroup.VoiceLimitGroupReference = string.Empty);
+ }
+ }
+
+ private TreeNode CreateSynthNode(TreeNodeCollection collection, TreeNode parent, int nodeIndex = -1)
+ {
+ saved = false;
+
+ int index = 0;
+
+ while (collection.ContainsKey($"Synth_{index}"))
+ {
+ index++;
+ }
+
+ TreeNode treeNode = nodeIndex == -1 ? collection.Add($"Synth_{index}") : collection.Insert(nodeIndex, $"Synth_{index}");
+ treeNode.Name = treeNode.Text;
+ treeNode.ContextMenuStrip = trackMenu;
+ BuilderSynthNode synthNode = new BuilderSynthNode();
+ synthNode.Type = BuilderSynthType.WithChildren;
+ synthNode.Name = treeNode.FullPath;
+ treeNode.Tag = synthNode;
+ project.SynthNodes.Add(synthNode);
+
+ if (parent != null && parent.Tag is BuilderSynthNode)
+ {
+ BuilderSynthNode parentSynthNode = (BuilderSynthNode)parent.Tag;
+
+ if (parentSynthNode.Type == BuilderSynthType.WithChildren)
+ {
+ parentSynthNode.Children.Add(synthNode.Name);
+ }
+ }
+
+ treeNode.TreeView.SelectedNode = treeNode;
+ treeNode.EnsureVisible();
+ return treeNode;
+ }
+
+ private TreeNode CreateSoundNode(TreeNodeCollection collection, TreeNode parent, int nodeIndex = -1)
+ {
+ saved = false;
+
+ int index = 0;
+
+ while (collection.ContainsKey($"Sound_{index}"))
+ {
+ index++;
+ }
+
+ TreeNode treeNode = nodeIndex == -1 ? collection.Add($"Sound_{index}") : collection.Insert(nodeIndex, $"Sound_{index}");
+ treeNode.Name = treeNode.Text;
+ treeNode.ContextMenuStrip = trackItemMenu;
+ treeNode.ImageIndex = 3;
+ treeNode.SelectedImageIndex = 3;
+ BuilderSynthNode synthNode = new BuilderSynthNode();
+ synthNode.Name = treeNode.FullPath;
+ treeNode.Tag = synthNode;
+ project.SynthNodes.Add(synthNode);
+
+ if (parent != null && parent.Tag is BuilderSynthNode)
+ {
+ BuilderSynthNode parentSynthNode = (BuilderSynthNode)parent.Tag;
+
+ if (parentSynthNode.Type == BuilderSynthType.WithChildren)
+ {
+ parentSynthNode.Children.Add(synthNode.Name);
+ }
+ }
+
+ treeNode.TreeView.SelectedNode = treeNode;
+ treeNode.EnsureVisible();
+ return treeNode;
+ }
+
+ private TreeNode CreateSoundElementNode(TreeNodeCollection collection, TreeNode parent, int nodeIndex = -1)
+ {
+ saved = false;
+
+ int index = 0;
+
+ while (collection.ContainsKey($"SoundElement_{index}"))
+ {
+ index++;
+ }
+
+ TreeNode treeNode = nodeIndex == -1 ? collection.Add($"SoundElement_{index}") : collection.Insert(nodeIndex, $"SoundElement_{index}");
+ treeNode.Name = treeNode.Text;
+ treeNode.ContextMenuStrip = soundElementMenu;
+ BuilderSoundElementNode soundElementNode = new BuilderSoundElementNode();
+ soundElementNode.Name = treeNode.FullPath;
+ treeNode.Tag = soundElementNode;
+ treeNode.ImageIndex = 3;
+ treeNode.SelectedImageIndex = 3;
+ project.SoundElementNodes.Add(soundElementNode);
+
+ treeNode.TreeView.SelectedNode = treeNode;
+ treeNode.EnsureVisible();
+ return treeNode;
+ }
+
+ private TreeNode CreateAisacNode(TreeNodeCollection collection, TreeNode parent, int nodeIndex = -1, BuilderAisacNode aisacNodeToImport = null)
+ {
+ saved = false;
+
+ int index = 0;
+
+ while (collection.ContainsKey($"AISAC_{index}"))
+ {
+ index++;
+ }
+
+ TreeNode treeNode = nodeIndex == -1 ? collection.Add($"AISAC_{index}") : collection.Insert(nodeIndex, $"AISAC_{index}");
+ treeNode.Name = treeNode.Text;
+ treeNode.ContextMenuStrip = aisacNodeMenu;
+ BuilderAisacNode aisacNode = aisacNodeToImport != null ? aisacNodeToImport : new BuilderAisacNode();
+ aisacNode.Name = treeNode.FullPath;
+ treeNode.Tag = aisacNode;
+ project.AisacNodes.Add(aisacNode);
+
+ treeNode.TreeView.SelectedNode = treeNode;
+ treeNode.EnsureVisible();
+ return treeNode;
+ }
+
+ private TreeNode CreateVoiceLimitGroupNode(TreeNodeCollection collection, TreeNode parent, int nodeIndex = -1)
+ {
+ saved = false;
+
+ int index = 0;
+
+ while (collection.ContainsKey($"VoiceLimitGroup_{index}"))
+ {
+ index++;
+ }
+
+ TreeNode treeNode = nodeIndex == -1 ? collection.Add($"VoiceLimitGroup_{index}") : collection.Insert(nodeIndex, $"VoiceLimitGroup_{index}");
+ treeNode.Name = treeNode.Text;
+ treeNode.ContextMenuStrip = nodeMenu;
+ BuilderVoiceLimitGroupNode voiceLimitGroup = new BuilderVoiceLimitGroupNode();
+ voiceLimitGroup.Name = treeNode.FullPath;
+ treeNode.Tag = voiceLimitGroup;
+ project.VoiceLimitGroupNodes.Add(voiceLimitGroup);
+
+ treeNode.TreeView.SelectedNode = treeNode;
+ treeNode.EnsureVisible();
+ return treeNode;
+ }
+
+ private TreeNode CreateFolder(TreeNodeCollection collection, TreeNode parent)
+ {
+ saved = false;
+
+ int index = 0;
+
+ while (collection.ContainsKey($"Folder_{index}"))
+ {
+ index++;
+ }
+
+ TreeNode treeNode = collection.Add($"Folder_{index}");
+ treeNode.Name = treeNode.Text;
+ treeNode.ContextMenuStrip = folderMenu;
+ treeNode.ImageIndex = 1;
+ treeNode.SelectedImageIndex = 2;
+
+ treeNode.TreeView.SelectedNode = treeNode;
+ treeNode.EnsureVisible();
+ return treeNode;
+ }
+
+ private TreeNode CreateSynthFolder(TreeNodeCollection collection)
+ {
+ saved = false;
+
+ int index = 0;
+
+ while (collection.ContainsKey($"Folder_{index}"))
+ {
+ index++;
+ }
+
+ TreeNode treeNode = collection.Add($"Folder_{index}");
+ treeNode.Name = treeNode.Text;
+ treeNode.ContextMenuStrip = synthFolderMenu;
+ treeNode.ImageIndex = 1;
+ treeNode.SelectedImageIndex = 2;
+
+ treeNode.TreeView.SelectedNode = treeNode;
+ treeNode.EnsureVisible();
+ return treeNode;
+ }
+
+ private void CreateChildNode(object sender, EventArgs e)
+ {
+ ContextMenuStrip menuStrip = (ContextMenuStrip)((ToolStripItem)sender).Owner;
+
+ if (menuStrip.SourceControl is TreeView)
+ {
+ TreeView selectedTree = (TreeView)menuStrip.SourceControl;
+ TreeNode selectedNode = selectedTree.SelectedNode;
+
+ if (selectedTree == cueTree)
+ {
+ CreateCueNode(selectedTree.Nodes, null);
+ }
+
+ else if (selectedTree == synthTree)
+ {
+ if (selectedNode.Tag is BuilderSynthNode && ((BuilderSynthNode)selectedNode.Tag).Type == BuilderSynthType.WithChildren)
+ {
+ CreateSoundNode(selectedNode.Nodes, selectedNode);
+ }
+
+ else
+ {
+ CreateSynthNode(selectedNode.Nodes, selectedNode);
+ }
+ }
+
+ else if (selectedTree == soundElementTree)
+ {
+ CreateSoundElementNode(selectedNode.Nodes, selectedNode);
+ }
+
+ else if (selectedTree == aisacTree)
+ {
+ CreateAisacNode(selectedNode.Nodes, selectedNode);
+ }
+
+ else if (selectedTree == voiceLimitGroupTree)
+ {
+ CreateVoiceLimitGroupNode(selectedTree.Nodes, null);
+ }
+ }
+ }
+
+ private void CreateNode(object sender, EventArgs e)
+ {
+ ContextMenuStrip menuStrip = (ContextMenuStrip)((ToolStripItem)sender).Owner;
+
+ if (menuStrip.SourceControl is TreeView)
+ {
+ TreeView selectedTree = (TreeView)menuStrip.SourceControl;
+
+ if (selectedTree == cueTree)
+ {
+ CreateCueNode(selectedTree.Nodes, null);
+ }
+
+ else if (selectedTree == synthTree)
+ {
+ CreateSynthNode(selectedTree.Nodes, null);
+ }
+
+ else if (selectedTree == soundElementTree)
+ {
+ CreateSoundElementNode(selectedTree.Nodes, null);
+ }
+
+ else if (selectedTree == aisacTree)
+ {
+ CreateAisacNode(selectedTree.Nodes, null);
+ }
+
+ else if (selectedTree == voiceLimitGroupTree)
+ {
+ CreateVoiceLimitGroupNode(selectedTree.Nodes, null);
+ }
+ }
+ }
+
+ private void CreateFolder(object sender, EventArgs e)
+ {
+ ContextMenuStrip menuStrip = (ContextMenuStrip)((ToolStripItem)sender).Owner;
+
+ if (menuStrip.SourceControl is TreeView)
+ {
+ TreeView selectedTree = (TreeView)menuStrip.SourceControl;
+
+ if (selectedTree == synthTree)
+ {
+ CreateSynthFolder(selectedTree.Nodes);
+ }
+
+ else
+ {
+ CreateFolder(selectedTree.Nodes, null);
+ }
+ }
+ }
+
+ private void RemoveNodes(TreeNodeCollection collection)
+ {
+ foreach (TreeNode node in collection)
+ {
+ if (node.Tag is BuilderBaseNode)
+ {
+ RemoveNode((BuilderBaseNode)node.Tag);
+ }
+
+ RemoveNodes(node.Nodes);
+ }
+ }
+
+ private void RemoveNode(TreeNode treeNode)
+ {
+ saved = false;
+
+ if (treeNode.Tag is BuilderBaseNode)
+ {
+ RemoveNode((BuilderBaseNode)treeNode.Tag);
+ }
+
+ RemoveNodes(treeNode.Nodes);
+ treeNode.Remove();
+ }
+
+ private void RemoveNode(object sender, EventArgs e)
+ {
+ saved = false;
+
+ ContextMenuStrip menuStrip = (ContextMenuStrip)((ToolStripItem)sender).Owner;
+
+ if (menuStrip.SourceControl is TreeView)
+ {
+ TreeView selectedTree = (TreeView)menuStrip.SourceControl;
+ TreeNode selectedNode = selectedTree.SelectedNode;
+
+ RemoveNode(selectedNode);
+ }
+ }
+
+ private void BuildProject(object sender, EventArgs e)
+ {
+ project.BinaryDirectory.Create();
+ project.Order(cueTree, synthTree, soundElementTree, aisacTree, voiceLimitGroupTree);
+ Builder.CsbBuilder.Build(project, Path.Combine(project.BinaryDirectory.FullName, project.Name + ".csb"));
+
+ Process.Start(project.BinaryDirectory.FullName);
+ }
+
+ private void CopyFullPath(object sender, EventArgs e)
+ {
+ ContextMenuStrip menuStrip = (ContextMenuStrip)((ToolStripItem)sender).Owner;
+
+ if (menuStrip.SourceControl is TreeView)
+ {
+ TreeView selectedTree = (TreeView)menuStrip.SourceControl;
+ TreeNode selectedNode = selectedTree.SelectedNode;
+
+ Clipboard.SetText(selectedNode.FullPath);
+ }
+ }
+
+ private void CreateChildFolder(object sender, EventArgs e)
+ {
+ ContextMenuStrip menuStrip = (ContextMenuStrip)((ToolStripItem)sender).Owner;
+
+ if (menuStrip.SourceControl is TreeView)
+ {
+ TreeView selectedTree = (TreeView)menuStrip.SourceControl;
+ TreeNode selectedNode = selectedTree.SelectedNode;
+
+ if (selectedTree == synthTree)
+ {
+ CreateSynthFolder(selectedNode.Nodes);
+ }
+
+ else
+ {
+ CreateFolder(selectedNode.Nodes, selectedNode);
+ }
+ }
+ }
+
+ private void RenameNode(object sender, TreeNodeMouseClickEventArgs e)
+ {
+ e.Node.BeginEdit();
+ }
+
+ private void UpdateNodeNoRename(TreeNode treeNode)
+ {
+ if (treeNode.Tag is BuilderBaseNode)
+ {
+ BuilderBaseNode baseNode = (BuilderBaseNode)treeNode.Tag;
+ baseNode.Name = treeNode.FullPath;
+ }
+
+ foreach (TreeNode childNode in treeNode.Nodes)
+ {
+ UpdateNodeNoRename(childNode);
+ }
+ }
+
+ private void UpdateNodes(TreeNodeCollection collection)
+ {
+ foreach (TreeNode treeNode in collection)
+ {
+ if (treeNode.Tag is BuilderBaseNode)
+ {
+ BuilderBaseNode baseNode = (BuilderBaseNode)treeNode.Tag;
+
+ string previousName = baseNode.Name;
+ baseNode.Name = treeNode.FullPath;
+
+ // Do it only if it's different, don't waste time
+ if (previousName != baseNode.Name)
+ {
+ string fullPath = baseNode.Name;
+ if (baseNode is BuilderSynthNode)
+ {
+ project.CueNodes.Where(cue => cue.SynthReference == previousName).ToList().ForEach(cue => cue.SynthReference = fullPath);
+ project.SynthNodes.Where(synth => synth.Children.Contains(previousName)).ToList().ForEach(synth => synth.Children[synth.Children.IndexOf(previousName)] = fullPath);
+ }
+
+ else if (baseNode is BuilderSoundElementNode)
+ {
+ project.SynthNodes.Where(synth => synth.SoundElementReference == previousName).ToList().ForEach(synth => synth.SoundElementReference = fullPath);
+ }
+
+ else if (baseNode is BuilderAisacNode)
+ {
+ project.SynthNodes.Where(synth => synth.AisacReference == previousName).ToList().ForEach(synth => synth.AisacReference = fullPath);
+ }
+
+ else if (baseNode is BuilderVoiceLimitGroupNode)
+ {
+ project.SynthNodes.Where(synth => synth.VoiceLimitGroupReference == previousName).ToList().ForEach(synth => synth.VoiceLimitGroupReference = fullPath);
+ }
+ }
+ }
+
+ else
+ {
+ treeNode.ImageIndex = 1;
+ treeNode.SelectedImageIndex = 2;
+ }
+
+ UpdateNodes(treeNode.Nodes);
+ }
+ }
+
+ private void UpdateAllNodes()
+ {
+ UpdateNodes(cueTree.Nodes);
+ UpdateNodes(synthTree.Nodes);
+ UpdateNodes(soundElementTree.Nodes);
+ UpdateNodes(aisacTree.Nodes);
+ UpdateNodes(voiceLimitGroupTree.Nodes);
+ }
+
+ private void OnRenameEnd(object sender, NodeLabelEditEventArgs e)
+ {
+ if (string.IsNullOrEmpty(e.Label))
+ {
+ e.CancelEdit = true;
+ return;
+ }
+
+ saved = false;
+ string previousName = e.Node.FullPath;
+
+ e.Node.Name = e.Label;
+ e.Node.Text = e.Label;
+
+ string fullPath = e.Node.FullPath;
+
+ UpdateAllNodes();
+
+ if (e.Node.Tag is BuilderSynthNode)
+ {
+ project.CueNodes.Where(cue => cue.SynthReference == previousName).ToList().ForEach(cue => cue.SynthReference = fullPath);
+ project.SynthNodes.Where(synth => synth.Children.Contains(previousName)).ToList().ForEach(synth => synth.Children[synth.Children.IndexOf(previousName)] = fullPath);
+ }
+
+ else if (e.Node.Tag is BuilderSoundElementNode)
+ {
+ project.SynthNodes.Where(synth => synth.SoundElementReference == previousName).ToList().ForEach(synth => synth.SoundElementReference = fullPath);
+ }
+
+ else if (e.Node.Tag is BuilderAisacNode)
+ {
+ project.SynthNodes.Where(synth => synth.AisacReference == previousName).ToList().ForEach(synth => synth.AisacReference = fullPath);
+ }
+
+ else if (e.Node.Tag is BuilderVoiceLimitGroupNode)
+ {
+ project.SynthNodes.Where(synth => synth.VoiceLimitGroupReference == previousName).ToList().ForEach(synth => synth.VoiceLimitGroupReference = fullPath);
+ }
+
+ propertyGrid.Refresh();
+ }
+
+ private void OnPropertyChange(object s, PropertyValueChangedEventArgs e)
+ {
+ saved = false;
+ propertyGrid.Refresh();
+ }
+
+ private DialogResult AskForSave()
+ {
+ DialogResult dialogResult = DialogResult.No;
+
+ if (!saved)
+ {
+ dialogResult = MessageBox.Show("Do you want to save your changes?", "CSB Builder", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning);
+
+ if (dialogResult == DialogResult.Yes)
+ {
+ SaveProject(null, null);
+ }
+ }
+
+ return dialogResult;
+ }
+
+ private void LoadProject(object sender, EventArgs e)
+ {
+ if (AskForSave() == DialogResult.Cancel)
+ {
+ return;
+ }
+
+ using (OpenFileDialog openProject = new OpenFileDialog
+ {
+ Title = "Open CSB Project File",
+ Filter = "CSB Project files|*.csbproject",
+ DefaultExt = "csbproject",
+ })
+ {
+ if (openProject.ShowDialog() == DialogResult.OK)
+ {
+ CsbProject csbProject = CsbProject.Load(openProject.FileName);
+
+ if (!csbProject.AudioDirectory.Exists)
+ {
+ MessageBox.Show("Audio directory does not seem to be present for this project. All the audio references will be removed.");
+ csbProject.SoundElementNodes.ForEach(soundElementNode => soundElementNode.Intro = string.Empty);
+ csbProject.SoundElementNodes.ForEach(soundElementNode => soundElementNode.Loop = string.Empty);
+ }
+
+ SetProject(csbProject);
+ }
+ }
+ }
+
+ private void SaveProject(object sender, EventArgs e)
+ {
+ project.Order(cueTree, synthTree, soundElementTree, aisacTree, voiceLimitGroupTree);
+ project.Save();
+ saved = true;
+ }
+
+ private void SaveProjectAs(object sender, EventArgs e)
+ {
+ using (SaveFileDialog saveProject = new SaveFileDialog
+ {
+ Title = "Save CSB Project File As",
+ Filter = "CSB Project files|*.csbproject",
+ DefaultExt = "csbproject",
+ })
+ {
+ if (saveProject.ShowDialog() == DialogResult.OK)
+ {
+ project.Order(cueTree, synthTree, soundElementTree, aisacTree, voiceLimitGroupTree);
+ project.SaveAs(saveProject.FileName);
+ saved = true;
+
+ // Reload the project
+ SetProject(project);
+ }
+ }
+ }
+
+ private void OnClose(object sender, FormClosingEventArgs e)
+ {
+ if (AskForSave() == DialogResult.Cancel)
+ {
+ e.Cancel = true;
+ }
+ }
+
+ private void Exit(object sender, EventArgs e)
+ {
+ Close();
+ }
+
+ private void BuildProjectAs(object sender, EventArgs e)
+ {
+ using (SaveFileDialog buildCsb = new SaveFileDialog()
+ {
+ Title = "Build Current Project As",
+ DefaultExt = "csb",
+ Filter = "CSB Files|*.csb",
+ FileName = project.Name,
+ })
+ {
+ if (buildCsb.ShowDialog() == DialogResult.OK)
+ {
+ project.Order(cueTree, synthTree, soundElementTree, aisacTree, voiceLimitGroupTree);
+ Builder.CsbBuilder.Build(project, buildCsb.FileName);
+ }
+ }
+ }
+
+ private void AfterNodeSelect(object sender, TreeViewEventArgs e)
+ {
+ propertyGrid.SelectedObject = e.Node.Tag;
+ }
+
+ private void MergeProject(object sender, EventArgs e)
+ {
+ using (OpenFileDialog openProject = new OpenFileDialog
+ {
+ Title = "Merge Project With",
+ Filter = "CSB Project files|*.csbproject",
+ DefaultExt = "csbproject",
+ })
+ {
+ if (openProject.ShowDialog() == DialogResult.OK)
+ {
+ CsbProject csbProject = CsbProject.Load(openProject.FileName);
+
+ if (!csbProject.AudioDirectory.Exists)
+ {
+ MessageBox.Show("Audio directory does not seem to be present for this project. All the audio references will be removed.");
+ csbProject.SoundElementNodes.ForEach(soundElementNode => soundElementNode.Intro = string.Empty);
+ csbProject.SoundElementNodes.ForEach(soundElementNode => soundElementNode.Loop = string.Empty);
+ }
+
+ else
+ {
+ // Copy all to this project's audio folder
+ foreach (FileInfo audioFile in csbProject.AudioDirectory.EnumerateFiles())
+ {
+ audioFile.CopyTo(Path.Combine(project.AudioDirectory.FullName, audioFile.Name), true);
+ }
+ }
+
+ project.CueNodes.AddRange(csbProject.CueNodes);
+ project.SynthNodes.AddRange(csbProject.SynthNodes);
+ project.SoundElementNodes.AddRange(csbProject.SoundElementNodes);
+ project.AisacNodes.AddRange(csbProject.AisacNodes);
+ project.VoiceLimitGroupNodes.AddRange(csbProject.VoiceLimitGroupNodes);
+
+ // Reload
+ SetProject(project);
+ }
+ }
+ }
+
+ private void ImportAndMergeProject(object sender, EventArgs e)
+ {
+ using (OpenFileDialog openCsbFile = new OpenFileDialog
+ {
+ Title = "Import And Merge CSB File With",
+ DefaultExt = "csb",
+ Filter = "CSB Files|*.csb",
+ })
+ {
+ if (openCsbFile.ShowDialog() == DialogResult.OK)
+ {
+ CsbProject csbProject = new CsbProject();
+ csbProject.Directory = project.Directory;
+ CsbImporter.Import(openCsbFile.FileName, csbProject);
+
+ project.CueNodes.AddRange(csbProject.CueNodes);
+ project.SynthNodes.AddRange(csbProject.SynthNodes);
+ project.SoundElementNodes.AddRange(csbProject.SoundElementNodes);
+ project.AisacNodes.AddRange(csbProject.AisacNodes);
+ project.VoiceLimitGroupNodes.AddRange(csbProject.VoiceLimitGroupNodes);
+
+ // Reload
+ SetProject(project);
+ }
+ }
+ }
+
+ private void OnKeyDown(object sender, KeyEventArgs e)
+ {
+ TreeView treeView = (TreeView)sender;
+
+ if (e.KeyCode == Keys.Delete && treeView.SelectedNode != null)
+ {
+ RemoveNode(treeView.SelectedNode);
+ }
+
+ else if (e.Control && e.KeyCode == Keys.C && treeView.SelectedNode != null)
+ {
+ CopyNode(treeView.SelectedNode);
+ }
+
+ else if (e.Control && e.KeyCode == Keys.V && treeView == treeViewOfCopiedNode)
+ {
+ if (treeView.SelectedNode == null)
+ {
+ PasteNode();
+ }
+
+ else if (treeView.SelectedNode != null && (treeView.SelectedNode.Tag == null || (treeView.SelectedNode.Tag is BuilderSynthNode && ((BuilderSynthNode)treeView.SelectedNode.Tag).Type == BuilderSynthType.WithChildren)))
+ {
+ PasteAsChildNode(treeView.SelectedNode);
+ }
+
+ else if (treeView.SelectedNode != null && treeView.SelectedNode.Tag != null)
+ {
+ PasteNode(treeView.SelectedNode.Index + 1);
+ }
+ }
+
+ else if (e.KeyCode == Keys.Enter && treeView.SelectedNode != null)
+ {
+ treeView.SelectedNode.BeginEdit();
+ }
+ }
+
+ private bool CheckIfAny(TreeView treeView)
+ {
+ foreach (TreeNode treeNode in treeView.Nodes)
+ {
+ if (CheckIfAny(treeNode))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ private bool CheckIfAny(TreeNode treeNode)
+ {
+ if (treeNode.Tag != null)
+ {
+ return true;
+ }
+
+ foreach (TreeNode childNode in treeNode.Nodes)
+ {
+ if (CheckIfAny(childNode))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ private void SetAisacReference(object sender, EventArgs e)
+ {
+ if (!CheckIfAny(aisacTree))
+ {
+ MessageBox.Show("This project does not contain any Aisac nodes.", "CSB Builder", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ return;
+ }
+
+ using (SetReferenceForm setReferenceForm = new SetReferenceForm(aisacTree))
+ {
+ if (setReferenceForm.ShowDialog(this) == DialogResult.OK)
+ {
+ ContextMenuStrip menuStrip = (ContextMenuStrip)((ToolStripItem)sender).Owner;
+
+ if (menuStrip.SourceControl is TreeView)
+ {
+ TreeView selectedTree = (TreeView)menuStrip.SourceControl;
+ TreeNode selectedNode = selectedTree.SelectedNode;
+
+ if (selectedNode.Tag is BuilderSynthNode)
+ {
+ BuilderSynthNode synthNode = (BuilderSynthNode)selectedNode.Tag;
+
+ if (setReferenceForm.SelectedNode == null)
+ {
+ synthNode.AisacReference = string.Empty;
+ }
+
+ else
+ {
+ synthNode.AisacReference = setReferenceForm.SelectedNode.FullPath;
+ }
+ }
+
+ saved = false;
+ propertyGrid.Refresh();
+ }
+ }
+ }
+ }
+
+ private void SetVoiceLimitGroupReference(object sender, EventArgs e)
+ {
+ if (voiceLimitGroupTree.Nodes.Count == 0)
+ {
+ MessageBox.Show("This project does not contain any Voice Limit Group nodes.", "CSB Builder", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ return;
+ }
+
+ using (SetReferenceForm setReferenceForm = new SetReferenceForm(voiceLimitGroupTree))
+ {
+ if (setReferenceForm.ShowDialog(this) == DialogResult.OK)
+ {
+ ContextMenuStrip menuStrip = (ContextMenuStrip)((ToolStripItem)sender).Owner;
+
+ if (menuStrip.SourceControl is TreeView)
+ {
+ TreeView selectedTree = (TreeView)menuStrip.SourceControl;
+ TreeNode selectedNode = selectedTree.SelectedNode;
+
+ if (selectedNode.Tag is BuilderSynthNode)
+ {
+ BuilderSynthNode synthNode = (BuilderSynthNode)selectedNode.Tag;
+
+ if (setReferenceForm.SelectedNode == null)
+ {
+ synthNode.VoiceLimitGroupReference = string.Empty;
+ }
+
+ else
+ {
+ synthNode.VoiceLimitGroupReference = setReferenceForm.SelectedNode.FullPath;
+ }
+ }
+
+ saved = false;
+ propertyGrid.Refresh();
+ }
+ }
+ }
+ }
+
+ private void SetSynthReference(object sender, EventArgs e)
+ {
+ if (!CheckIfAny(synthTree))
+ {
+ MessageBox.Show("This project does not contain any Synth nodes.", "CSB Builder", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ return;
+ }
+
+ using (SetReferenceForm setReferenceForm = new SetReferenceForm(synthTree))
+ {
+ if (setReferenceForm.ShowDialog(this) == DialogResult.OK)
+ {
+ ContextMenuStrip menuStrip = (ContextMenuStrip)((ToolStripItem)sender).Owner;
+
+ if (menuStrip.SourceControl is TreeView)
+ {
+ TreeView selectedTree = (TreeView)menuStrip.SourceControl;
+ TreeNode selectedNode = selectedTree.SelectedNode;
+
+ if (selectedNode.Tag is BuilderCueNode)
+ {
+ BuilderCueNode cueNode = (BuilderCueNode)selectedNode.Tag;
+
+ if (setReferenceForm.SelectedNode == null)
+ {
+ cueNode.SynthReference = string.Empty;
+ }
+
+ else
+ {
+ cueNode.SynthReference = setReferenceForm.SelectedNode.FullPath;
+ }
+ }
+
+ saved = false;
+ propertyGrid.Refresh();
+ }
+ }
+ }
+ }
+
+ private void SelectSynthReference(object sender, EventArgs e)
+ {
+ ContextMenuStrip menuStrip = (ContextMenuStrip)((ToolStripItem)sender).Owner;
+
+ if (menuStrip.SourceControl is TreeView)
+ {
+ TreeView selectedTree = (TreeView)menuStrip.SourceControl;
+ TreeNode selectedNode = selectedTree.SelectedNode;
+
+ if (selectedNode.Tag is BuilderCueNode)
+ {
+ BuilderCueNode cueNode = (BuilderCueNode)selectedNode.Tag;
+ if (!string.IsNullOrEmpty(cueNode.SynthReference))
+ {
+ TreeNode treeNode = synthTree.FindNodeByFullPath(cueNode.SynthReference);
+
+ synthTree.SelectedNode = treeNode;
+ treeNode.EnsureVisible();
+ synthTree.Focus();
+ }
+ }
+ }
+ }
+
+ private void SelectAisacReference(object sender, EventArgs e)
+ {
+ ContextMenuStrip menuStrip = (ContextMenuStrip)((ToolStripItem)sender).Owner;
+
+ if (menuStrip.SourceControl is TreeView)
+ {
+ TreeView selectedTree = (TreeView)menuStrip.SourceControl;
+ TreeNode selectedNode = selectedTree.SelectedNode;
+
+ if (selectedNode.Tag is BuilderSynthNode)
+ {
+ BuilderSynthNode synthNode = (BuilderSynthNode)selectedNode.Tag;
+ if (!string.IsNullOrEmpty(synthNode.AisacReference))
+ {
+ TreeNode treeNode = aisacTree.FindNodeByFullPath(synthNode.AisacReference);
+
+ tabControl1.SelectTab(tabPage1);
+ aisacTree.SelectedNode = treeNode;
+ treeNode.EnsureVisible();
+ aisacTree.Focus();
+ }
+ }
+ }
+ }
+
+ private void SelectVoiceLimitGroupReference(object sender, EventArgs e)
+ {
+ ContextMenuStrip menuStrip = (ContextMenuStrip)((ToolStripItem)sender).Owner;
+
+ if (menuStrip.SourceControl is TreeView)
+ {
+ TreeView selectedTree = (TreeView)menuStrip.SourceControl;
+ TreeNode selectedNode = selectedTree.SelectedNode;
+
+ if (selectedNode.Tag is BuilderSynthNode)
+ {
+ BuilderSynthNode synthNode = (BuilderSynthNode)selectedNode.Tag;
+ if (!string.IsNullOrEmpty(synthNode.VoiceLimitGroupReference))
+ {
+ TreeNode treeNode = voiceLimitGroupTree.FindNodeByFullPath(synthNode.VoiceLimitGroupReference);
+
+ tabControl1.SelectTab(tabPage2);
+ voiceLimitGroupTree.SelectedNode = treeNode;
+ treeNode.EnsureVisible();
+ voiceLimitGroupTree.Focus();
+ }
+ }
+ }
+ }
+
+ private void SelectSoundElementReference(object sender, EventArgs e)
+ {
+ ContextMenuStrip menuStrip = (ContextMenuStrip)((ToolStripItem)sender).Owner;
+
+ if (menuStrip.SourceControl is TreeView)
+ {
+ TreeView selectedTree = (TreeView)menuStrip.SourceControl;
+ TreeNode selectedNode = selectedTree.SelectedNode;
+
+ if (selectedNode.Tag is BuilderSynthNode)
+ {
+ BuilderSynthNode synthNode = (BuilderSynthNode)selectedNode.Tag;
+ if (!string.IsNullOrEmpty(synthNode.SoundElementReference))
+ {
+ TreeNode treeNode = soundElementTree.FindNodeByFullPath(synthNode.SoundElementReference);
+
+ soundElementTree.SelectedNode = treeNode;
+ treeNode.EnsureVisible();
+ soundElementTree.Focus();
+ }
+ }
+ }
+ }
+
+ private void SetSoundElementReference(object sender, EventArgs e)
+ {
+ if (!CheckIfAny(soundElementTree))
+ {
+ MessageBox.Show("This project does not contain any Sound nodes.", "CSB Builder", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ return;
+ }
+
+ using (SetReferenceForm setReferenceForm = new SetReferenceForm(soundElementTree))
+ {
+ if (setReferenceForm.ShowDialog(this) == DialogResult.OK)
+ {
+ ContextMenuStrip menuStrip = (ContextMenuStrip)((ToolStripItem)sender).Owner;
+
+ if (menuStrip.SourceControl is TreeView)
+ {
+ TreeView selectedTree = (TreeView)menuStrip.SourceControl;
+ TreeNode selectedNode = selectedTree.SelectedNode;
+
+ if (selectedNode.Tag is BuilderSynthNode)
+ {
+ BuilderSynthNode synthNode = (BuilderSynthNode)selectedNode.Tag;
+
+ if (setReferenceForm.SelectedNode == null)
+ {
+ synthNode.SoundElementReference = string.Empty;
+ }
+
+ else
+ {
+ synthNode.SoundElementReference = setReferenceForm.SelectedNode.FullPath;
+ }
+ }
+
+ saved = false;
+ propertyGrid.Refresh();
+ }
+ }
+ }
+ }
+
+ private void SetAudio(object sender, EventArgs e)
+ {
+ ContextMenuStrip menuStrip = (ContextMenuStrip)((ToolStripItem)sender).Owner;
+
+ if (menuStrip.SourceControl is TreeView)
+ {
+ TreeView selectedTree = (TreeView)menuStrip.SourceControl;
+ TreeNode selectedNode = selectedTree.SelectedNode;
+
+ BuilderSoundElementNode soundElementNode = (BuilderSoundElementNode)selectedNode.Tag;
+
+ if (selectedNode.Tag is BuilderSoundElementNode)
+ {
+ string intro = soundElementNode.Intro;
+ if (!string.IsNullOrEmpty(intro))
+ {
+ intro = Path.Combine(project.AudioDirectory.FullName, intro);
+ }
+
+ string loop = soundElementNode.Loop;
+ if (!string.IsNullOrEmpty(loop))
+ {
+ loop = Path.Combine(project.AudioDirectory.FullName, loop);
+ }
+
+ using (SetAudioForm setAudioForm = new SetAudioForm(intro, loop))
+ {
+ if (setAudioForm.ShowDialog(this) == DialogResult.OK)
+ {
+ uint sampleRate = soundElementNode.SampleRate;
+ byte channelCount = soundElementNode.ChannelCount;
+
+ uint introSampleCount = 0;
+ soundElementNode.Intro = project.AddAudio(setAudioForm.Intro);
+ if (!string.IsNullOrEmpty(setAudioForm.Intro))
+ {
+ ReadAdx(setAudioForm.Intro, out sampleRate, out channelCount, out introSampleCount);
+ }
+
+ uint loopSampleCount = 0;
+ soundElementNode.Loop = project.AddAudio(setAudioForm.Loop);
+ if (!string.IsNullOrEmpty(setAudioForm.Loop))
+ {
+ ReadAdx(setAudioForm.Loop, out sampleRate, out channelCount, out loopSampleCount);
+ }
+
+ soundElementNode.SampleRate = sampleRate;
+ soundElementNode.ChannelCount = channelCount;
+ soundElementNode.SampleCount = introSampleCount + loopSampleCount;
+ propertyGrid.Refresh();
+ }
+ }
+ }
+ }
+ }
+
+ public void ReadAdx(string path, out uint sampleRate, out byte channelCount, out uint sampleCount)
+ {
+ AdxHeader header = AdxConverter.LoadHeader(path);
+ sampleRate = header.SampleRate;
+ channelCount = header.ChannelCount;
+ sampleCount = header.SampleCount;
+ }
+
+ private void CreateChildSoundNode(object sender, EventArgs e)
+ {
+ ContextMenuStrip menuStrip = (ContextMenuStrip)((ToolStripItem)sender).Owner;
+
+ if (menuStrip.SourceControl is TreeView)
+ {
+ TreeView selectedTree = (TreeView)menuStrip.SourceControl;
+ TreeNode selectedNode = selectedTree.SelectedNode;
+
+ if (selectedNode.Tag == null)
+ {
+ CreateSoundNode(selectedNode.Nodes, selectedNode);
+ }
+ }
+ }
+
+ private void CreateSound(object sender, EventArgs e)
+ {
+ ContextMenuStrip menuStrip = (ContextMenuStrip)((ToolStripItem)sender).Owner;
+
+ if (menuStrip.SourceControl is TreeView)
+ {
+ TreeView selectedTree = (TreeView)menuStrip.SourceControl;
+
+ CreateSoundNode(selectedTree.Nodes, null);
+ }
+ }
+
+ private int GetByteCountFromMiliseconds(int miliseconds, int sampleRate, int channelCount, int bitsPerSample)
+ {
+ return (int)(miliseconds * sampleRate / 1000.0) * channelCount * bitsPerSample / 8;
+ }
+
+ private void AddSoundElementSound(BuilderSoundElementNode soundElementNode, double volume, double pitch, int sampleCount, int delayTime)
+ {
+ BufferedWaveProvider provider = null;
+ int delayInBytes = 0;
+
+ if (!string.IsNullOrEmpty(soundElementNode.Intro))
+ {
+ provider = AdxConverter.Decode(project.GetFullAudioPath(soundElementNode.Intro), volume, pitch);
+
+ if (delayTime != 0)
+ {
+ delayInBytes = GetByteCountFromMiliseconds(delayTime, provider.WaveFormat.SampleRate, provider.WaveFormat.Channels, provider.WaveFormat.BitsPerSample);
+
+ byte[] buffer = new byte[provider.BufferLength];
+ provider.Read(buffer, 0, buffer.Length);
+
+ provider = new BufferedWaveProvider(provider.WaveFormat);
+ provider.BufferLength = delayInBytes + buffer.Length;
+ provider.ReadFully = false;
+
+ provider.AddSamples(new byte[delayInBytes], 0, delayInBytes);
+ provider.AddSamples(buffer, 0, buffer.Length);
+ }
+ }
+
+ // If there's ANYTHING that can loop audio files in NAudio... please, tell me!
+ if (!string.IsNullOrEmpty(soundElementNode.Loop))
+ {
+ BufferedWaveProvider loopProvider = AdxConverter.Decode(project.GetFullAudioPath(soundElementNode.Loop), volume, pitch);
+
+ if (provider == null && delayTime != 0)
+ {
+ delayInBytes = GetByteCountFromMiliseconds(delayTime, loopProvider.WaveFormat.SampleRate, loopProvider.WaveFormat.Channels, loopProvider.WaveFormat.BitsPerSample);
+ }
+
+ int writtenByteCount = 0;
+
+ byte[] intro = null;
+
+ byte[] loop = new byte[loopProvider.BufferLength];
+ loopProvider.Read(loop, 0, loop.Length);
+
+ if (provider != null)
+ {
+ intro = new byte[provider.BufferLength];
+ provider.Read(intro, 0, intro.Length);
+ }
+
+ provider = new BufferedWaveProvider(loopProvider.WaveFormat);
+ provider.BufferLength = 0;
+
+ if (sampleCount != -1)
+ {
+ provider.BufferLength = delayInBytes + (sampleCount * provider.WaveFormat.Channels * provider.WaveFormat.BitsPerSample / 8);
+ }
+
+ else
+ {
+ if (intro != null)
+ {
+ provider.BufferLength += intro.Length;
+ }
+
+ provider.BufferLength += loop.Length;
+ }
+
+ provider.ReadFully = false;
+
+ if (intro != null)
+ {
+ provider.AddSamples(intro, 0, intro.Length);
+ writtenByteCount += intro.Length;
+ }
+
+ else if (intro == null && delayTime != 0)
+ {
+ provider.BufferLength += delayInBytes;
+ provider.AddSamples(new byte[delayInBytes], 0, delayInBytes);
+ writtenByteCount += delayInBytes;
+ }
+
+ if (sampleCount != -1)
+ {
+ while (writtenByteCount < provider.BufferLength)
+ {
+ if ((writtenByteCount + loop.Length) > provider.BufferLength)
+ {
+ provider.AddSamples(loop, 0, provider.BufferLength - writtenByteCount);
+ break;
+ }
+
+ writtenByteCount += loop.Length;
+ provider.AddSamples(loop, 0, loop.Length);
+ }
+ }
+
+ else
+ {
+ provider.AddSamples(loop, 0, loop.Length);
+ }
+ }
+
+ if (provider != null)
+ {
+ WaveOut sound = new WaveOut();
+ sound.Init(provider);
+ sounds.Add(sound);
+ }
+ }
+
+ private void AddSoundElementSound(TreeNode soundElementTreeNode, double volume, double pitch, int sampleCount, int delayTime)
+ {
+ BuilderSoundElementNode soundElementNode = (BuilderSoundElementNode)soundElementTreeNode.Tag;
+ AddSoundElementSound(soundElementNode, volume, pitch, sampleCount, delayTime);
+ }
+
+ private double GetSecondsFromSampleCount(int sampleCount, int sampleRate)
+ {
+ return sampleCount / (double)sampleRate;
+ }
+
+ private void GetTheBiggestSampleCount(TreeNode synthTreeNode, ref int sampleCount)
+ {
+ if (synthTreeNode.Tag is BuilderSynthNode)
+ {
+ BuilderSynthNode synthNode = (BuilderSynthNode)synthTreeNode.Tag;
+
+ if (synthNode.Type == BuilderSynthType.Single && !string.IsNullOrEmpty(synthNode.SoundElementReference))
+ {
+ BuilderSoundElementNode soundElementNode = (BuilderSoundElementNode)soundElementTree.FindNodeByFullPath(synthNode.SoundElementReference).Tag;
+
+ // We want the loop to be at least 10 seconds
+ int soundElementSampleCount = (int)soundElementNode.SampleCount;
+
+ while (GetSecondsFromSampleCount(soundElementSampleCount, (int)soundElementNode.SampleRate) < 10.0)
+ {
+ soundElementSampleCount *= 2;
+ }
+
+ if (soundElementSampleCount > sampleCount)
+ {
+ sampleCount = soundElementSampleCount;
+ }
+ }
+ }
+
+ foreach (TreeNode childNode in synthTreeNode.Nodes)
+ {
+ GetTheBiggestSampleCount(childNode, ref sampleCount);
+ }
+ }
+
+ private double GetAbsolutePitch(TreeNode synthTreeNode)
+ {
+ double pitch = 0;
+
+ while (synthTreeNode != null)
+ {
+ if (synthTreeNode.Tag is BuilderSynthNode)
+ {
+ BuilderSynthNode synthNode = (BuilderSynthNode)synthTreeNode.Tag;
+ pitch += synthNode.Pitch;
+ }
+
+ synthTreeNode = synthTreeNode.Parent;
+ }
+
+ return pitch / 1000.0;
+ }
+
+ private double GetAbsoluteVolume(TreeNode synthTreeNode)
+ {
+ double volume = 1000;
+
+ while (synthTreeNode != null)
+ {
+ if (synthTreeNode.Tag is BuilderSynthNode)
+ {
+ BuilderSynthNode synthNode = (BuilderSynthNode)synthTreeNode.Tag;
+ volume = (volume * synthNode.Volume) / 1000;
+ }
+
+ synthTreeNode = synthTreeNode.Parent;
+ }
+
+ return volume / 1000.0;
+ }
+
+ private int GetAbsoluteDelayTime(TreeNode synthTreeNode)
+ {
+ int delayTime = 0;
+
+ while (synthTreeNode != null)
+ {
+ if (synthTreeNode.Tag is BuilderSynthNode)
+ {
+ BuilderSynthNode synthNode = (BuilderSynthNode)synthTreeNode.Tag;
+ delayTime += (int)synthNode.DelayTime;
+ }
+
+ synthTreeNode = synthTreeNode.Parent;
+ }
+
+ return delayTime;
+ }
+
+ private void AddSynthSound(TreeNode synthTreeNode, int sampleCount)
+ {
+ BuilderSynthNode synthNode = (BuilderSynthNode)synthTreeNode.Tag;
+
+ if (synthNode.Type == BuilderSynthType.WithChildren)
+ {
+ if (synthNode.PlaybackType == BuilderSynthPlaybackType.RandomNoRepeat || synthNode.PlaybackType == BuilderSynthPlaybackType.Random)
+ {
+ TreeNode childNode = synthTreeNode.Nodes[synthNode.RandomChildNode];
+ BuilderSynthNode childSynthNode = (BuilderSynthNode)childNode.Tag;
+
+ if (childSynthNode.Type == BuilderSynthType.Single && !string.IsNullOrEmpty(childSynthNode.SoundElementReference) && childSynthNode.PlayThisTurn)
+ {
+ AddSoundElementSound(soundElementTree.FindNodeByFullPath(childSynthNode.SoundElementReference), GetAbsoluteVolume(childNode), GetAbsolutePitch(childNode), sampleCount, GetAbsoluteDelayTime(childNode));
+ }
+
+ else if (childSynthNode.Type == BuilderSynthType.WithChildren)
+ {
+ AddSynthSound(childNode, sampleCount);
+ }
+ }
+
+ else if (synthNode.PlaybackType == BuilderSynthPlaybackType.Sequential)
+ {
+ TreeNode childNode = synthTreeNode.Nodes[synthNode.NextChildNode];
+ BuilderSynthNode childSynthNode = (BuilderSynthNode)childNode.Tag;
+
+ if (childSynthNode.Type == BuilderSynthType.Single && !string.IsNullOrEmpty(childSynthNode.SoundElementReference) && childSynthNode.PlayThisTurn)
+ {
+ AddSoundElementSound(soundElementTree.FindNodeByFullPath(childSynthNode.SoundElementReference), GetAbsoluteVolume(childNode), GetAbsolutePitch(childNode), sampleCount, GetAbsoluteDelayTime(childNode));
+ }
+
+ else if (childSynthNode.Type == BuilderSynthType.WithChildren)
+ {
+ AddSynthSound(childNode, sampleCount);
+ }
+ }
+
+ else
+ {
+ foreach (TreeNode childNode in synthTreeNode.Nodes)
+ {
+ BuilderSynthNode childSynthNode = (BuilderSynthNode)childNode.Tag;
+
+ if (childSynthNode.Type == BuilderSynthType.Single && !string.IsNullOrEmpty(childSynthNode.SoundElementReference) && childSynthNode.PlayThisTurn)
+ {
+ AddSoundElementSound(soundElementTree.FindNodeByFullPath(childSynthNode.SoundElementReference), GetAbsoluteVolume(childNode), GetAbsolutePitch(childNode), sampleCount, GetAbsoluteDelayTime(childNode));
+ }
+
+ else if (childSynthNode.Type == BuilderSynthType.WithChildren)
+ {
+ AddSynthSound(childNode, sampleCount);
+ }
+ }
+ }
+ }
+
+ else if (synthNode.Type == BuilderSynthType.Single)
+ {
+ if (!string.IsNullOrEmpty(synthNode.SoundElementReference) && synthNode.PlayThisTurn)
+ {
+ AddSoundElementSound(soundElementTree.FindNodeByFullPath(synthNode.SoundElementReference), synthNode.Volume / 1000.0, synthNode.Pitch / 1000.0, GetTheBiggestSampleCount(synthTreeNode), (int)synthNode.DelayTime);
+ }
+ }
+ }
+
+ private int GetTheBiggestSampleCount(TreeNode synthNode)
+ {
+ int sampleCount = -1;
+ GetTheBiggestSampleCount(synthNode, ref sampleCount);
+
+ return sampleCount;
+ }
+
+ private void PlaySound(object sender, EventArgs e)
+ {
+ StopSound(sender, e);
+
+ if (cueTree.Focused && cueTree.SelectedNode != null && cueTree.SelectedNode.Tag is BuilderCueNode)
+ {
+ BuilderCueNode cueNode = (BuilderCueNode)cueTree.SelectedNode.Tag;
+
+ if (!string.IsNullOrEmpty(cueNode.SynthReference))
+ {
+ TreeNode synthNode = synthTree.FindNodeByFullPath(cueNode.SynthReference);
+ AddSynthSound(synthNode, GetTheBiggestSampleCount(synthNode));
+ }
+ }
+
+ else if (soundElementTree.Focused && soundElementTree.SelectedNode != null && soundElementTree.SelectedNode.Tag is BuilderSoundElementNode)
+ {
+ AddSoundElementSound(soundElementTree.SelectedNode, 1, 0, -1, 0);
+ }
+
+ else if (synthTree.Focused && synthTree.SelectedNode != null && synthTree.SelectedNode.Tag is BuilderSynthNode)
+ {
+ AddSynthSound(synthTree.SelectedNode, GetTheBiggestSampleCount(synthTree.SelectedNode));
+ }
+
+ sounds.ForEach(sound => sound.Play());
+ }
+
+ private void StopSound(object sender, EventArgs e)
+ {
+ sounds.ForEach(sound =>
+ {
+ sound.Stop();
+ sound.Dispose();
+ });
+
+ sounds.Clear();
+ }
+
+ private TreeNode CloneNode(TreeNode treeNode)
+ {
+ TreeNode clonedNode = (TreeNode)treeNode.Clone();
+ CloneTag(clonedNode);
+
+ return clonedNode;
+ }
+
+ private void CloneTag(TreeNode treeNode)
+ {
+ if (treeNode.Tag != null && treeNode.Tag is ICloneable)
+ {
+ treeNode.Tag = ((ICloneable)treeNode.Tag).Clone();
+ }
+
+ foreach (TreeNode childNode in treeNode.Nodes)
+ {
+ CloneTag(childNode);
+ }
+ }
+
+ private void CopyNode(TreeNode treeNode)
+ {
+ treeViewOfCopiedNode = treeNode.TreeView;
+ copiedNode = CloneNode(treeNode);
+ }
+
+ private void CopyNode(object sender, EventArgs e)
+ {
+ ContextMenuStrip menuStrip = (ContextMenuStrip)((ToolStripItem)sender).Owner;
+
+ if (menuStrip.SourceControl is TreeView)
+ {
+ TreeView selectedTree = (TreeView)menuStrip.SourceControl;
+ TreeNode selectedNode = selectedTree.SelectedNode;
+
+ CopyNode(selectedNode);
+ }
+ }
+
+ private void AddToProject(TreeNode treeNode)
+ {
+ if (treeNode.Tag is BuilderCueNode)
+ {
+ BuilderCueNode cueNode = (BuilderCueNode)treeNode.Tag;
+
+ // Do checks
+ if (!string.IsNullOrEmpty(cueNode.SynthReference) && synthTree.FindNodeByFullPath(cueNode.SynthReference) == null)
+ {
+ cueNode.SynthReference = string.Empty;
+ }
+
+ project.CueNodes.Add(cueNode);
+ }
+
+ else if (treeNode.Tag is BuilderSynthNode)
+ {
+ BuilderSynthNode synthNode = (BuilderSynthNode)treeNode.Tag;
+
+ if (!string.IsNullOrEmpty(synthNode.SoundElementReference) && soundElementTree.FindNodeByFullPath(synthNode.SoundElementReference) == null)
+ {
+ synthNode.SoundElementReference = string.Empty;
+ }
+
+ if (!string.IsNullOrEmpty(synthNode.AisacReference) && aisacTree.FindNodeByFullPath(synthNode.AisacReference) == null)
+ {
+ synthNode.AisacReference = string.Empty;
+ }
+
+ if (!string.IsNullOrEmpty(synthNode.VoiceLimitGroupReference) && !voiceLimitGroupTree.Nodes.ContainsKey(synthNode.VoiceLimitGroupReference))
+ {
+ synthNode.VoiceLimitGroupReference = string.Empty;
+ }
+
+ project.SynthNodes.Add(synthNode);
+ }
+
+ if (treeNode.Tag is BuilderSoundElementNode)
+ {
+ BuilderSoundElementNode soundElementNode = (BuilderSoundElementNode)treeNode.Tag;
+
+ if (!string.IsNullOrEmpty(soundElementNode.Intro) && !File.Exists(project.GetFullAudioPath(soundElementNode.Intro)))
+ {
+ soundElementNode.Intro = string.Empty;
+ }
+
+ if (!string.IsNullOrEmpty(soundElementNode.Loop) && !File.Exists(project.GetFullAudioPath(soundElementNode.Loop)))
+ {
+ soundElementNode.Loop = string.Empty;
+ }
+
+ project.SoundElementNodes.Add(soundElementNode);
+ }
+
+ if (treeNode.Tag is BuilderAisacNode)
+ {
+ project.AisacNodes.Add((BuilderAisacNode)treeNode.Tag);
+ }
+
+ if (treeNode.Tag is BuilderVoiceLimitGroupNode)
+ {
+ project.VoiceLimitGroupNodes.Add((BuilderVoiceLimitGroupNode)treeNode.Tag);
+ }
+ }
+
+ private void PasteAsChildNode(TreeNode parent, int nodeIndex = -1)
+ {
+ saved = false;
+
+ TreeNode nodeToPaste = CloneNode(copiedNode);
+
+ // Look for any duplicates
+ int index = -1;
+ string name = nodeToPaste.Name;
+
+ while (parent.Nodes.ContainsKey(nodeToPaste.Name))
+ {
+ nodeToPaste.Name = $"{name}_Copy{++index}";
+ }
+
+ nodeToPaste.Text = nodeToPaste.Name;
+
+ // paste it now
+ if (nodeIndex == -1)
+ {
+ parent.Nodes.Add(nodeToPaste);
+ }
+
+ else
+ {
+ parent.Nodes.Insert(nodeIndex, nodeToPaste);
+ }
+
+ // Update the CSB node and its children (will prevent some issues)
+ UpdateNodeNoRename(nodeToPaste);
+
+ // fix node if the tree is synthTree, and the nodes are synth nodes
+ if (parent.TreeView == synthTree && parent.Tag is BuilderSynthNode && nodeToPaste.Tag is BuilderSynthNode)
+ {
+ BuilderSynthNode synthNode = (BuilderSynthNode)parent.Tag;
+ BuilderSynthNode copiedSynthNode = (BuilderSynthNode)nodeToPaste.Tag;
+
+ if (synthNode.Type == BuilderSynthType.WithChildren)
+ {
+ // add the new node to track's children
+ synthNode.Children.Add(copiedSynthNode.Name);
+ }
+ }
+
+ AddToProject(nodeToPaste);
+
+ nodeToPaste.TreeView.SelectedNode = nodeToPaste;
+ nodeToPaste.EnsureVisible();
+ }
+
+ private void PasteNode(object sender, EventArgs e)
+ {
+ ContextMenuStrip menuStrip = (ContextMenuStrip)((ToolStripItem)sender).Owner;
+
+ if (menuStrip.SourceControl is TreeView)
+ {
+ TreeView selectedTree = (TreeView)menuStrip.SourceControl;
+ TreeNode selectedNode = selectedTree.SelectedNode;
+
+ if (selectedTree == treeViewOfCopiedNode)
+ {
+ // Parent is a CSB node but the copied object is a folder? abort.
+ if (selectedNode.Tag != null && copiedNode.Tag == null)
+ {
+ return;
+ }
+
+ PasteAsChildNode(selectedNode);
+ }
+ }
+ }
+
+ private void PasteNode(int nodeIndex = -1)
+ {
+ saved = false;
+
+ TreeNode nodeToPaste = CloneNode(copiedNode);
+
+ // check if it's cue and fix duplicate identifier if needed
+ if (nodeToPaste.Tag is BuilderCueNode)
+ {
+ BuilderCueNode cueNode = (BuilderCueNode)nodeToPaste.Tag;
+
+ while (project.CueNodes.Exists(cue => cue.Identifier == cueNode.Identifier))
+ {
+ cueNode.Identifier++;
+ }
+ }
+
+ // paste
+ if (treeViewOfCopiedNode.SelectedNode != null && treeViewOfCopiedNode.SelectedNode.Parent != null)
+ {
+ // Look for any duplicates
+ int index = -1;
+ string name = nodeToPaste.Name;
+
+ while (treeViewOfCopiedNode.SelectedNode.Parent.Nodes.ContainsKey(nodeToPaste.Name))
+ {
+ nodeToPaste.Name = $"{name}_Copy{++index}";
+ }
+
+ nodeToPaste.Text = nodeToPaste.Name;
+
+ if (nodeIndex == -1)
+ {
+ treeViewOfCopiedNode.SelectedNode.Parent.Nodes.Add(nodeToPaste);
+ }
+
+ else
+ {
+ treeViewOfCopiedNode.SelectedNode.Parent.Nodes.Insert(nodeIndex, nodeToPaste);
+ }
+ }
+
+ else
+ {
+ // Look for any duplicates
+ int index = -1;
+ string name = nodeToPaste.Name;
+
+ while (treeViewOfCopiedNode.Nodes.ContainsKey(nodeToPaste.Name))
+ {
+ nodeToPaste.Name = $"{name}_Copy{++index}";
+ }
+
+ nodeToPaste.Text = nodeToPaste.Name;
+
+ if (nodeIndex == -1)
+ {
+ treeViewOfCopiedNode.Nodes.Add(nodeToPaste);
+ }
+
+ else
+ {
+ treeViewOfCopiedNode.Nodes.Insert(nodeIndex, nodeToPaste);
+ }
+ }
+
+ // update the CSB node and its children
+ UpdateNodeNoRename(nodeToPaste);
+ AddToProject(nodeToPaste);
+
+ nodeToPaste.TreeView.SelectedNode = nodeToPaste;
+ nodeToPaste.EnsureVisible();
+ }
+
+ private void PasteNodeOnTree(object sender, EventArgs e)
+ {
+ ContextMenuStrip menuStrip = (ContextMenuStrip)((ToolStripItem)sender).Owner;
+
+ if (menuStrip.SourceControl is TreeView)
+ {
+ TreeView selectedTree = (TreeView)menuStrip.SourceControl;
+
+ if (selectedTree == treeViewOfCopiedNode)
+ {
+ PasteNode();
+ }
+ }
+ }
+
+ private void PasteAndInsertNode(object sender, EventArgs e)
+ {
+ ContextMenuStrip menuStrip = (ContextMenuStrip)((ToolStripItem)sender).Owner;
+
+ if (menuStrip.SourceControl is TreeView)
+ {
+ TreeView selectedTree = (TreeView)menuStrip.SourceControl;
+ TreeNode selectedNode = selectedTree.SelectedNode;
+
+ if (selectedTree == treeViewOfCopiedNode)
+ {
+ PasteNode(selectedNode.Index + 1);
+ }
+ }
+ }
+
+ private void ShowAbout(object sender, EventArgs e)
+ {
+ MessageBox.Show($"{Program.ApplicationVersion} by Skyth (blueskythlikesclouds)", "CSB Builder");
+ }
+
+ private void CreateChildTrackNode(object sender, EventArgs e)
+ {
+ ContextMenuStrip menuStrip = (ContextMenuStrip)((ToolStripItem)sender).Owner;
+
+ if (menuStrip.SourceControl is TreeView)
+ {
+ TreeView selectedTree = (TreeView)menuStrip.SourceControl;
+ TreeNode selectedNode = selectedTree.SelectedNode;
+
+ if (selectedTree == synthTree)
+ {
+ CreateSynthNode(selectedNode.Nodes, selectedNode);
+ }
+ }
+ }
+
+ private void CreateAndInsertNode(object sender, EventArgs e)
+ {
+ ContextMenuStrip menuStrip = (ContextMenuStrip)((ToolStripItem)sender).Owner;
+
+ if (menuStrip.SourceControl is TreeView)
+ {
+ TreeView selectedTree = (TreeView)menuStrip.SourceControl;
+ TreeNode selectedNode = selectedTree.SelectedNode;
+
+ if (selectedTree == cueTree)
+ {
+ CreateCueNode(selectedTree.Nodes, null, selectedNode.Index + 1);
+ }
+
+ else if (selectedTree == synthTree)
+ {
+ if (selectedNode.Tag is BuilderSynthNode && ((BuilderSynthNode)selectedNode.Tag).Type == BuilderSynthType.WithChildren)
+ {
+ CreateSoundNode(selectedNode.Nodes, selectedNode, selectedNode.Index + 1);
+ }
+
+ else
+ {
+ CreateSynthNode(selectedNode.Nodes, selectedNode, selectedNode.Index + 1);
+ }
+ }
+
+ else if (selectedTree == soundElementTree)
+ {
+ CreateSoundElementNode(selectedNode.Parent != null ? selectedNode.Parent.Nodes : selectedTree.Nodes, selectedNode, selectedNode.Index + 1);
+ }
+
+ else if (selectedTree == aisacTree)
+ {
+ CreateAisacNode(selectedNode.Nodes, selectedNode, selectedNode.Index + 1);
+ }
+
+ else if (selectedTree == voiceLimitGroupTree)
+ {
+ CreateVoiceLimitGroupNode(selectedTree.Nodes, null, selectedNode.Index + 1);
+ }
+ }
+ }
+
+ private void CreateAndInsertSoundNode(object sender, EventArgs e)
+ {
+ ContextMenuStrip menuStrip = (ContextMenuStrip)((ToolStripItem)sender).Owner;
+
+ if (menuStrip.SourceControl is TreeView)
+ {
+ TreeView selectedTree = (TreeView)menuStrip.SourceControl;
+ TreeNode selectedNode = selectedTree.SelectedNode;
+
+ if (selectedNode.Tag is BuilderSynthNode)
+ {
+ if (selectedNode.Parent == null)
+ {
+ CreateSoundNode(synthTree.Nodes, null, selectedNode.Index + 1);
+ }
+
+ else
+ {
+ CreateSoundNode(selectedNode.Parent.Nodes, selectedNode.Parent, selectedNode.Index + 1);
+ }
+ }
+ }
+ }
+
+ private void LoadTemplate(object sender, EventArgs e)
+ {
+ ContextMenuStrip menuStrip = (ContextMenuStrip)((ToolStripItem)sender).Owner;
+
+ if (menuStrip.SourceControl is TreeView)
+ {
+ TreeView selectedTree = (TreeView)menuStrip.SourceControl;
+ TreeNode selectedNode = selectedTree.SelectedNode;
+
+ if (selectedTree == aisacTree)
+ {
+ using (OpenFileDialog openAisacTemplate = new OpenFileDialog()
+ {
+ Title = "Load AISAC Template",
+ Filter = "XML Files|*.xml",
+ DefaultExt = "xml",
+ FileName = selectedNode != null ? selectedNode.Name : string.Empty,
+ })
+ {
+ if (openAisacTemplate.ShowDialog() == DialogResult.OK)
+ {
+ XmlSerializer aisacSerializer = new XmlSerializer(typeof(BuilderAisacNode));
+
+ try
+ {
+ using (Stream source = File.OpenRead(openAisacTemplate.FileName))
+ {
+ BuilderAisacNode aisacNode = (BuilderAisacNode)aisacSerializer.Deserialize(source);
+ TreeNode aisacTreeNode = null;
+
+ // folder
+ if (selectedNode != null && selectedNode.Tag == null)
+ {
+ aisacTreeNode = CreateAisacNode(selectedNode.Nodes, selectedNode, -1, aisacNode);
+ }
+
+ // aisac
+ else if (selectedNode != null && selectedNode.Tag is BuilderAisacNode)
+ {
+ project.AisacNodes[project.AisacNodes.IndexOf((BuilderAisacNode)selectedNode.Tag)] = aisacNode;
+
+ aisacNode.Name = selectedNode.FullPath;
+ selectedNode.Tag = aisacNode;
+ selectedTree.SelectedNode = selectedNode;
+ }
+
+ // nothing, create a new aisac
+ else if (selectedNode == null)
+ {
+ aisacTreeNode = CreateAisacNode(aisacTree.Nodes, null, -1, aisacNode);
+ }
+
+ // fix the current aisac if it was imported
+ if (aisacTreeNode != null)
+ {
+ if (!string.IsNullOrEmpty(aisacNode.Name))
+ {
+ // duplicate? fix it really quick
+ string name = Path.GetFileName(aisacNode.Name);
+ string uniqueName = name;
+
+ TreeNodeCollection collection = aisacTreeNode.Parent != null ? aisacTreeNode.Parent.Nodes : aisacTree.Nodes;
+
+ int index = -1;
+ while (collection.ContainsKey(uniqueName))
+ {
+ uniqueName = $"{name}_{++index}";
+ }
+
+ aisacTreeNode.Name = uniqueName;
+ aisacTreeNode.Text = aisacTreeNode.Name;
+ }
+
+ aisacNode.Name = aisacTreeNode.FullPath;
+ aisacTreeNode.Tag = aisacNode;
+
+ selectedTree.SelectedNode = aisacTreeNode;
+ aisacTreeNode.EnsureVisible();
+ }
+ }
+ }
+
+ catch
+ {
+ MessageBox.Show("The template file is invalid.", "CSB Builder", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private void SaveTemplate(object sender, EventArgs e)
+ {
+ ContextMenuStrip menuStrip = (ContextMenuStrip)((ToolStripItem)sender).Owner;
+
+ if (menuStrip.SourceControl is TreeView)
+ {
+ TreeView selectedTree = (TreeView)menuStrip.SourceControl;
+ TreeNode selectedNode = selectedTree.SelectedNode;
+
+ if (selectedTree == aisacTree)
+ {
+ using (SaveFileDialog saveAisacTemplate = new SaveFileDialog()
+ {
+ Title = "Save AISAC Template",
+ Filter = "XML Files|*.xml",
+ DefaultExt = "xml",
+ FileName = selectedNode.Name,
+ })
+ {
+ if (saveAisacTemplate.ShowDialog() == DialogResult.OK)
+ {
+ if (selectedNode.Tag is BuilderAisacNode)
+ {
+ XmlSerializer aisacSerializer = new XmlSerializer(typeof(BuilderAisacNode));
+
+ using (Stream destination = File.Create(saveAisacTemplate.FileName))
+ {
+ aisacSerializer.Serialize(destination, selectedNode.Tag);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/Source/CsbBuilder/MainForm.resx b/Source/CsbBuilder/MainForm.resx
new file mode 100644
index 0000000..3d93939
--- /dev/null
+++ b/Source/CsbBuilder/MainForm.resx
@@ -0,0 +1,177 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ 394, 17
+
+
+ True
+
+
+ 259, 17
+
+
+ 17, 17
+
+
+ 459, 56
+
+
+ 120, 17
+
+
+ True
+
+
+ 161, 95
+
+
+ 504, 17
+
+
+ 615, 17
+
+
+ 730, 17
+
+
+ 840, 17
+
+
+ 17, 56
+
+
+ 151, 56
+
+
+ 312, 56
+
+
+ 629, 56
+
+
+ 745, 56
+
+
+ 17, 95
+
+
+ 172
+
+
\ No newline at end of file
diff --git a/Source/CsbBuilder/Program.cs b/Source/CsbBuilder/Program.cs
index 49e7d33..d1277cf 100644
--- a/Source/CsbBuilder/Program.cs
+++ b/Source/CsbBuilder/Program.cs
@@ -1,77 +1,58 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using System.IO;
+using System.Threading;
+using System.Threading.Tasks;
using System.Windows.Forms;
-
-using SonicAudioLib.CriMw;
-using SonicAudioLib.CriMw.Serialization;
-using SonicAudioLib.IO;
-using SonicAudioLib.Archive;
-
+using System.IO;
+using System.Reflection;
using System.Globalization;
-using System.Xml.Serialization;
-using System.Runtime.Serialization.Formatters.Binary;
-using System.Runtime.Serialization;
+
namespace CsbBuilder
{
- class Program
+ static class Program
{
+ public static string ProjectsPath
+ {
+ get
+ {
+ return Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "Projects");
+ }
+ }
+
+ public static string ApplicationVersion
+ {
+ get
+ {
+ AssemblyName assemblyName = Assembly.GetEntryAssembly().GetName();
+ return $"{assemblyName.Name} (Version {assemblyName.Version.ToString()})";
+ }
+ }
+
+ ///
+ /// The main entry point for the application.
+ ///
+ [STAThread]
static void Main(string[] args)
{
- if (args.Length < 1)
+ if (args.Length > 0)
{
- Console.WriteLine(Properties.Resources.Description);
- Console.ReadLine();
+ Audio.AdxConverter.ConvertToWav(args[0]);
return;
}
- if (args[0].EndsWith(".csb"))
- {
- List tables = CriTableSerializer.Deserialize(args[0]);
- Serialize(args[0] + ".xml", tables);
-
- foreach (CriTableCueSheet table in tables)
- {
- DirectoryInfo baseDirectory = new DirectoryInfo(
- Path.Combine(
- Path.GetDirectoryName(args[0]),
- Path.GetFileNameWithoutExtension(args[0]),
- Enum.GetName(typeof(CriTableCueSheet.EnumTableType), table.TableType)));
-
- baseDirectory.Create();
-
- foreach (CriTableCue cue in table.DataList.OfType())
- {
- Serialize(Path.Combine(baseDirectory.FullName, cue.Name + ".xml"), cue);
- }
-
- foreach (CriTableSynth synth in table.DataList.OfType())
- {
- Directory.CreateDirectory(Path.Combine(baseDirectory.FullName, Path.GetDirectoryName(synth.SynthName)));
- Serialize(Path.Combine(baseDirectory.FullName, synth.SynthName + ".xml"), synth);
- }
-
- foreach (CriTableSoundElement soundElement in table.DataList.OfType())
- {
- Directory.CreateDirectory(Path.Combine(baseDirectory.FullName, Path.GetDirectoryName(soundElement.Name)));
- }
- }
- }
-
- else if (File.GetAttributes(args[0]).HasFlag(FileAttributes.Directory))
- {
- }
+ Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("en-US");
+ Application.ThreadException += OnException;
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault(false);
+ Application.Run(new MainForm());
}
- static void Serialize(string path, object obj)
+ private static void OnException(object sender, ThreadExceptionEventArgs e)
{
- XmlSerializer serializer = new XmlSerializer(obj.GetType());
- using (Stream destination = File.Create(path))
- {
- serializer.Serialize(destination, obj);
- }
+ new ExceptionForm(e.Exception).ShowDialog();
+ Application.Exit();
}
}
}
diff --git a/Source/CsbBuilder/Project/CsbProject.cs b/Source/CsbBuilder/Project/CsbProject.cs
new file mode 100644
index 0000000..54ae4b1
--- /dev/null
+++ b/Source/CsbBuilder/Project/CsbProject.cs
@@ -0,0 +1,261 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.IO;
+
+using CsbBuilder.BuilderNode;
+
+using System.Xml.Serialization;
+using System.Windows.Forms;
+
+using CsbBuilder;
+
+namespace CsbBuilder.Project
+{
+ public class CsbProject
+ {
+ private string name = "New CSB Project";
+ private DirectoryInfo directory = new DirectoryInfo(Path.Combine(Program.ProjectsPath, "New CSB Project"));
+
+ private List cueNodes = new List();
+ private List synthNodes = new List();
+ private List soundElementNodes = new List();
+ private List aisacNodes = new List();
+ private List voiceLimitGroupNodes = new List();
+
+ public string Name
+ {
+ get
+ {
+ return name;
+ }
+
+ set
+ {
+ name = value;
+ }
+ }
+
+ [XmlIgnore]
+ public DirectoryInfo Directory
+ {
+ get
+ {
+ return directory;
+ }
+
+ set
+ {
+ directory = value;
+ }
+ }
+
+ [XmlIgnore]
+ public DirectoryInfo AudioDirectory
+ {
+ get
+ {
+ return new DirectoryInfo(Path.Combine(directory.FullName, "Audio"));
+ }
+ }
+
+ [XmlIgnore]
+ public DirectoryInfo BinaryDirectory
+ {
+ get
+ {
+ return new DirectoryInfo(Path.Combine(directory.FullName, "Binary"));
+ }
+ }
+
+ [XmlIgnore]
+ public FileInfo ProjectFile
+ {
+ get
+ {
+ return new FileInfo(Path.Combine(directory.FullName, $"{name}.csbproject"));
+ }
+ }
+
+ [XmlArray("CueNodes"), XmlArrayItem(typeof(BuilderCueNode))]
+ public List CueNodes
+ {
+ get
+ {
+ return cueNodes;
+ }
+ }
+
+ [XmlArray("SynthNodes"), XmlArrayItem(typeof(BuilderSynthNode))]
+ public List SynthNodes
+ {
+ get
+ {
+ return synthNodes;
+ }
+ }
+
+ [XmlArray("SoundElementNodes"), XmlArrayItem(typeof(BuilderSoundElementNode))]
+ public List SoundElementNodes
+ {
+ get
+ {
+ return soundElementNodes;
+ }
+ }
+
+ [XmlArray("AisacNodes"), XmlArrayItem(typeof(BuilderAisacNode))]
+ public List AisacNodes
+ {
+ get
+ {
+ return aisacNodes;
+ }
+ }
+
+ [XmlArray("VoiceLimitGroupNodes"), XmlArrayItem(typeof(BuilderVoiceLimitGroupNode))]
+ public List VoiceLimitGroupNodes
+ {
+ get
+ {
+ return voiceLimitGroupNodes;
+ }
+ }
+
+ private void GetAbsoluteIndex(string path, TreeNode treeNode, ref int index, ref bool stop)
+ {
+ if (!stop)
+ {
+ index++;
+
+ if (treeNode.FullPath == path)
+ {
+ stop = true;
+ }
+
+ else
+ {
+ foreach (TreeNode childNode in treeNode.Nodes)
+ {
+ GetAbsoluteIndex(path, childNode, ref index, ref stop);
+ }
+ }
+ }
+ }
+
+ private int GetAbsoluteIndex(string path, TreeView treeView)
+ {
+ bool stop = false;
+ int index = -1;
+
+ foreach (TreeNode treeNode in treeView.Nodes)
+ {
+ GetAbsoluteIndex(path, treeNode, ref index, ref stop);
+ }
+
+ return index;
+ }
+
+ public void Order(TreeView cueTree, TreeView synthTree, TreeView soundElementTree, TreeView aisacTree, TreeView voiceLimitGroupTree)
+ {
+ cueNodes = cueNodes.OrderBy(cue => cueTree.Nodes.IndexOfKey(cue.Name)).ToList();
+ synthNodes = synthNodes.OrderBy(synth => GetAbsoluteIndex(synth.Name, synthTree)).ToList();
+ soundElementNodes = soundElementNodes.OrderBy(soundElement => soundElementTree.FindNodeByFullPath(soundElement.Name).Index).ToList();
+ aisacNodes = aisacNodes.OrderBy(aisac => aisacTree.FindNodeByFullPath(aisac.Name).Index).ToList();
+ voiceLimitGroupNodes = voiceLimitGroupNodes.OrderBy(voiceLimitGroup => voiceLimitGroupTree.Nodes.IndexOfKey(voiceLimitGroup.Name)).ToList();
+
+ synthNodes.ForEach(synth =>
+ {
+ if (synth.Children.Count > 0)
+ {
+ synth.Children = synth.Children.OrderBy(child => synthTree.FindNodeByFullPath(child).Index).ToList();
+ }
+ });
+ }
+
+ public static CsbProject Load(string projectFile)
+ {
+ XmlSerializer serializer = new XmlSerializer(typeof(CsbProject));
+
+ CsbProject csbProject = null;
+ using (Stream source = File.OpenRead(projectFile))
+ {
+ csbProject = (CsbProject)serializer.Deserialize(source);
+ }
+
+ csbProject.Directory = new DirectoryInfo(Path.GetDirectoryName(projectFile));
+ return csbProject;
+ }
+
+ public string AddAudio(string path)
+ {
+ if (string.IsNullOrEmpty(path))
+ {
+ return string.Empty;
+ }
+
+ string name = Path.GetFileName(path);
+ string nameNoExtension = Path.GetFileNameWithoutExtension(name);
+ string outputPath = Path.Combine(AudioDirectory.FullName, name);
+
+ if (path != outputPath)
+ {
+ string uniqueName = nameNoExtension;
+
+ int index = -1;
+ while (File.Exists(Path.Combine(AudioDirectory.FullName, $"{uniqueName}.adx")))
+ {
+ uniqueName = $"{nameNoExtension}_{++index}";
+ }
+
+ outputPath = Path.Combine(AudioDirectory.FullName, $"{uniqueName}.adx");
+ File.Copy(path, outputPath, true);
+
+ name = $"{uniqueName}.adx";
+ }
+
+ return name;
+ }
+
+ public string GetFullAudioPath(string name)
+ {
+ return Path.Combine(AudioDirectory.FullName, name);
+ }
+
+ public void Save()
+ {
+ XmlSerializer serializer = new XmlSerializer(typeof(CsbProject));
+
+ using (Stream destination = ProjectFile.Create())
+ {
+ serializer.Serialize(destination, this);
+ }
+ }
+
+ public void SaveAs(string outputDirectory)
+ {
+ DirectoryInfo oldAudioDirectory = AudioDirectory;
+
+ name = Path.GetFileNameWithoutExtension(outputDirectory);
+ directory = new DirectoryInfo(Path.GetDirectoryName(outputDirectory));
+
+ Create();
+ Save();
+
+ if (oldAudioDirectory.Exists)
+ {
+ foreach (FileInfo audioFile in oldAudioDirectory.EnumerateFiles())
+ {
+ audioFile.CopyTo(Path.Combine(AudioDirectory.FullName, audioFile.Name), true);
+ }
+ }
+ }
+
+ public void Create()
+ {
+ directory.Create();
+ AudioDirectory.Create();
+ }
+ }
+}
diff --git a/Source/CsbBuilder/Properties/AssemblyInfo.cs b/Source/CsbBuilder/Properties/AssemblyInfo.cs
index 17a78b0..5db7c97 100644
--- a/Source/CsbBuilder/Properties/AssemblyInfo.cs
+++ b/Source/CsbBuilder/Properties/AssemblyInfo.cs
@@ -5,12 +5,12 @@ using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
-[assembly: AssemblyTitle("CsbBuilder")]
+[assembly: AssemblyTitle("CSB Builder")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CsbBuilder")]
-[assembly: AssemblyCopyright("Copyright © 2016")]
+[assembly: AssemblyCopyright("Copyright © blueskythlikesclouds 2014-2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -20,7 +20,7 @@ using System.Runtime.InteropServices;
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("91f6b6a6-5d95-4c7a-b22e-a35bd32db67a")]
+[assembly: Guid("70a6a571-23ec-4b2c-a579-1e6812ddc34e")]
// Version information for an assembly consists of the following four values:
//
@@ -32,5 +32,4 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: AssemblyVersion("0.1.*")]
diff --git a/Source/CsbBuilder/Properties/Resources.Designer.cs b/Source/CsbBuilder/Properties/Resources.Designer.cs
index 41de69e..2a0e611 100644
--- a/Source/CsbBuilder/Properties/Resources.Designer.cs
+++ b/Source/CsbBuilder/Properties/Resources.Designer.cs
@@ -61,11 +61,222 @@ namespace CsbBuilder.Properties {
}
///
- /// Looks up a localized string similar to placeholder.
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
///
- internal static string Description {
+ internal static System.Drawing.Bitmap Build {
get {
- return ResourceManager.GetString("Description", resourceCulture);
+ object obj = ResourceManager.GetObject("Build", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap Copy {
+ get {
+ object obj = ResourceManager.GetObject("Copy", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap Create {
+ get {
+ object obj = ResourceManager.GetObject("Create", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap Exit {
+ get {
+ object obj = ResourceManager.GetObject("Exit", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap Folder {
+ get {
+ object obj = ResourceManager.GetObject("Folder", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap FolderOpen {
+ get {
+ object obj = ResourceManager.GetObject("FolderOpen", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap Import {
+ get {
+ object obj = ResourceManager.GetObject("Import", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap ImportAndMerge {
+ get {
+ object obj = ResourceManager.GetObject("ImportAndMerge", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap LoadProject {
+ get {
+ object obj = ResourceManager.GetObject("LoadProject", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap Merge {
+ get {
+ object obj = ResourceManager.GetObject("Merge", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap NewProject {
+ get {
+ object obj = ResourceManager.GetObject("NewProject", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap Node {
+ get {
+ object obj = ResourceManager.GetObject("Node", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap Paste {
+ get {
+ object obj = ResourceManager.GetObject("Paste", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap Play {
+ get {
+ object obj = ResourceManager.GetObject("Play", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap Remove {
+ get {
+ object obj = ResourceManager.GetObject("Remove", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap Save {
+ get {
+ object obj = ResourceManager.GetObject("Save", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap SaveAs {
+ get {
+ object obj = ResourceManager.GetObject("SaveAs", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap Select {
+ get {
+ object obj = ResourceManager.GetObject("Select", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap SetReference {
+ get {
+ object obj = ResourceManager.GetObject("SetReference", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap Sound {
+ get {
+ object obj = ResourceManager.GetObject("Sound", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap Stop {
+ get {
+ object obj = ResourceManager.GetObject("Stop", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap Template {
+ get {
+ object obj = ResourceManager.GetObject("Template", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
}
}
}
diff --git a/Source/CsbBuilder/Properties/Resources.resx b/Source/CsbBuilder/Properties/Resources.resx
index 8c89008..d18f0f6 100644
--- a/Source/CsbBuilder/Properties/Resources.resx
+++ b/Source/CsbBuilder/Properties/Resources.resx
@@ -117,7 +117,71 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- placeholder
+
+
+ ..\Resources\CreateListItem_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\Stop_grey_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\MergeModule_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\Remove_thin_10x_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\Paste_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\Save_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\ProjectFolderOpen_exp_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\BuildDefinition_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\Exit_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\Import_grey_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\Reference_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\FolderBrowserDialogControl_grey_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\SoundFile_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\AudioPlayback_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\SaveAs_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\Merge_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\Select_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\Copy_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\Folder_grey_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\FolderOpen_exp_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\None_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\Template_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
\ No newline at end of file
diff --git a/Source/CsbBuilder/Properties/Settings.Designer.cs b/Source/CsbBuilder/Properties/Settings.Designer.cs
new file mode 100644
index 0000000..032ae36
--- /dev/null
+++ b/Source/CsbBuilder/Properties/Settings.Designer.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace CsbBuilder.Properties
+{
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/Source/CsbBuilder/Properties/Settings.settings b/Source/CsbBuilder/Properties/Settings.settings
new file mode 100644
index 0000000..3964565
--- /dev/null
+++ b/Source/CsbBuilder/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/Source/CsbBuilder/Resources/AudioPlayback_16x.png b/Source/CsbBuilder/Resources/AudioPlayback_16x.png
new file mode 100644
index 0000000..8b3b711
Binary files /dev/null and b/Source/CsbBuilder/Resources/AudioPlayback_16x.png differ
diff --git a/Source/CsbBuilder/Resources/BuildDefinition_16x.png b/Source/CsbBuilder/Resources/BuildDefinition_16x.png
new file mode 100644
index 0000000..521adb0
Binary files /dev/null and b/Source/CsbBuilder/Resources/BuildDefinition_16x.png differ
diff --git a/Source/CsbBuilder/Resources/Copy_16x.png b/Source/CsbBuilder/Resources/Copy_16x.png
new file mode 100644
index 0000000..6b42cf4
Binary files /dev/null and b/Source/CsbBuilder/Resources/Copy_16x.png differ
diff --git a/Source/CsbBuilder/Resources/CreateListItem_16x.png b/Source/CsbBuilder/Resources/CreateListItem_16x.png
new file mode 100644
index 0000000..2822e25
Binary files /dev/null and b/Source/CsbBuilder/Resources/CreateListItem_16x.png differ
diff --git a/Source/CsbBuilder/Resources/Exit_16x.png b/Source/CsbBuilder/Resources/Exit_16x.png
new file mode 100644
index 0000000..75998f1
Binary files /dev/null and b/Source/CsbBuilder/Resources/Exit_16x.png differ
diff --git a/Source/CsbBuilder/Resources/FolderBrowserDialogControl_grey_16x.png b/Source/CsbBuilder/Resources/FolderBrowserDialogControl_grey_16x.png
new file mode 100644
index 0000000..fd27d0f
Binary files /dev/null and b/Source/CsbBuilder/Resources/FolderBrowserDialogControl_grey_16x.png differ
diff --git a/Source/CsbBuilder/Resources/FolderOpen_exp_16x.png b/Source/CsbBuilder/Resources/FolderOpen_exp_16x.png
new file mode 100644
index 0000000..0ba2020
Binary files /dev/null and b/Source/CsbBuilder/Resources/FolderOpen_exp_16x.png differ
diff --git a/Source/CsbBuilder/Resources/Folder_grey_16x.png b/Source/CsbBuilder/Resources/Folder_grey_16x.png
new file mode 100644
index 0000000..eba8cb3
Binary files /dev/null and b/Source/CsbBuilder/Resources/Folder_grey_16x.png differ
diff --git a/Source/CsbBuilder/Resources/Import_grey_16x.png b/Source/CsbBuilder/Resources/Import_grey_16x.png
new file mode 100644
index 0000000..f05dbcb
Binary files /dev/null and b/Source/CsbBuilder/Resources/Import_grey_16x.png differ
diff --git a/Source/CsbBuilder/Resources/MergeModule_16x.png b/Source/CsbBuilder/Resources/MergeModule_16x.png
new file mode 100644
index 0000000..bb1edcc
Binary files /dev/null and b/Source/CsbBuilder/Resources/MergeModule_16x.png differ
diff --git a/Source/CsbBuilder/Resources/Merge_16x.png b/Source/CsbBuilder/Resources/Merge_16x.png
new file mode 100644
index 0000000..49bb53e
Binary files /dev/null and b/Source/CsbBuilder/Resources/Merge_16x.png differ
diff --git a/Source/CsbBuilder/Resources/None_16x.png b/Source/CsbBuilder/Resources/None_16x.png
new file mode 100644
index 0000000..ab120e4
Binary files /dev/null and b/Source/CsbBuilder/Resources/None_16x.png differ
diff --git a/Source/CsbBuilder/Resources/Paste_16x.png b/Source/CsbBuilder/Resources/Paste_16x.png
new file mode 100644
index 0000000..494792e
Binary files /dev/null and b/Source/CsbBuilder/Resources/Paste_16x.png differ
diff --git a/Source/CsbBuilder/Resources/ProjectFolderOpen_exp_16x.png b/Source/CsbBuilder/Resources/ProjectFolderOpen_exp_16x.png
new file mode 100644
index 0000000..2877b60
Binary files /dev/null and b/Source/CsbBuilder/Resources/ProjectFolderOpen_exp_16x.png differ
diff --git a/Source/CsbBuilder/Resources/Reference_16x.png b/Source/CsbBuilder/Resources/Reference_16x.png
new file mode 100644
index 0000000..afd4bd2
Binary files /dev/null and b/Source/CsbBuilder/Resources/Reference_16x.png differ
diff --git a/Source/CsbBuilder/Resources/Remove_16x.png b/Source/CsbBuilder/Resources/Remove_16x.png
new file mode 100644
index 0000000..95ee227
Binary files /dev/null and b/Source/CsbBuilder/Resources/Remove_16x.png differ
diff --git a/Source/CsbBuilder/Resources/Remove_thin_10x_16x.png b/Source/CsbBuilder/Resources/Remove_thin_10x_16x.png
new file mode 100644
index 0000000..1b68318
Binary files /dev/null and b/Source/CsbBuilder/Resources/Remove_thin_10x_16x.png differ
diff --git a/Source/CsbBuilder/Resources/SaveAs_16x.png b/Source/CsbBuilder/Resources/SaveAs_16x.png
new file mode 100644
index 0000000..360a39e
Binary files /dev/null and b/Source/CsbBuilder/Resources/SaveAs_16x.png differ
diff --git a/Source/CsbBuilder/Resources/Save_16x.png b/Source/CsbBuilder/Resources/Save_16x.png
new file mode 100644
index 0000000..81eca19
Binary files /dev/null and b/Source/CsbBuilder/Resources/Save_16x.png differ
diff --git a/Source/CsbBuilder/Resources/Select_16x.png b/Source/CsbBuilder/Resources/Select_16x.png
new file mode 100644
index 0000000..16cd632
Binary files /dev/null and b/Source/CsbBuilder/Resources/Select_16x.png differ
diff --git a/Source/CsbBuilder/Resources/SoundFile_16x.png b/Source/CsbBuilder/Resources/SoundFile_16x.png
new file mode 100644
index 0000000..ce3c8f9
Binary files /dev/null and b/Source/CsbBuilder/Resources/SoundFile_16x.png differ
diff --git a/Source/CsbBuilder/Resources/Stop_grey_16x.png b/Source/CsbBuilder/Resources/Stop_grey_16x.png
new file mode 100644
index 0000000..ff2b150
Binary files /dev/null and b/Source/CsbBuilder/Resources/Stop_grey_16x.png differ
diff --git a/Source/CsbBuilder/Resources/Template_16x.png b/Source/CsbBuilder/Resources/Template_16x.png
new file mode 100644
index 0000000..7b4c1d4
Binary files /dev/null and b/Source/CsbBuilder/Resources/Template_16x.png differ
diff --git a/Source/CsbBuilder/Serialization/SerializationAisacGraphTable.cs b/Source/CsbBuilder/Serialization/SerializationAisacGraphTable.cs
new file mode 100644
index 0000000..852594a
--- /dev/null
+++ b/Source/CsbBuilder/Serialization/SerializationAisacGraphTable.cs
@@ -0,0 +1,94 @@
+using System.IO;
+using SonicAudioLib.CriMw.Serialization;
+
+namespace CsbBuilder.Serialization
+{
+ [CriSerializable("TBLIGR")]
+ public class SerializationAisacGraphTable
+ {
+ private byte typeField = 0;
+ private float imaxField = 0;
+ private float iminField = 0;
+ private float omaxField = 0;
+ private float ominField = 0;
+ private byte[] pointsField = null;
+
+ [CriField("type", 0)]
+ public byte Type
+ {
+ get
+ {
+ return typeField;
+ }
+ set
+ {
+ typeField = value;
+ }
+ }
+
+ [CriField("imax", 1)]
+ public float InMax
+ {
+ get
+ {
+ return imaxField;
+ }
+ set
+ {
+ imaxField = value;
+ }
+ }
+
+ [CriField("imin", 2)]
+ public float InMin
+ {
+ get
+ {
+ return iminField;
+ }
+ set
+ {
+ iminField = value;
+ }
+ }
+
+ [CriField("omax", 3)]
+ public float OutMax
+ {
+ get
+ {
+ return omaxField;
+ }
+ set
+ {
+ omaxField = value;
+ }
+ }
+
+ [CriField("omin", 4)]
+ public float OutMin
+ {
+ get
+ {
+ return ominField;
+ }
+ set
+ {
+ ominField = value;
+ }
+ }
+
+ [CriField("points", 5)]
+ public byte[] Points
+ {
+ get
+ {
+ return pointsField;
+ }
+ set
+ {
+ pointsField = value;
+ }
+ }
+ }
+}
diff --git a/Source/CsbBuilder/CriTableAisacPoint.cs b/Source/CsbBuilder/Serialization/SerializationAisacPointTable.cs
similarity index 58%
rename from Source/CsbBuilder/CriTableAisacPoint.cs
rename to Source/CsbBuilder/Serialization/SerializationAisacPointTable.cs
index a63f7db..af00809 100644
--- a/Source/CsbBuilder/CriTableAisacPoint.cs
+++ b/Source/CsbBuilder/Serialization/SerializationAisacPointTable.cs
@@ -1,28 +1,24 @@
using System.IO;
using SonicAudioLib.CriMw.Serialization;
-using System;
-using System.Xml.Serialization;
-
-namespace CsbBuilder
+namespace CsbBuilder.Serialization
{
- [Serializable]
[CriSerializable("TBLIPT")]
- public class CriTableAisacPoint
+ public class SerializationAisacPointTable
{
- private ushort _in = 0;
- private ushort _out = 0;
+ private ushort inField = 0;
+ private ushort outField = 0;
[CriField("in", 0)]
public ushort In
{
get
{
- return _in;
+ return inField;
}
set
{
- _in = value;
+ inField = value;
}
}
@@ -31,11 +27,11 @@ namespace CsbBuilder
{
get
{
- return _out;
+ return outField;
}
set
{
- _out = value;
+ outField = value;
}
}
}
diff --git a/Source/CsbBuilder/CriTableAisac.cs b/Source/CsbBuilder/Serialization/SerializationAisacTable.cs
similarity index 51%
rename from Source/CsbBuilder/CriTableAisac.cs
rename to Source/CsbBuilder/Serialization/SerializationAisacTable.cs
index f2785ad..8129730 100644
--- a/Source/CsbBuilder/CriTableAisac.cs
+++ b/Source/CsbBuilder/Serialization/SerializationAisacTable.cs
@@ -1,32 +1,27 @@
-using System.Collections.Generic;
using System.IO;
-using SonicAudioLib.CriMw;
using SonicAudioLib.CriMw.Serialization;
-using System;
-using System.Xml.Serialization;
-
-namespace CsbBuilder
+namespace CsbBuilder.Serialization
{
- [Serializable]
[CriSerializable("TBLISC")]
- public class CriTableAisac
+ public class SerializationAisacTable
{
- private string _name = string.Empty;
- private string _ptname = string.Empty;
- private byte _type = 0;
- private byte _rndrng = 0;
+ private string nameField = string.Empty;
+ private string ptnameField = string.Empty;
+ private byte typeField = 0;
+ private byte[] grphField = null;
+ private byte rndrngField = 0;
[CriField("name", 0)]
public string Name
{
get
{
- return _name;
+ return nameField;
}
set
{
- _name = value;
+ nameField = value;
}
}
@@ -35,11 +30,11 @@ namespace CsbBuilder
{
get
{
- return _ptname;
+ return ptnameField;
}
set
{
- _ptname = value;
+ ptnameField = value;
}
}
@@ -48,29 +43,24 @@ namespace CsbBuilder
{
get
{
- return _type;
+ return typeField;
}
set
{
- _type = value;
+ typeField = value;
}
}
- [CriIgnore]
- public List GraphList { get; set; }
-
- [XmlIgnore]
[CriField("grph", 3)]
public byte[] Graph
{
get
{
- return CriTableSerializer.Serialize(GraphList, CriTableWriterSettings.AdxSettings);
+ return grphField;
}
-
set
{
- GraphList = CriTableSerializer.Deserialize(value);
+ grphField = value;
}
}
@@ -79,11 +69,11 @@ namespace CsbBuilder
{
get
{
- return _rndrng;
+ return rndrngField;
}
set
{
- _rndrng = value;
+ rndrngField = value;
}
}
}
diff --git a/Source/CsbBuilder/Serialization/SerializationCueSheetTable.cs b/Source/CsbBuilder/Serialization/SerializationCueSheetTable.cs
new file mode 100644
index 0000000..0d43119
--- /dev/null
+++ b/Source/CsbBuilder/Serialization/SerializationCueSheetTable.cs
@@ -0,0 +1,52 @@
+using System.IO;
+using SonicAudioLib.CriMw.Serialization;
+
+namespace CsbBuilder.Serialization
+{
+ [CriSerializable("TBLCSB")]
+ public class SerializationCueSheetTable
+ {
+ private string nameField = string.Empty;
+ private byte ttypeField = 0;
+ private byte[] utfField = null;
+
+ [CriField("name", 0)]
+ public string Name
+ {
+ get
+ {
+ return nameField;
+ }
+ set
+ {
+ nameField = value;
+ }
+ }
+
+ [CriField("ttype", 1)]
+ public byte TableType
+ {
+ get
+ {
+ return ttypeField;
+ }
+ set
+ {
+ ttypeField = value;
+ }
+ }
+
+ [CriField("utf", 2)]
+ public byte[] TableData
+ {
+ get
+ {
+ return utfField;
+ }
+ set
+ {
+ utfField = value;
+ }
+ }
+ }
+}
diff --git a/Source/CsbBuilder/CriTableCue.cs b/Source/CsbBuilder/Serialization/SerializationCueTable.cs
similarity index 57%
rename from Source/CsbBuilder/CriTableCue.cs
rename to Source/CsbBuilder/Serialization/SerializationCueTable.cs
index c2b0f01..3cb3b59 100644
--- a/Source/CsbBuilder/CriTableCue.cs
+++ b/Source/CsbBuilder/Serialization/SerializationCueTable.cs
@@ -1,31 +1,27 @@
using System.IO;
using SonicAudioLib.CriMw.Serialization;
-using System;
-using System.Xml.Serialization;
-
-namespace CsbBuilder
+namespace CsbBuilder.Serialization
{
- [Serializable]
[CriSerializable("TBLCUE")]
- public class CriTableCue
+ public class SerializationCueTable
{
- private string _name = string.Empty;
- private uint _id = 0;
- private string _synth = string.Empty;
- private string _udata = string.Empty;
- private byte _flags = 0;
+ private string nameField = string.Empty;
+ private uint idField = 0;
+ private string synthField = string.Empty;
+ private string udataField = string.Empty;
+ private byte flagsField = 0;
[CriField("name", 0)]
public string Name
{
get
{
- return _name;
+ return nameField;
}
set
{
- _name = value;
+ nameField = value;
}
}
@@ -34,24 +30,24 @@ namespace CsbBuilder
{
get
{
- return _id;
+ return idField;
}
set
{
- _id = value;
+ idField = value;
}
}
[CriField("synth", 2)]
- public string Synth
+ public string SynthPath
{
get
{
- return _synth;
+ return synthField;
}
set
{
- _synth = value;
+ synthField = value;
}
}
@@ -60,11 +56,11 @@ namespace CsbBuilder
{
get
{
- return _udata;
+ return udataField;
}
set
{
- _udata = value;
+ udataField = value;
}
}
@@ -73,11 +69,11 @@ namespace CsbBuilder
{
get
{
- return _flags;
+ return flagsField;
}
set
{
- _flags = value;
+ flagsField = value;
}
}
}
diff --git a/Source/CsbBuilder/Serialization/SerializationSoundElementTable.cs b/Source/CsbBuilder/Serialization/SerializationSoundElementTable.cs
new file mode 100644
index 0000000..5c05fbe
--- /dev/null
+++ b/Source/CsbBuilder/Serialization/SerializationSoundElementTable.cs
@@ -0,0 +1,108 @@
+using System.IO;
+using SonicAudioLib.CriMw.Serialization;
+
+namespace CsbBuilder.Serialization
+{
+ [CriSerializable("TBLSDL")]
+ public class SerializationSoundElementTable
+ {
+ private string nameField = string.Empty;
+ private byte[] dataField = null;
+ private byte fmtField = 0;
+ private byte nchField = 0;
+ private bool stmflgField = false;
+ private uint sfreqField = 0;
+ private uint nsmplField = 0;
+
+ [CriField("name", 0)]
+ public string Name
+ {
+ get
+ {
+ return nameField;
+ }
+ set
+ {
+ nameField = value;
+ }
+ }
+
+ [CriField("data", 1)]
+ public byte[] Data
+ {
+ get
+ {
+ return dataField;
+ }
+ set
+ {
+ dataField = value;
+ }
+ }
+
+ [CriField("fmt", 2)]
+ public byte FormatType
+ {
+ get
+ {
+ return fmtField;
+ }
+ set
+ {
+ fmtField = value;
+ }
+ }
+
+ [CriField("nch", 3)]
+ public byte NumberChannels
+ {
+ get
+ {
+ return nchField;
+ }
+ set
+ {
+ nchField = value;
+ }
+ }
+
+ [CriField("stmflg", 4)]
+ public bool Streaming
+ {
+ get
+ {
+ return stmflgField;
+ }
+ set
+ {
+ stmflgField = value;
+ }
+ }
+
+ [CriField("sfreq", 5)]
+ public uint SoundFrequency
+ {
+ get
+ {
+ return sfreqField;
+ }
+ set
+ {
+ sfreqField = value;
+ }
+ }
+
+ [CriField("nsmpl", 6)]
+ public uint NumberSamples
+ {
+ get
+ {
+ return nsmplField;
+ }
+ set
+ {
+ nsmplField = value;
+ }
+ }
+ }
+}
diff --git a/Source/CsbBuilder/CriTableSynth.cs b/Source/CsbBuilder/Serialization/SerializationSynthTable.cs
similarity index 56%
rename from Source/CsbBuilder/CriTableSynth.cs
rename to Source/CsbBuilder/Serialization/SerializationSynthTable.cs
index b2f4718..ee6c98c 100644
--- a/Source/CsbBuilder/CriTableSynth.cs
+++ b/Source/CsbBuilder/Serialization/SerializationSynthTable.cs
@@ -1,222 +1,150 @@
-using System.Collections.Generic;
using System.IO;
using SonicAudioLib.CriMw.Serialization;
-using System;
-using System.Linq;
-using System.Xml.Serialization;
-
-namespace CsbBuilder
+namespace CsbBuilder.Serialization
{
- [Serializable]
[CriSerializable("TBLSYN")]
- public class CriTableSynth
+ public class SerializationSynthTable
{
- public enum EnumSynthType : byte
- {
- Waveform = 0,
- Polyphonic = 1,
- Random = 3,
- };
-
- private string _synname = string.Empty;
- private EnumSynthType _syntype = EnumSynthType.Waveform;
- private EnumSynthType _cmplxtype = EnumSynthType.Waveform;
- private string _lnkname = string.Empty;
- private string _issetname = string.Empty;
- private short _volume = 1000;
- private short _pitch = 0;
- private uint _dlytim = 0;
- private byte _s_cntrl = 0;
- private ushort _eg_dly = 0;
- private ushort _eg_atk = 0;
- private ushort _eg_hld = 0;
- private ushort _eg_dcy = 0;
- private ushort _eg_rel = 0;
- private ushort _eg_sus = 1000;
- private byte _f_type = 0;
- private ushort _f_cof1 = 0;
- private ushort _f_cof2 = 0;
- private ushort _f_reso = 0;
- private byte _f_roff = 0;
- private string _dryoname = string.Empty;
- private string _mtxrtr = string.Empty;
- private ushort _dry0 = 0;
- private ushort _dry1 = 0;
- private ushort _dry2 = 0;
- private ushort _dry3 = 0;
- private ushort _dry4 = 0;
- private ushort _dry5 = 0;
- private ushort _dry6 = 0;
- private ushort _dry7 = 0;
- private string _wetoname = string.Empty;
- private ushort _wet0 = 0;
- private ushort _wet1 = 0;
- private ushort _wet2 = 0;
- private ushort _wet3 = 0;
- private ushort _wet4 = 0;
- private ushort _wet5 = 0;
- private ushort _wet6 = 0;
- private ushort _wet7 = 0;
- private string _wcnct0 = string.Empty;
- private string _wcnct1 = string.Empty;
- private string _wcnct2 = string.Empty;
- private string _wcnct3 = string.Empty;
- private string _wcnct4 = string.Empty;
- private string _wcnct5 = string.Empty;
- private string _wcnct6 = string.Empty;
- private string _wcnct7 = string.Empty;
- private string _vl_gname = string.Empty;
- private byte _vl_type = 0;
- private byte _vl_prio = 0;
- private ushort _vl_phtime = 0;
- private sbyte _vl_pcdlt = 0;
- private short _p3d_vo = 0;
- private short _p3d_vg = 1000;
- private short _p3d_ao = 0;
- private short _p3d_ag = 1000;
- private short _p3d_ido = 0;
- private short _p3d_idg = 1000;
- private byte _dry0g = 255;
- private byte _dry1g = 255;
- private byte _dry2g = 255;
- private byte _dry3g = 255;
- private byte _dry4g = 255;
- private byte _dry5g = 255;
- private byte _dry6g = 255;
- private byte _dry7g = 255;
- private byte _wet0g = 255;
- private byte _wet1g = 255;
- private byte _wet2g = 255;
- private byte _wet3g = 255;
- private byte _wet4g = 255;
- private byte _wet5g = 255;
- private byte _wet6g = 255;
- private byte _wet7g = 255;
- private byte _f1_type = 0;
- private ushort _f1_cofo = 0;
- private ushort _f1_cofg = 0;
- private ushort _f1_resoo = 0;
- private ushort _f1_resog = 0;
- private byte _f2_type = 0;
- private ushort _f2_coflo = 0;
- private ushort _f2_coflg = 1000;
- private ushort _f2_cofho = 0;
- private ushort _f2_cofhg = 1000;
- private byte _probability = 100;
- private byte _n_lmt_children = 0;
- private byte _repeat = 0;
- private uint _combo_time = 0;
- private byte _combo_loop_back = 0;
+ private string synnameField = string.Empty;
+ private byte syntypeField = 0;
+ private byte cmplxtypeField = 0;
+ private string lnknameField = string.Empty;
+ private string issetnameField = string.Empty;
+ private short volumeField = 1000;
+ private short pitchField = 0;
+ private uint dlytimField = 0;
+ private byte s_cntrlField = 0;
+ private ushort eg_dlyField = 0;
+ private ushort eg_atkField = 0;
+ private ushort eg_hldField = 0;
+ private ushort eg_dcyField = 0;
+ private ushort eg_relField = 0;
+ private ushort eg_susField = 1000;
+ private byte f_typeField = 0;
+ private ushort f_cof1Field = 0;
+ private ushort f_cof2Field = 0;
+ private ushort f_resoField = 0;
+ private byte f_roffField = 0;
+ private string dryonameField = string.Empty;
+ private string mtxrtrField = string.Empty;
+ private ushort dry0Field = 0;
+ private ushort dry1Field = 0;
+ private ushort dry2Field = 0;
+ private ushort dry3Field = 0;
+ private ushort dry4Field = 0;
+ private ushort dry5Field = 0;
+ private ushort dry6Field = 0;
+ private ushort dry7Field = 0;
+ private string wetonameField = string.Empty;
+ private ushort wet0Field = 0;
+ private ushort wet1Field = 0;
+ private ushort wet2Field = 0;
+ private ushort wet3Field = 0;
+ private ushort wet4Field = 0;
+ private ushort wet5Field = 0;
+ private ushort wet6Field = 0;
+ private ushort wet7Field = 0;
+ private string wcnct0Field = string.Empty;
+ private string wcnct1Field = string.Empty;
+ private string wcnct2Field = string.Empty;
+ private string wcnct3Field = string.Empty;
+ private string wcnct4Field = string.Empty;
+ private string wcnct5Field = string.Empty;
+ private string wcnct6Field = string.Empty;
+ private string wcnct7Field = string.Empty;
+ private string vl_gnameField = string.Empty;
+ private byte vl_typeField = 0;
+ private byte vl_prioField = 0;
+ private ushort vl_phtimeField = 0;
+ private sbyte vl_pcdltField = 0;
+ private short p3d_voField = 0;
+ private short p3d_vgField = 1000;
+ private short p3d_aoField = 0;
+ private short p3d_agField = 1000;
+ private short p3d_idoField = 0;
+ private short p3d_idgField = 1000;
+ private byte dry0gField = 255;
+ private byte dry1gField = 255;
+ private byte dry2gField = 255;
+ private byte dry3gField = 255;
+ private byte dry4gField = 255;
+ private byte dry5gField = 255;
+ private byte dry6gField = 255;
+ private byte dry7gField = 255;
+ private byte wet0gField = 255;
+ private byte wet1gField = 255;
+ private byte wet2gField = 255;
+ private byte wet3gField = 255;
+ private byte wet4gField = 255;
+ private byte wet5gField = 255;
+ private byte wet6gField = 255;
+ private byte wet7gField = 255;
+ private byte f1_typeField = 0;
+ private ushort f1_cofoField = 0;
+ private ushort f1_cofgField = 0;
+ private ushort f1_resooField = 0;
+ private ushort f1_resogField = 0;
+ private byte f2_typeField = 0;
+ private ushort f2_cofloField = 0;
+ private ushort f2_coflgField = 1000;
+ private ushort f2_cofhoField = 0;
+ private ushort f2_cofhgField = 1000;
+ private byte probabilityField = 100;
+ private byte n_lmt_childrenField = 0;
+ private byte repeatField = 0;
+ private uint combo_timeField = 0;
+ private byte combo_loop_backField = 0;
[CriField("synname", 0)]
public string SynthName
{
get
{
- return _synname;
+ return synnameField;
}
set
{
- _synname = value;
+ synnameField = value;
}
}
[CriField("syntype", 1)]
- public EnumSynthType SynthType
+ public byte SynthType
{
get
{
- return _syntype;
+ return syntypeField;
}
set
{
- _syntype = value;
+ syntypeField = value;
}
}
[CriField("cmplxtype", 2)]
- public EnumSynthType ComplexType
+ public byte ComplexType
{
get
{
- return _cmplxtype;
+ return cmplxtypeField;
}
set
{
- _cmplxtype = value;
+ cmplxtypeField = value;
}
}
- [CriIgnore]
- public List LinkNameList { get; set; }
-
- [CriIgnore]
- public List AisacSetNameList { get; set; }
-
- [XmlIgnore]
[CriField("lnkname", 3)]
public string LinkName
{
get
{
- if (_syntype == EnumSynthType.Waveform && LinkNameList.Count > 0)
- {
- return LinkNameList[0];
- }
-
- string result = string.Empty;
- foreach (string linkName in LinkNameList)
- {
- result += linkName + (char)0x0A;
- }
-
- return result;
- }
-
- set
- {
- if (!string.IsNullOrEmpty(value))
- {
- LinkNameList = value.Split(new char[] { (char)0x0A }, StringSplitOptions.RemoveEmptyEntries).ToList();
- }
- }
- }
-
- [XmlIgnore]
- [CriField("issetname", 4)]
- public string AisacSetName
- {
- get
- {
- string result = string.Empty;
- foreach (string aisacSetName in AisacSetNameList)
- {
- result += aisacSetName + (char)0x0A;
- }
-
- return result;
- }
-
- set
- {
- if (!string.IsNullOrEmpty(value))
- {
- AisacSetNameList = value.Split(new char[] { (char)0x0A }, StringSplitOptions.RemoveEmptyEntries).ToList();
- }
- }
- }
-
- /*[CriField("lnkname", 3)]
- public string LinkName
- {
- get
- {
- return _lnkname;
+ return lnknameField;
}
set
{
- _lnkname = value;
+ lnknameField = value;
}
}
@@ -225,24 +153,24 @@ namespace CsbBuilder
{
get
{
- return _issetname;
+ return issetnameField;
}
set
{
- _issetname = value;
+ issetnameField = value;
}
- }*/
+ }
[CriField("volume", 5)]
public short Volume
{
get
{
- return _volume;
+ return volumeField;
}
set
{
- _volume = value;
+ volumeField = value;
}
}
@@ -251,11 +179,11 @@ namespace CsbBuilder
{
get
{
- return _pitch;
+ return pitchField;
}
set
{
- _pitch = value;
+ pitchField = value;
}
}
@@ -264,24 +192,24 @@ namespace CsbBuilder
{
get
{
- return _dlytim;
+ return dlytimField;
}
set
{
- _dlytim = value;
+ dlytimField = value;
}
}
[CriField("s_cntrl", 8)]
- public byte SoundControl
+ public byte SControl
{
get
{
- return _s_cntrl;
+ return s_cntrlField;
}
set
{
- _s_cntrl = value;
+ s_cntrlField = value;
}
}
@@ -290,11 +218,11 @@ namespace CsbBuilder
{
get
{
- return _eg_dly;
+ return eg_dlyField;
}
set
{
- _eg_dly = value;
+ eg_dlyField = value;
}
}
@@ -303,11 +231,11 @@ namespace CsbBuilder
{
get
{
- return _eg_atk;
+ return eg_atkField;
}
set
{
- _eg_atk = value;
+ eg_atkField = value;
}
}
@@ -316,11 +244,11 @@ namespace CsbBuilder
{
get
{
- return _eg_hld;
+ return eg_hldField;
}
set
{
- _eg_hld = value;
+ eg_hldField = value;
}
}
@@ -329,11 +257,11 @@ namespace CsbBuilder
{
get
{
- return _eg_dcy;
+ return eg_dcyField;
}
set
{
- _eg_dcy = value;
+ eg_dcyField = value;
}
}
@@ -342,11 +270,11 @@ namespace CsbBuilder
{
get
{
- return _eg_rel;
+ return eg_relField;
}
set
{
- _eg_rel = value;
+ eg_relField = value;
}
}
@@ -355,11 +283,11 @@ namespace CsbBuilder
{
get
{
- return _eg_sus;
+ return eg_susField;
}
set
{
- _eg_sus = value;
+ eg_susField = value;
}
}
@@ -368,11 +296,11 @@ namespace CsbBuilder
{
get
{
- return _f_type;
+ return f_typeField;
}
set
{
- _f_type = value;
+ f_typeField = value;
}
}
@@ -381,11 +309,11 @@ namespace CsbBuilder
{
get
{
- return _f_cof1;
+ return f_cof1Field;
}
set
{
- _f_cof1 = value;
+ f_cof1Field = value;
}
}
@@ -394,11 +322,11 @@ namespace CsbBuilder
{
get
{
- return _f_cof2;
+ return f_cof2Field;
}
set
{
- _f_cof2 = value;
+ f_cof2Field = value;
}
}
@@ -407,11 +335,11 @@ namespace CsbBuilder
{
get
{
- return _f_reso;
+ return f_resoField;
}
set
{
- _f_reso = value;
+ f_resoField = value;
}
}
@@ -420,11 +348,11 @@ namespace CsbBuilder
{
get
{
- return _f_roff;
+ return f_roffField;
}
set
{
- _f_roff = value;
+ f_roffField = value;
}
}
@@ -433,11 +361,11 @@ namespace CsbBuilder
{
get
{
- return _dryoname;
+ return dryonameField;
}
set
{
- _dryoname = value;
+ dryonameField = value;
}
}
@@ -446,11 +374,11 @@ namespace CsbBuilder
{
get
{
- return _mtxrtr;
+ return mtxrtrField;
}
set
{
- _mtxrtr = value;
+ mtxrtrField = value;
}
}
@@ -459,11 +387,11 @@ namespace CsbBuilder
{
get
{
- return _dry0;
+ return dry0Field;
}
set
{
- _dry0 = value;
+ dry0Field = value;
}
}
@@ -472,11 +400,11 @@ namespace CsbBuilder
{
get
{
- return _dry1;
+ return dry1Field;
}
set
{
- _dry1 = value;
+ dry1Field = value;
}
}
@@ -485,11 +413,11 @@ namespace CsbBuilder
{
get
{
- return _dry2;
+ return dry2Field;
}
set
{
- _dry2 = value;
+ dry2Field = value;
}
}
@@ -498,11 +426,11 @@ namespace CsbBuilder
{
get
{
- return _dry3;
+ return dry3Field;
}
set
{
- _dry3 = value;
+ dry3Field = value;
}
}
@@ -511,11 +439,11 @@ namespace CsbBuilder
{
get
{
- return _dry4;
+ return dry4Field;
}
set
{
- _dry4 = value;
+ dry4Field = value;
}
}
@@ -524,11 +452,11 @@ namespace CsbBuilder
{
get
{
- return _dry5;
+ return dry5Field;
}
set
{
- _dry5 = value;
+ dry5Field = value;
}
}
@@ -537,11 +465,11 @@ namespace CsbBuilder
{
get
{
- return _dry6;
+ return dry6Field;
}
set
{
- _dry6 = value;
+ dry6Field = value;
}
}
@@ -550,11 +478,11 @@ namespace CsbBuilder
{
get
{
- return _dry7;
+ return dry7Field;
}
set
{
- _dry7 = value;
+ dry7Field = value;
}
}
@@ -563,11 +491,11 @@ namespace CsbBuilder
{
get
{
- return _wetoname;
+ return wetonameField;
}
set
{
- _wetoname = value;
+ wetonameField = value;
}
}
@@ -576,11 +504,11 @@ namespace CsbBuilder
{
get
{
- return _wet0;
+ return wet0Field;
}
set
{
- _wet0 = value;
+ wet0Field = value;
}
}
@@ -589,11 +517,11 @@ namespace CsbBuilder
{
get
{
- return _wet1;
+ return wet1Field;
}
set
{
- _wet1 = value;
+ wet1Field = value;
}
}
@@ -602,11 +530,11 @@ namespace CsbBuilder
{
get
{
- return _wet2;
+ return wet2Field;
}
set
{
- _wet2 = value;
+ wet2Field = value;
}
}
@@ -615,11 +543,11 @@ namespace CsbBuilder
{
get
{
- return _wet3;
+ return wet3Field;
}
set
{
- _wet3 = value;
+ wet3Field = value;
}
}
@@ -628,11 +556,11 @@ namespace CsbBuilder
{
get
{
- return _wet4;
+ return wet4Field;
}
set
{
- _wet4 = value;
+ wet4Field = value;
}
}
@@ -641,11 +569,11 @@ namespace CsbBuilder
{
get
{
- return _wet5;
+ return wet5Field;
}
set
{
- _wet5 = value;
+ wet5Field = value;
}
}
@@ -654,11 +582,11 @@ namespace CsbBuilder
{
get
{
- return _wet6;
+ return wet6Field;
}
set
{
- _wet6 = value;
+ wet6Field = value;
}
}
@@ -667,11 +595,11 @@ namespace CsbBuilder
{
get
{
- return _wet7;
+ return wet7Field;
}
set
{
- _wet7 = value;
+ wet7Field = value;
}
}
@@ -680,11 +608,11 @@ namespace CsbBuilder
{
get
{
- return _wcnct0;
+ return wcnct0Field;
}
set
{
- _wcnct0 = value;
+ wcnct0Field = value;
}
}
@@ -693,11 +621,11 @@ namespace CsbBuilder
{
get
{
- return _wcnct1;
+ return wcnct1Field;
}
set
{
- _wcnct1 = value;
+ wcnct1Field = value;
}
}
@@ -706,11 +634,11 @@ namespace CsbBuilder
{
get
{
- return _wcnct2;
+ return wcnct2Field;
}
set
{
- _wcnct2 = value;
+ wcnct2Field = value;
}
}
@@ -719,11 +647,11 @@ namespace CsbBuilder
{
get
{
- return _wcnct3;
+ return wcnct3Field;
}
set
{
- _wcnct3 = value;
+ wcnct3Field = value;
}
}
@@ -732,11 +660,11 @@ namespace CsbBuilder
{
get
{
- return _wcnct4;
+ return wcnct4Field;
}
set
{
- _wcnct4 = value;
+ wcnct4Field = value;
}
}
@@ -745,11 +673,11 @@ namespace CsbBuilder
{
get
{
- return _wcnct5;
+ return wcnct5Field;
}
set
{
- _wcnct5 = value;
+ wcnct5Field = value;
}
}
@@ -758,11 +686,11 @@ namespace CsbBuilder
{
get
{
- return _wcnct6;
+ return wcnct6Field;
}
set
{
- _wcnct6 = value;
+ wcnct6Field = value;
}
}
@@ -771,11 +699,11 @@ namespace CsbBuilder
{
get
{
- return _wcnct7;
+ return wcnct7Field;
}
set
{
- _wcnct7 = value;
+ wcnct7Field = value;
}
}
@@ -784,11 +712,11 @@ namespace CsbBuilder
{
get
{
- return _vl_gname;
+ return vl_gnameField;
}
set
{
- _vl_gname = value;
+ vl_gnameField = value;
}
}
@@ -797,11 +725,11 @@ namespace CsbBuilder
{
get
{
- return _vl_type;
+ return vl_typeField;
}
set
{
- _vl_type = value;
+ vl_typeField = value;
}
}
@@ -810,11 +738,11 @@ namespace CsbBuilder
{
get
{
- return _vl_prio;
+ return vl_prioField;
}
set
{
- _vl_prio = value;
+ vl_prioField = value;
}
}
@@ -823,11 +751,11 @@ namespace CsbBuilder
{
get
{
- return _vl_phtime;
+ return vl_phtimeField;
}
set
{
- _vl_phtime = value;
+ vl_phtimeField = value;
}
}
@@ -836,11 +764,11 @@ namespace CsbBuilder
{
get
{
- return _vl_pcdlt;
+ return vl_pcdltField;
}
set
{
- _vl_pcdlt = value;
+ vl_pcdltField = value;
}
}
@@ -849,11 +777,11 @@ namespace CsbBuilder
{
get
{
- return _p3d_vo;
+ return p3d_voField;
}
set
{
- _p3d_vo = value;
+ p3d_voField = value;
}
}
@@ -862,11 +790,11 @@ namespace CsbBuilder
{
get
{
- return _p3d_vg;
+ return p3d_vgField;
}
set
{
- _p3d_vg = value;
+ p3d_vgField = value;
}
}
@@ -875,11 +803,11 @@ namespace CsbBuilder
{
get
{
- return _p3d_ao;
+ return p3d_aoField;
}
set
{
- _p3d_ao = value;
+ p3d_aoField = value;
}
}
@@ -888,11 +816,11 @@ namespace CsbBuilder
{
get
{
- return _p3d_ag;
+ return p3d_agField;
}
set
{
- _p3d_ag = value;
+ p3d_agField = value;
}
}
@@ -901,11 +829,11 @@ namespace CsbBuilder
{
get
{
- return _p3d_ido;
+ return p3d_idoField;
}
set
{
- _p3d_ido = value;
+ p3d_idoField = value;
}
}
@@ -914,219 +842,219 @@ namespace CsbBuilder
{
get
{
- return _p3d_idg;
+ return p3d_idgField;
}
set
{
- _p3d_idg = value;
+ p3d_idgField = value;
}
}
[CriField("dry0g", 58)]
- public byte Dry0Gain
+ public byte Dry0g
{
get
{
- return _dry0g;
+ return dry0gField;
}
set
{
- _dry0g = value;
+ dry0gField = value;
}
}
[CriField("dry1g", 59)]
- public byte Dry1Gain
+ public byte Dry1g
{
get
{
- return _dry1g;
+ return dry1gField;
}
set
{
- _dry1g = value;
+ dry1gField = value;
}
}
[CriField("dry2g", 60)]
- public byte Dry2Gain
+ public byte Dry2g
{
get
{
- return _dry2g;
+ return dry2gField;
}
set
{
- _dry2g = value;
+ dry2gField = value;
}
}
[CriField("dry3g", 61)]
- public byte Dry3Gain
+ public byte Dry3g
{
get
{
- return _dry3g;
+ return dry3gField;
}
set
{
- _dry3g = value;
+ dry3gField = value;
}
}
[CriField("dry4g", 62)]
- public byte Dry4Gain
+ public byte Dry4g
{
get
{
- return _dry4g;
+ return dry4gField;
}
set
{
- _dry4g = value;
+ dry4gField = value;
}
}
[CriField("dry5g", 63)]
- public byte Dry5Gain
+ public byte Dry5g
{
get
{
- return _dry5g;
+ return dry5gField;
}
set
{
- _dry5g = value;
+ dry5gField = value;
}
}
[CriField("dry6g", 64)]
- public byte Dry6Gain
+ public byte Dry6g
{
get
{
- return _dry6g;
+ return dry6gField;
}
set
{
- _dry6g = value;
+ dry6gField = value;
}
}
[CriField("dry7g", 65)]
- public byte Dry7Gain
+ public byte Dry7g
{
get
{
- return _dry7g;
+ return dry7gField;
}
set
{
- _dry7g = value;
+ dry7gField = value;
}
}
[CriField("wet0g", 66)]
- public byte Wet0Gain
+ public byte Wet0g
{
get
{
- return _wet0g;
+ return wet0gField;
}
set
{
- _wet0g = value;
+ wet0gField = value;
}
}
[CriField("wet1g", 67)]
- public byte Wet1Gain
+ public byte Wet1g
{
get
{
- return _wet1g;
+ return wet1gField;
}
set
{
- _wet1g = value;
+ wet1gField = value;
}
}
[CriField("wet2g", 68)]
- public byte Wet2Gain
+ public byte Wet2g
{
get
{
- return _wet2g;
+ return wet2gField;
}
set
{
- _wet2g = value;
+ wet2gField = value;
}
}
[CriField("wet3g", 69)]
- public byte Wet3Gain
+ public byte Wet3g
{
get
{
- return _wet3g;
+ return wet3gField;
}
set
{
- _wet3g = value;
+ wet3gField = value;
}
}
[CriField("wet4g", 70)]
- public byte Wet4Gain
+ public byte Wet4g
{
get
{
- return _wet4g;
+ return wet4gField;
}
set
{
- _wet4g = value;
+ wet4gField = value;
}
}
[CriField("wet5g", 71)]
- public byte Wet5Gain
+ public byte Wet5g
{
get
{
- return _wet5g;
+ return wet5gField;
}
set
{
- _wet5g = value;
+ wet5gField = value;
}
}
[CriField("wet6g", 72)]
- public byte Wet6Gain
+ public byte Wet6g
{
get
{
- return _wet6g;
+ return wet6gField;
}
set
{
- _wet6g = value;
+ wet6gField = value;
}
}
[CriField("wet7g", 73)]
- public byte Wet7Gain
+ public byte Wet7g
{
get
{
- return _wet7g;
+ return wet7gField;
}
set
{
- _wet7g = value;
+ wet7gField = value;
}
}
@@ -1135,11 +1063,11 @@ namespace CsbBuilder
{
get
{
- return _f1_type;
+ return f1_typeField;
}
set
{
- _f1_type = value;
+ f1_typeField = value;
}
}
@@ -1148,11 +1076,11 @@ namespace CsbBuilder
{
get
{
- return _f1_cofo;
+ return f1_cofoField;
}
set
{
- _f1_cofo = value;
+ f1_cofoField = value;
}
}
@@ -1161,11 +1089,11 @@ namespace CsbBuilder
{
get
{
- return _f1_cofg;
+ return f1_cofgField;
}
set
{
- _f1_cofg = value;
+ f1_cofgField = value;
}
}
@@ -1174,11 +1102,11 @@ namespace CsbBuilder
{
get
{
- return _f1_resoo;
+ return f1_resooField;
}
set
{
- _f1_resoo = value;
+ f1_resooField = value;
}
}
@@ -1187,11 +1115,11 @@ namespace CsbBuilder
{
get
{
- return _f1_resog;
+ return f1_resogField;
}
set
{
- _f1_resog = value;
+ f1_resogField = value;
}
}
@@ -1200,11 +1128,11 @@ namespace CsbBuilder
{
get
{
- return _f2_type;
+ return f2_typeField;
}
set
{
- _f2_type = value;
+ f2_typeField = value;
}
}
@@ -1213,11 +1141,11 @@ namespace CsbBuilder
{
get
{
- return _f2_coflo;
+ return f2_cofloField;
}
set
{
- _f2_coflo = value;
+ f2_cofloField = value;
}
}
@@ -1226,11 +1154,11 @@ namespace CsbBuilder
{
get
{
- return _f2_coflg;
+ return f2_coflgField;
}
set
{
- _f2_coflg = value;
+ f2_coflgField = value;
}
}
@@ -1239,11 +1167,11 @@ namespace CsbBuilder
{
get
{
- return _f2_cofho;
+ return f2_cofhoField;
}
set
{
- _f2_cofho = value;
+ f2_cofhoField = value;
}
}
@@ -1252,11 +1180,11 @@ namespace CsbBuilder
{
get
{
- return _f2_cofhg;
+ return f2_cofhgField;
}
set
{
- _f2_cofhg = value;
+ f2_cofhgField = value;
}
}
@@ -1265,11 +1193,11 @@ namespace CsbBuilder
{
get
{
- return _probability;
+ return probabilityField;
}
set
{
- _probability = value;
+ probabilityField = value;
}
}
@@ -1278,11 +1206,11 @@ namespace CsbBuilder
{
get
{
- return _n_lmt_children;
+ return n_lmt_childrenField;
}
set
{
- _n_lmt_children = value;
+ n_lmt_childrenField = value;
}
}
@@ -1291,11 +1219,11 @@ namespace CsbBuilder
{
get
{
- return _repeat;
+ return repeatField;
}
set
{
- _repeat = value;
+ repeatField = value;
}
}
@@ -1304,11 +1232,11 @@ namespace CsbBuilder
{
get
{
- return _combo_time;
+ return combo_timeField;
}
set
{
- _combo_time = value;
+ combo_timeField = value;
}
}
@@ -1317,11 +1245,11 @@ namespace CsbBuilder
{
get
{
- return _combo_loop_back;
+ return combo_loop_backField;
}
set
{
- _combo_loop_back = value;
+ combo_loop_backField = value;
}
}
}
diff --git a/Source/CsbBuilder/CriTableVersionInfo.cs b/Source/CsbBuilder/Serialization/SerializationVersionInfoTable.cs
similarity index 57%
rename from Source/CsbBuilder/CriTableVersionInfo.cs
rename to Source/CsbBuilder/Serialization/SerializationVersionInfoTable.cs
index c4ce6e9..11ef395 100644
--- a/Source/CsbBuilder/CriTableVersionInfo.cs
+++ b/Source/CsbBuilder/Serialization/SerializationVersionInfoTable.cs
@@ -1,28 +1,24 @@
using System.IO;
using SonicAudioLib.CriMw.Serialization;
-using System;
-using System.Xml.Serialization;
-
-namespace CsbBuilder
+namespace CsbBuilder.Serialization
{
- [Serializable]
[CriSerializable("TBL_INFO")]
- public class CriTableVersionInfo
+ public class SerializationVersionInfoTable
{
- private uint _DataFmtVer = 0x940000;
- private uint _ExtSize = 0;
+ private uint DataFmtVerField = 0x940000;
+ private uint ExtSizeField = 0;
[CriField("DataFmtVer", 0)]
public uint DataFormatVersion
{
get
{
- return _DataFmtVer;
+ return DataFmtVerField;
}
set
{
- _DataFmtVer = value;
+ DataFmtVerField = value;
}
}
@@ -31,11 +27,11 @@ namespace CsbBuilder
{
get
{
- return _ExtSize;
+ return ExtSizeField;
}
set
{
- _ExtSize = value;
+ ExtSizeField = value;
}
}
}
diff --git a/Source/CsbBuilder/CriTableVoiceLimitGroup.cs b/Source/CsbBuilder/Serialization/SerializationVoiceLimitGroupTable.cs
similarity index 57%
rename from Source/CsbBuilder/CriTableVoiceLimitGroup.cs
rename to Source/CsbBuilder/Serialization/SerializationVoiceLimitGroupTable.cs
index f15a400..e23e4b1 100644
--- a/Source/CsbBuilder/CriTableVoiceLimitGroup.cs
+++ b/Source/CsbBuilder/Serialization/SerializationVoiceLimitGroupTable.cs
@@ -1,28 +1,24 @@
using System.IO;
using SonicAudioLib.CriMw.Serialization;
-using System;
-using System.Xml.Serialization;
-
-namespace CsbBuilder
+namespace CsbBuilder.Serialization
{
- [Serializable]
[CriSerializable("TBLVLG")]
- public class CriTableVoiceLimitGroup
+ public class SerializationVoiceLimitGroupTable
{
- private string _vlgname = string.Empty;
- private uint _vlgnvoice = 0;
+ private string vlgnameField = string.Empty;
+ private uint vlgnvoiceField = 0;
[CriField("vlgname", 0)]
public string VoiceLimitGroupName
{
get
{
- return _vlgname;
+ return vlgnameField;
}
set
{
- _vlgname = value;
+ vlgnameField = value;
}
}
@@ -31,11 +27,11 @@ namespace CsbBuilder
{
get
{
- return _vlgnvoice;
+ return vlgnvoiceField;
}
set
{
- _vlgnvoice = value;
+ vlgnvoiceField = value;
}
}
}
diff --git a/Source/CsbBuilder/SetAudioForm.Designer.cs b/Source/CsbBuilder/SetAudioForm.Designer.cs
new file mode 100644
index 0000000..5ef0298
--- /dev/null
+++ b/Source/CsbBuilder/SetAudioForm.Designer.cs
@@ -0,0 +1,193 @@
+namespace CsbBuilder
+{
+ partial class SetAudioForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.groupBox1 = new System.Windows.Forms.GroupBox();
+ this.swapButton = new System.Windows.Forms.Button();
+ this.okButton = new System.Windows.Forms.Button();
+ this.introBrowseButton = new System.Windows.Forms.Button();
+ this.cancelButton = new System.Windows.Forms.Button();
+ this.loopBrowseButton = new System.Windows.Forms.Button();
+ this.loopTextBox = new System.Windows.Forms.MaskedTextBox();
+ this.label2 = new System.Windows.Forms.Label();
+ this.label1 = new System.Windows.Forms.Label();
+ this.introTextBox = new System.Windows.Forms.MaskedTextBox();
+ this.groupBox1.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // groupBox1
+ //
+ this.groupBox1.Controls.Add(this.swapButton);
+ this.groupBox1.Controls.Add(this.okButton);
+ this.groupBox1.Controls.Add(this.introBrowseButton);
+ this.groupBox1.Controls.Add(this.cancelButton);
+ this.groupBox1.Controls.Add(this.loopBrowseButton);
+ this.groupBox1.Controls.Add(this.loopTextBox);
+ this.groupBox1.Controls.Add(this.label2);
+ this.groupBox1.Controls.Add(this.label1);
+ this.groupBox1.Controls.Add(this.introTextBox);
+ this.groupBox1.FlatStyle = System.Windows.Forms.FlatStyle.System;
+ this.groupBox1.Location = new System.Drawing.Point(12, 12);
+ this.groupBox1.Name = "groupBox1";
+ this.groupBox1.Size = new System.Drawing.Size(529, 102);
+ this.groupBox1.TabIndex = 7;
+ this.groupBox1.TabStop = false;
+ this.groupBox1.Text = "Audio";
+ //
+ // swapButton
+ //
+ this.swapButton.Anchor = System.Windows.Forms.AnchorStyles.None;
+ this.swapButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(162)));
+ this.swapButton.Location = new System.Drawing.Point(499, 17);
+ this.swapButton.Name = "swapButton";
+ this.swapButton.Size = new System.Drawing.Size(24, 50);
+ this.swapButton.TabIndex = 6;
+ this.swapButton.Text = "↕";
+ this.swapButton.UseVisualStyleBackColor = true;
+ this.swapButton.Click += new System.EventHandler(this.Swap);
+ //
+ // okButton
+ //
+ this.okButton.Anchor = System.Windows.Forms.AnchorStyles.None;
+ this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.okButton.FlatStyle = System.Windows.Forms.FlatStyle.System;
+ this.okButton.Location = new System.Drawing.Point(367, 73);
+ this.okButton.Name = "okButton";
+ this.okButton.Size = new System.Drawing.Size(75, 23);
+ this.okButton.TabIndex = 8;
+ this.okButton.Text = "OK";
+ this.okButton.UseVisualStyleBackColor = true;
+ //
+ // introBrowseButton
+ //
+ this.introBrowseButton.Anchor = System.Windows.Forms.AnchorStyles.None;
+ this.introBrowseButton.FlatStyle = System.Windows.Forms.FlatStyle.System;
+ this.introBrowseButton.Location = new System.Drawing.Point(418, 17);
+ this.introBrowseButton.Name = "introBrowseButton";
+ this.introBrowseButton.Size = new System.Drawing.Size(75, 23);
+ this.introBrowseButton.TabIndex = 5;
+ this.introBrowseButton.Text = "Browse";
+ this.introBrowseButton.UseVisualStyleBackColor = true;
+ this.introBrowseButton.Click += new System.EventHandler(this.BrowseIntro);
+ //
+ // cancelButton
+ //
+ this.cancelButton.Anchor = System.Windows.Forms.AnchorStyles.None;
+ this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+ this.cancelButton.FlatStyle = System.Windows.Forms.FlatStyle.System;
+ this.cancelButton.Location = new System.Drawing.Point(448, 73);
+ this.cancelButton.Name = "cancelButton";
+ this.cancelButton.Size = new System.Drawing.Size(75, 23);
+ this.cancelButton.TabIndex = 9;
+ this.cancelButton.Text = "Cancel";
+ this.cancelButton.UseVisualStyleBackColor = true;
+ //
+ // loopBrowseButton
+ //
+ this.loopBrowseButton.Anchor = System.Windows.Forms.AnchorStyles.None;
+ this.loopBrowseButton.FlatStyle = System.Windows.Forms.FlatStyle.System;
+ this.loopBrowseButton.Location = new System.Drawing.Point(418, 44);
+ this.loopBrowseButton.Name = "loopBrowseButton";
+ this.loopBrowseButton.Size = new System.Drawing.Size(75, 23);
+ this.loopBrowseButton.TabIndex = 4;
+ this.loopBrowseButton.Text = "Browse";
+ this.loopBrowseButton.UseVisualStyleBackColor = true;
+ this.loopBrowseButton.Click += new System.EventHandler(this.BrowseLoop);
+ //
+ // loopTextBox
+ //
+ this.loopTextBox.Anchor = System.Windows.Forms.AnchorStyles.None;
+ this.loopTextBox.ImeMode = System.Windows.Forms.ImeMode.NoControl;
+ this.loopTextBox.Location = new System.Drawing.Point(43, 45);
+ this.loopTextBox.Name = "loopTextBox";
+ this.loopTextBox.Size = new System.Drawing.Size(369, 20);
+ this.loopTextBox.TabIndex = 3;
+ //
+ // label2
+ //
+ this.label2.AutoSize = true;
+ this.label2.Location = new System.Drawing.Point(6, 48);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(34, 13);
+ this.label2.TabIndex = 2;
+ this.label2.Text = "Loop:";
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(9, 21);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(31, 13);
+ this.label1.TabIndex = 1;
+ this.label1.Text = "Intro:";
+ //
+ // introTextBox
+ //
+ this.introTextBox.Anchor = System.Windows.Forms.AnchorStyles.None;
+ this.introTextBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.introTextBox.ImeMode = System.Windows.Forms.ImeMode.NoControl;
+ this.introTextBox.Location = new System.Drawing.Point(43, 19);
+ this.introTextBox.Name = "introTextBox";
+ this.introTextBox.Size = new System.Drawing.Size(369, 20);
+ this.introTextBox.TabIndex = 0;
+ //
+ // SetAudioForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(554, 124);
+ this.Controls.Add(this.groupBox1);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "SetAudioForm";
+ this.ShowIcon = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+ this.Text = "Load Audio";
+ this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.OnClose);
+ this.groupBox1.ResumeLayout(false);
+ this.groupBox1.PerformLayout();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.GroupBox groupBox1;
+ private System.Windows.Forms.Button loopBrowseButton;
+ private System.Windows.Forms.MaskedTextBox loopTextBox;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.MaskedTextBox introTextBox;
+ private System.Windows.Forms.Button okButton;
+ private System.Windows.Forms.Button cancelButton;
+ private System.Windows.Forms.Button swapButton;
+ private System.Windows.Forms.Button introBrowseButton;
+ }
+}
\ No newline at end of file
diff --git a/Source/CsbBuilder/SetAudioForm.cs b/Source/CsbBuilder/SetAudioForm.cs
new file mode 100644
index 0000000..06f4d66
--- /dev/null
+++ b/Source/CsbBuilder/SetAudioForm.cs
@@ -0,0 +1,99 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using System.IO;
+
+namespace CsbBuilder
+{
+ public partial class SetAudioForm : Form
+ {
+ public SetAudioForm(string intro, string loop)
+ {
+ InitializeComponent();
+
+ introTextBox.Text = intro;
+ loopTextBox.Text = loop;
+ }
+
+ public string Intro
+ {
+ get
+ {
+ return introTextBox.Text;
+ }
+ }
+
+ public string Loop
+ {
+ get
+ {
+ return loopTextBox.Text;
+ }
+ }
+
+ private void Swap(object sender, EventArgs e)
+ {
+ string intro = introTextBox.Text;
+ string loop = loopTextBox.Text;
+
+ introTextBox.Text = loop;
+ loopTextBox.Text = intro;
+ }
+
+ private void BrowseIntro(object sender, EventArgs e)
+ {
+ using (OpenFileDialog openAdx = new OpenFileDialog
+ {
+ Title = "Please select your ADX file.",
+ Filter = "ADX Files|*.adx",
+ DefaultExt = "adx",
+ })
+ {
+ if (openAdx.ShowDialog() == DialogResult.OK)
+ {
+ introTextBox.Text = openAdx.FileName;
+ }
+ }
+ }
+
+ private void BrowseLoop(object sender, EventArgs e)
+ {
+ using (OpenFileDialog openAdx = new OpenFileDialog
+ {
+ Title = "Please select your ADX file.",
+ Filter = "ADX Files|*.adx",
+ DefaultExt = "adx",
+ })
+ {
+ if (openAdx.ShowDialog() == DialogResult.OK)
+ {
+ loopTextBox.Text = openAdx.FileName;
+ }
+ }
+ }
+
+ private void OnClose(object sender, FormClosingEventArgs e)
+ {
+ if (DialogResult == DialogResult.OK)
+ {
+ if ((!string.IsNullOrEmpty(Intro) && !File.Exists(Intro)) || (!string.IsNullOrEmpty(Loop) && !File.Exists(Loop)))
+ {
+ MessageBox.Show("File(s) not found.", "CSB Builder", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ e.Cancel = true;
+ }
+
+ if ((!string.IsNullOrEmpty(Intro) && !Intro.EndsWith(".adx")) || (!string.IsNullOrEmpty(Loop) && !Loop.EndsWith(".adx")))
+ {
+ MessageBox.Show("Please use an .ADX file.", "CSB Builder", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+ e.Cancel = true;
+ }
+ }
+ }
+ }
+}
diff --git a/Source/CsbBuilder/SetAudioForm.resx b/Source/CsbBuilder/SetAudioForm.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/Source/CsbBuilder/SetAudioForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Source/CsbBuilder/SetReferenceForm.Designer.cs b/Source/CsbBuilder/SetReferenceForm.Designer.cs
new file mode 100644
index 0000000..12b63be
--- /dev/null
+++ b/Source/CsbBuilder/SetReferenceForm.Designer.cs
@@ -0,0 +1,115 @@
+namespace CsbBuilder
+{
+ partial class SetReferenceForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.cancelButton = new System.Windows.Forms.Button();
+ this.okButton = new System.Windows.Forms.Button();
+ this.groupBox1 = new System.Windows.Forms.GroupBox();
+ this.nodeTree = new System.Windows.Forms.TreeView();
+ this.groupBox1.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // cancelButton
+ //
+ this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+ this.cancelButton.FlatStyle = System.Windows.Forms.FlatStyle.System;
+ this.cancelButton.Location = new System.Drawing.Point(389, 391);
+ this.cancelButton.Name = "cancelButton";
+ this.cancelButton.Size = new System.Drawing.Size(75, 23);
+ this.cancelButton.TabIndex = 8;
+ this.cancelButton.Text = "Cancel";
+ this.cancelButton.UseVisualStyleBackColor = true;
+ //
+ // okButton
+ //
+ this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.okButton.FlatStyle = System.Windows.Forms.FlatStyle.System;
+ this.okButton.Location = new System.Drawing.Point(308, 391);
+ this.okButton.Name = "okButton";
+ this.okButton.Size = new System.Drawing.Size(75, 23);
+ this.okButton.TabIndex = 7;
+ this.okButton.Text = "OK";
+ this.okButton.UseVisualStyleBackColor = true;
+ //
+ // groupBox1
+ //
+ this.groupBox1.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.groupBox1.AutoSize = true;
+ this.groupBox1.Controls.Add(this.nodeTree);
+ this.groupBox1.Location = new System.Drawing.Point(12, 12);
+ this.groupBox1.Name = "groupBox1";
+ this.groupBox1.Size = new System.Drawing.Size(452, 373);
+ this.groupBox1.TabIndex = 9;
+ this.groupBox1.TabStop = false;
+ this.groupBox1.Text = "Node Tree";
+ //
+ // nodeTree
+ //
+ this.nodeTree.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.nodeTree.HideSelection = false;
+ this.nodeTree.Location = new System.Drawing.Point(3, 16);
+ this.nodeTree.Name = "nodeTree";
+ this.nodeTree.PathSeparator = "/";
+ this.nodeTree.Size = new System.Drawing.Size(446, 354);
+ this.nodeTree.TabIndex = 0;
+ this.nodeTree.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.nodeTree_NodeMouseDoubleClick);
+ //
+ // SetReferenceForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(476, 426);
+ this.Controls.Add(this.groupBox1);
+ this.Controls.Add(this.cancelButton);
+ this.Controls.Add(this.okButton);
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "SetReferenceForm";
+ this.ShowIcon = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+ this.Text = "Please select the node you want to set as reference.";
+ this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.SetReferenceForm_FormClosing);
+ this.groupBox1.ResumeLayout(false);
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Button cancelButton;
+ private System.Windows.Forms.Button okButton;
+ private System.Windows.Forms.GroupBox groupBox1;
+ private System.Windows.Forms.TreeView nodeTree;
+ }
+}
\ No newline at end of file
diff --git a/Source/CsbBuilder/SetReferenceForm.cs b/Source/CsbBuilder/SetReferenceForm.cs
new file mode 100644
index 0000000..4834e16
--- /dev/null
+++ b/Source/CsbBuilder/SetReferenceForm.cs
@@ -0,0 +1,96 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+using CsbBuilder.BuilderNode;
+
+namespace CsbBuilder
+{
+ public partial class SetReferenceForm : Form
+ {
+ public TreeNode SelectedNode
+ {
+ get
+ {
+ return nodeTree.SelectedNode;
+ }
+ }
+
+ public SetReferenceForm(TreeView treeView)
+ {
+ InitializeComponent();
+
+ nodeTree.ImageList = treeView.ImageList;
+
+ foreach (TreeNode treeNode in treeView.Nodes)
+ {
+ AddNode(treeNode, null);
+ }
+
+ nodeTree.ExpandAll();
+ }
+
+ private void AddNode(TreeNode treeNode, TreeNode parentNode)
+ {
+ bool cancel = false;
+
+ if (treeNode.Tag is BuilderSynthNode)
+ {
+ BuilderSynthNode synthNode = (BuilderSynthNode)treeNode.Tag;
+ if (treeNode.Parent != null && treeNode.Parent.Tag != null && synthNode.Type == 0)
+ {
+ cancel = true;
+ }
+ }
+
+ TreeNode newNode = null;
+ if (!cancel)
+ {
+ newNode = new TreeNode();
+ newNode.Name = treeNode.Name;
+ newNode.Text = treeNode.Text;
+ newNode.ImageIndex = treeNode.ImageIndex;
+ newNode.SelectedImageIndex = treeNode.SelectedImageIndex;
+
+ if (parentNode != null)
+ {
+ parentNode.Nodes.Add(newNode);
+ }
+
+ else
+ {
+ nodeTree.Nodes.Add(newNode);
+ }
+ }
+
+ foreach (TreeNode childNode in treeNode.Nodes)
+ {
+ AddNode(childNode, newNode);
+ }
+ }
+
+ private void SetReferenceForm_FormClosing(object sender, FormClosingEventArgs e)
+ {
+ if (DialogResult == DialogResult.OK)
+ {
+ if (SelectedNode != null && SelectedNode.ImageIndex == 3)
+ {
+ MessageBox.Show("You can't set a folder as a reference!", "CSB Builder", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ e.Cancel = true;
+ }
+ }
+ }
+
+ private void nodeTree_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
+ {
+ Close();
+ DialogResult = DialogResult.OK;
+ }
+ }
+}
diff --git a/Source/CsbBuilder/SetReferenceForm.resx b/Source/CsbBuilder/SetReferenceForm.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/Source/CsbBuilder/SetReferenceForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Source/CsbBuilder/packages.config b/Source/CsbBuilder/packages.config
new file mode 100644
index 0000000..14d3468
--- /dev/null
+++ b/Source/CsbBuilder/packages.config
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/Source/CsbEditor/Properties/AssemblyInfo.cs b/Source/CsbEditor/Properties/AssemblyInfo.cs
index ba36765..bda939e 100644
--- a/Source/CsbEditor/Properties/AssemblyInfo.cs
+++ b/Source/CsbEditor/Properties/AssemblyInfo.cs
@@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CsbEditor")]
-[assembly: AssemblyCopyright("Copyright © 2016")]
+[assembly: AssemblyCopyright("Copyright © blueskythlikesclouds 2014-2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -32,5 +32,4 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: AssemblyVersion("0.2.*")]
diff --git a/Source/SonicAudioCmd/Program.cs b/Source/SonicAudioCmd/Program.cs
index d9c2750..3fb46c1 100644
--- a/Source/SonicAudioCmd/Program.cs
+++ b/Source/SonicAudioCmd/Program.cs
@@ -20,47 +20,7 @@ namespace SonicAudioCmd
{
static void Main(string[] args)
{
- if (args[0].EndsWith(".cpk"))
- {
- CriCpkArchive archive = new CriCpkArchive();
- archive.Load(args[0]);
- //archive.Print();
-
- foreach (CriCpkEntry entry in archive)
- {
- using (Stream source = File.OpenRead(args[0]), substream = entry.Open(source))
- {
- FileInfo fileInfo = new FileInfo(Path.Combine(Path.GetFileNameWithoutExtension(args[0]), entry.DirectoryName != null ? entry.DirectoryName : "", entry.Name != null ? entry.Name : entry.Id.ToString() + ".bin"));
- fileInfo.Directory.Create();
- using (Stream destination = fileInfo.Create())
- {
- substream.CopyTo(destination);
- }
- fileInfo.LastWriteTime = entry.UpdateDateTime;
- }
- }
- }
-
- else
- {
- CriCpkArchive archive = new CriCpkArchive();
- archive.Align = 16;
- archive.Mode = CriCpkMode.Id;
-
- uint id = 0;
- foreach (string file in Directory.GetFiles(args[0], "*", SearchOption.AllDirectories))
- {
- CriCpkEntry entry = new CriCpkEntry();
- entry.Id = id;
- entry.Name = Path.GetFileName(file);
- entry.DirectoryName = Path.GetDirectoryName(file.Replace(args[0] + "\\", ""));
- entry.FilePath = new FileInfo(file);
- archive.Add(entry);
- id++;
- }
-
- archive.Save(args[0] + ".cpk");
- }
+ // What are you looking at? There's nothing here. Go away.
}
}
}
diff --git a/Source/SonicAudioCmd/Properties/AssemblyInfo.cs b/Source/SonicAudioCmd/Properties/AssemblyInfo.cs
index a8563c3..7078b76 100644
--- a/Source/SonicAudioCmd/Properties/AssemblyInfo.cs
+++ b/Source/SonicAudioCmd/Properties/AssemblyInfo.cs
@@ -33,4 +33,3 @@ using System.Runtime.InteropServices;
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Source/SonicAudioCmd/cpk_packer.txt b/Source/SonicAudioCmd/cpk_packer.txt
new file mode 100644
index 0000000..440f728
--- /dev/null
+++ b/Source/SonicAudioCmd/cpk_packer.txt
@@ -0,0 +1,72 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.IO;
+using System.IO.Compression;
+using System.ComponentModel;
+using System.Collections;
+using System.Threading;
+
+using SonicAudioLib;
+using SonicAudioLib.Archive;
+using SonicAudioLib.IO;
+using SonicAudioLib.CriMw;
+
+using System.Xml;
+
+namespace SonicAudioCmd
+{
+ class Program
+ {
+ static void Main(string[] args)
+ {
+ if (args[0].EndsWith(".cpk"))
+ {
+ CriCpkArchive archive = new CriCpkArchive();
+ archive.Load(args[0]);
+ //archive.Print();
+
+ foreach (CriCpkEntry entry in archive)
+ {
+ new Thread(new ThreadStart(delegate
+ {
+ using (Stream source = File.OpenRead(args[0]), substream = entry.Open(source))
+ {
+ Console.WriteLine("Extracting {0}{1}", entry.DirectoryName, entry.Name);
+
+ FileInfo fileInfo = new FileInfo(Path.Combine(Path.GetFileNameWithoutExtension(args[0]), entry.DirectoryName != null ? entry.DirectoryName : "", entry.Name != null ? entry.Name : entry.Id.ToString() + ".bin"));
+ fileInfo.Directory.Create();
+ using (Stream destination = fileInfo.Create())
+ {
+ substream.CopyTo(destination);
+ }
+ fileInfo.LastWriteTime = entry.UpdateDateTime;
+ }
+ })).Start();
+ }
+ }
+
+ else
+ {
+ CriCpkArchive archive = new CriCpkArchive();
+ archive.Align = 16;
+ archive.Mode = CriCpkMode.Id;
+
+ uint id = 0;
+ foreach (string file in Directory.GetFiles(args[0], "*", SearchOption.AllDirectories))
+ {
+ CriCpkEntry entry = new CriCpkEntry();
+ entry.Id = id;
+ entry.Name = Path.GetFileName(file);
+ entry.DirectoryName = Path.GetDirectoryName(file.Replace(args[0] + "\\", ""));
+ entry.FilePath = new FileInfo(file);
+ archive.Add(entry);
+ id++;
+ }
+
+ archive.Save(args[0] + ".cpk");
+ }
+ }
+ }
+}
diff --git a/Source/SonicAudioLib/Archive/CriCpkArchive.cs b/Source/SonicAudioLib/Archive/CriCpkArchive.cs
index 7fe6c90..098ad14 100644
--- a/Source/SonicAudioLib/Archive/CriCpkArchive.cs
+++ b/Source/SonicAudioLib/Archive/CriCpkArchive.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
+using System.Reflection;
using SonicAudioLib.IO;
using SonicAudioLib.CriMw;
@@ -63,9 +64,9 @@ namespace SonicAudioLib.Archive
set
{
- if (value <= 0)
+ if (align != 1)
{
- value = 1;
+ new NotImplementedException("Currently, alignment handling in .CPK files is broken. Always use 1.");
}
align = value;
@@ -93,12 +94,15 @@ namespace SonicAudioLib.Archive
{
reader.Read();
-#if DEBUG
- for (int i = 0; i < reader.NumberOfFields; i++)
+ // The older CPK versions don't have the CpkMode field, and the other stuff. I will add
+ // support for the older versions when someone reports it. I need file examples.
+ ushort version = reader.GetUInt16("Version");
+ ushort revision = reader.GetUInt16("Revision");
+
+ if (version != 7 && revision != 2)
{
- Console.WriteLine("{0} ({1}): {2}", reader.GetFieldName(i), reader.GetFieldFlag(i), reader.GetValue(i));
+ throw new Exception($"This CPK file version ({version}.{revision}) isn't supported yet! Please report the error with the file if you want support for this CPK version.");
}
-#endif
mode = (CriCpkMode)reader.GetUInt32("CpkMode");
@@ -129,11 +133,7 @@ namespace SonicAudioLib.Archive
entry.Position = (long)tocReader.GetUInt64("FileOffset");
entry.Id = tocReader.GetUInt32("ID");
entry.Comment = tocReader.GetString("UserString");
-
- if (entry.Length != tocReader.GetUInt32("ExtractSize"))
- {
- entry.IsCompressed = true;
- }
+ entry.IsCompressed = entry.Length != tocReader.GetUInt32("ExtractSize");
if (contentPosition < tocPosition)
{
@@ -181,11 +181,7 @@ namespace SonicAudioLib.Archive
CriCpkEntry entry = new CriCpkEntry();
entry.Id = dataReader.GetUInt16("ID");
entry.Length = dataReader.GetUInt16("FileSize");
-
- if (entry.Length != dataReader.GetUInt16("ExtractSize"))
- {
- entry.IsCompressed = true;
- }
+ entry.IsCompressed = entry.Length != dataReader.GetUInt16("ExtractSize");
entries.Add(entry);
}
@@ -201,11 +197,7 @@ namespace SonicAudioLib.Archive
CriCpkEntry entry = new CriCpkEntry();
entry.Id = dataReader.GetUInt16("ID");
entry.Length = dataReader.GetUInt32("FileSize");
-
- if (entry.Length != dataReader.GetUInt32("ExtractSize"))
- {
- entry.IsCompressed = true;
- }
+ entry.IsCompressed = entry.Length != dataReader.GetUInt32("ExtractSize");
entries.Add(entry);
}
@@ -325,6 +317,8 @@ namespace SonicAudioLib.Archive
tocMemoryStream = new MemoryStream();
etocMemoryStream = new MemoryStream();
+ var orderedEntries = entries.OrderBy(entry => entry.Name).ToList();
+
using (CriCpkSection tocSection = new CriCpkSection(tocMemoryStream, "TOC "))
using (CriCpkSection etocSection = new CriCpkSection(etocMemoryStream, "ETOC"))
{
@@ -343,20 +337,20 @@ namespace SonicAudioLib.Archive
etocSection.Writer.WriteField("UpdateDateTime", typeof(ulong));
etocSection.Writer.WriteField("LocalDir", typeof(string));
- foreach (CriCpkEntry entry in entries)
+ foreach (CriCpkEntry entry in orderedEntries)
{
- tocSection.Writer.WriteRow(true,
- (entry.DirectoryName).Replace('\\', '/'),
- entry.Name,
- (uint)entry.Length,
- (uint)entry.Length,
- (ulong)(vldPool.Length - 2048),
- entry.Id,
+ tocSection.Writer.WriteRow(true,
+ (entry.DirectoryName).Replace('\\', '/'),
+ entry.Name,
+ (uint)entry.Length,
+ (uint)entry.Length,
+ (ulong)(vldPool.Length - 2048),
+ entry.Id,
entry.Comment);
- etocSection.Writer.WriteRow(true,
- CpkDateTimeFromDateTime(entry.UpdateDateTime),
- entry.DirectoryName);
+ etocSection.Writer.WriteRow(true,
+ CpkDateTimeFromDateTime(entry.UpdateDateTime),
+ entry.FilePath.DirectoryName.Replace('\\', '/'));
vldPool.Put(entry.FilePath);
}
@@ -376,11 +370,11 @@ namespace SonicAudioLib.Archive
itocSection.Writer.WriteField("ID", typeof(int));
itocSection.Writer.WriteField("TocIndex", typeof(int));
- foreach (CriCpkEntry entry in entries)
+ foreach (CriCpkEntry entry in orderedEntries)
{
- itocSection.Writer.WriteRow(true,
- (int)entry.Id,
- entries.IndexOf(entry));
+ itocSection.Writer.WriteRow(true,
+ (int)entry.Id,
+ orderedEntries.IndexOf(entry));
}
itocSection.Writer.WriteEndTable();
@@ -417,9 +411,9 @@ namespace SonicAudioLib.Archive
foreach (CriCpkEntry entry in filesL)
{
- dataWriter.WriteRow(true,
- (ushort)entry.Id,
- (ushort)entry.Length,
+ dataWriter.WriteRow(true,
+ (ushort)entry.Id,
+ (ushort)entry.Length,
(ushort)entry.Length);
}
@@ -439,9 +433,9 @@ namespace SonicAudioLib.Archive
foreach (CriCpkEntry entry in filesH)
{
- dataWriter.WriteRow(true,
- (ushort)entry.Id,
- (uint)entry.Length,
+ dataWriter.WriteRow(true,
+ (ushort)entry.Id,
+ (uint)entry.Length,
(uint)entry.Length);
}
@@ -508,7 +502,7 @@ namespace SonicAudioLib.Archive
cpkSection.Writer.WriteValue("Sorted", (ushort)1);
cpkSection.Writer.WriteValue("CpkMode", (uint)mode);
- cpkSection.Writer.WriteValue("Tvers", "SONICAUDIOLIB, DLL1.0.0.0");
+ cpkSection.Writer.WriteValue("Tvers", GetToolVersion());
cpkSection.Writer.WriteValue("Comment", Comment);
cpkSection.Writer.WriteValue("FileSize", (ulong)vldPool.Length);
@@ -557,10 +551,16 @@ namespace SonicAudioLib.Archive
private ulong CpkDateTimeFromDateTime(DateTime dateTime)
{
- return ((((ulong)dateTime.Year * 0x100 + (uint)dateTime.Month) * 0x100 + (uint)dateTime.Day) * 0x100000000) +
+ return ((((ulong)dateTime.Year * 0x100 + (uint)dateTime.Month) * 0x100 + (uint)dateTime.Day) * 0x100000000) +
((((ulong)dateTime.Hour * 0x100 + (uint)dateTime.Minute) * 0x100 + (uint)dateTime.Second) * 0x100);
}
+ private string GetToolVersion()
+ {
+ AssemblyName assemblyName = Assembly.GetEntryAssembly().GetName();
+ return $"{assemblyName.Name}, {assemblyName.Version.ToString()}";
+ }
+
private class CriCpkSection : IDisposable
{
private Stream destination;
@@ -622,4 +622,4 @@ namespace SonicAudioLib.Archive
}
}
}
-}
+}
\ No newline at end of file
diff --git a/Source/SonicAudioLib/CriMw/CriTableReader.cs b/Source/SonicAudioLib/CriMw/CriTableReader.cs
index 0c95a5c..c869834 100644
--- a/Source/SonicAudioLib/CriMw/CriTableReader.cs
+++ b/Source/SonicAudioLib/CriMw/CriTableReader.cs
@@ -195,6 +195,11 @@ namespace SonicAudioLib.CriMw
{
return fields.FindIndex(field => field.Name == fieldName);
}
+
+ public bool ContainsField(string fieldName)
+ {
+ return fields.Exists(field => field.Name == fieldName);
+ }
private void GoToValue(int fieldIndex)
{
diff --git a/Source/SonicAudioLib/CriMw/Serialization/CriTableSerializer.cs b/Source/SonicAudioLib/CriMw/Serialization/CriTableSerializer.cs
index 63c5365..1ba93ed 100644
--- a/Source/SonicAudioLib/CriMw/Serialization/CriTableSerializer.cs
+++ b/Source/SonicAudioLib/CriMw/Serialization/CriTableSerializer.cs
@@ -163,7 +163,7 @@ namespace SonicAudioLib.CriMw.Serialization
if (defaultValue is bool)
{
- defaultValue = (bool)defaultValue == true ? 1 : 0;
+ defaultValue = ((bool)defaultValue == true) ? (byte)1 : (byte)0;
}
else if (defaultValue is Enum)
@@ -199,7 +199,7 @@ namespace SonicAudioLib.CriMw.Serialization
if (value is bool)
{
- value = (bool)value == true ? 1 : 0;
+ value = ((bool)value == true) ? (byte)1 : (byte)0;
}
else if (value is Enum)
@@ -236,6 +236,11 @@ namespace SonicAudioLib.CriMw.Serialization
public static ArrayList Deserialize(byte[] sourceByteArray, Type type)
{
+ if (sourceByteArray == null || sourceByteArray.Length == 0)
+ {
+ return new ArrayList();
+ }
+
using (MemoryStream source = new MemoryStream(sourceByteArray))
{
return Deserialize(source, type);
@@ -244,6 +249,11 @@ namespace SonicAudioLib.CriMw.Serialization
public static ArrayList Deserialize(string sourceFileName, Type type)
{
+ if (!File.Exists(sourceFileName))
+ {
+ return new ArrayList();
+ }
+
using (Stream source = File.OpenRead(sourceFileName))
{
return Deserialize(source, type);
@@ -256,49 +266,55 @@ namespace SonicAudioLib.CriMw.Serialization
using (CriTableReader tableReader = CriTableReader.Create(source, true))
{
- PropertyInfo[] propertyInfos = type.GetProperties();
+ IEnumerable propertyInfos = type.GetProperties().Where(property =>
+ {
+ if (property.GetCustomAttribute() == null)
+ {
+ string fieldName = property.Name;
+
+ if (property.GetCustomAttribute() != null)
+ {
+ fieldName = property.GetCustomAttribute().FieldName;
+ }
+
+ return tableReader.ContainsField(fieldName);
+ }
+
+ return false;
+ });
while (tableReader.Read())
{
object obj = Activator.CreateInstance(type);
- for (int i = 0; i < tableReader.NumberOfFields; i++)
+ // I hope this is faster than the old method lol
+ foreach (PropertyInfo propertyInfo in propertyInfos)
{
- string fieldName = tableReader.GetFieldName(i);
+ string fieldName = propertyInfo.Name;
- foreach (PropertyInfo propertyInfo in propertyInfos)
+ if (propertyInfo.GetCustomAttribute() != null)
{
- string fieldNameMatch = propertyInfo.Name;
-
- CriFieldAttribute fieldAttribute = propertyInfo.GetCustomAttribute();
-
- if (fieldAttribute != null && !string.IsNullOrEmpty(fieldAttribute.FieldName))
- {
- fieldNameMatch = fieldAttribute.FieldName;
- }
-
- if (fieldName == fieldNameMatch)
- {
- object value = tableReader.GetValue(i);
- if (propertyInfo.PropertyType == typeof(byte[]) && value is Substream)
- {
- value = ((Substream)value).ToArray();
- }
-
- if (propertyInfo.PropertyType == typeof(bool))
- {
- value = (byte)value != 0;
- }
-
- else if (propertyInfo.PropertyType.IsEnum)
- {
- value = Enum.ToObject(propertyInfo.PropertyType, value);
- }
-
- propertyInfo.SetValue(obj, value);
- break;
- }
+ fieldName = propertyInfo.GetCustomAttribute().FieldName;
}
+
+ object value = tableReader.GetValue(fieldName);
+
+ if (value is Substream)
+ {
+ value = ((Substream)value).ToArray();
+ }
+
+ else if (value is byte && propertyInfo.PropertyType == typeof(bool))
+ {
+ value = (byte)value == 1;
+ }
+
+ else if (propertyInfo.PropertyType.IsEnum)
+ {
+ value = Convert.ChangeType(value, Enum.GetUnderlyingType(propertyInfo.PropertyType));
+ }
+
+ propertyInfo.SetValue(obj, value);
}
arrayList.Add(obj);
diff --git a/Source/SonicAudioLib/Properties/AssemblyInfo.cs b/Source/SonicAudioLib/Properties/AssemblyInfo.cs
index efb864a..9588bfa 100644
--- a/Source/SonicAudioLib/Properties/AssemblyInfo.cs
+++ b/Source/SonicAudioLib/Properties/AssemblyInfo.cs
@@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SonicAudioLib")]
-[assembly: AssemblyCopyright("Copyright © blueskythlikesclouds 2014-2016")]
+[assembly: AssemblyCopyright("Copyright © blueskythlikesclouds 2014-2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -32,5 +32,4 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: AssemblyVersion("0.1.*")]