ReverbEffect is now an AudioResource
							parent
							
								
									d17fb55810
								
							
						
					
					
						commit
						4591920bf6
					
				| 
						 | 
					@ -4,14 +4,12 @@ using System.Runtime.InteropServices;
 | 
				
			||||||
namespace MoonWorks.Audio
 | 
					namespace MoonWorks.Audio
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	// sound instances can send their audio to this voice to add reverb
 | 
						// sound instances can send their audio to this voice to add reverb
 | 
				
			||||||
	public unsafe class ReverbEffect : IDisposable
 | 
						public unsafe class ReverbEffect : AudioResource
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		private IntPtr voice;
 | 
							private IntPtr voice;
 | 
				
			||||||
		public IntPtr Voice => voice;
 | 
							public IntPtr Voice => voice;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		private bool disposedValue;
 | 
							public ReverbEffect(AudioDevice audioDevice) : base(audioDevice)
 | 
				
			||||||
 | 
					 | 
				
			||||||
		public ReverbEffect(AudioDevice audioDevice)
 | 
					 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			/* Init reverb */
 | 
								/* Init reverb */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -97,32 +95,9 @@ namespace MoonWorks.Audio
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		protected virtual void Dispose(bool disposing)
 | 
							protected override void Destroy()
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			if (!disposedValue)
 | 
								FAudio.FAudioVoice_DestroyVoice(Voice);
 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				if (disposing)
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					// TODO: dispose managed state (managed objects)
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
				FAudio.FAudioVoice_DestroyVoice(voice);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
				disposedValue = true;
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		~ReverbEffect()
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
		    // Do not change this code. Put cleanup code in 'Dispose(bool disposing)' method
 | 
					 | 
				
			||||||
		    Dispose(disposing: false);
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		public void Dispose()
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			// Do not change this code. Put cleanup code in 'Dispose(bool disposing)' method
 | 
					 | 
				
			||||||
			Dispose(disposing: true);
 | 
					 | 
				
			||||||
			GC.SuppressFinalize(this);
 | 
					 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue