mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 22:25:04 -04:00
saved current work on VOIP plugin. Not working yet.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4958 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
5679a30e67
commit
c78b45b755
9 changed files with 254 additions and 100 deletions
87
plugins/VOIP/VOIPPlugin.cpp
Normal file
87
plugins/VOIP/VOIPPlugin.cpp
Normal file
|
@ -0,0 +1,87 @@
|
|||
#include <retroshare/rsplugin.h>
|
||||
#include <QTranslator>
|
||||
#include <QApplication>
|
||||
|
||||
#include "VOIPPlugin.h"
|
||||
#include "AudioInputConfig.h"
|
||||
|
||||
//static void *inited = new VOIPPlugin() ;
|
||||
|
||||
extern "C" {
|
||||
void *RETROSHARE_PLUGIN_provide()
|
||||
{
|
||||
static VOIPPlugin *p = new VOIPPlugin() ;
|
||||
|
||||
return (void*)p ;
|
||||
}
|
||||
}
|
||||
|
||||
void VOIPPlugin::getPluginVersion(int& major,int& minor,int& svn_rev) const
|
||||
{
|
||||
major = 5 ;
|
||||
minor = 1 ;
|
||||
svn_rev = 4350 ;
|
||||
}
|
||||
|
||||
VOIPPlugin::VOIPPlugin()
|
||||
{
|
||||
mVoip = NULL ;
|
||||
mPlugInHandler = NULL;
|
||||
mPeers = NULL;
|
||||
}
|
||||
|
||||
void VOIPPlugin::setInterfaces(RsPlugInInterfaces &interfaces)
|
||||
{
|
||||
mPeers = interfaces.mPeers;
|
||||
}
|
||||
|
||||
ConfigPage *VOIPPlugin::qt_config_page() const
|
||||
{
|
||||
if(config_page == NULL)
|
||||
config_page = new AudioInputConfig() ;
|
||||
|
||||
return config_page ;
|
||||
}
|
||||
|
||||
RsPQIService *VOIPPlugin::rs_pqi_service() const
|
||||
{
|
||||
if(mVoip == NULL)
|
||||
{
|
||||
mVoip = new p3VoipService(/*mPlugInHandler*/) ; // , 3600 * 24 * 30 * 6); // 6 Months
|
||||
rsVoip = mVoip ;
|
||||
}
|
||||
|
||||
return mVoip ;
|
||||
}
|
||||
|
||||
void VOIPPlugin::setPlugInHandler(RsPluginHandler *pgHandler)
|
||||
{
|
||||
mPlugInHandler = pgHandler;
|
||||
}
|
||||
|
||||
std::string VOIPPlugin::getShortPluginDescription() const
|
||||
{
|
||||
return QApplication::translate("VOIP", "This plugin provides voice communication between friends in RetroShare.").toUtf8().constData();
|
||||
}
|
||||
|
||||
std::string VOIPPlugin::getPluginName() const
|
||||
{
|
||||
return QApplication::translate("VOIPPlugin", "VOIP").toUtf8().constData();
|
||||
}
|
||||
|
||||
QTranslator* VOIPPlugin::qt_translator(QApplication *app, const QString& languageCode) const
|
||||
{
|
||||
if (languageCode == "en") {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
QTranslator* translator = new QTranslator(app);
|
||||
if (translator->load(":/lang/VOIP_" + languageCode + ".qm")) {
|
||||
return translator;
|
||||
}
|
||||
|
||||
delete(translator);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue