3
Fork 0

Updated API

This commit is contained in:
Artem Prilutskiy 2016-04-08 15:58:05 +03:00
parent 83efcf40d7
commit a50c976356
5 changed files with 15 additions and 15 deletions

View file

@ -36,13 +36,13 @@ PatchCordProxy::~PatchCordProxy()
void PatchCordProxy::setTalkerID(uint32_t value)
{
getContextBanner();
setVendorSpecificValue(VALUE_CORD_OUTGOING_SOURCE_ID, value);
setSpecificValue(VALUE_CORD_OUTGOING_SOURCE_ID, value);
}
uint32_t PatchCordProxy::getTalkerID()
{
getContextBanner();
return getVendorSpecificValue(VALUE_CORD_INCOMING_SOURCE_ID);
return getSpecificValue(VALUE_CORD_INCOMING_SOURCE_ID);
}
void PatchCordProxy::getContextBanner()
@ -80,10 +80,10 @@ void PatchCordProxy::getContextBanner()
dbus_message_unref(message);
}
void PatchCordProxy::setVendorSpecificValue(uint32_t key, uint32_t value)
void PatchCordProxy::setSpecificValue(uint32_t key, uint32_t value)
{
DBusMessage* message = dbus_message_new_method_call(
name, OBJECT_PATH, INTERFACE_NAME, "setVendorSpecificValue");
name, OBJECT_PATH, INTERFACE_NAME, "setSpecificValue");
dbus_message_append_args(message,
DBUS_TYPE_STRING, &banner,
@ -106,7 +106,7 @@ void PatchCordProxy::setVendorSpecificValue(uint32_t key, uint32_t value)
banner = NULL;
}
uint32_t PatchCordProxy::getVendorSpecificValue(uint32_t key)
uint32_t PatchCordProxy::getSpecificValue(uint32_t key)
{
DBusMessage* message = dbus_message_new_method_call(
name, OBJECT_PATH, INTERFACE_NAME, "getContextData");

View file

@ -25,8 +25,8 @@ class PatchCordProxy
char* banner;
void getContextBanner();
void setVendorSpecificValue(uint32_t key, uint32_t value);
uint32_t getVendorSpecificValue(uint32_t key);
void setSpecificValue(uint32_t key, uint32_t value);
uint32_t getSpecificValue(uint32_t key);
};

View file

@ -32,7 +32,7 @@ BrandMeisterBridge::~BrandMeisterBridge()
void BrandMeisterBridge::setProxyConfiguration(const char* configuration)
{
char* pointer = const_cast<char*>(configuration);
// <Network ID>:<PatchCord ID>
uint32_t network = strtol(pointer + 0, &pointer, 10);
uint32_t link = strtol(pointer + 1, &pointer, 10);
proxy = new PatchCordProxy(network, link);

View file

@ -36,13 +36,13 @@ PatchCordProxy::~PatchCordProxy()
void PatchCordProxy::setTalkerID(uint32_t value)
{
getContextBanner();
setVendorSpecificValue(VALUE_CORD_OUTGOING_SOURCE_ID, value);
setSpecificValue(VALUE_CORD_OUTGOING_SOURCE_ID, value);
}
uint32_t PatchCordProxy::getTalkerID()
{
getContextBanner();
return getVendorSpecificValue(VALUE_CORD_INCOMING_SOURCE_ID);
return getSpecificValue(VALUE_CORD_INCOMING_SOURCE_ID);
}
void PatchCordProxy::getContextBanner()
@ -80,10 +80,10 @@ void PatchCordProxy::getContextBanner()
dbus_message_unref(message);
}
void PatchCordProxy::setVendorSpecificValue(uint32_t key, uint32_t value)
void PatchCordProxy::setSpecificValue(uint32_t key, uint32_t value)
{
DBusMessage* message = dbus_message_new_method_call(
name, OBJECT_PATH, INTERFACE_NAME, "setVendorSpecificValue");
name, OBJECT_PATH, INTERFACE_NAME, "setSpecificValue");
dbus_message_append_args(message,
DBUS_TYPE_STRING, &banner,
@ -106,7 +106,7 @@ void PatchCordProxy::setVendorSpecificValue(uint32_t key, uint32_t value)
banner = NULL;
}
uint32_t PatchCordProxy::getVendorSpecificValue(uint32_t key)
uint32_t PatchCordProxy::getSpecificValue(uint32_t key)
{
DBusMessage* message = dbus_message_new_method_call(
name, OBJECT_PATH, INTERFACE_NAME, "getContextData");

View file

@ -25,8 +25,8 @@ class PatchCordProxy
char* banner;
void getContextBanner();
void setVendorSpecificValue(uint32_t key, uint32_t value);
uint32_t getVendorSpecificValue(uint32_t key);
void setSpecificValue(uint32_t key, uint32_t value);
uint32_t getSpecificValue(uint32_t key);
};