Example #1
0
 public void DisconnectFrom(Dsp target)
 {
     if (target != null)
     {
         currentResult = NativeMethods.FMOD_DSP_DisconnectFrom(handle, target.Handle);
     }
 }
Example #2
0
 public void AddDsp(Dsp dsp)
 {
     if (dsp != null)
     {
         currentResult = NativeMethods.FMOD_Channel_AddDSP(handle, dsp.Handle);
     }
 }
Example #3
0
 public void AddInput(Dsp target)
 {
     if (target != null)
     {
         currentResult = NativeMethods.FMOD_DSP_AddInput(handle, target.Handle);
     }
 }
Example #4
0
 public void AddDsp(Dsp dsp)
 {
     if (dsp != null)
     {
         currentResult = NativeMethods.FMOD_ChannelGroup_AddDSP(handle, dsp.Handle);
     }
     else
     {
         throw new ArgumentNullException("dsp");
     }
 }
Example #5
0
		public void DisconnectFrom(Dsp target)
		{
			if (target != null)
			{
				currentResult = NativeMethods.FMOD_DSP_DisconnectFrom(handle, target.Handle);
			}
		}		
Example #6
0
		public void AddInput(Dsp target)
		{
			if (target != null)
			{
				currentResult = NativeMethods.FMOD_DSP_AddInput(handle, target.Handle);
			}
		}		
Example #7
0
		public void AddDsp(Dsp dsp)
		{
			if (dsp != null)
			{
				currentResult = NativeMethods.FMOD_Channel_AddDSP(handle, dsp.Handle);
			}
		}
		public void AddDsp(Dsp dsp)
		{
			if (dsp != null)
			{
				currentResult = NativeMethods.FMOD_ChannelGroup_AddDSP(handle, dsp.Handle);
			}
			else throw new ArgumentNullException("dsp");
		}
Example #9
0
		protected virtual void Dispose(bool disposing)
		{
			if (!disposed)
			{
				if (disposing)
				{
					if (drivers != null)
					{
						drivers.Dispose();
						drivers = null;
					}
					
					if (recordDrivers != null)
					{
						recordDrivers.Dispose();
						recordDrivers = null;
					}
					
					if (masterChannelGroup != null)
					{
						masterChannelGroup.Dispose();
						masterChannelGroup = null;
					}
					
					if (dspHead != null)
					{
						dspHead.Dispose();
						dspHead = null;
					}
				}
				
				if (handle != IntPtr.Zero)
				{
					NativeMethods.FMOD_System_Release(handle);
					handle = IntPtr.Zero;
				}
			}
			disposed = true;
		}
Example #10
0
		public void PlayDsp(ChannelIndex channelId, Dsp dsp, bool paused, ref Channel channel)
		{
			if (dsp != null)
			{
				currentResult = Result.Ok;
				IntPtr channelHandle;

				if (channel != null)
				{
					channelHandle = channel.Handle;
				}
				else
				{
					channel = new Channel();
					channelHandle = new IntPtr();
				}

				try
				{
					currentResult = NativeMethods.FMOD_System_PlayDSP(handle, channelId, dsp.Handle, paused, ref channelHandle);
				}
				catch (System.Runtime.InteropServices.ExternalException)
				{
					currentResult = Result.InvalidParameterError;
				}
				
				if (currentResult != Result.Ok)
				{
					channel = new Channel();
					channel.Handle = channelHandle;				
				}
				else
				{
					channel = null;
				}
			}
			else throw new ArgumentNullException("dsp");
		}
Example #11
0
		/// <summary>
		/// Create Dsp by index
		/// </summary>
		/// <param name="index">The index of the Dsp to create</param>		
		/// <returns>A new Dsp</returns>
		public Dsp CreateDsp(int index)
		{
			currentResult = Result.Ok;
			IntPtr dspHandle = new IntPtr();
			Dsp dsp = null;

			try
			{
				currentResult = NativeMethods.FMOD_System_CreateDSPByIndex(handle, index, ref dspHandle);
			}
			catch (System.Runtime.InteropServices.ExternalException)
			{
				currentResult = Result.InvalidParameterError;
			}
			
			if (currentResult == Result.Ok)
			{
				dsp = new Dsp();
				dsp.Handle = dspHandle;				
			}

			return dsp;
		}