Move legacy sound and attachment errors to media
This commit is contained in:
1 parent
0773a82342
commit
8982bb034e
3 files changed
+6
-6
No files matched your search
@@ -347,7 +347,7 @@ void InputBar::onAttachClicked() {
|
||||
GUI_INFO("InputBar: PM attachment selected name=%s bytes=%lld", qPrintable(fi.fileName()), (long long)fi.size());
|
||||
return;
|
||||
}
|
||||
if (fi.size() == 0) { DEBUG_WARN(DEBUG_CATEGORY_DEBUG, "InputBar::onAttachClicked: empty file"); return; }
|
||||
if (fi.size() == 0) { DEBUG_WARN(DEBUG_CATEGORY_MEDIA, "InputBar::onAttachClicked: empty file"); return; }
|
||||
|
||||
QString mediaPath = m_mediaDirBase + "/" + m_channelIdForRecord;
|
||||
VoiceEncoder::ensureMediaDir(mediaPath);
|
||||
|
||||
@@ -437,14 +437,14 @@ bool SoundManager::loadSound(const QString& name, const QString& filePath) {
|
||||
|
||||
void SoundManager::play(const QString& name) {
|
||||
if (!m_enabled) return;
|
||||
if (!m_initialized) { DEBUG_WARN(DEBUG_CATEGORY_DEBUG, "SoundManager::play: not initialized"); return; }
|
||||
if (!m_initialized) { DEBUG_WARN(DEBUG_CATEGORY_MEDIA, "SoundManager::play: not initialized"); return; }
|
||||
|
||||
EventSettings es = m_eventSettings.value(name);
|
||||
if (!es.enabled) return;
|
||||
|
||||
auto it = m_sounds.find(name);
|
||||
if (it == m_sounds.end()) {
|
||||
DEBUG_WARN(DEBUG_CATEGORY_DEBUG, "SoundManager::play: sound '%s' not loaded", qPrintable(name));
|
||||
DEBUG_WARN(DEBUG_CATEGORY_MEDIA, "SoundManager::play: sound '%s' not loaded", qPrintable(name));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -461,7 +461,7 @@ void SoundManager::play(const QString& name) {
|
||||
|
||||
void SoundManager::playLoop(const QString& name) {
|
||||
if (!m_enabled) return;
|
||||
if (!m_initialized) { DEBUG_WARN(DEBUG_CATEGORY_DEBUG, "SoundManager::playLoop: not initialized"); return; }
|
||||
if (!m_initialized) { DEBUG_WARN(DEBUG_CATEGORY_MEDIA, "SoundManager::playLoop: not initialized"); return; }
|
||||
|
||||
/* остановить предыдущий цикл (иначе call_connecting + call_ringing звучат вместе) */
|
||||
stopLoop();
|
||||
@@ -471,7 +471,7 @@ void SoundManager::playLoop(const QString& name) {
|
||||
|
||||
auto it = m_sounds.find(name);
|
||||
if (it == m_sounds.end()) {
|
||||
DEBUG_WARN(DEBUG_CATEGORY_DEBUG, "SoundManager::playLoop: sound '%s' not loaded", qPrintable(name));
|
||||
DEBUG_WARN(DEBUG_CATEGORY_MEDIA, "SoundManager::playLoop: sound '%s' not loaded", qPrintable(name));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,6 @@ int VoiceEncoder::preset() { return s_preset; }
|
||||
void VoiceEncoder::ensureMediaDir(const QString& dir) {
|
||||
QDir d;
|
||||
if (!d.mkpath(dir)) {
|
||||
DEBUG_WARN(DEBUG_CATEGORY_DEBUG, "VoiceEncoder: cannot create media dir %s", qPrintable(dir));
|
||||
DEBUG_WARN(DEBUG_CATEGORY_MEDIA, "VoiceEncoder: cannot create media dir %s", qPrintable(dir));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user