Exemple #1
0
 public void Kill()
 {
     if (fscMode)
     {
         HITVM.Get().StopFSC(fsc);
     }
     else
     {
         Bass.BASS_ChannelStop(Channel);
         LoopSound.Free();
     }
 }
 public void Kill()
 {
     if (fscMode)
     {
         HITVM.Get().StopFSC(fsc);
     }
     else
     {
         inst.Stop();
         inst.Dispose();
         sfx.Dispose();
     }
 }
Exemple #3
0
        public HITThread(HITFile Src, HITVM VM)
        {
            this.Src  = Src;
            this.VM   = VM;
            Registers = new int[16];
            LocalVar  = new int[54];
            ObjectVar = new int[29];

            Notes          = new List <HITNoteEntry>();
            NotesByChannel = new Dictionary <int, HITNoteEntry>();
            Owners         = new List <int>();

            Stack      = new Stack <int>();
            audContent = Content.Content.Get().Audio;
        }
        public AmbiencePlayer(Ambience amb)
        {
            if (amb.Loop)
            {
                byte[] data   = new XAFile(FSO.Content.Content.Get().GetPath(amb.Path)).DecompressedData;
                var    stream = new MemoryStream(data);
                sfx = SoundEffect.FromStream(stream);
                stream.Close();

                inst          = sfx.CreateInstance();
                inst.IsLooped = true;
                inst.Play();
                fscMode = false;
            }
            else
            {
                fsc = HITVM.Get().PlayFSC(FSO.Content.Content.Get().GetPath(amb.Path));
                fsc.SetVolume(0.33f); //may need tweaking
                fscMode = true;
            }
        }
Exemple #5
0
        public AmbiencePlayer(Ambience amb)
        {
            if (amb.Loop)
            {
                byte[] data = new XAFile(TSO.Content.Content.Get().GetPath(amb.Path)).DecompressedData;

                LoopSound = GCHandle.Alloc(data, GCHandleType.Pinned);

                IntPtr pointer = LoopSound.AddrOfPinnedObject();
                Channel = Bass.BASS_StreamCreateFile(pointer, 0, data.Length, BASSFlag.BASS_DEFAULT | BASSFlag.BASS_STREAM_AUTOFREE);
                //Bass.BASS_ChannelSetAttribute(Channel, BASSAttribute.BASS_ATTRIB_VOL, 0.33f);
                Bass.BASS_ChannelFlags(Channel, BASSFlag.BASS_MUSIC_LOOP, BASSFlag.BASS_MUSIC_LOOP);
                Bass.BASS_ChannelPlay(Channel, false);
                fscMode = false;
            }
            else
            {
                fsc = HITVM.Get().PlayFSC(TSO.Content.Content.Get().GetPath(amb.Path));
                fsc.SetVolume(0.33f); //may need tweaking
                fscMode = true;
            }
        }
Exemple #6
0
 public static void Init()
 {
     INSTANCE = new HITVM();
 }
Exemple #7
0
 public static void Init()
 {
     INSTANCE = new HITVM();
 }
        public HITThread(HITFile Src, HITVM VM)
        {
            this.Src = Src;
            this.VM = VM;
            Registers = new int[16];
            LocalVar = new int[54];
            ObjectVar = new int[29];

            Notes = new List<HITNoteEntry>();
            NotesByChannel = new Dictionary<SoundEffectInstance, HITNoteEntry>();
            Owners = new List<int>();

            Stack = new Stack<int>();
            audContent = Content.Content.Get().Audio;
        }