mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-12 22:09:25 +08:00
nodejs: changes for electron compatibility
Change-Id: Icfb6ca3858450eaf2b5bbfbb16fcc024c8c9d772
This commit is contained in:
@ -9,11 +9,11 @@ ring_wrapper.cpp: nodejs_interface.i configurationmanager.i managerimpl.i
|
||||
$(SWIG) -v -c++ -javascript -node -o ring_wrapper.cpp nodejs_interface.i
|
||||
|
||||
build/Makefile: ring_wrapper.cpp binding.gyp
|
||||
node-gyp configure
|
||||
node-gyp configure --target=1.6.2 --arch=x64 --dist-url=https://atom.io/download/electron
|
||||
|
||||
build/Release/obj.target/dring.node: build/Makefile ring_wrapper.cpp callback.h
|
||||
node-gyp build
|
||||
|
||||
CLEANFILES= \
|
||||
$(BUILT_SOURCES) \
|
||||
build/Release/dring.node
|
||||
build/Release/dring.node
|
@ -23,7 +23,7 @@
|
||||
class RingDaemon{
|
||||
constructor(callbackMap) {
|
||||
if(callbackMap){
|
||||
this.dring = require("./build/Release/dring");
|
||||
this.dring = require("./build/Release/dring.node");
|
||||
this.dring.init(callbackMap);
|
||||
var that = this;
|
||||
this.pollIntervalId = setInterval(function () {
|
||||
@ -92,16 +92,18 @@ class RingDaemon{
|
||||
|
||||
this.dring.addAccount(params);
|
||||
}
|
||||
|
||||
getAudioOutputDeviceList() {
|
||||
var devicesVect = this.dring.getAudioOutputDeviceList();
|
||||
var outputDevices = [];
|
||||
for(var i=0; i<devicesVect.size(); i++)
|
||||
outputDevices.push(devicesVect.get(i));
|
||||
|
||||
return outputDevices;
|
||||
stringVectToArr(stringvect){
|
||||
var outputArr = [];
|
||||
for(var i=0; i<stringvect.size(); i++)
|
||||
outputArr.push(stringvect.get(i));
|
||||
return outputArr;
|
||||
}
|
||||
getAccountList(){
|
||||
return this.stringVectToArr(this.dring.getAccountList());
|
||||
}
|
||||
getAudioOutputDeviceList() {
|
||||
return this.stringVectToArr(this.dring.getAudioOutputDeviceList());
|
||||
}
|
||||
|
||||
getVolume(deviceName) {
|
||||
return this.dring.getVolume(deviceName);
|
||||
}
|
||||
@ -116,9 +118,4 @@ class RingDaemon{
|
||||
}
|
||||
}
|
||||
|
||||
var f = function(){
|
||||
console.log("RegistrationStateChanged JS");
|
||||
};
|
||||
|
||||
var daemon = new RingDaemon({"RegistrationStateChanged": f});
|
||||
//daemon.stop();
|
||||
module.exports = RingDaemon;
|
Reference in New Issue
Block a user