Beispiel #1
0
        private void AddSound(EndianReader reader, int offset, int size, uint id, uint sourceID)
        {
            // Read the sound's RIFX data so we can identify its format
            reader.SeekTo(offset);
            RIFX rifx = new RIFX(reader, size);

            Composer.SoundFormat format = FormatIdentification.IdentifyFormat(rifx);

            // Create information to tag the tree node with
            SoundFileInfo info = new SoundFileInfo
            {
                Reader = reader,
                Offset = offset,
                Size   = size,
                ID     = id,
                Format = format
            };

            if (!isDisplay)
            {
                List <SoundFileInfo> sfi;
                if (cache.SoundFiles.TryGetValue(sourceID, out sfi))
                {
                    sfi.Add(info);
                }
                else
                {
                    cache.SoundFiles.Add(sourceID, new List <SoundFileInfo>()
                    {
                        info
                    });
                }

                return;
            }

            lstPerms.Items.Add(tag.Filename.Substring(tag.Filename.LastIndexOf("\\") + 1) + " [" + lstPerms.Items.Count.ToString() + "]");
            _perms.Add(info);
        }
Beispiel #2
0
 public static extern uint SndSetSound(SoundEvent seSoundEvent,
                                       SoundFileInfo pSoundFileInfo, bool fSuppressUI);
Beispiel #3
0
 public static extern uint SndSetSound(SoundEvent seSoundEvent,
     SoundFileInfo pSoundFileInfo, bool fSuppressUI);
Beispiel #4
0
 private static RIFX ReadRIFX(SoundFileInfo info)
 {
     info.Reader.SeekTo(info.Offset);
     return(new RIFX(info.Reader, info.Size));
 }