Commit ee588f9e authored by pvuorela's avatar pvuorela

Merge branch 'master' into 'master'

VoiceCall: Make it work without Mer specific bits

See merge request !19
parents c15b7f95 d9f246e8
...@@ -5,6 +5,10 @@ QT = core dbus ...@@ -5,6 +5,10 @@ QT = core dbus
CONFIG += c++11 CONFIG += c++11
enable-debug {
DEFINES += WANT_TRACE
}
HEADERS += \ HEADERS += \
common.h \ common.h \
voicecallmanagerinterface.h \ voicecallmanagerinterface.h \
......
...@@ -5,7 +5,14 @@ QT = core dbus qml multimedia ...@@ -5,7 +5,14 @@ QT = core dbus qml multimedia
TARGET = voicecall TARGET = voicecall
uri = org.nemomobile.voicecall uri = org.nemomobile.voicecall
PKGCONFIG += ngf-qt5 enable-debug {
DEFINES += WANT_TRACE
}
enable-ngf {
PKGCONFIG += ngf-qt5
DEFINES += WITH_NGF
}
HEADERS += \ HEADERS += \
voicecallaudiorecorder.h \ voicecallaudiorecorder.h \
......
#include "common.h" #include "common.h"
#include "voicecallmanager.h" #include "voicecallmanager.h"
#ifdef WITH_NGF
#include <NgfClient> #include <NgfClient>
#endif
#include <QQmlInfo> #include <QQmlInfo>
#include <QQmlEngine> #include <QQmlEngine>
...@@ -22,7 +24,9 @@ public: ...@@ -22,7 +24,9 @@ public:
voicecalls(NULL), voicecalls(NULL),
providers(NULL), providers(NULL),
activeVoiceCall(NULL), activeVoiceCall(NULL),
#ifdef WITH_NGF
ngf(0), ngf(0),
#endif
eventId(0), eventId(0),
connected(false) connected(false)
{ /*...*/ } { /*...*/ }
...@@ -36,7 +40,10 @@ public: ...@@ -36,7 +40,10 @@ public:
VoiceCallHandler* activeVoiceCall; VoiceCallHandler* activeVoiceCall;
#ifdef WITH_NGF
Ngf::Client *ngf; Ngf::Client *ngf;
#endif
quint32 eventId; quint32 eventId;
bool connected; bool connected;
...@@ -74,8 +81,10 @@ void VoiceCallManager::initialize(bool notifyError) ...@@ -74,8 +81,10 @@ void VoiceCallManager::initialize(bool notifyError)
Q_D(VoiceCallManager); Q_D(VoiceCallManager);
bool success = false; bool success = false;
#ifdef WITH_NGF
d->ngf = new Ngf::Client(this); d->ngf = new Ngf::Client(this);
d->ngf->connect(); d->ngf->connect();
#endif
if(d->interface->isValid()) if(d->interface->isValid())
{ {
...@@ -287,11 +296,14 @@ bool VoiceCallManager::startDtmfTone(const QString &tone) ...@@ -287,11 +296,14 @@ bool VoiceCallManager::startDtmfTone(const QString &tone)
QMap<QString, QVariant> properties; QMap<QString, QVariant> properties;
properties.insert("tonegen.value", toneId); properties.insert("tonegen.value", toneId);
#ifdef WITH_NGF
if (d->eventId > 0) if (d->eventId > 0)
{ {
d->ngf->stop(d->eventId); d->ngf->stop(d->eventId);
} }
d->eventId = d->ngf->play("dtmf", properties); d->eventId = d->ngf->play("dtmf", properties);
#endif
return true; return true;
} }
...@@ -303,7 +315,9 @@ bool VoiceCallManager::stopDtmfTone() ...@@ -303,7 +315,9 @@ bool VoiceCallManager::stopDtmfTone()
if (d->eventId > 0) if (d->eventId > 0)
{ {
#ifdef WITH_NGF
d->ngf->stop(d->eventId); d->ngf->stop(d->eventId);
#endif
d->eventId = 0; d->eventId = 0;
} }
......
...@@ -4,6 +4,10 @@ QT += dbus ...@@ -4,6 +4,10 @@ QT += dbus
DEFINES += PLUGIN_NAME=\\\"voicecall-playback-manager-plugin\\\" DEFINES += PLUGIN_NAME=\\\"voicecall-playback-manager-plugin\\\"
enable-debug {
DEFINES += WANT_TRACE
}
HEADERS += \ HEADERS += \
playbackmanagerplugin.h playbackmanagerplugin.h
......
TEMPLATE = subdirs TEMPLATE = subdirs
SUBDIRS = declarative providers ngf playback-manager mce SUBDIRS = declarative providers playback-manager mce
enable-ngf {
SUBDIRS += ngf
}
...@@ -4,6 +4,10 @@ QT += dbus ...@@ -4,6 +4,10 @@ QT += dbus
PKGCONFIG += qofono-qt5 PKGCONFIG += qofono-qt5
enable-debug {
DEFINES += WANT_TRACE
}
HEADERS += \ HEADERS += \
ofonovoicecallhandler.h \ ofonovoicecallhandler.h \
ofonovoicecallprovider.h \ ofonovoicecallprovider.h \
......
TEMPLATE = subdirs TEMPLATE = subdirs
SUBDIRS = ofono telepathy SUBDIRS = ofono
enable-telepathy {
SUBDIRS += telepathy
}
...@@ -76,6 +76,7 @@ BuildRequires: pkgconfig(qofono-qt5) ...@@ -76,6 +76,7 @@ BuildRequires: pkgconfig(qofono-qt5)
%qmake5 %qmake5
qmake -qt=5 CONFIG+=enable-ngf CONFIG+=enable-audiopolicy CONFIG+=enable-telepathy CONFIG+=enable-nemo-devicelock CONFIG+=install-servicefiles
make %{?_smp_mflags} make %{?_smp_mflags}
%install %install
......
...@@ -5,7 +5,10 @@ CONFIG += link_pkgconfig ...@@ -5,7 +5,10 @@ CONFIG += link_pkgconfig
INCLUDEPATH += ../lib/src INCLUDEPATH += ../lib/src
PKGCONFIG += libresourceqt5 nemodevicelock enable-nemo-devicelock {
PKGCONFIG += libresourceqt5 nemodevicelock
DEFINES += WITH_NEMO_DEVICELOCK
}
packagesExist(qt5-boostable) { packagesExist(qt5-boostable) {
DEFINES += HAS_BOOSTER DEFINES += HAS_BOOSTER
...@@ -14,26 +17,28 @@ packagesExist(qt5-boostable) { ...@@ -14,26 +17,28 @@ packagesExist(qt5-boostable) {
warning("qt5-boostable not available; startup times will be slower") warning("qt5-boostable not available; startup times will be slower")
} }
QT += multimedia # for basic ringtone plugin. QT += multimedia # for basic ringtone plugin.
LIBS += -L../lib/src -lvoicecall LIBS += -L../lib/src -lvoicecall
HEADERS += \ HEADERS += \
dbus/voicecallmanagerdbusservice.h \ dbus/voicecallmanagerdbusservice.h \
basicvoicecallconfigurator.h \ basicvoicecallconfigurator.h \
audiocallpolicyproxy.h \
voicecallmanager.h \ voicecallmanager.h \
basicringtonenotificationprovider.h basicringtonenotificationprovider.h
SOURCES += \ SOURCES += \
dbus/voicecallmanagerdbusservice.cpp \ dbus/voicecallmanagerdbusservice.cpp \
basicvoicecallconfigurator.cpp \ basicvoicecallconfigurator.cpp \
audiocallpolicyproxy.cpp \
voicecallmanager.cpp \ voicecallmanager.cpp \
main.cpp \ main.cpp \
basicringtonenotificationprovider.cpp basicringtonenotificationprovider.cpp
enable-audiopolicy {
HEADERS += audiocallpolicyproxy.h
SOURCES += audiocallpolicyproxy.cpp
DEFINES += WITH_AUDIOPOLICY
}
target.path = /usr/bin target.path = /usr/bin
INSTALLS += target INSTALLS += target
...@@ -43,5 +48,6 @@ OTHER_FILES += voicecall-manager.desktop voicecall-manager.service ...@@ -43,5 +48,6 @@ OTHER_FILES += voicecall-manager.desktop voicecall-manager.service
systemd_service_entry.files = voicecall-manager.service systemd_service_entry.files = voicecall-manager.service
systemd_service_entry.path = /usr/lib/systemd/user systemd_service_entry.path = /usr/lib/systemd/user
INSTALLS += autostart_entry systemd_service_entry install-servicefiles {
INSTALLS += systemd_service_entry
}
...@@ -23,9 +23,15 @@ ...@@ -23,9 +23,15 @@
#include <QHash> #include <QHash>
#include <QUuid> #include <QUuid>
#include <QSettings>
#ifdef WITH_NEMO_DEVICELOCK
#include <nemo-devicelock/devicelock.h> #include <nemo-devicelock/devicelock.h>
#endif
#ifdef WITH_AUDIOPOLICY
#include "audiocallpolicyproxy.h" #include "audiocallpolicyproxy.h"
#endif
class VoiceCallManagerPrivate class VoiceCallManagerPrivate
{ {
...@@ -45,7 +51,10 @@ public: ...@@ -45,7 +51,10 @@ public:
AbstractVoiceCallHandler *activeVoiceCall; AbstractVoiceCallHandler *activeVoiceCall;
#ifdef WITH_NEMO_DEVICELOCK
NemoDeviceLock::DeviceLock deviceLock; NemoDeviceLock::DeviceLock deviceLock;
#endif
QString audioMode; QString audioMode;
bool isAudioRouted; bool isAudioRouted;
bool isMicrophoneMuted; bool isMicrophoneMuted;
...@@ -327,8 +336,12 @@ void VoiceCallManager::onVoiceCallAdded(AbstractVoiceCallHandler *handler) ...@@ -327,8 +336,12 @@ void VoiceCallManager::onVoiceCallAdded(AbstractVoiceCallHandler *handler)
TRACE TRACE
Q_D(VoiceCallManager); Q_D(VoiceCallManager);
#ifdef WITH_NEMO_DEVICELOCK
if (!handler->isEmergency() if (!handler->isEmergency()
&& d->deviceLock.state() == NemoDeviceLock::DeviceLock::ManagerLockout) { && d->deviceLock.state() == NemoDeviceLock::DeviceLock::ManagerLockout) {
#else
if (!handler->isEmergency()) {
#endif
handler->hangup(); handler->hangup();
return; return;
......
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