2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

added some stickers logging , 0.8.18 dev version ready

This commit is contained in:
John Preston
2015-06-01 13:58:46 +03:00
parent 4bfe65d8ab
commit 42122fdea0
17 changed files with 810 additions and 36 deletions

View File

@@ -96,6 +96,7 @@ bool _checkALError() {
void audioInit() {
if (!capture) {
capture = new AudioCapture();
cSetHasAudioCapture(capture->check());
}
uint64 ms = getms();
@@ -202,6 +203,7 @@ void audioInit() {
avcodec_register_all();
LOG(("Audio init time: %1").arg(getms() - ms));
cSetHasAudioPlayer(true);
}
void audioPlayNotify() {
@@ -240,6 +242,9 @@ void audioFinish() {
alcCloseDevice(audioDevice);
audioDevice = 0;
}
cSetHasAudioCapture(false);
cSetHasAudioPlayer(false);
}
AudioPlayer::AudioPlayer() : _current(0),
@@ -421,6 +426,16 @@ void AudioCapture::stop(bool needResult) {
emit captureOnStop(needResult);
}
bool AudioCapture::check() {
if (const ALCchar *def = alcGetString(0, ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER)) {
if (ALCdevice *dev = alcCaptureOpenDevice(def, AudioVoiceMsgFrequency, AL_FORMAT_MONO16, AudioVoiceMsgFrequency / 5)) {
alcCaptureCloseDevice(dev);
return _checkALCError();
}
}
return false;
}
AudioCapture::~AudioCapture() {
capture = 0;
_captureThread.quit();