1
0
mirror of https://github.com/danog/php-libtgvoip.git synced 2024-11-30 04:19:26 +01:00

Check if isPlaying()

This commit is contained in:
Daniil Gentili 2017-07-13 18:54:59 +02:00
parent 69f4905dc0
commit e181d51de2
3 changed files with 13 additions and 1 deletions

View File

@ -151,7 +151,9 @@ void AudioInputModule::RunSenderThread() {
inputFiles.pop();
memset(data + (read % inputCSamplesSize), 0, inputCSamplesSize - (read % inputCSamplesSize));
}
wrapper->playing = true;
} else {
wrapper->playing = false;
if (holdFiles.empty()) {
memset(data, 0, inputCSamplesSize);
} else {

View File

@ -35,6 +35,7 @@ void VoIP::__construct()
current_call = params[1];*/
in=NULL;
out=NULL;
playing = false;
inst = new VoIPController();
inst->implData = (void *) this;
@ -222,6 +223,11 @@ Php::Value VoIP::getState()
return state;
}
Php::Value VoIP::isPlaying()
{
return playing;
}
Php::Value VoIP::getOutputState()
{
return outputState;
@ -296,6 +302,7 @@ PHPCPP_EXPORT void *get_module()
voip.method<&VoIP::getState>("getState", Php::Public | Php::Final);
voip.method<&VoIP::isPlaying>("isPlaying", Php::Public | Php::Final);
voip.method<&VoIP::getOutputState>("getOutputState", Php::Public | Php::Final);
voip.method<&VoIP::getInputState>("getInputState", Php::Public | Php::Final);
voip.method<&VoIP::getOutputParams>("getOutputParams", Php::Public | Php::Final);

5
main.h
View File

@ -93,6 +93,9 @@ class VoIP : public Php::Base
Php::Value getOutputParams();
Php::Value getInputParams();
Php::Value isPlaying();
/*
Php::Value madeline;
Php::Value current_call;
@ -106,7 +109,7 @@ class VoIP : public Php::Base
int inputState = AUDIO_STATE_NONE;
int outputState = AUDIO_STATE_NONE;
bool playing;
private:
VoIPController *inst;
};