Commit 91d8bf31 authored by Jean-Francois Dockes's avatar Jean-Francois Dockes
Browse files

removed volumeDB interface

parent b96cbbc8
upmpdcli (0.3-1) unstable; urgency=low
* Removed DB volume interface, this was confusing some players
-- Jean-Francois Dockes <jf@dockes.org> Mon, 10 Feb 2014 14:09:20 +0100
upmpdcli (0.2-1) unstable; urgency=low
* Improved event management. Moderate the load generated by sound volume changes
-- Jean-Francois Dockes <jf@dockes.org> Tue, 11 Feb 2014 11:20:00 +0100
upmpdcli (0.1-1) unstable; urgency=low
* Initial release
......
......@@ -115,71 +115,6 @@
</argument>
</argumentList>
</action>
<action>
<name>GetVolumeDB</name>
<argumentList>
<argument>
<name>InstanceID</name>
<direction>in</direction>
<relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable>
</argument>
<argument>
<name>Channel</name>
<direction>in</direction>
<relatedStateVariable>A_ARG_TYPE_Channel</relatedStateVariable>
</argument>
<argument>
<name>CurrentVolume</name>
<direction>out</direction>
<relatedStateVariable>VolumeDB</relatedStateVariable>
</argument>
</argumentList>
</action>
<action>
<name>SetVolumeDB</name>
<argumentList>
<argument>
<name>InstanceID</name>
<direction>in</direction>
<relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable>
</argument>
<argument>
<name>Channel</name>
<direction>in</direction>
<relatedStateVariable>A_ARG_TYPE_Channel</relatedStateVariable>
</argument>
<argument>
<name>DesiredVolume</name>
<direction>in</direction>
<relatedStateVariable>VolumeDB</relatedStateVariable>
</argument>
</argumentList>
</action>
<action>
<name>GetVolumeDBRange</name>
<argumentList>
<argument>
<name>InstanceID</name>
<direction>in</direction>
<relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable>
</argument>
<argument>
<name>Channel</name>
<direction>in</direction>
<relatedStateVariable>A_ARG_TYPE_Channel</relatedStateVariable>
</argument>
<argument>
<name>MinValue</name>
<direction>out</direction>
<relatedStateVariable>VolumeDB</relatedStateVariable>
</argument>
<argument>
<name>MaxValue</name>
<direction>out</direction>
<relatedStateVariable>VolumeDB</relatedStateVariable>
</argument>
</argumentList>
</action>
</actionList>
<serviceStateTable>
<stateVariable sendEvents="no">
......@@ -203,15 +138,6 @@
<step>1</step>
</allowedValueRange>
</stateVariable>
<stateVariable sendEvents="no">
<name>VolumeDB</name>
<dataType>i2</dataType>
<allowedValueRange>
<minimum>-10240</minimum>
<maximum>0</maximum>
<step>1</step>
</allowedValueRange>
</stateVariable>
<stateVariable sendEvents="no">
<name>A_ARG_TYPE_Channel</name>
<dataType>string</dataType>
......
......@@ -86,8 +86,10 @@ bool MPDCli::showError(const string& who)
}
int error = mpd_connection_get_error(M_CONN);
if (error == MPD_ERROR_SUCCESS)
if (error == MPD_ERROR_SUCCESS) {
//LOGDEB("MPDCli::showError: " << who << " success !" << endl;);
return false;
}
LOGERR(who << " failed: " << mpd_connection_get_error_message(M_CONN)
<< endl);
if (error == MPD_ERROR_SERVER) {
......@@ -122,7 +124,10 @@ bool MPDCli::updStatus()
if (mpds == 0) {
openconn();
mpds = mpd_run_status(M_CONN);
LOGERR("MPDCli::updStatus: can't get status" << endl);
if (mpds == 0) {
LOGERR("MPDCli::updStatus: can't get status" << endl);
showError("MPDCli::updStatus");
}
return false;
}
......
......@@ -51,7 +51,7 @@ public:
int getVolume(const SoapArgs& sc, SoapData& data, bool isDb);
int listPresets(const SoapArgs& sc, SoapData& data);
int selectPreset(const SoapArgs& sc, SoapData& data);
int getVolumeDBRange(const SoapArgs& sc, SoapData& data);
// int getVolumeDBRange(const SoapArgs& sc, SoapData& data);
virtual bool getEventDataRendering(bool all,
std::vector<std::string>& names,
std::vector<std::string>& values);
......@@ -117,24 +117,24 @@ UpMpd::UpMpd(const string& deviceid,
{ auto bound = bind(&UpMpd::setVolume, this, _1, _2, false);
addActionMapping("SetVolume", bound);
}
{ auto bound = bind(&UpMpd::setVolume, this, _1, _2, true);
addActionMapping("SetVolumeDB", bound);
}
// { auto bound = bind(&UpMpd::setVolume, this, _1, _2, true);
// addActionMapping("SetVolumeDB", bound);
// }
{ auto bound = bind(&UpMpd::getVolume, this, _1, _2, false);
addActionMapping("GetVolume", bound);
}
{ auto bound = bind(&UpMpd::getVolume, this, _1, _2, true);
addActionMapping("GetVolumeDB", bound);
}
// { auto bound = bind(&UpMpd::getVolume, this, _1, _2, true);
// addActionMapping("GetVolumeDB", bound);
// }
{ auto bound = bind(&UpMpd::listPresets, this, _1, _2);
addActionMapping("ListPresets", bound);
}
{ auto bound = bind(&UpMpd::selectPreset, this, _1, _2);
addActionMapping("SelectPreset", bound);
}
{ auto bound = bind(&UpMpd::getVolumeDBRange, this, _1, _2);
addActionMapping("GetVolumeDBRange", bound);
}
// { auto bound = bind(&UpMpd::getVolumeDBRange, this, _1, _2);
// addActionMapping("GetVolumeDBRange", bound);
// }
addServiceType(serviceIdTransport,
"urn:schemas-upnp-org:service:AVTransport:1");
......@@ -237,8 +237,8 @@ bool UpMpd::rdstateMToU(unordered_map<string, string>& status)
char cvalue[30];
sprintf(cvalue, "%d", volume);
status["Volume"] = cvalue;
sprintf(cvalue, "%d", percentodbvalue(volume));
status["VolumeDB"] = cvalue;
// sprintf(cvalue, "%d", percentodbvalue(volume));
// status["VolumeDB"] = cvalue;
status["Mute"] = volume == 0 ? "1" : "0";
}
......@@ -306,7 +306,7 @@ bool UpMpd::getEventDataRendering(bool all, std::vector<std::string>& names,
// specified in the service description (SCPD) available from the
// device.
#if 0
int UpMpd::getVolumeDBRange(const SoapArgs& sc, SoapData& data)
{
map<string, string>::const_iterator it;
......@@ -320,7 +320,7 @@ int UpMpd::getVolumeDBRange(const SoapArgs& sc, SoapData& data)
return UPNP_E_SUCCESS;
}
#endif
int UpMpd::setMute(const SoapArgs& sc, SoapData& data)
{
map<string, string>::const_iterator it;
......@@ -813,7 +813,7 @@ int UpMpd::playcontrol(const SoapArgs& sc, SoapData& data, int what)
case MpdStatus::MPDS_PLAY:
switch (what) {
case 0: ok = m_mpdcli->stop(); break;
case 1:break;
case 1: ok = m_mpdcli->play();break;
case 2: ok = m_mpdcli->togglePause();break;
}
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment