Soundux/src/core/global/globals.hpp

38 lines
1.3 KiB
C++
Raw Normal View History

2021-01-27 12:38:03 +01:00
#pragma once
#include "../../helper/audio/audio.hpp"
#if defined(__linux__)
#include "../../helper/audio/linux/pulse.hpp"
#endif
#include "../../helper/icons/icons.hpp"
#include "../../helper/threads/processing.hpp"
2021-03-18 20:52:30 +01:00
#include "../../helper/ytdl/youtube-dl.hpp"
2021-01-27 12:38:03 +01:00
#include "../../ui/ui.hpp"
#include "../config/config.hpp"
#include "../hotkeys/hotkeys.hpp"
2021-01-28 18:16:23 +01:00
#include "objects.hpp"
2021-01-27 12:38:03 +01:00
#include <memory>
namespace Soundux
{
namespace Globals
{
inline Objects::Data gData;
inline Objects::Audio gAudio;
#if defined(__linux__)
inline Objects::Pulse gPulse;
inline Objects::IconFetcher gIcons;
#endif
2021-01-27 12:38:03 +01:00
inline Objects::Config gConfig;
2021-03-18 20:52:30 +01:00
inline Objects::YoutubeDl gYtdl;
inline Objects::Hotkeys gHotKeys;
2021-01-27 12:38:03 +01:00
inline Objects::Settings gSettings;
inline std::unique_ptr<Objects::Window> gGui;
inline Objects::ProcessingQueue<std::uintptr_t> gQueue;
2021-01-27 12:38:03 +01:00
/* Allows for fast & easy sound access, is populated on start up */
inline std::shared_mutex gSoundsMutex;
inline std::shared_mutex gFavoritesMutex;
inline std::map<std::uint32_t, std::reference_wrapper<Objects::Sound>> gSounds;
inline std::map<std::uint32_t, std::reference_wrapper<Objects::Sound>> gFavorites;
2021-01-27 12:38:03 +01:00
} // namespace Globals
} // namespace Soundux