diff --git a/audio/AudioInputModule.cpp b/audio/AudioInputModule.cpp index 898fdb4..4413c6a 100644 --- a/audio/AudioInputModule.cpp +++ b/audio/AudioInputModule.cpp @@ -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 { diff --git a/main.cpp b/main.cpp index fbca1d7..cb394eb 100644 --- a/main.cpp +++ b/main.cpp @@ -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); diff --git a/main.h b/main.h index d11a559..a8fd111 100644 --- a/main.h +++ b/main.h @@ -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; };