Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated SoundRecorder to support multiple input devices #99

Merged
merged 1 commit into from
Feb 25, 2015
Merged

Updated SoundRecorder to support multiple input devices #99

merged 1 commit into from
Feb 25, 2015

Conversation

zsbzsb
Copy link
Member

@zsbzsb zsbzsb commented Feb 25, 2015

And if you decide to mention that sfSoundRecorder_getDevice returns an IntPtr instead of a string that is required. Otherwise the interop will free our static string causing a crash on next call. And yes it has been fully tested.

http://elegantcode.com/2010/11/17/the-black-art-of-pinvoke-and-marshaling-in-net/

Doing some more research on marshaling strings, I found out that in case the native function does its own cleanup, an IntPtr must be returned by the C# prototype declaration instead of a String.

@zsbzsb zsbzsb mentioned this pull request Feb 25, 2015
@LaurentGomila
Copy link
Member

And if you decide to mention that sfSoundRecorder_getDevice returns an IntPtr instead of a string that is required.

I don't care since it remains an internal detail.

But shouldn't GetDevice/SetDevice be a Device property instead?

@zsbzsb
Copy link
Member Author

zsbzsb commented Feb 25, 2015

setDevice returns a bool indicating if it was successful.

@LaurentGomila
Copy link
Member

Ah, right.

LaurentGomila added a commit that referenced this pull request Feb 25, 2015
Updated SoundRecorder to support multiple input devices
@LaurentGomila LaurentGomila merged commit 6bd5648 into SFML:master Feb 25, 2015
@zsbzsb zsbzsb deleted the feature/sound_recorder branch February 25, 2015 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants