BrawlCrate v0.41
Wii File Editor
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Properties | List of all members
BrawlLib.SSBB.ResourceNodes.RWSDDataNode Class Reference
Inheritance diagram for BrawlLib.SSBB.ResourceNodes.RWSDDataNode:
BrawlLib.SSBB.ResourceNodes.RSARFileEntryNode BrawlLib.SSBB.ResourceNodes.ResourceNode

Public Member Functions

override bool OnInitialize ()
 
override int OnCalculateSize (bool force)
 
override void OnRebuild (VoidPtr address, int length, bool force)
 
override void Remove ()
 
- Public Member Functions inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
void OnRenamed ()
 
List< ResourceNodeGetChildrenRecursive ()
 Used primarily to get bone lists. Kept for all resource nodes for utility. More...
 
virtual void SignalPropertyChange ()
 
virtual void Dispose ()
 
void SelectChildAtIndex (int index)
 
void UpdateProperties ()
 
void UpdateCurrentControl ()
 
virtual bool MoveUp ()
 
virtual bool MoveDown ()
 
virtual void OnMoved ()
 
virtual void DoMoveDown ()
 
virtual void DoMoveDown (bool select)
 
virtual void DoMoveUp ()
 
virtual void DoMoveUp (bool select)
 
virtual bool AddUp ()
 
virtual bool AddDown ()
 
virtual bool ToParent ()
 
void Populate (int levels=-1)
 
virtual void OnPopulate ()
 
void Initialize (ResourceNode parent, FileMap source)
 
void Initialize (ResourceNode parent, VoidPtr address, int length)
 
void Initialize (ResourceNode parent, DataSource origSource)
 
virtual void Initialize (ResourceNode parent, DataSource origSource, DataSource uncompSource)
 
virtual bool OnInitialize ()
 
virtual void Restore ()
 
virtual void Remove ()
 
virtual void RemoveChild (ResourceNode child)
 
virtual void AddChild (ResourceNode child)
 
virtual void AddChild (ResourceNode child, bool change)
 
virtual void InsertChild (ResourceNode child, int index)
 
virtual void InsertChild (ResourceNode child, bool change, int index)
 
void SetSizeInternal (int size)
 
virtual void Replace (string fileName)
 
virtual void Replace (ResourceNode node)
 
virtual void Replace (string fileName, FileMapProtect prot, FileOptions options)
 
virtual void ReplaceRaw (VoidPtr address, int length)
 
virtual void ReplaceRaw (FileMap map)
 
virtual void Export (string outPath)
 
void Export (FileStream outStream)
 
virtual void ExportUncompressed (string outPath)
 
void ExportUncompressed (FileStream outStream)
 
virtual void Rebuild ()
 
virtual void Rebuild (bool force)
 
virtual void Rebuild (VoidPtr address, int length, bool force)
 
virtual void OnRebuild (VoidPtr address, int length, bool force)
 
virtual int CalculateSize (bool force)
 
virtual int OnCalculateSize (bool force)
 
void Merge ()
 
void Merge (bool forceBuild)
 
ResourceNode FindChildByType (string path, bool searchChildren, params ResourceType[] types)
 
ResourceNode FindChildByType (string path, bool searchChildren, StringComparison compare, params ResourceType[] types)
 
ResourceNode FindChild (string path)
 
ResourceNode FindChild (string path, bool searchChildren)
 
ResourceNode FindChild (string path, StringComparison compare)
 
ResourceNode FindChild (string path, bool searchChildren, StringComparison compare)
 
ResourceNode[] FindChildrenByClassType (string path, Type type)
 
ResourceNode[] FindChildrenByType (string path, ResourceType type)
 
ResourceNode[] FindChildrenByTypeInGroup (string path, ResourceType type, byte group)
 
ResourceNode[] FindChildrenByName (string name)
 
unsafe string FindName (string name)
 
ResourceNode FindEmbeddedIndex (int index)
 
virtual unsafe byte[] MD5 ()
 Find the MD5 checksum of this node's data. If this node doesn't have any data (BRESGroupNode, for example), this method will return null. More...
 
string MD5Str ()
 Get the result of the MD5() function as a string of hexadecimal digits. If MD5() returns null, this method will return an empty string. More...
 
ResourceNode PrevSibling ()
 
ResourceNode NextSibling ()
 
override string ToString ()
 
virtual void SortChildren ()
 

Public Attributes

RWSD_WSDEntry _part1
 
RWSD_NoteEvent _part2
 
RWSD_NoteInfo _part3
 
List< RSARSoundNode_refs = new List<RSARSoundNode>()
 
VoidPtr _baseAddr
 
- Public Attributes inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
Form _mainForm
 
string _name
 
string _origPath
 
ResourceNode _parent
 
List< ResourceNode_children = new List<ResourceNode>()
 
int _calcSize
 
EventHandler UpdateControl
 
MoveEventHandler MovedDown
 
ResourceEventHandler Renamed
 
ResourceEventHandler PropertyChanged
 
ResourceEventHandler Replaced
 
ResourceEventHandler Restored
 
ResourceChildEventHandler ChildRemoved
 
bool _isPopulating
 
bool _replaced
 

Properties

string[] References [get]
 
float Pitch [get, set]
 
byte Pan [get, set]
 
byte SurroundPan [get, set]
 
byte FxSendA [get, set]
 
byte FxSendB [get, set]
 
byte FxSendC [get, set]
 
byte MainSend [get, set]
 
float Position [get, set]
 
float Length [get, set]
 
uint Decay [get, set]
 
RSARFileAudioNode Sound [get, set]
 
string Wave [get, set]
 
byte Attack [get, set]
 
byte InfoDecay [get, set]
 
byte Sustain [get, set]
 
byte Release [get, set]
 
byte Hold [get, set]
 
byte OriginalKey [get, set]
 
byte Volume [get, set]
 
byte InfoPan [get, set]
 
byte InfoSurroundPan [get, set]
 
float InfoPitch [get, set]
 
WaveEncoding Encoding [get]
 
int Channels [get]
 
bool IsLooped [get]
 
int SampleRate [get]
 
int LoopStartSample [get]
 
int NumSamples [get]
 
- Properties inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
string FilePath [get]
 
string FileName [get]
 
string DirectoryName [get]
 
ResourceNode RootNode [get]
 
DataSource OriginalSource [get]
 
DataSource UncompressedSource [get]
 
DataSource WorkingSource [get]
 
DataSource WorkingUncompressed [get]
 
virtual bool HasChildren [get]
 
virtual ResourceType ResourceFileType [get]
 
string NodeType [get]
 
virtual string TreePathAbsolute [get]
 
virtual string TreePath [get]
 
virtual int Level [get]
 
virtual int MaxNameLength [get]
 
virtual bool AllowDuplicateNames [get]
 
virtual bool AllowNullNames [get]
 
virtual string Name [get, set]
 
ResourceNode Parent [get, set]
 
List< ResourceNodeChildren [get]
 
int Index [get]
 
int HexIndex [get]
 
bool IsCompressed [get]
 
bool HasChanged [get, set]
 
bool IsBranch [get]
 
bool HasMerged [get]
 
virtual bool AllowSaving [get, set]
 
virtual bool IsDirty [get, set]
 
virtual uint UncompressedSize [get]
 
virtual Type[] AllowedChildTypes [get]
 
virtual string Compression [get, set]
 
virtual bool RetainChildrenOnReplace [get]
 
virtual bool supportsCompression [get]
 
static MD5CryptoServiceProvider MD5Provider [get]
 

Additional Inherited Members

- Static Public Member Functions inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
static ResourceNode[] FindAllSubNodes (ResourceNode root)
 
static ResourceNode FindNode (ResourceNode root, string path, bool searchChildren, StringComparison compare)
 
- Protected Member Functions inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
void ForceReplacedEvent ()
 
virtual void MergeInternal ()
 
- Events inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
SelectEventHandler SelectChild
 
EventHandler UpdateProps
 
MoveEventHandler MovedUp
 
ResourceEventHandler Disposing
 
ResourceChildEventHandler ChildAdded
 
ResourceChildInsertEventHandler ChildInserted
 

Member Function Documentation

◆ OnCalculateSize()

override int BrawlLib.SSBB.ResourceNodes.RWSDDataNode.OnCalculateSize ( bool  force)
inlinevirtual

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

341 {
342 return RWSD_DATAEntry.Size + RWSD_WSDEntry.Size + 0x20 + RWSD_NoteEvent.Size + 12 + RWSD_NoteInfo.Size;
343 }
const int Size
Definition: RWSD.cs:128

◆ OnInitialize()

override bool BrawlLib.SSBB.ResourceNodes.RWSDDataNode.OnInitialize ( )
inlinevirtual

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

311 {
312 RuintList* list;
313
314 _part1 = *Header->GetWsdInfo(_offset);
315
316 list = Header->GetTrackTable(_offset); //Count is always 1
317 ruint* r = (ruint*) list->Get(_offset, 0);
318 RuintList* l = (RuintList*) r->Offset(_offset);
319 _part2 = *(RWSD_NoteEvent*) l->Get(_offset, 0);
320
321 list = Header->GetNoteTable(_offset); //Count is always 1
322 _part3 = *(RWSD_NoteInfo*) list->Get(_offset, 0);
323
324 if (_name == null)
325 {
326 _name = $"[{Index}]Data";
327 }
328
329 if (Parent.Parent.Children.Count > 1 && _part3._waveIndex < Parent.Parent.Children[1].Children.Count)
330 {
331 _soundNode = Parent.Parent.Children[1].Children[_part3._waveIndex] as RSARFileAudioNode;
332 }
333
336
337 return false;
338 }
RWSD_NoteInfo _part3
Definition: RWSDDataNode.cs:17
RWSD_NoteEvent _part2
Definition: RWSDDataNode.cs:16
RWSD_WSDEntry _part1
Definition: RWSDDataNode.cs:15
void SetSizeInternal(int size)
Definition: ResourceNode.cs:799
string _name
Definition: ResourceNode.cs:139
ResourceNode Parent
Definition: ResourceNode.cs:245
List< ResourceNode > Children
Definition: ResourceNode.cs:262
Definition: RWSD.cs:57
RWSD_WSDEntry * GetWsdInfo(VoidPtr offset)
Definition: RWSD.cs:77
RuintList * GetTrackTable(VoidPtr offset)
Definition: RWSD.cs:82
RuintList * GetNoteTable(VoidPtr offset)
Definition: RWSD.cs:87
const int Size
Definition: RWSD.cs:60
const int Size
Definition: RWSD.cs:116
bint _waveIndex
Definition: RWSD.cs:130
Definition: RWSD.cs:95
const int Size
Definition: RWSD.cs:96
Definition: Common.cs:285
VoidPtr Get(VoidPtr offset, int index)
Definition: Common.cs:310
Definition: Common.cs:232
VoidPtr Offset(VoidPtr baseAddr)
Definition: Common.cs:257

◆ OnRebuild()

override void BrawlLib.SSBB.ResourceNodes.RWSDDataNode.OnRebuild ( VoidPtr  address,
int  length,
bool  force 
)
inlinevirtual

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

348 {
349 VoidPtr addr = address;
350
351 RWSD_DATAEntry* header = (RWSD_DATAEntry*) addr;
352
353 addr += RWSD_DATAEntry.Size;
354
355 header->_wsdInfo = addr - _baseAddr;
356 RWSD_WSDEntry* wsd = (RWSD_WSDEntry*) addr;
357 *wsd = _part1;
358 addr += RWSD_WSDEntry.Size;
359
360 header->_trackTable = addr - _baseAddr;
361 RuintList* list = (RuintList*) addr;
362 addr += 12;
363
364 list->_numEntries = 1;
365 list->Entries[0] = addr - _baseAddr;
366
367 ruint* r = (ruint*) addr;
368 addr += 8;
369
370 *r = addr - _baseAddr;
371
372 RuintList* list2 = (RuintList*) addr;
373 addr += 12;
374
375 list2->_numEntries = 1;
376 list2->Entries[0] = addr - _baseAddr;
377
378 RWSD_NoteEvent* ev = (RWSD_NoteEvent*) addr;
379 *ev = _part2;
380 addr += RWSD_NoteEvent.Size;
381
382 header->_noteTable = addr - _baseAddr;
383 RuintList* list3 = (RuintList*) addr;
384 addr += 12;
385
386 list3->_numEntries = 1;
387 list3->Entries[0] = addr - _baseAddr;
388
389 RWSD_NoteInfo* info = (RWSD_NoteInfo*) addr;
390 *info = _part3;
391 addr += RWSD_NoteInfo.Size;
392 }
VoidPtr _baseAddr
Definition: RWSDDataNode.cs:345
Definition: VoidPtr.cs:9
ruint _trackTable
Definition: RWSD.cs:63
ruint _noteTable
Definition: RWSD.cs:64
ruint _wsdInfo
Definition: RWSD.cs:62
ruint * Entries
Definition: Common.cs:301
bint _numEntries
Definition: Common.cs:288

◆ Remove()

override void BrawlLib.SSBB.ResourceNodes.RWSDDataNode.Remove ( )
inlinevirtual

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

395 {
396 foreach (RSARSoundNode n in _refs)
397 {
398 n.SoundDataNode = null;
399 }
400
401 base.Remove();
402 }
List< RSARSoundNode > _refs
Definition: RWSDDataNode.cs:19

Member Data Documentation

◆ _baseAddr

VoidPtr BrawlLib.SSBB.ResourceNodes.RWSDDataNode._baseAddr

◆ _part1

RWSD_WSDEntry BrawlLib.SSBB.ResourceNodes.RWSDDataNode._part1

◆ _part2

RWSD_NoteEvent BrawlLib.SSBB.ResourceNodes.RWSDDataNode._part2

◆ _part3

RWSD_NoteInfo BrawlLib.SSBB.ResourceNodes.RWSDDataNode._part3

◆ _refs

List<RSARSoundNode> BrawlLib.SSBB.ResourceNodes.RWSDDataNode._refs = new List<RSARSoundNode>()

Property Documentation

◆ Attack

byte BrawlLib.SSBB.ResourceNodes.RWSDDataNode.Attack
getset
188 {
189 get => _part3._attack;
190 set
191 {
192 _part3._attack = value;
194 }
195 }
virtual void SignalPropertyChange()
Definition: ResourceNode.cs:313
byte _attack
Definition: RWSD.cs:131

◆ Channels

int BrawlLib.SSBB.ResourceNodes.RWSDDataNode.Channels
get

◆ Decay

uint BrawlLib.SSBB.ResourceNodes.RWSDDataNode.Decay
getset
123 {
124 get => _part2.noteIndex;
125 set
126 {
127 _part2.noteIndex = value;
129 }
130 }
buint noteIndex
Definition: RWSD.cs:120

◆ Encoding

WaveEncoding BrawlLib.SSBB.ResourceNodes.RWSDDataNode.Encoding
get

◆ FxSendA

byte BrawlLib.SSBB.ResourceNodes.RWSDDataNode.FxSendA
getset
57 {
58 get => _part1._fxSendA;
59 set
60 {
61 _part1._fxSendA = value;
63 }
64 }
byte _fxSendA
Definition: RWSD.cs:101

◆ FxSendB

byte BrawlLib.SSBB.ResourceNodes.RWSDDataNode.FxSendB
getset
68 {
69 get => _part1._fxSendB;
70 set
71 {
72 _part1._fxSendB = value;
74 }
75 }
byte _fxSendB
Definition: RWSD.cs:102

◆ FxSendC

byte BrawlLib.SSBB.ResourceNodes.RWSDDataNode.FxSendC
getset
79 {
80 get => _part1._fxSendC;
81 set
82 {
83 _part1._fxSendC = value;
85 }
86 }
byte _fxSendC
Definition: RWSD.cs:103

◆ Hold

byte BrawlLib.SSBB.ResourceNodes.RWSDDataNode.Hold
getset
232 {
233 get => _part3._hold;
234 set
235 {
236 _part3._hold = value;
238 }
239 }
byte _hold
Definition: RWSD.cs:135

◆ InfoDecay

byte BrawlLib.SSBB.ResourceNodes.RWSDDataNode.InfoDecay
getset
199 {
200 get => _part3._decay;
201 set
202 {
203 _part3._decay = value;
205 }
206 }
byte _decay
Definition: RWSD.cs:132

◆ InfoPan

byte BrawlLib.SSBB.ResourceNodes.RWSDDataNode.InfoPan
getset
265 {
266 get => _part3._pan;
267 set
268 {
269 _part3._pan = value;
271 }
272 }
byte _pan
Definition: RWSD.cs:141

◆ InfoPitch

float BrawlLib.SSBB.ResourceNodes.RWSDDataNode.InfoPitch
getset
287 {
288 get => _part3._pitch;
289 set
290 {
291 _part3._pitch = value;
293 }
294 }
bfloat _pitch
Definition: RWSD.cs:143

◆ InfoSurroundPan

byte BrawlLib.SSBB.ResourceNodes.RWSDDataNode.InfoSurroundPan
getset
276 {
277 get => _part3._surroundPan;
278 set
279 {
280 _part3._surroundPan = value;
282 }
283 }
byte _surroundPan
Definition: RWSD.cs:142

◆ IsLooped

bool BrawlLib.SSBB.ResourceNodes.RWSDDataNode.IsLooped
get

◆ Length

float BrawlLib.SSBB.ResourceNodes.RWSDDataNode.Length
getset
112 {
113 get => _part2.length;
114 set
115 {
116 _part2.length = value;
118 }
119 }
bfloat length
Definition: RWSD.cs:119

◆ LoopStartSample

int BrawlLib.SSBB.ResourceNodes.RWSDDataNode.LoopStartSample
get

◆ MainSend

byte BrawlLib.SSBB.ResourceNodes.RWSDDataNode.MainSend
getset
90 {
91 get => _part1._mainSend;
92 set
93 {
94 _part1._mainSend = value;
96 }
97 }
byte _mainSend
Definition: RWSD.cs:104

◆ NumSamples

int BrawlLib.SSBB.ResourceNodes.RWSDDataNode.NumSamples
get

◆ OriginalKey

byte BrawlLib.SSBB.ResourceNodes.RWSDDataNode.OriginalKey
getset
243 {
244 get => _part3._originalKey;
245 set
246 {
247 _part3._originalKey = value;
249 }
250 }
byte _originalKey
Definition: RWSD.cs:139

◆ Pan

byte BrawlLib.SSBB.ResourceNodes.RWSDDataNode.Pan
getset
35 {
36 get => _part1._pan;
37 set
38 {
39 _part1._pan = value;
41 }
42 }
byte _pan
Definition: RWSD.cs:99

◆ Pitch

float BrawlLib.SSBB.ResourceNodes.RWSDDataNode.Pitch
getset
24 {
25 get => _part1._pitch;
26 set
27 {
28 _part1._pitch = value;
30 }
31 }
bfloat _pitch
Definition: RWSD.cs:98

◆ Position

float BrawlLib.SSBB.ResourceNodes.RWSDDataNode.Position
getset
101 {
102 get => _part2.position;
103 set
104 {
105 _part2.position = value;
107 }
108 }
bfloat position
Definition: RWSD.cs:118

◆ References

string [] BrawlLib.SSBB.ResourceNodes.RWSDDataNode.References
get

◆ Release

byte BrawlLib.SSBB.ResourceNodes.RWSDDataNode.Release
getset
221 {
222 get => _part3._release;
223 set
224 {
225 _part3._release = value;
227 }
228 }
byte _release
Definition: RWSD.cs:134

◆ SampleRate

int BrawlLib.SSBB.ResourceNodes.RWSDDataNode.SampleRate
get

◆ Sound

RSARFileAudioNode BrawlLib.SSBB.ResourceNodes.RWSDDataNode.Sound
getset
136 {
137 get => _soundNode;
138 set
139 {
140 if (_soundNode != value)
141 {
142 _soundNode = value;
143 }
144 }
145 }

◆ SurroundPan

byte BrawlLib.SSBB.ResourceNodes.RWSDDataNode.SurroundPan
getset
46 {
47 get => _part1._surroundPan;
48 set
49 {
50 _part1._surroundPan = value;
52 }
53 }
byte _surroundPan
Definition: RWSD.cs:100

◆ Sustain

byte BrawlLib.SSBB.ResourceNodes.RWSDDataNode.Sustain
getset
210 {
211 get => _part3._sustain;
212 set
213 {
214 _part3._sustain = value;
216 }
217 }
byte _sustain
Definition: RWSD.cs:133

◆ Volume

byte BrawlLib.SSBB.ResourceNodes.RWSDDataNode.Volume
getset
254 {
255 get => _part3._volume;
256 set
257 {
258 _part3._volume = value;
260 }
261 }
byte _volume
Definition: RWSD.cs:140

◆ Wave

string BrawlLib.SSBB.ResourceNodes.RWSDDataNode.Wave
getset
151 {
152 get => _soundNode == null ? null : _soundNode._name;
153 set
154 {
155 if (string.IsNullOrEmpty(value))
156 {
157 Sound = null;
158 }
159 else
160 {
161 RSARFileAudioNode node = null;
162 int t = 0;
163 foreach (RSARFileAudioNode r in Parent.Parent.Children[1].Children)
164 {
165 if (r.Name == value)
166 {
167 node = r;
168 break;
169 }
170
171 t++;
172 }
173
174 if (node != null)
175 {
176 Sound = node;
177 _part3._waveIndex = t;
179 }
180 }
181 }
182 }
RSARFileAudioNode Sound
Definition: RWSDDataNode.cs:136

The documentation for this class was generated from the following file: