mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-31 23:50:05 +00:00
Media Manager stub
This commit is contained in:
parent
9830caebeb
commit
a89c20c697
3 changed files with 79 additions and 0 deletions
|
|
@ -79,6 +79,7 @@ set(SRC_GL_DRAW source/scwx/qt/gl/draw/draw_item.cpp
|
||||||
source/scwx/qt/gl/draw/placefile_triangles.cpp
|
source/scwx/qt/gl/draw/placefile_triangles.cpp
|
||||||
source/scwx/qt/gl/draw/rectangle.cpp)
|
source/scwx/qt/gl/draw/rectangle.cpp)
|
||||||
set(HDR_MANAGER source/scwx/qt/manager/font_manager.hpp
|
set(HDR_MANAGER source/scwx/qt/manager/font_manager.hpp
|
||||||
|
source/scwx/qt/manager/media_manager.hpp
|
||||||
source/scwx/qt/manager/placefile_manager.hpp
|
source/scwx/qt/manager/placefile_manager.hpp
|
||||||
source/scwx/qt/manager/position_manager.hpp
|
source/scwx/qt/manager/position_manager.hpp
|
||||||
source/scwx/qt/manager/radar_product_manager.hpp
|
source/scwx/qt/manager/radar_product_manager.hpp
|
||||||
|
|
@ -89,6 +90,7 @@ set(HDR_MANAGER source/scwx/qt/manager/font_manager.hpp
|
||||||
source/scwx/qt/manager/timeline_manager.hpp
|
source/scwx/qt/manager/timeline_manager.hpp
|
||||||
source/scwx/qt/manager/update_manager.hpp)
|
source/scwx/qt/manager/update_manager.hpp)
|
||||||
set(SRC_MANAGER source/scwx/qt/manager/font_manager.cpp
|
set(SRC_MANAGER source/scwx/qt/manager/font_manager.cpp
|
||||||
|
source/scwx/qt/manager/media_manager.cpp
|
||||||
source/scwx/qt/manager/placefile_manager.cpp
|
source/scwx/qt/manager/placefile_manager.cpp
|
||||||
source/scwx/qt/manager/position_manager.cpp
|
source/scwx/qt/manager/position_manager.cpp
|
||||||
source/scwx/qt/manager/radar_product_manager.cpp
|
source/scwx/qt/manager/radar_product_manager.cpp
|
||||||
|
|
|
||||||
45
scwx-qt/source/scwx/qt/manager/media_manager.cpp
Normal file
45
scwx-qt/source/scwx/qt/manager/media_manager.cpp
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
#include <scwx/qt/manager/media_manager.hpp>
|
||||||
|
#include <scwx/util/logger.hpp>
|
||||||
|
|
||||||
|
namespace scwx
|
||||||
|
{
|
||||||
|
namespace qt
|
||||||
|
{
|
||||||
|
namespace manager
|
||||||
|
{
|
||||||
|
|
||||||
|
static const std::string logPrefix_ = "scwx::qt::manager::media_manager";
|
||||||
|
static const auto logger_ = scwx::util::Logger::Create(logPrefix_);
|
||||||
|
|
||||||
|
class MediaManager::Impl
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit Impl() {}
|
||||||
|
|
||||||
|
~Impl() {}
|
||||||
|
};
|
||||||
|
|
||||||
|
MediaManager::MediaManager() : p(std::make_unique<Impl>()) {}
|
||||||
|
MediaManager::~MediaManager() = default;
|
||||||
|
|
||||||
|
std::shared_ptr<MediaManager> MediaManager::Instance()
|
||||||
|
{
|
||||||
|
static std::weak_ptr<MediaManager> mediaManagerReference_ {};
|
||||||
|
static std::mutex instanceMutex_ {};
|
||||||
|
|
||||||
|
std::unique_lock lock(instanceMutex_);
|
||||||
|
|
||||||
|
std::shared_ptr<MediaManager> mediaManager = mediaManagerReference_.lock();
|
||||||
|
|
||||||
|
if (mediaManager == nullptr)
|
||||||
|
{
|
||||||
|
mediaManager = std::make_shared<MediaManager>();
|
||||||
|
mediaManagerReference_ = mediaManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
return mediaManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace manager
|
||||||
|
} // namespace qt
|
||||||
|
} // namespace scwx
|
||||||
32
scwx-qt/source/scwx/qt/manager/media_manager.hpp
Normal file
32
scwx-qt/source/scwx/qt/manager/media_manager.hpp
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
|
||||||
|
namespace scwx
|
||||||
|
{
|
||||||
|
namespace qt
|
||||||
|
{
|
||||||
|
namespace manager
|
||||||
|
{
|
||||||
|
|
||||||
|
class MediaManager : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
Q_DISABLE_COPY_MOVE(MediaManager)
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit MediaManager();
|
||||||
|
~MediaManager();
|
||||||
|
|
||||||
|
static std::shared_ptr<MediaManager> Instance();
|
||||||
|
|
||||||
|
private:
|
||||||
|
class Impl;
|
||||||
|
std::unique_ptr<Impl> p;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace manager
|
||||||
|
} // namespace qt
|
||||||
|
} // namespace scwx
|
||||||
Loading…
Add table
Add a link
Reference in a new issue