[pulseaudio-discuss] [PATCH 1/4] stream-restore: add volume_is_absolute bool in client side
Felipe Contreras
felipe.contreras at gmail.com
Sat May 9 02:50:59 PDT 2009
On Sat, May 9, 2009 at 1:39 AM, Lennart Poettering
<lennart at poettering.net> wrote:
> On Fri, 08.05.09 00:45, Marc-André Lureau (marcandre.lureau at gmail.com) wrote:
>
>> From: Marc-André Lureau <marc-andre.lureau at nokia.com>
>>
>> While trying to keep ABI compatibility, I introduce a bitfield for the
>> boolean volume_is_absolute. We can't extend the struct because the
>> API is using pa_ext_stream_restore_info data[] directly..
>
> Looks mostly good.
>
>> @@ -24,6 +24,7 @@
>>
>> #include <pulse/context.h>
>> #include <pulse/version.h>
>> +#include <pulsecore/macro.h>
>
> No! pulsecore is private API. pulse/ext-stream-restore.h is public
> API. We cannot include this here!
>
>>
>> /** \file
>> *
>> @@ -39,7 +40,8 @@ typedef struct pa_ext_stream_restore_info {
>> pa_channel_map channel_map; /**< The channel map for the volume field, if applicable */
>> pa_cvolume volume; /**< The volume of the stream when it was seen last, if applicable and saved */
>> const char *device; /**< The sink/source of the stream when it was last seen, if applicable and saved */
>> - int mute; /**< The boolean mute state of the stream when it was last seen, if applicable and saved */
>> + int mute:1; /**< The boolean mute state of the stream when it was last seen, if applicable and saved */
>> + pa_bool_t volume_is_absolute:1; /**< True if the volume is absolute, if applicable and saved. \since 0.9.16 */
>> } pa_ext_stream_restore_info;
>
> pa_bool_t is used internally only. In the public API we only expose
> ints. pa_bool_t is defined as _Bool on C99 and int on other
> compilers. This discrepancy should not be visible to outside due to
> ABI stability issues.
Minor comment; if you include stdbool.h you can use 'bool' which IMHO
is less ugly than _Bool. And I wonder what's the point of pa_bool_t...
if the compiler doesn't have stdbool.h, then just define 'bool' as you
would define pa_bool_t.
--
Felipe Contreras
More information about the pulseaudio-discuss
mailing list