diff options
Diffstat (limited to 'src/call-volume.c')
-rw-r--r-- | src/call-volume.c | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/src/call-volume.c b/src/call-volume.c index 7a0bc9a5..415f177d 100644 --- a/src/call-volume.c +++ b/src/call-volume.c @@ -48,34 +48,44 @@ static GSList *g_drivers = NULL; struct ofono_call_volume { DBusMessage *pending; + unsigned char speaker_volume; + unsigned char microphone_volume; + unsigned char pending_volume; const struct ofono_call_volume_driver *driver; - int flags; void *driver_data; struct ofono_atom *atom; +}; - unsigned char speaker_volume; - unsigned char microphone_volume; +void ofono_call_volume_set_speaker_volume(struct ofono_call_volume *cv, + unsigned char percent) +{ + DBusConnection *conn = ofono_dbus_get_connection(); + const char *path = __ofono_atom_get_path(cv->atom); - /* temp volume before it is accepted by remote */ - unsigned char temp_volume; -}; + cv->speaker_volume = percent; -void ofono_call_volume_notify(struct ofono_call_volume *cv, - const char *property, + if (__ofono_atom_get_registered(cv->atom) == FALSE) + return; + + ofono_dbus_signal_property_changed(conn, path, CALL_VOLUME_INTERFACE, + "SpeakerVolume", + DBUS_TYPE_BYTE, &percent); +} + +void ofono_call_volume_set_microphone_volume(struct ofono_call_volume *cv, unsigned char percent) { DBusConnection *conn = ofono_dbus_get_connection(); const char *path = __ofono_atom_get_path(cv->atom); - if (!strcmp(property, "SpeakerVolume")) - cv->speaker_volume = percent; + cv->microphone_volume = percent; - if (!strcmp(property, "MicrophoneVolume")) - cv->microphone_volume = percent; + if (__ofono_atom_get_registered(cv->atom) == FALSE) + return; ofono_dbus_signal_property_changed(conn, path, CALL_VOLUME_INTERFACE, - property, DBUS_TYPE_BYTE, - &percent); + "MicrophoneVolume", + DBUS_TYPE_BYTE, &percent); } static DBusMessage *cv_get_properties(DBusConnection *conn, |