mirror of
https://github.com/danog/libtgvoip.git
synced 2024-11-27 04:34:42 +01:00
Signal bars in CX wrapper
This commit is contained in:
parent
6e840a6992
commit
9d6c54772e
@ -40,6 +40,7 @@ VoIPControllerWrapper::VoIPControllerWrapper(){
|
||||
controller=new VoIPController();
|
||||
controller->implData=(void*)this;
|
||||
controller->SetStateCallback(VoIPControllerWrapper::OnStateChanged);
|
||||
controller->SetSignalBarsCountCallback(VoIPControllerWrapper::OnSignalBarsChanged);
|
||||
stateCallback=nullptr;
|
||||
}
|
||||
|
||||
@ -136,11 +137,20 @@ void VoIPControllerWrapper::OnStateChanged(VoIPController* c, int state){
|
||||
reinterpret_cast<VoIPControllerWrapper^>(c->implData)->OnStateChangedInternal(state);
|
||||
}
|
||||
|
||||
void VoIPControllerWrapper::OnSignalBarsChanged(VoIPController* c, int count){
|
||||
reinterpret_cast<VoIPControllerWrapper^>(c->implData)->OnSignalBarsChangedInternal(count);
|
||||
}
|
||||
|
||||
void VoIPControllerWrapper::OnStateChangedInternal(int state){
|
||||
if(stateCallback)
|
||||
stateCallback->OnCallStateChanged((CallState)state);
|
||||
}
|
||||
|
||||
void VoIPControllerWrapper::OnSignalBarsChangedInternal(int count){
|
||||
if(stateCallback)
|
||||
stateCallback->OnSignalBarsChanged(count);
|
||||
}
|
||||
|
||||
void VoIPControllerWrapper::SetConfig(double initTimeout, double recvTimeout, DataSavingMode dataSavingMode, bool enableAEC, bool enableNS, bool enableAGC, Platform::String^ logFilePath, Platform::String^ statsDumpFilePath){
|
||||
voip_config_t config{0};
|
||||
config.init_timeout=initTimeout;
|
||||
|
@ -60,6 +60,7 @@ namespace libtgvoip{
|
||||
|
||||
public interface class IStateCallback{
|
||||
void OnCallStateChanged(CallState newState);
|
||||
void OnSignalBarsChanged(int count);
|
||||
};
|
||||
|
||||
public ref class VoIPControllerWrapper sealed{
|
||||
@ -85,7 +86,9 @@ namespace libtgvoip{
|
||||
//static Platform::String^ TestAesIge();
|
||||
private:
|
||||
static void OnStateChanged(tgvoip::VoIPController* c, int state);
|
||||
static void OnSignalBarsChanged(tgvoip::VoIPController* c, int count);
|
||||
void OnStateChangedInternal(int state);
|
||||
void OnSignalBarsChangedInternal(int count);
|
||||
tgvoip::VoIPController* controller;
|
||||
IStateCallback^ stateCallback;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user