Audio explorer progress

This commit is contained in:
dexy 2022-01-14 04:33:20 +11:00
parent df79715e6b
commit 75c3a0690b
8 changed files with 664 additions and 286 deletions

File diff suppressed because it is too large Load Diff

View File

@ -512,7 +512,6 @@
//
// ToolsAudioExplorerMenu
//
this.ToolsAudioExplorerMenu.Enabled = false;
this.ToolsAudioExplorerMenu.Name = "ToolsAudioExplorerMenu";
this.ToolsAudioExplorerMenu.Size = new System.Drawing.Size(180, 22);
this.ToolsAudioExplorerMenu.Text = "Audio Explorer";

View File

@ -241,10 +241,6 @@ namespace CodeWalker
Scenarios.EnsureScenarioTypes(FileCache);
UpdateStatus("File cache loaded.");
Invoke(new Action(() => {
ToolsAudioExplorerMenu.Enabled = true;
}));
}
}
});
@ -4334,13 +4330,13 @@ namespace CodeWalker
private void ToolsBinSearchMenu_Click(object sender, EventArgs e)
{
BinarySearchForm f = new BinarySearchForm(FileCache);
BinarySearchForm f = new BinarySearchForm(GetFileCache());
f.Show(this);
}
private void ToolsAudioExplorerMenu_Click(object sender, EventArgs e)
{
AudioExplorerForm f = new AudioExplorerForm(FileCache);
AudioExplorerForm f = new AudioExplorerForm(GetFileCache());
f.Show(this);
}
@ -4352,7 +4348,7 @@ namespace CodeWalker
private void ToolsJenkIndMenu_Click(object sender, EventArgs e)
{
JenkIndForm f = new JenkIndForm(FileCache);
JenkIndForm f = new JenkIndForm(GetFileCache());
f.Show(this);
}

View File

@ -304,7 +304,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADo
HwAAAk1TRnQBSQFMAgEBGAEAAcgBAQHIAQEBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
HwAAAk1TRnQBSQFMAgEBGAEAAdABAQHQAQEBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAAXADAAEBAQABCAYAARwYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA

View File

@ -37,7 +37,7 @@
this.label16 = new System.Windows.Forms.Label();
this.MloRoomTextBox = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.Hash1TextBox = new System.Windows.Forms.TextBox();
this.ZoneTextBox = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.Unk02TextBox = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
@ -47,7 +47,7 @@
this.label5 = new System.Windows.Forms.Label();
this.EchoTextBox = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.Unk06TextBox = new System.Windows.Forms.TextBox();
this.SoundTextBox = new System.Windows.Forms.TextBox();
this.label7 = new System.Windows.Forms.Label();
this.Unk07TextBox = new System.Windows.Forms.TextBox();
this.label8 = new System.Windows.Forms.Label();
@ -63,7 +63,7 @@
this.label15 = new System.Windows.Forms.Label();
this.Unk13TextBox = new System.Windows.Forms.TextBox();
this.label17 = new System.Windows.Forms.Label();
this.Unk14TextBox = new System.Windows.Forms.TextBox();
this.SoundSetTextBox = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// label12
@ -139,19 +139,19 @@
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(9, 63);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(64, 13);
this.label1.Size = new System.Drawing.Size(35, 13);
this.label1.TabIndex = 66;
this.label1.Text = "Ref Hash 1:";
this.label1.Text = "Zone:";
//
// Hash1TextBox
// ZoneTextBox
//
this.Hash1TextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
this.ZoneTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.Hash1TextBox.Location = new System.Drawing.Point(86, 60);
this.Hash1TextBox.Name = "Hash1TextBox";
this.Hash1TextBox.Size = new System.Drawing.Size(237, 20);
this.Hash1TextBox.TabIndex = 67;
this.Hash1TextBox.TextChanged += new System.EventHandler(this.Hash1TextBox_TextChanged);
this.ZoneTextBox.Location = new System.Drawing.Point(86, 60);
this.ZoneTextBox.Name = "ZoneTextBox";
this.ZoneTextBox.Size = new System.Drawing.Size(237, 20);
this.ZoneTextBox.TabIndex = 67;
this.ZoneTextBox.TextChanged += new System.EventHandler(this.Hash1TextBox_TextChanged);
//
// label2
//
@ -196,11 +196,11 @@
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(9, 135);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(42, 13);
this.label4.Size = new System.Drawing.Size(45, 13);
this.label4.TabIndex = 72;
this.label4.Text = "Reverb:";
//
// Unk04TextBox
// ReverbTextBox
//
this.ReverbTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
@ -215,11 +215,11 @@
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(9, 159);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(42, 13);
this.label5.Size = new System.Drawing.Size(35, 13);
this.label5.TabIndex = 74;
this.label5.Text = "Echo:";
//
// Unk05TextBox
// EchoTextBox
//
this.EchoTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
@ -234,19 +234,19 @@
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(9, 183);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(68, 13);
this.label6.Size = new System.Drawing.Size(41, 13);
this.label6.TabIndex = 76;
this.label6.Text = "Unk06 hash:";
this.label6.Text = "Sound:";
//
// Unk06TextBox
// SoundTextBox
//
this.Unk06TextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
this.SoundTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.Unk06TextBox.Location = new System.Drawing.Point(86, 180);
this.Unk06TextBox.Name = "Unk06TextBox";
this.Unk06TextBox.Size = new System.Drawing.Size(237, 20);
this.Unk06TextBox.TabIndex = 77;
this.Unk06TextBox.TextChanged += new System.EventHandler(this.Unk06TextBox_TextChanged);
this.SoundTextBox.Location = new System.Drawing.Point(86, 180);
this.SoundTextBox.Name = "SoundTextBox";
this.SoundTextBox.Size = new System.Drawing.Size(237, 20);
this.SoundTextBox.TabIndex = 77;
this.SoundTextBox.TextChanged += new System.EventHandler(this.Unk06TextBox_TextChanged);
//
// label7
//
@ -386,19 +386,19 @@
this.label17.AutoSize = true;
this.label17.Location = new System.Drawing.Point(9, 375);
this.label17.Name = "label17";
this.label17.Size = new System.Drawing.Size(68, 13);
this.label17.Size = new System.Drawing.Size(58, 13);
this.label17.TabIndex = 92;
this.label17.Text = "Unk14 hash:";
this.label17.Text = "Sound set:";
//
// Unk14TextBox
// SoundSetTextBox
//
this.Unk14TextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
this.SoundSetTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.Unk14TextBox.Location = new System.Drawing.Point(86, 372);
this.Unk14TextBox.Name = "Unk14TextBox";
this.Unk14TextBox.Size = new System.Drawing.Size(237, 20);
this.Unk14TextBox.TabIndex = 93;
this.Unk14TextBox.TextChanged += new System.EventHandler(this.Unk14TextBox_TextChanged);
this.SoundSetTextBox.Location = new System.Drawing.Point(86, 372);
this.SoundSetTextBox.Name = "SoundSetTextBox";
this.SoundSetTextBox.Size = new System.Drawing.Size(237, 20);
this.SoundSetTextBox.TabIndex = 93;
this.SoundSetTextBox.TextChanged += new System.EventHandler(this.Unk14TextBox_TextChanged);
//
// EditAudioInteriorRoomPanel
//
@ -406,7 +406,7 @@
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(562, 450);
this.Controls.Add(this.label17);
this.Controls.Add(this.Unk14TextBox);
this.Controls.Add(this.SoundSetTextBox);
this.Controls.Add(this.label15);
this.Controls.Add(this.Unk13TextBox);
this.Controls.Add(this.label14);
@ -422,7 +422,7 @@
this.Controls.Add(this.label7);
this.Controls.Add(this.Unk07TextBox);
this.Controls.Add(this.label6);
this.Controls.Add(this.Unk06TextBox);
this.Controls.Add(this.SoundTextBox);
this.Controls.Add(this.label5);
this.Controls.Add(this.EchoTextBox);
this.Controls.Add(this.label4);
@ -432,7 +432,7 @@
this.Controls.Add(this.label2);
this.Controls.Add(this.Unk02TextBox);
this.Controls.Add(this.label1);
this.Controls.Add(this.Hash1TextBox);
this.Controls.Add(this.ZoneTextBox);
this.Controls.Add(this.label16);
this.Controls.Add(this.MloRoomTextBox);
this.Controls.Add(this.label13);
@ -458,7 +458,7 @@
private System.Windows.Forms.Label label16;
private System.Windows.Forms.TextBox MloRoomTextBox;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox Hash1TextBox;
private System.Windows.Forms.TextBox ZoneTextBox;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox Unk02TextBox;
private System.Windows.Forms.Label label3;
@ -468,7 +468,7 @@
private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox EchoTextBox;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.TextBox Unk06TextBox;
private System.Windows.Forms.TextBox SoundTextBox;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.TextBox Unk07TextBox;
private System.Windows.Forms.Label label8;
@ -484,6 +484,6 @@
private System.Windows.Forms.Label label15;
private System.Windows.Forms.TextBox Unk13TextBox;
private System.Windows.Forms.Label label17;
private System.Windows.Forms.TextBox Unk14TextBox;
private System.Windows.Forms.TextBox SoundSetTextBox;
}
}

View File

@ -49,12 +49,12 @@ namespace CodeWalker.Project.Panels
populatingui = true;
NameTextBox.Text = string.Empty;
MloRoomTextBox.Text = string.Empty;
Hash1TextBox.Text = string.Empty;
ZoneTextBox.Text = string.Empty;
Unk02TextBox.Text = string.Empty;
Unk03TextBox.Text = string.Empty;
ReverbTextBox.Text = string.Empty;
EchoTextBox.Text = string.Empty;
Unk06TextBox.Text = string.Empty;
SoundTextBox.Text = string.Empty;
Unk07TextBox.Text = string.Empty;
Unk08TextBox.Text = string.Empty;
Unk09TextBox.Text = string.Empty;
@ -62,7 +62,7 @@ namespace CodeWalker.Project.Panels
Unk11TextBox.Text = string.Empty;
Unk12TextBox.Text = string.Empty;
Unk13TextBox.Text = string.Empty;
Unk14TextBox.Text = string.Empty;
SoundSetTextBox.Text = string.Empty;
Flags0TextBox.Text = string.Empty;
populatingui = false;
}
@ -76,12 +76,12 @@ namespace CodeWalker.Project.Panels
NameTextBox.Text = cr.NameHash.ToString();
MloRoomTextBox.Text = cr.MloRoom.ToString();
Hash1TextBox.Text = cr.Hash1.ToString();
ZoneTextBox.Text = cr.Zone.ToString();
Unk02TextBox.Text = cr.Unk02.ToString();
Unk03TextBox.Text = FloatUtil.ToString(cr.Unk03);
ReverbTextBox.Text = FloatUtil.ToString(cr.Reverb);
EchoTextBox.Text = FloatUtil.ToString(cr.Echo);
Unk06TextBox.Text = cr.Unk06.ToString();
SoundTextBox.Text = cr.Sound.ToString();
Unk07TextBox.Text = FloatUtil.ToString(cr.Unk07);
Unk08TextBox.Text = FloatUtil.ToString(cr.Unk08);
Unk09TextBox.Text = FloatUtil.ToString(cr.Unk09);
@ -89,7 +89,7 @@ namespace CodeWalker.Project.Panels
Unk11TextBox.Text = FloatUtil.ToString(cr.Unk11);
Unk12TextBox.Text = FloatUtil.ToString(cr.Unk12);
Unk13TextBox.Text = cr.Unk13.ToString();
Unk14TextBox.Text = cr.Unk14.ToString();
SoundSetTextBox.Text = cr.SoundSet.ToString();
Flags0TextBox.Text = cr.Flags0.Hex;
populatingui = false;
@ -158,7 +158,7 @@ namespace CodeWalker.Project.Panels
if (CurrentRoom == null) return;
uint hash = 0;
string name = Hash1TextBox.Text;
string name = ZoneTextBox.Text;
if (!uint.TryParse(name, out hash))//don't re-hash hashes
{
hash = JenkHash.GenHash(name);
@ -166,9 +166,9 @@ namespace CodeWalker.Project.Panels
}
//NameHashLabel.Text = "Hash: " + hash.ToString();
if (CurrentRoom.Hash1 != hash)
if (CurrentRoom.Zone != hash)
{
CurrentRoom.Hash1 = hash;
CurrentRoom.Zone = hash;
ProjectItemChanged();
}
@ -248,7 +248,7 @@ namespace CodeWalker.Project.Panels
if (CurrentRoom == null) return;
uint hash = 0;
string name = Unk06TextBox.Text;
string name = SoundTextBox.Text;
if (!uint.TryParse(name, out hash))//don't re-hash hashes
{
hash = JenkHash.GenHash(name);
@ -256,9 +256,9 @@ namespace CodeWalker.Project.Panels
}
//NameHashLabel.Text = "Hash: " + hash.ToString();
if (CurrentRoom.Unk06 != hash)
if (CurrentRoom.Sound != hash)
{
CurrentRoom.Unk06 = hash;
CurrentRoom.Sound = hash;
ProjectItemChanged();
}
@ -394,7 +394,7 @@ namespace CodeWalker.Project.Panels
if (CurrentRoom == null) return;
uint hash = 0;
string name = Unk14TextBox.Text;
string name = SoundSetTextBox.Text;
if (!uint.TryParse(name, out hash))//don't re-hash hashes
{
hash = JenkHash.GenHash(name);
@ -402,9 +402,9 @@ namespace CodeWalker.Project.Panels
}
//NameHashLabel.Text = "Hash: " + hash.ToString();
if (CurrentRoom.Unk14 != hash)
if (CurrentRoom.SoundSet != hash)
{
CurrentRoom.Unk14 = hash;
CurrentRoom.SoundSet = hash;
ProjectItemChanged();
}

View File

@ -6779,8 +6779,8 @@ namespace CodeWalker.Project
room.NameHash = JenkHash.GenHash(room.Name);
room.Flags0 = 0xAAAAAAAA;
room.Unk06 = (uint)MetaName.null_sound;
room.Unk14 = 3565506855;//?
room.Sound = (uint)MetaName.null_sound;
room.SoundSet = 3565506855;//?
CurrentAudioFile.AddRelData(room);

View File

@ -52,7 +52,7 @@ namespace CodeWalker.Tools
foreach (var kvp in GameFileCache.AudioGameDict) addItem(kvp.Value);
}
NameComboBox.AutoCompleteCustomSource.AddRange(namelist.ToArray());
NameComboBox.Text = "";
NameComboBox.Text = "(Start typing to search...)";
@ -103,10 +103,15 @@ namespace CodeWalker.Tools
return str + " : " + typeid;
}
private IEnumerable<MetaHash> GetUniqueHashes(MetaHash[] hashes, RelData item)
{
return hashes?.Distinct()?.Where(h => h != item.NameHash); //try avoid infinite loops...
}
private void LoadItemHierarchy(RelData item, TreeNode parentNode = null)
{
TreeNode node = null;
TreeNode node;
if (parentNode == null)
{
HierarchyTreeView.Nodes.Clear();
@ -121,18 +126,17 @@ namespace CodeWalker.Tools
node.Tag = item;
var synths = item.GetSynthHashes();
var mixers = item.GetMixerHashes();
var curves = item.GetCurveHashes();
var categs = item.GetCategoryHashes();
var sounds = item.GetSoundHashes();
var games = item.GetGameHashes();
var synths = GetUniqueHashes(item.GetSynthHashes(), item);
var mixers = GetUniqueHashes(item.GetMixerHashes(), item);
var curves = GetUniqueHashes(item.GetCurveHashes(), item);
var categs = GetUniqueHashes(item.GetCategoryHashes(), item);
var sounds = GetUniqueHashes(item.GetSoundHashes(), item);
var games = GetUniqueHashes(item.GetGameHashes(), item);
if (synths != null)
{
foreach (var h in synths)
{
if (GameFileCache.AudioSynthsDict.TryGetValue(h, out RelData child)) LoadItemHierarchy(child, node);
}