26
26
27
27
enum {
28
28
PROPERTY_CODEC ,
29
+ PROPERTY_DELAY ,
30
+ PROPERTY_CLIENT_DELAY ,
29
31
PROPERTY_RUNNING ,
30
- PROPERTY_SOFTVOL ,
32
+ PROPERTY_SOFT_VOLUME ,
31
33
PROPERTY_VOLUME ,
32
34
};
33
35
@@ -39,8 +41,10 @@ struct property {
39
41
static bool monitor_properties = false;
40
42
static struct property monitor_properties_set [] = {
41
43
[PROPERTY_CODEC ] = { "Codec" , false },
44
+ [PROPERTY_DELAY ] = { "Delay" , false },
45
+ [PROPERTY_CLIENT_DELAY ] = { "ClientDelay" , false },
42
46
[PROPERTY_RUNNING ] = { "Running" , false },
43
- [PROPERTY_SOFTVOL ] = { "SoftVolume" , false },
47
+ [PROPERTY_SOFT_VOLUME ] = { "SoftVolume" , false },
44
48
[PROPERTY_VOLUME ] = { "Volume" , false },
45
49
};
46
50
@@ -76,23 +80,39 @@ static dbus_bool_t monitor_dbus_message_iter_get_pcm_props_cb(const char *key,
76
80
goto fail ;
77
81
const char * codec ;
78
82
dbus_message_iter_get_basic (& variant , & codec );
79
- printf ("PropertyChanged %s Codec %s\n" , path , codec );
83
+ printf ("PropertyChanged %s %s %s\n" , path , key , codec );
84
+ }
85
+ else if (monitor_properties_set [PROPERTY_DELAY ].enabled &&
86
+ strcmp (key , monitor_properties_set [PROPERTY_DELAY ].name ) == 0 ) {
87
+ if (type != (type_expected = DBUS_TYPE_UINT16 ))
88
+ goto fail ;
89
+ dbus_uint16_t delay ;
90
+ dbus_message_iter_get_basic (& variant , & delay );
91
+ printf ("PropertyChanged %s %s %#.1f\n" , path , key , delay / 10.0 );
92
+ }
93
+ else if (monitor_properties_set [PROPERTY_CLIENT_DELAY ].enabled &&
94
+ strcmp (key , monitor_properties_set [PROPERTY_CLIENT_DELAY ].name ) == 0 ) {
95
+ if (type != (type_expected = DBUS_TYPE_INT16 ))
96
+ goto fail ;
97
+ dbus_int16_t delay ;
98
+ dbus_message_iter_get_basic (& variant , & delay );
99
+ printf ("PropertyChanged %s %s %#.1f\n" , path , key , delay / 10.0 );
80
100
}
81
101
else if (monitor_properties_set [PROPERTY_RUNNING ].enabled &&
82
102
strcmp (key , monitor_properties_set [PROPERTY_RUNNING ].name ) == 0 ) {
83
103
if (type != (type_expected = DBUS_TYPE_BOOLEAN ))
84
104
goto fail ;
85
105
dbus_bool_t running ;
86
106
dbus_message_iter_get_basic (& variant , & running );
87
- printf ("PropertyChanged %s Running %s\n" , path , running ? "true" : "false" );
107
+ printf ("PropertyChanged %s %s %s\n" , path , key , running ? "true" : "false" );
88
108
}
89
- else if (monitor_properties_set [PROPERTY_SOFTVOL ].enabled &&
90
- strcmp (key , monitor_properties_set [PROPERTY_SOFTVOL ].name ) == 0 ) {
109
+ else if (monitor_properties_set [PROPERTY_SOFT_VOLUME ].enabled &&
110
+ strcmp (key , monitor_properties_set [PROPERTY_SOFT_VOLUME ].name ) == 0 ) {
91
111
if (type != (type_expected = DBUS_TYPE_BOOLEAN ))
92
112
goto fail ;
93
113
dbus_bool_t softvol ;
94
114
dbus_message_iter_get_basic (& variant , & softvol );
95
- printf ("PropertyChanged %s SoftVolume %s\n" , path , softvol ? "true" : "false" );
115
+ printf ("PropertyChanged %s %s %s\n" , path , key , softvol ? "true" : "false" );
96
116
}
97
117
else if (monitor_properties_set [PROPERTY_VOLUME ].enabled &&
98
118
strcmp (key , monitor_properties_set [PROPERTY_VOLUME ].name ) == 0 ) {
@@ -106,7 +126,7 @@ static dbus_bool_t monitor_dbus_message_iter_get_pcm_props_cb(const char *key,
106
126
dbus_message_iter_recurse (& variant , & iter );
107
127
dbus_message_iter_get_fixed_array (& iter , & data , & len );
108
128
109
- printf ("PropertyChanged %s Volume " , path );
129
+ printf ("PropertyChanged %s %s " , path , key );
110
130
for (size_t i = 0 ; i < (size_t )len ; i ++ )
111
131
printf (" %u%s" , data [i ] & 0x7f , data [i ] & 0x80 ? "[M]" : "" );
112
132
printf ("\n" );
0 commit comments