Pass the profile object instead of the profile name to pa_card_set_profile()
When setting attribute foo, or in this case the card profile, in my
opinion the thing passed to the set_foo() function should be of the
type of foo, not a string identifier that can be used to search for
the actual foo in set_foo().
This is mostly a question of taste, but there's at least some small
benefit from passing the actual object: often the profile object is
already available when calling pa_card_set_profile(), so passing the
card name would cause unnecessary searching when pa_card_set_profile()
needs to look up the profile from the hashmap.
sink-input, source-output: Don't assume that proplist has been initialized in free()
It's bad form to assume in free() that any member of the struct has
been initialized. I ran into problems with this when I reordered
things in pa_sink_input_new() and pa_source_output_new().
Protocol version 29 will correspond to PA 5.0, and the node stuff has
been postponed until 6.0, so the node interface needs to bump the
protocol version to 30.
If we agree that all strings sent over the native protocol must be
valid UTF-8, then it can be checked in pa_tagstruct_gets(), so
callers don't have to the checking themselves. There were not many
callers that were checking the UTF-8 validity, but there probably
should have been many more.
This will be used for dealing with node directions. Someone might ask
what's the point of adding functions for serializing just one byte;
the point is the validation in pa_tagstruct_get_direction(). It's nice
to be able to assume that the function will return a valid direction,
instead of an arbitrary 8-bit value.