FS#145 - Implement copy constructors and ToString functions in SFML.Net

git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1330 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
LaurentGom 2010-01-06 12:37:29 +00:00
parent bd9a60fef2
commit dd255a916d
28 changed files with 627 additions and 0 deletions

View file

@ -77,6 +77,17 @@ namespace SFML
throw new LoadingFailedException("sound buffer");
}
////////////////////////////////////////////////////////////
/// <summary>
/// Construct the sound buffer from another sound buffer
/// </summary>
/// <param name="copy">Sound buffer to copy</param>
////////////////////////////////////////////////////////////
public SoundBuffer(SoundBuffer copy) :
base(sfSoundBuffer_Copy(copy.This))
{
}
////////////////////////////////////////////////////////////
/// <summary>
/// Save the sound buffer to an audio file
@ -134,6 +145,20 @@ namespace SFML
}
}
////////////////////////////////////////////////////////////
/// <summary>
/// Provide a string describing the object
/// </summary>
/// <returns>String description of the object</returns>
////////////////////////////////////////////////////////////
public override string ToString()
{
return "[SoundBuffer]" +
" SampleRate = " + SampleRate +
" ChannelsCount = " + ChannelsCount +
" Duration = " + Duration;
}
////////////////////////////////////////////////////////////
/// <summary>
/// Handle the destruction of the object
@ -155,6 +180,9 @@ namespace SFML
[DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity]
unsafe static extern IntPtr sfSoundBuffer_CreateFromSamples(short* Samples, uint SamplesCount, uint ChannelsCount, uint SampleRate);
[DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity]
static extern IntPtr sfSoundBuffer_Copy(IntPtr SoundBuffer);
[DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity]
static extern void sfSoundBuffer_Destroy(IntPtr SoundBuffer);