Commit ec0c0388 authored by Ming Rui Zhang's avatar Ming Rui Zhang Committed by Andreas Traczyk
Browse files

avmodel: add recorder playback stopped signal

Change-Id: I3151c8312f246dac0638422522c321671cf700fc
parent 6791e0bc
...@@ -328,6 +328,11 @@ Q_SIGNALS: ...@@ -328,6 +328,11 @@ Q_SIGNALS:
* @param level Volume in range [0, 1] * @param level Volume in range [0, 1]
*/ */
void audioMeter(const std::string& id, float level); void audioMeter(const std::string& id, float level);
/**
* local recorder stopped
* @param filePath
*/
void recordPlaybackStopped(const std::string& filePath);
private: private:
std::unique_ptr<AVModelPimpl> pimpl_; std::unique_ptr<AVModelPimpl> pimpl_;
......
...@@ -117,6 +117,11 @@ public Q_SLOTS: ...@@ -117,6 +117,11 @@ public Q_SLOTS:
* @param level Volume in range [0, 1] * @param level Volume in range [0, 1]
*/ */
void slotAudioMeter(const std::string& id, float level); void slotAudioMeter(const std::string& id, float level);
/**
* Listen from CallbacksHandler when a recorder stopped notice is incoming
* @param filePath
*/
void slotRecordPlaybackStopped(const std::string& filePath);
}; };
...@@ -664,7 +669,9 @@ AVModelPimpl::AVModelPimpl(AVModel& linked, const CallbacksHandler& callbacksHan ...@@ -664,7 +669,9 @@ AVModelPimpl::AVModelPimpl(AVModel& linked, const CallbacksHandler& callbacksHan
connect(&callbacksHandler, &CallbacksHandler::callStateChanged, connect(&callbacksHandler, &CallbacksHandler::callStateChanged,
this, &AVModelPimpl::slotCallStateChanged); this, &AVModelPimpl::slotCallStateChanged);
connect(&*renderers_[video::PREVIEW_RENDERER_ID], &api::video::Renderer::frameUpdated, connect(&*renderers_[video::PREVIEW_RENDERER_ID], &api::video::Renderer::frameUpdated,
this, &AVModelPimpl::slotFrameUpdated); this, &AVModelPimpl::slotFrameUpdated);
connect(&callbacksHandler, &CallbacksHandler::recordPlaybackStopped,
this, &AVModelPimpl::slotRecordPlaybackStopped);
auto startedPreview = false; auto startedPreview = false;
auto restartRenderers = [&](const QStringList& callList) { auto restartRenderers = [&](const QStringList& callList) {
...@@ -889,6 +896,12 @@ AVModelPimpl::slotAudioMeter(const std::string& id, float level) ...@@ -889,6 +896,12 @@ AVModelPimpl::slotAudioMeter(const std::string& id, float level)
emit linked_.audioMeter(id, level); emit linked_.audioMeter(id, level);
} }
void
AVModelPimpl::slotRecordPlaybackStopped(const std::string &filePath)
{
emit linked_.recordPlaybackStopped(filePath);
}
} // namespace lrc } // namespace lrc
#include "api/moc_avmodel.cpp" #include "api/moc_avmodel.cpp"
......
...@@ -145,6 +145,12 @@ CallbacksHandler::CallbacksHandler(const Lrc& parent) ...@@ -145,6 +145,12 @@ CallbacksHandler::CallbacksHandler(const Lrc& parent)
&CallbacksHandler::slotIncomingMessage, &CallbacksHandler::slotIncomingMessage,
Qt::QueuedConnection); Qt::QueuedConnection);
connect(&CallManager::instance(),
&CallManagerInterface::recordPlaybackStopped,
this,
&CallbacksHandler::slotRecordPlaybackStopped,
Qt::QueuedConnection);
connect(&CallManager::instance(), connect(&CallManager::instance(),
&CallManagerInterface::voiceMailNotify, &CallManagerInterface::voiceMailNotify,
this, this,
...@@ -276,6 +282,12 @@ CallbacksHandler::slotVoiceMailNotify(const QString& accountId, int newCount, in ...@@ -276,6 +282,12 @@ CallbacksHandler::slotVoiceMailNotify(const QString& accountId, int newCount, in
emit voiceMailNotify(accountId.toStdString(), newCount, oldCount, urgentCount); emit voiceMailNotify(accountId.toStdString(), newCount, oldCount, urgentCount);
} }
void
CallbacksHandler::slotRecordPlaybackStopped(const QString& filePath)
{
emit recordPlaybackStopped(filePath.toStdString());
}
void void
CallbacksHandler::slotContactAdded(const QString& accountId, CallbacksHandler::slotContactAdded(const QString& accountId,
const QString& contactUri, const QString& contactUri,
......
...@@ -268,6 +268,12 @@ Q_SIGNALS: ...@@ -268,6 +268,12 @@ Q_SIGNALS:
*/ */
void audioMeter(const std::string& id, float level); void audioMeter(const std::string& id, float level);
/**
* Emitted when an local recorder is finished
* @param filePath
*/
void recordPlaybackStopped(const std::string& filePath);
/** /**
* Emitted when an audio level is received * Emitted when an audio level is received
* @param accountId * @param accountId
...@@ -509,6 +515,12 @@ private Q_SLOTS: ...@@ -509,6 +515,12 @@ private Q_SLOTS:
int oldCount, int oldCount,
int urgentCount); int urgentCount);
/**
* Emit recordPlaybackStopped
* @param filePath
*/
void slotRecordPlaybackStopped(const QString& filePath);
private: private:
const api::Lrc& parent; const api::Lrc& parent;
}; };
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment