The PulseAudio DBUS API page says that the arguments to LoadModule are
Arguments: name : String, arguments : {String -> String}
It also states that {String -> String} is a dictionary with a String key and String value.
How do I send this via the c++ API? Normally I would do something like this:
msg = dbus_message_new_method_call(
"org.PulseAudio1", //Destination
"/org/pulseaudio/core1", //Object path to call on
interfaceStr, //Interface to call on
method); //Method
Then create a msg iterator:
//append arguments to the LoadModule() method. (String, {String->String})
dbus_message_iter_init_append(msg, &msgIter);
dbus_message_iter_append_basic(&msgIter, DBUS_TYPE_STRING,&moduleName);
//dict entries
dbus_message_iter_open_container(&msgIter, DBUS_TYPE_DICT_ENTRY, NULL, &subIter);
dbus_message_iter_append_basic(&subIter, DBUS_TYPE_STRING, &sourceStr);
dbus_message_iter_append_basic(&subIter, DBUS_TYPE_STRING, &sourcePath);
dbus_message_iter_close_container(&msgIter, &subIter);
dbus_message_iter_open_container(&msgIter, DBUS_TYPE_DICT_ENTRY, NULL, &subIter);
dbus_message_iter_append_basic(&subIter, DBUS_TYPE_STRING, &sinkStr);
dbus_message_iter_append_basic(&subIter, DBUS_TYPE_STRING, &sinkPath);
dbus_message_iter_close_container(&msgIter, &subIter);
This creates a parameter list like this, I think: LoadModule(String, {String->String}, {String->String})
However, the function does not give a reply. I don't think I'm creating the parameters correctly. In fact, I'm pretty sure I'm not. I've seen others use arrays for different methods, but it does not specify that here. Is there a way to specifically state that something is a key/value?
UPDATE:
I found this line: A dictionary entry must be element of an array, and it must contain only a key-value pair of two elements, with a basic D-Bus type key. on the GNU Using of D-Bus Page, in case it helps. I'll try that and post the results.