public void LoadAnySound(SoundResource soundResource) { if (!Common.FileSystem.Instance.FileExists(ContentPath + soundResource.Name)) { throw new System.IO.FileNotFoundException("File not found: " + ContentPath + soundResource.Name, ContentPath + soundResource.Name); } managerGlue.LoadAnySound(soundResource, ContentPath + soundResource.Name); }
public SoundChannel(SoundResource soundResource, IChannelGlue channel) { CurrentSoundResource = soundResource; if (channel != null) { InitiateChannelGlue(channel); } else { state = PlayState.NotReady; } SoundManager.Instance.RegisterChannel(this); }
private void InitiateChannelGlue(IChannelGlue channel) { SoundResource soundResource = (SoundResource)CurrentSoundResource; ChannelGlue = channel; channel.SoundEnds += new EventHandler(channel_SoundEnds); channel.GoesVirtual += new EventHandler(channel_GoesVirtual); channel.LeavesVirtual += new EventHandler(channel_LeavesVirtual); baseFrequency = channel.Frequency; if (soundResource.Is3DSound) { channel._3DPanLevel = panLevel; } // Fetch correct variables values volume = channel.Volume; //if (soundResource.Is3DSound) // minMaxDistance = channel._3DMinMaxDistance; }
public void LoadSound(Stream stream, string filename, SoundResource soundResource) { soundResource.Name = "Music/" + filename; LoadAnySound(soundResource); soundStreams[stream] = soundResource; }
public void LoadSound(SFX sfx, string filename, SoundResource soundResource) { soundResource.Name = "SFX/" + filename; LoadAnySound(soundResource); soundEffects[sfx] = soundResource; }
public void LoadAnySound(SoundResource soundResource) { if (!Common.FileSystem.Instance.FileExists(ContentPath + soundResource.Name)) throw new System.IO.FileNotFoundException("File not found: " + ContentPath + soundResource.Name, ContentPath + soundResource.Name); managerGlue.LoadAnySound(soundResource, ContentPath + soundResource.Name); }
public SoundChannel(SoundResource soundResource, IChannelGlue channel) { CurrentSoundResource = soundResource; if (channel != null) InitiateChannelGlue(channel); else state = PlayState.NotReady; SoundManager.Instance.RegisterChannel(this); }