A music switch container in a sound bank.
Inheritance: IWwiseObject
Example #1
0
        private void ReadObjects(EndianReader reader)
        {
            int  numObjects = reader.ReadInt32();
            long offset     = reader.Position;

            for (int i = 0; i < numObjects; i++)
            {
                // Read the object's header
                ObjectType type = (ObjectType)reader.ReadSByte();
                int        size = reader.ReadInt32();
                offset += 5;

                // Read the object's ID
                uint id = reader.ReadUInt32();

                // Read the rest of the object based upon its type
                IWwiseObject obj = null;
                switch (type)
                {
                case ObjectType.Voice:
                    obj = new SoundBankVoice(reader, id);
                    break;

                case ObjectType.Action:
                    obj = new SoundBankAction(reader, id);
                    break;

                case ObjectType.Event:
                    SoundBankEvent ev = new SoundBankEvent(reader, id);
                    _eventsById[ev.ID] = ev;
                    obj = ev;
                    break;

                case ObjectType.SequenceContainer:
                    obj = new SoundBankSequenceContainer(reader, id);
                    break;

                case ObjectType.SwitchContainer:
                    obj = new SoundBankSwitchContainer(reader, id);
                    break;

                case ObjectType.ActorMixer:
                    obj = new SoundBankActorMixer(reader, id);
                    break;

                case ObjectType.MusicPlaylistContainer:
                    obj = new SoundBankMusicPlaylist(reader, id);
                    break;

                case ObjectType.MusicSegment:
                    obj = new SoundBankMusicSegment(reader, id);
                    break;

                case ObjectType.MusicTrack:
                    obj = new SoundBankMusicTrack(reader, id);
                    break;

                case ObjectType.MusicSwitchContainer:
                    obj = new SoundBankMusicSwitchContainer(reader, id);
                    break;
                }

                // Register the object if something was read
                if (obj != null)
                {
                    _objects.Add(obj);
                }

                // Skip to the next object
                offset += size;
                reader.SeekTo(offset);
            }
        }
Example #2
0
 public void Visit(SoundBankMusicSwitchContainer container)
 {
     DispatchAll(container.SegmentIDs);
 }
Example #3
0
        private void ReadObjects(EndianReader reader)
        {
            int numObjects = reader.ReadInt32();
            long offset = reader.Position;

            for (int i = 0; i < numObjects; i++)
            {
                // Read the object's header
                ObjectType type = (ObjectType)reader.ReadSByte();
                int size = reader.ReadInt32();
                offset += 5;

                // Read the object's ID
                uint id = reader.ReadUInt32();

                // Read the rest of the object based upon its type
                IWwiseObject obj = null;
                switch (type)
                {
                    case ObjectType.Voice:
                        obj = new SoundBankVoice(reader, id);
                        break;

                    case ObjectType.Action:
                        obj = new SoundBankAction(reader, id);
                        break;

                    case ObjectType.Event:
                        SoundBankEvent ev = new SoundBankEvent(reader, id);
                        _eventsById[ev.ID] = ev;
                        obj = ev;
                        break;

                    case ObjectType.SequenceContainer:
                        obj = new SoundBankSequenceContainer(reader, id);
                        break;

                    case ObjectType.SwitchContainer:
                        obj = new SoundBankSwitchContainer(reader, id);
                        break;

                    case ObjectType.ActorMixer:
                        obj = new SoundBankActorMixer(reader, id);
                        break;

                    case ObjectType.MusicPlaylistContainer:
                        obj = new SoundBankMusicPlaylist(reader, id);
                        break;

                    case ObjectType.MusicSegment:
                        obj = new SoundBankMusicSegment(reader, id);
                        break;

                    case ObjectType.MusicTrack:
                        obj = new SoundBankMusicTrack(reader, id);
                        break;

                    case ObjectType.MusicSwitchContainer:
                        obj = new SoundBankMusicSwitchContainer(reader, id);
                        break;
                }

                // Register the object if something was read
                if (obj != null)
                    _objects.Add(obj);

                // Skip to the next object
                offset += size;
                reader.SeekTo(offset);
            }
        }