bastibe/PySoundCard — pull request #39 by mgeier (2014-11-15 21:18:21+00:00)
Title: Add OutputStream and InputStream classes

I didn't like the 3 choices for `input_device` and `output_device` in the `Stream` constructor.
The possible values are `True` (for default device), `False`-ish (for disabling the device) and a device dict to specify a certain non-default device (or other non-default settings).
I think that's quite un-symmetrical and hard for users to remember.

My suggestion is to have a `Stream` class which always has inputs *and* outputs, so it is not necessary (and not possible) to disable one of them.
For the cases where only one "direction" is needed, I implemented the classes `InputStream` and `OutputStream`.
I think from a user's perspective this is clearer and easier to use, the implementation of the 3 classes is of course a little more complicated than the 1 class. I'm not very experienced with creating class hierarchies in Python, therefore it's quite likely that my implementation can be significantly improved.

I also replaced the device dicts with device numbers and created additional arguments instead.
Now there are more constructor arguments than before, but to simplify those, I added an `init` object to the module namespace which can be used to select default settings which will be used on subsequent calls to the constructors.