| 1 | // |
| 2 | // libtgvoip is free and unencumbered public domain software. |
| 3 | // For more information, see http://unlicense.org or the UNLICENSE file |
| 4 | // you should have received with this source code distribution. |
| 5 | // |
| 6 | |
| 7 | #ifndef LIBTGVOIP_AUDIOOUTPUTANDROID_H |
| 8 | #define LIBTGVOIP_AUDIOOUTPUTANDROID_H |
| 9 | |
| 10 | #include <jni.h> |
| 11 | #include "../../audio/AudioOutput.h" |
| 12 | |
| 13 | namespace tgvoip{ namespace audio{ |
| 14 | class AudioOutputAndroid : public AudioOutput{ |
| 15 | |
| 16 | public: |
| 17 | |
| 18 | AudioOutputAndroid(); |
| 19 | virtual ~AudioOutputAndroid(); |
| 20 | virtual void Start(); |
| 21 | virtual void Stop(); |
| 22 | virtual bool IsPlaying() override; |
| 23 | void HandleCallback(JNIEnv* env, jbyteArray buffer); |
| 24 | static jmethodID initMethod; |
| 25 | static jmethodID releaseMethod; |
| 26 | static jmethodID startMethod; |
| 27 | static jmethodID stopMethod; |
| 28 | static jclass jniClass; |
| 29 | |
| 30 | private: |
| 31 | jobject javaObject; |
| 32 | bool running; |
| 33 | |
| 34 | }; |
| 35 | }} |
| 36 | |
| 37 | #endif //LIBTGVOIP_AUDIOOUTPUTANDROID_H |
| 38 | |