-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
439 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> | ||
<busconfig> | ||
<policy group="audio"> | ||
<allow own="org.nemomobile.Route.Manager"/> | ||
</policy> | ||
<policy group="whell"> | ||
<allow own="org.maemo.resource.manager"/> | ||
</policy> | ||
<policy context="default"> | ||
<allow send_destination="org.nemomobile.Route.Manager" send_interface="org.nemomobile.Route.Manager"/> | ||
<allow send_destination="org.maemo.resource.manager" send_interface="org.maemo.resource.manager"/> | ||
</policy> | ||
</busconfig> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include "audioroutemanager.h" | ||
#include "routemanageradaptor.h" | ||
|
||
#include <QDBusConnection> | ||
#include <QDBusError> | ||
|
||
AudioRouteManager::AudioRouteManager(QObject* parent) | ||
: QObject { parent } | ||
{ | ||
QDBusConnection systemBus = QDBusConnection::systemBus(); | ||
|
||
m_audioRouteSerice = new AudioRouteService(this); | ||
new RouteManagerAdaptor(m_audioRouteSerice); | ||
|
||
if (!systemBus.registerObject("/org/nemomobile/Route/Manager", "org.nemomobile.Route.Manager", m_audioRouteSerice)) { | ||
qWarning() << "Cant register Audio Router Manager"; | ||
} | ||
|
||
if (!systemBus.registerService("org.nemomobile.Route.Manager")) { | ||
qWarning("Unable to register D-Bus service %s: %s", "org.nemomobile.Route.Manager", systemBus.lastError().message().toUtf8().constData()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#ifndef AUDIOROUTEMANAGER_H | ||
#define AUDIOROUTEMANAGER_H | ||
|
||
#include "audiorouteservice.h" | ||
#include <QObject> | ||
|
||
class AudioRouteManager : public QObject { | ||
Q_OBJECT | ||
public: | ||
explicit AudioRouteManager(QObject* parent = nullptr); | ||
|
||
private: | ||
AudioRouteService* m_audioRouteSerice; | ||
}; | ||
|
||
#endif // AUDIOROUTEMANAGER_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
#include "audiorouteservice.h" | ||
#include <QDebug> | ||
#include <QVariantMap> | ||
|
||
AudioRouteService::AudioRouteService(QObject* parent) | ||
: QObject(parent) | ||
{ | ||
} | ||
|
||
QString AudioRouteService::ActiveRoutes(uint& output_device_type, QString& input_device, uint& input_device_type) | ||
{ | ||
qDebug() << output_device_type; | ||
qDebug() << input_device; | ||
qDebug() << input_device_type; | ||
|
||
qWarning() << "NOT IMPLEMENTED YEAT" << Q_FUNC_INFO; | ||
return ""; | ||
} | ||
|
||
QString AudioRouteService::GetAll(uint& output_device_type, QString& input_device, uint& input_device_type, QVariantMap& features) | ||
{ | ||
qDebug() << output_device_type; | ||
qDebug() << input_device; | ||
qDebug() << input_device_type; | ||
qDebug() << features; | ||
|
||
qWarning() << "NOT IMPLEMENTED YEAT" << Q_FUNC_INFO; | ||
return ""; | ||
} | ||
|
||
void AudioRouteService::Disable(const QString& feature) | ||
{ | ||
qDebug() << feature; | ||
qWarning() << "NOT IMPLEMENTED YEAT" << Q_FUNC_INFO; | ||
} | ||
|
||
void AudioRouteService::Enable(const QString& feature) | ||
{ | ||
qDebug() << feature; | ||
qWarning() << "NOT IMPLEMENTED YEAT" << Q_FUNC_INFO; | ||
} | ||
|
||
void AudioRouteService::Prefer(const QString& device) | ||
{ | ||
qDebug() << device; | ||
qWarning() << "NOT IMPLEMENTED YEAT" << Q_FUNC_INFO; | ||
} | ||
|
||
QStringList AudioRouteService::Features() | ||
{ | ||
qWarning() << "NOT IMPLEMENTED YEAT" << Q_FUNC_INFO; | ||
QStringList features = QStringList() << "bluetooth_override" | ||
<< "speaker" | ||
<< "voicecallrecord" | ||
<< "fmradioloopback" | ||
<< "fmradio" | ||
<< "emergencycall"; | ||
|
||
return features; | ||
} | ||
|
||
QStringList AudioRouteService::FeaturesAllowed() | ||
{ | ||
qWarning() << "NOT IMPLEMENTED YEAT" << Q_FUNC_INFO; | ||
return QStringList(); | ||
} | ||
|
||
QStringList AudioRouteService::FeaturesEnabled() | ||
{ | ||
qWarning() << "NOT IMPLEMENTED YEAT" << Q_FUNC_INFO; | ||
return QStringList(); | ||
} | ||
|
||
uint AudioRouteService::InterfaceVersion() | ||
{ | ||
qWarning() << "NOT IMPLEMENTED YEAT" << Q_FUNC_INFO; | ||
return 0; | ||
} | ||
|
||
QVariantMap AudioRouteService::Routes() | ||
{ | ||
qWarning() << "NOT IMPLEMENTED YEAT" << Q_FUNC_INFO; | ||
return QVariantMap(); | ||
} | ||
|
||
QVariantMap AudioRouteService::RoutesFiltered(uint filter) | ||
{ | ||
qDebug() << filter; | ||
qWarning() << "NOT IMPLEMENTED YEAT" << Q_FUNC_INFO; | ||
return QVariantMap(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#ifndef AUDIOROUTESERVICE_H | ||
#define AUDIOROUTESERVICE_H | ||
|
||
#include <QObject> | ||
|
||
class AudioRouteService : public QObject { | ||
Q_OBJECT | ||
|
||
public: | ||
explicit AudioRouteService(QObject* parent = nullptr); | ||
QString ActiveRoutes(uint& output_device_type, QString& input_device, uint& input_device_type); | ||
QString GetAll(uint& output_device_type, QString& input_device, uint& input_device_type, QVariantMap& features); | ||
|
||
void Disable(const QString& feature); | ||
void Enable(const QString& feature); | ||
void Prefer(const QString& device); | ||
|
||
QStringList Features(); | ||
QStringList FeaturesAllowed(); | ||
QStringList FeaturesEnabled(); | ||
uint InterfaceVersion(); | ||
|
||
QVariantMap Routes(); | ||
QVariantMap RoutesFiltered(uint filter); | ||
}; | ||
|
||
#endif // AUDIOROUTESERVICE_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> | ||
<node> | ||
<interface name="org.nemomobile.Route.Manager"> | ||
<method name="InterfaceVersion"> | ||
<arg name="version" type="u" direction="out"/> | ||
</method> | ||
<!-- since InterfaceVersion 1 --> | ||
<method name="GetAll"> | ||
<annotation name="org.qtproject.QtDBus.QtTypeName.Out4" value="QVariantMap"/> | ||
<arg name="output_device" type="s" direction="out"/> | ||
<arg name="output_device_type" type="u" direction="out"/> | ||
<arg name="input_device" type="s" direction="out"/> | ||
<arg name="input_device_type" type="u" direction="out"/> | ||
<arg name="features" type="a(suu)" direction="out"/> | ||
</method> | ||
<method name="Enable"> | ||
<arg name="feature" type="s" direction="in"/> | ||
</method> | ||
<method name="Disable"> | ||
<arg name="feature" type="s" direction="in"/> | ||
</method> | ||
<signal name="AudioRouteChanged"> | ||
<arg name="device" type="s"/> | ||
<arg name="device_type" type="u"/> | ||
</signal> | ||
<signal name="AudioFeatureChanged"> | ||
<arg name="name" type="s"/> | ||
<arg name="allowed" type="u"/> | ||
<arg name="enabled" type="u"/> | ||
</signal> | ||
|
||
<!-- since InterfaceVersion 2 --> | ||
<method name="Features"> | ||
<arg name="features" type="as" direction="out"/> | ||
</method> | ||
<method name="FeaturesAllowed"> | ||
<arg name="features_allowed" type="as" direction="out"/> | ||
</method> | ||
<method name="FeaturesEnabled"> | ||
<arg name="features_enabled" type="as" direction="out"/> | ||
</method> | ||
<method name="Routes"> | ||
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMap"/> | ||
<arg name="routes" type="a(su)" direction="out"/> | ||
</method> | ||
<method name="ActiveRoutes"> | ||
<arg name="output_device" type="s" direction="out"/> | ||
<arg name="output_device_type" type="u" direction="out"/> | ||
<arg name="input_device" type="s" direction="out"/> | ||
<arg name="input_device_type" type="u" direction="out"/> | ||
</method> | ||
|
||
<!-- since InterfaceVersion 3 --> | ||
<method name="RoutesFiltered"> | ||
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMap"/> | ||
<arg name="filter" type="u" direction="in"/> | ||
<arg name="routes" type="a(su)" direction="out"/> | ||
</method> | ||
|
||
<method name="Prefer"> | ||
<arg name="device" type="sub" direction="in"/> | ||
</method> | ||
</interface> | ||
</node> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> | ||
<node> | ||
<interface name="org.maemo.resource.manager"> | ||
<method name="Register"> | ||
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMap"/> | ||
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/> | ||
<arg name="send" type="a(iuuuuuusu)" direction="in"/> | ||
<arg name="error" type="a(iuuis)" direction="out"/> | ||
</method> | ||
<method name="unregister"> | ||
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMap"/> | ||
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/> | ||
<arg name="send" type="a(iuu)" direction="in"/> | ||
<arg name="error" type="a(iuuis)" direction="out"/> | ||
</method> | ||
<method name="update"> | ||
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMap"/> | ||
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/> | ||
<arg name="send" type="a(iuuuuuusu)" direction="in"/> | ||
<arg name="error" type="a(iuuis)" direction="out"/> | ||
</method> | ||
<method name="acquire"> | ||
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMap"/> | ||
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/> | ||
<arg name="send" type="a(iuu)" direction="in"/> | ||
<arg name="error" type="a(iuuis)" direction="out"/> | ||
</method> | ||
<method name="release"> | ||
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMap"/> | ||
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/> | ||
<arg name="send" type="a(iuu)" direction="in"/> | ||
<arg name="error" type="a(iuuis)" direction="out"/> | ||
</method> | ||
<method name="grant"> | ||
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMap"/> | ||
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/> | ||
<arg name="send" type="a(iuuu)" direction="in"/> | ||
<arg name="error" type="a(iuuis)" direction="out"/> | ||
</method> | ||
<method name="advice"> | ||
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMap"/> | ||
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/> | ||
<arg name="send" type="a(iuuu)" direction="in"/> | ||
<arg name="error" type="a(iuuis)" direction="out"/> | ||
</method> | ||
<method name="audio"> | ||
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMap"/> | ||
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/> | ||
<arg name="send" type="a(iuususis)" direction="in"/> | ||
<arg name="error" type="a(iuuis)" direction="out"/> | ||
</method> | ||
<method name="video"> | ||
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMap"/> | ||
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/> | ||
<arg name="send" type="a(iuuu)" direction="in"/> | ||
<arg name="error" type="a(iuuis)" direction="out"/> | ||
</method> | ||
</interface> | ||
</node> |
Oops, something went wrong.