Skip to content
Snippets Groups Projects
Unverified Commit ca39ce30 authored by Sébastien Blin's avatar Sébastien Blin
Browse files

avmodel: link to deviceEvent signal

Detects when a new device is plugged or unplugged

Change-Id: Ifc9eeefad45f3916bdb26b816995028fda8a08b7
parent 5366d7ed
Branches
No related tags found
No related merge requests found
......@@ -219,6 +219,10 @@ Q_SIGNALS:
* @param id
*/
void frameUpdated(const std::string& id);
/**
* Emitted when a device is plugged or unplugged
*/
void deviceEvent();
private:
std::unique_ptr<AVModelPimpl> pimpl_;
......
......@@ -110,6 +110,10 @@ public Q_SLOTS:
* @param id
*/
void slotFrameUpdated(const std::string& id);
/**
* Detect when a device is plugged or unplugged
*/
void slotDeviceEvent();
};
......@@ -481,6 +485,8 @@ AVModelPimpl::init()
#ifndef ENABLE_LIBWRAP
SIZE_RENDERER = renderers_.size();
#endif
connect(&callbacksHandler, &CallbacksHandler::deviceEvent,
this, &AVModelPimpl::slotDeviceEvent);
connect(&callbacksHandler, &CallbacksHandler::startedDecoding,
this, &AVModelPimpl::startedDecoding);
connect(&callbacksHandler, &CallbacksHandler::stoppedDecoding,
......@@ -684,6 +690,12 @@ AVModelPimpl::slotFrameUpdated(const std::string& id)
emit linked_.frameUpdated(id);
}
void
AVModelPimpl::slotDeviceEvent()
{
emit linked_.deviceEvent();
}
} // namespace lrc
#include "api/moc_avmodel.cpp"
......
......@@ -200,6 +200,12 @@ CallbacksHandler::CallbacksHandler(const Lrc& parent)
this,
&CallbacksHandler::slotStoppedDecoding,
Qt::QueuedConnection);
connect(&VideoManager::instance(),
&VideoManagerInterface::deviceEvent,
this,
&CallbacksHandler::slotDeviceEvent,
Qt::QueuedConnection);
}
CallbacksHandler::~CallbacksHandler()
......@@ -481,5 +487,11 @@ CallbacksHandler::slotStoppedDecoding(const QString& id, const QString& shmPath)
emit stoppedDecoding(id.toStdString(), shmPath.toStdString());
}
void
CallbacksHandler::slotDeviceEvent()
{
emit deviceEvent();
}
} // namespace lrc
......@@ -248,6 +248,11 @@ Q_SIGNALS:
*/
void stoppedDecoding(const std::string& id, const std::string& shmPath);
/**
* Emitted when a device is plugged or unplugged
*/
void deviceEvent();
private Q_SLOTS:
/**
* Emit newAccountMessage
......@@ -446,6 +451,11 @@ private Q_SLOTS:
*/
void slotStoppedDecoding(const QString& id, const QString& shmPath);
/**
* Detect when a device is plugged or unplugged
*/
void slotDeviceEvent();
private:
const api::Lrc& parent;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment