Commit 8218089d authored by Alexandre Lision's avatar Alexandre Lision Committed by Emmanuel Lepage Vallee

* #Fixed updatePlaybackScale declaration

parent e4c166d7
......@@ -58,7 +58,7 @@ AudioFile::onBufferFinish()
if ((updatePlaybackScale_ % 5) == 0) {
CallManager *cm = Manager::instance().getClient()->getCallManager();
cm->updatePlaybackScale(pos_ / divisor, buffer_->samples() / divisor);
cm->updatePlaybackScale(filepath_, pos_ / divisor, buffer_->samples() / divisor);
}
updatePlaybackScale_++;
......
......@@ -505,6 +505,6 @@ void CallManager::sipCallStateChanged(const std::string& accoundID, const std::s
}
void CallManager::updatePlaybackScale(const int32_t&, const int32_t&)
void CallManager::updatePlaybackScale(const std::string&, const int32_t&, const int32_t&)
{
}
......@@ -173,7 +173,7 @@ class CallManager
void conferenceChanged(const std::string& confID,const std::string& state);
void updatePlaybackScale(const int32_t&, const int32_t&);
void updatePlaybackScale(const std::string&, const int32_t&, const int32_t&);
void conferenceRemoved(const std::string&);
void newCallCreated(const std::string&, const std::string&, const std::string&);
void registrationStateChanged(const std::string&, const std::string&, const int32_t&);
......
<?xml version="1.0" encoding="UTF-8" ?>
<node name="/presencemanager-introspec" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
<interface name="org.sflphone.SFLphone.PresenceManager">
<!-- METHODS !-->
<!--<method name="enablePresence" tp:name-for-bindings="enablePresence">
<tp:added version="1.3.0"/>
<arg type="s" name="accountID" direction="in"/>
<arg type="b" name="flag" direction="in"/>
</method>-->
<method name="sendPresence" tp:name-for-bindings="sendPresence">
<tp:added version="1.3.0"/>
<arg type="s" name="accountID" direction="in"/>
<arg type="b" name="status" direction="in"/>
<arg type="s" name="note" direction="in"/>
</method>
<method name="approvePresSubServer" tp:name-for-bindings="approvePresSubServer">
<tp:added version="1.3.0"/>
<arg type="s" name="uri" direction="in"/>
<arg type="b" name="flag" direction="in"/>
</method>
<signal name="newPresSubClientNotification" tp:name-for-bindings="newPresSubClientNotification">
<tp:added version="1.3.0"/>
<arg type="s" name="buddyUri"/>
<arg type="s" name="status"/>
<arg type="s" name="lineStatus"/>
</signal>
<method name="subscribePresSubClient" tp:name-for-bindings="subscribePresSubClient">
<tp:added version="0.9.7"/>
<arg type="s" name="accountID" direction="in"/>
<arg type="s" name="uri" direction="in"/>
<arg type="b" name="flag" direction="in"/>
</method>
<!-- SIGNALS !-->
<signal name="newPresSubServerRequest" tp:name-for-bindings="newPresSubServerRequest">
<arg type="s" name="buddyUri"/>
</signal>
</interface>
</node>
/*
* Copyright (C) 2013 Savoir-Faire Linux Inc.
* Author: Patrick Keroulas <patrick.keroulas@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Additional permission under GNU GPL version 3 section 7:
*
* If you modify this program, or any covered work, by linking or
* combining it with the OpenSSL project's OpenSSL library (or a
* modified version of that library), containing parts covered by the
* terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
* grants you additional permission to convey the resulting work.
* Corresponding Source for a non-source form of such a combination
* shall include the source code for the parts of OpenSSL used as well
* as that of the covered work.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "presencemanager.h"
#include <cerrno>
#include <sstream>
#include "logger.h"
#include "sip/sipaccount.h"
#include "manager.h"
#include "sip/sippresence.h"
namespace {
const char* SERVER_PATH = "/org/sflphone/SFLphone/PresenceManager";
}
PresenceManager::PresenceManager(DBus::Connection& connection) :
DBus::ObjectAdaptor(connection, SERVER_PATH)
{}
/**
* Un/subscribe to buddySipUri for an accountID
*/
void
PresenceManager::subscribePresSubClient(const std::string& accountID, const std::string& uri, const bool& flag)
{
SIPAccount *sipaccount = Manager::instance().getSipAccount(accountID);
if (!sipaccount)
ERROR("Could not find account %s",accountID.c_str());
else{
DEBUG("%subscribePresence (acc:%s, buddy:%s)",flag? "S":"Uns", accountID.c_str(), uri.c_str());
sipaccount->getPresence()->subscribePresSubClient(uri,flag);
}
}
/**
* Enable the presence module (PUBLISH/SUBSCRIBE)
*/
void
PresenceManager::enablePresence(const std::string& accountID, const bool& flag){
SIPAccount *sipaccount = Manager::instance().getSipAccount(accountID);
if (!sipaccount)
ERROR("Could not find account %s",accountID.c_str());
else{
DEBUG("Enable Presence (acc:%s : %s)",accountID.c_str(), flag? "yes":"no");
sipaccount->getPresence()->enable(flag);
}
}
/**
* push a presence for a account
* Notify for IP2IP account and publish for PBX account
*/
void
PresenceManager::sendPresence(const std::string& accountID, const bool& status, const std::string& note)
{
SIPAccount *sipaccount = Manager::instance().getSipAccount(accountID);
if (!sipaccount)
ERROR("Could not find account %s.",accountID.c_str());
else{
DEBUG("Send Presence (acc:%s, status %s).",accountID.c_str(),status? "online":"offline");
sipaccount->getPresence()->sendPresence(status, note);
}
}
/**
* Accept or not a PresSubServer request for IP2IP account
*/
void
PresenceManager::approvePresSubServer(const std::string& uri, const bool& flag)
{
SIPAccount *sipaccount = Manager::instance().getIP2IPAccount();
if (!sipaccount)
ERROR("Could not find account IP2IP");
else{
DEBUG("Approve presence (acc:IP2IP, serv:%s, flag:%s)", uri.c_str(), flag? "true":"false");
sipaccount->getPresence()->approvePresSubServer(uri, flag);
}
}
/*
* Copyright (C) 2013 Savoir-Faire Linux Inc.
* Author: Patrick Keroulas <patrick.keroulas@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Additional permission under GNU GPL version 3 section 7:
*
* If you modify this program, or any covered work, by linking or
* combining it with the OpenSSL project's OpenSSL library (or a
* modified version of that library), containing parts covered by the
* terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
* grants you additional permission to convey the resulting work.
* Corresponding Source for a non-source form of such a combination
* shall include the source code for the parts of OpenSSL used as well
* as that of the covered work.
*/
#ifndef PRESENCEINT_H
#define PRESENCEINT_H
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#if HAVE_DBUS
#include "dbus/dbus_cpp.h"
#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 6
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#endif
#pragma GCC diagnostic ignored "-Wignored-qualifiers"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Weffc++"
#include "dbus/presencemanager-glue.h"
#pragma GCC diagnostic warning "-Wignored-qualifiers"
#pragma GCC diagnostic warning "-Wunused-parameter"
#pragma GCC diagnostic warning "-Weffc++"
#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 6
#pragma GCC diagnostic warning "-Wunused-but-set-variable"
#endif
#else
// these includes normally come with DBus C++
#include <vector>
#include <map>
#include <string>
#endif // HAVE_DBUS
class PresenceManager
#if HAVE_DBUS
: public org::sflphone::SFLphone::PresenceManager_adaptor,
public DBus::IntrospectableAdaptor,
public DBus::ObjectAdaptor
#endif
{
public:
#if HAVE_DBUS
PresenceManager(DBus::Connection& connection);
#else
PresenceManager();
#endif
void newPresSubClientNotification(const std::string& uri, const std::string& basic, const std::string& note);
void newPresSubServerRequest(const std::string& remote);
/* Presence subscription/Notification. */
void enablePresence(const std::string& accountID, const bool& flag);
void sendPresence(const std::string& accountID, const bool& status, const std::string& note);
void approvePresSubServer(const std::string& uri, const bool& flag);
void subscribePresSubClient(const std::string& accountID, const std::string& uri, const bool& flag);
};
#endif //CONFIGURATIONMANAGER_H
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