summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AudioManagerDaemon/src/CAmDatabaseHandler.cpp4
-rw-r--r--PluginControlInterface/src/CAmControlSenderBase.cpp33
-rw-r--r--PluginRoutingInterfaceDbus/include/RoutingReceiver.xml4
-rw-r--r--PluginRoutingInterfaceDbus/include/RoutingSender.xml10
-rw-r--r--PluginRoutingInterfaceDbus/src/CAmDbusSend.cpp20
5 files changed, 44 insertions, 27 deletions
diff --git a/AudioManagerDaemon/src/CAmDatabaseHandler.cpp b/AudioManagerDaemon/src/CAmDatabaseHandler.cpp
index de6296c..68a82c6 100644
--- a/AudioManagerDaemon/src/CAmDatabaseHandler.cpp
+++ b/AudioManagerDaemon/src/CAmDatabaseHandler.cpp
@@ -273,7 +273,7 @@ am_Error_e CAmDatabaseHandler::enterMainConnectionDB(const am_MainConnection_s &
}
else
{
- logError("DatabaseHandler::enterMainConnectionDB did not find route for MainConnection:", eCode);
+ logError("DatabaseHandler::enterMainConnectionDB did not find route for MainConnection: ", eCode);
MY_SQLITE_FINALIZE(query)
return (E_DATABASE_ERROR);
}
@@ -899,7 +899,7 @@ am_Error_e CAmDatabaseHandler::changeMainConnectionRouteDB(const am_mainConnecti
}
else
{
- logError("DatabaseHandler::changeMainConnectionRouteDB did not find route for MainConnection:", eCode);
+ logError("DatabaseHandler::changeMainConnectionRouteDB did not find route for MainConnection: ", eCode);
MY_SQLITE_FINALIZE(query)
return (E_DATABASE_ERROR);
}
diff --git a/PluginControlInterface/src/CAmControlSenderBase.cpp b/PluginControlInterface/src/CAmControlSenderBase.cpp
index 1277beb..34d6852 100644
--- a/PluginControlInterface/src/CAmControlSenderBase.cpp
+++ b/PluginControlInterface/src/CAmControlSenderBase.cpp
@@ -122,7 +122,10 @@ am_Error_e CAmControlSenderBase::hookUserDisconnectionRequest(const am_mainConne
{
handleStatus status;
status.status = false;
- mControlReceiveInterface->disconnect(status.handle, *it);
+ if((error=mControlReceiveInterface->disconnect(status.handle, *it)))
+ {
+ logError("Could not disconnect, Error", error);
+ }
listHandleStaus.push_back(status);
}
mainConnectionSet set;
@@ -173,7 +176,21 @@ am_Error_e CAmControlSenderBase::hookUserVolumeChange(const am_sinkID_t SinkID,
set.sinkID = SinkID;
set.mainVolume = newVolume;
am_Error_e error;
- if ((error = mControlReceiveInterface->setSinkVolume(set.handle, SinkID, newVolume, RAMP_GENIVI_DIRECT, 20)) != E_OK)
+
+ std::vector<mainVolumeSet>::iterator it(mListOpenVolumeChanges.begin());
+ for(;it!=mListOpenVolumeChanges.end();++it)
+ {
+ if (it->sinkID==SinkID)
+ return E_NOT_POSSIBLE;
+ }
+
+ am_Sink_s sinkData;
+ mControlReceiveInterface->getSinkInfoDB(SinkID,sinkData);
+
+ if (sinkData.mainVolume==newVolume)
+ return E_NO_CHANGE;
+
+ if ((error = mControlReceiveInterface->setSinkVolume(set.handle, SinkID, newVolume*3199, RAMP_UNKNOWN, 20)) != E_OK)
{
return error;
}
@@ -188,9 +205,15 @@ am_Error_e CAmControlSenderBase::hookUserVolumeStep(const am_sinkID_t SinkID, co
set.sinkID = SinkID;
am_Error_e error;
am_Sink_s sink;
+ std::vector<mainVolumeSet>::iterator it(mListOpenVolumeChanges.begin());
+ for(;it!=mListOpenVolumeChanges.end();++it)
+ {
+ if (it->sinkID==SinkID)
+ return E_NOT_POSSIBLE;
+ }
mControlReceiveInterface->getSinkInfoDB(SinkID, sink);
- set.mainVolume = sink.volume + increment;
- if ((error = mControlReceiveInterface->setSinkVolume(set.handle, SinkID, set.mainVolume, RAMP_GENIVI_DIRECT, 20)) != E_OK)
+ set.mainVolume = sink.volume + increment*3199;
+ if ((error = mControlReceiveInterface->setSinkVolume(set.handle, SinkID, set.mainVolume, RAMP_UNKNOWN, 20)) != E_OK)
{
return error;
}
@@ -414,6 +437,8 @@ void CAmControlSenderBase::cbAckSetSinkVolumeChange(const am_Handle_s handle, co
if (handle.handle == it->handle.handle)
{
mControlReceiveInterface->changeSinkMainVolumeDB(it->mainVolume, it->sinkID);
+ mListOpenVolumeChanges.erase(it);
+ break;
}
}
}
diff --git a/PluginRoutingInterfaceDbus/include/RoutingReceiver.xml b/PluginRoutingInterfaceDbus/include/RoutingReceiver.xml
index a263966..711e166 100644
--- a/PluginRoutingInterfaceDbus/include/RoutingReceiver.xml
+++ b/PluginRoutingInterfaceDbus/include/RoutingReceiver.xml
@@ -17,12 +17,12 @@
</method>
<method name="ackSetSinkVolume">
<arg name="handle" type="q" direction="in" />
- <arg name="volume" type="i" direction="in" />
+ <arg name="volume" type="n" direction="in" />
<arg name="error" type="q" direction="in" />
</method>
<method name="ackSetSourceVolume">
<arg name="handle" type="q" direction="in" />
- <arg name="volume" type="i" direction="in" />
+ <arg name="volume" type="n" direction="in" />
<arg name="error" type="q" direction="in" />
</method>
<method name="ackSetSourceState">
diff --git a/PluginRoutingInterfaceDbus/include/RoutingSender.xml b/PluginRoutingInterfaceDbus/include/RoutingSender.xml
index 7841218..d6fb2ea 100644
--- a/PluginRoutingInterfaceDbus/include/RoutingSender.xml
+++ b/PluginRoutingInterfaceDbus/include/RoutingSender.xml
@@ -4,11 +4,11 @@
"http://standards.freedesktop.org/dbus/1.0/introspect.dtd">
<node>
- <interface name='org.pulseaudio.genivi.RoutingSender'>
+ <interface name='org.pulseaudio.genivi.RoutingSend'>
<method name='asyncAbort'>
<arg name='handle' type='q' direction='in' />
<arg name='error' type='n' direction='out' />
- </method>
+ </method>
<method name='asyncConnect'>
<arg name='handle' type='q' direction='in' />
<arg name='connectionID' type='q' direction='in' />
@@ -22,7 +22,7 @@
<arg name='connectionID' type='q' direction='in' />
<arg name='error' type='n' direction='out' />
</method>
- <method name='setSinkVolume'>
+ <method name='asyncSetSinkVolume'>
<arg name='handle' type='q' direction='in' />
<arg name='sinkID' type='q' direction='in' />
<arg name='volume' type='n' direction='in' />
@@ -30,7 +30,7 @@
<arg name='time' type='q' direction='in' />
<arg name='error' type='n' direction='out' />
</method>
- <method name='setSourceVolume'>
+ <method name='asyncSetSourceVolume'>
<arg name='handle' type='q' direction='in' />
<arg name='sourceID' type='q' direction='in' />
<arg name='volume' type='n' direction='in' />
@@ -81,5 +81,5 @@
<arg name='domainState' type='q' direction='in' />
<arg name='error' type='n' direction='out' />
</method>
-</interface>
+ </interface>
</node>
diff --git a/PluginRoutingInterfaceDbus/src/CAmDbusSend.cpp b/PluginRoutingInterfaceDbus/src/CAmDbusSend.cpp
index 0f02ab3..cca1cd7 100644
--- a/PluginRoutingInterfaceDbus/src/CAmDbusSend.cpp
+++ b/PluginRoutingInterfaceDbus/src/CAmDbusSend.cpp
@@ -116,25 +116,17 @@ void CAmRoutingDbusSend::append(am_SoundProperty_s soundProperty)
am_Error_e CAmRoutingDbusSend::send()
{
- am_Error_e error;
+ int16_t error;
DBusMessage* reply(dbus_connection_send_with_reply_and_block(mpDbusConnection, mpDbusMessage, -1, &mDBusError));
if (!reply)
{
log(&routingDbus, DLT_LOG_ERROR, "CAmRoutingDbusSend::send failed, dbus error", mDBusError.message);
return (E_UNKNOWN);
}
- if (!dbus_message_iter_init(reply, &mDbusMessageIter))
- {
- log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::send DBus Message has no arguments!");
- }
- if (DBUS_TYPE_INT16 != dbus_message_iter_get_arg_type(&mDbusMessageIter))
- {
- log(&routingDbus, DLT_LOG_ERROR, "DBusMessageHandler::getBool DBUS handler argument is no error!");
- }
- else
- {
- dbus_message_iter_get_basic(&mDbusMessageIter, &error);
- }
- return (error);
+ if(!dbus_message_get_args(reply, &mDBusError, //
+ DBUS_TYPE_INT16, &error, //
+ DBUS_TYPE_INVALID))
+ return (E_UNKNOWN);
+ return (static_cast<am_Error_e>(error));
}
}