Ejemplo n.º 1
0
 public override bool Equals(object obj)
 {
     if (obj is CreateSoundExtendedInfo)
     {
         CreateSoundExtendedInfo otherInfo = (CreateSoundExtendedInfo)obj;
         return
             (
             StructureSize == otherInfo.StructureSize &&
             Length == otherInfo.Length &&
             FileOffset == otherInfo.FileOffset &&
             NumberOfChannels == otherInfo.NumberOfChannels &&
             DefaultFrequency == otherInfo.DefaultFrequency &&
             Format == otherInfo.Format &&
             DecodeBufferSize == otherInfo.DecodeBufferSize &&
             InitialSubSound == otherInfo.InitialSubSound &&
             NumberOfSubSounds == otherInfo.NumberOfSubSounds &&
             InclusionList == otherInfo.InclusionList &&
             InclusionListNumber == otherInfo.InclusionListNumber &&
             PcmReadCallback == otherInfo.PcmReadCallback &&
             PcmSetPositionCallback == otherInfo.PcmSetPositionCallback &&
             NonBlockCallback == otherInfo.NonBlockCallback &&
             DlsName == otherInfo.DlsName &&
             EncryptionKey == otherInfo.EncryptionKey &&
             MaximumPolyphony == otherInfo.MaximumPolyphony &&
             UserData == otherInfo.UserData
             );
     }
     else
     {
         return(false);
     }
 }
Ejemplo n.º 2
0
		internal Sound CreateStream(Sound sound, byte[] data, Modes mode, ref CreateSoundExtendedInfo info)
		{
			if (sound != null)
			{
				currentResult = Result.Ok;
				IntPtr soundHandle = new IntPtr();				

				try
				{
					currentResult = NativeMethods.FMOD_System_CreateStream(handle, data, mode, ref info, ref soundHandle);
				}
				catch (System.Runtime.InteropServices.ExternalException)
				{
					currentResult = Result.InvalidParameterError;
				}
				
				if (currentResult == Result.Ok)
				{					
					sound.Handle = soundHandle;				
					sound.SoundSystem = this;
				}
				else throw new ApplicationException("could not create stream: " + currentResult.ToString());

				return sound;
			}
			else throw new ArgumentNullException("sound");
		}
Ejemplo n.º 3
0
		//public CompactDiscSound CreateCompactDiscSound(char driveLetter)
		//{
			//string driveName = driveLetter + ":";
			//return CreateCompactDiscSound(driveName);
		//}
		#endregion

		#region CreateStream
		internal Sound CreateStream(string filePath, Modes mode, ref CreateSoundExtendedInfo info)
		{
			currentResult = Result.Ok;
			IntPtr soundHandle = new IntPtr();
			Sound sound = null;

			try
			{
				currentResult = NativeMethods.FMOD_System_CreateStream(handle, filePath, mode, ref info, ref soundHandle);
			}
			catch (System.Runtime.InteropServices.ExternalException)
			{
				currentResult = Result.InvalidParameterError;
			}
			
			if (currentResult == Result.Ok)
			{
				sound = new Sound(this, new Uri(filePath));
				sound.Handle = soundHandle;
				sound.SoundSystem = this;
			}
			else throw new ApplicationException("could not create stream: " + currentResult.ToString());

			return sound;
		}
Ejemplo n.º 4
0
		internal static extern Result FMOD_System_CreateStream(IntPtr systemHandle, byte[] nameOrData, Modes mode, ref CreateSoundExtendedInfo info, ref IntPtr soundHandle);
Ejemplo n.º 5
0
		internal static extern Result FMOD_System_CreateSound(IntPtr systemHandle, string nameOrData, Modes mode, ref CreateSoundExtendedInfo ifo, ref IntPtr sound);
Ejemplo n.º 6
0
 internal static extern Result FMOD_System_CreateStream(IntPtr systemHandle, byte[] nameOrData, Modes mode, ref CreateSoundExtendedInfo info, ref IntPtr soundHandle);
Ejemplo n.º 7
0
 internal static extern Result FMOD_System_CreateSound(IntPtr systemHandle, string nameOrData, Modes mode, ref CreateSoundExtendedInfo ifo, ref IntPtr sound);