mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-11-03 11:50:05 +00:00
Add media types for pre-defined audio files
This commit is contained in:
parent
a89c20c697
commit
318f35aebd
3 changed files with 53 additions and 0 deletions
24
scwx-qt/source/scwx/qt/types/media_types.cpp
Normal file
24
scwx-qt/source/scwx/qt/types/media_types.cpp
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#include <scwx/qt/types/media_types.hpp>
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
namespace scwx
|
||||
{
|
||||
namespace qt
|
||||
{
|
||||
namespace types
|
||||
{
|
||||
|
||||
static const std::unordered_map<AudioFile, std::string> audioFileInfo_ {
|
||||
{AudioFile::EasAttentionSignal,
|
||||
"qrc:/res/audio/wikimedia/"
|
||||
"Emergency_Alert_System_Attention_Signal_20s.ogg"}};
|
||||
|
||||
const std::string& GetMediaPath(AudioFile audioFile)
|
||||
{
|
||||
return audioFileInfo_.at(audioFile);
|
||||
}
|
||||
|
||||
} // namespace types
|
||||
} // namespace qt
|
||||
} // namespace scwx
|
||||
27
scwx-qt/source/scwx/qt/types/media_types.hpp
Normal file
27
scwx-qt/source/scwx/qt/types/media_types.hpp
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#pragma once
|
||||
|
||||
#include <scwx/util/iterator.hpp>
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace scwx
|
||||
{
|
||||
namespace qt
|
||||
{
|
||||
namespace types
|
||||
{
|
||||
|
||||
enum class AudioFile
|
||||
{
|
||||
EasAttentionSignal
|
||||
};
|
||||
typedef scwx::util::Iterator<AudioFile,
|
||||
AudioFile::EasAttentionSignal,
|
||||
AudioFile::EasAttentionSignal>
|
||||
AudioFileIterator;
|
||||
|
||||
const std::string& GetMediaPath(AudioFile audioFile);
|
||||
|
||||
} // namespace types
|
||||
} // namespace qt
|
||||
} // namespace scwx
|
||||
Loading…
Add table
Add a link
Reference in a new issue