mirror-chatterino2/mocks/include/mocks/EmptyApplication.hpp
pajlada a240797b68
Add support for sound backends & some miniaudio changes (#4978)
Miniaudio now runs everything in a separate audio thread - this uses boost::asio's io_context.
Our miniaudio implementation is now also much simplified - it does not use its own resource manager or device. This might end up being stupid if sounds don't work after changing output device or locking or w/e
I've made the sound controller into an interface, meaning we can support multiple sound backends in Chatterino. I've added a Null sound backend that disables all sound. A QMediaPlayer or QSoundEffect or Qt backend could be added.
Miniaudio might idle & disable the device now too, not sure

I've added some unrelated changes in the form of a new setting type, and a new setting page helper function for it, which will hopefully make adding new enum settings easier in the future.
This setting stores its value as a string instead of an int, and uses magic_enum to convert between that string value and its enum value.
2023-11-26 22:06:12 +01:00

110 lines
1.8 KiB
C++

#pragma once
#include "Application.hpp"
namespace chatterino::mock {
class EmptyApplication : public IApplication
{
public:
virtual ~EmptyApplication() = default;
Theme *getThemes() override
{
return nullptr;
}
Fonts *getFonts() override
{
return nullptr;
}
IEmotes *getEmotes() override
{
return nullptr;
}
AccountController *getAccounts() override
{
return nullptr;
}
HotkeyController *getHotkeys() override
{
return nullptr;
}
WindowManager *getWindows() override
{
return nullptr;
}
Toasts *getToasts() override
{
return nullptr;
}
CommandController *getCommands() override
{
return nullptr;
}
NotificationController *getNotifications() override
{
return nullptr;
}
HighlightController *getHighlights() override
{
return nullptr;
}
ITwitchIrcServer *getTwitch() override
{
return nullptr;
}
ChatterinoBadges *getChatterinoBadges() override
{
return nullptr;
}
FfzBadges *getFfzBadges() override
{
return nullptr;
}
SeventvBadges *getSeventvBadges() override
{
assert(!"getSeventvBadges was called without being initialized");
return nullptr;
}
IUserDataController *getUserData() override
{
return nullptr;
}
ISoundController *getSound() override
{
assert(!"getSound was called without being initialized");
return nullptr;
}
ITwitchLiveController *getTwitchLiveController() override
{
return nullptr;
}
ImageUploader *getImageUploader() override
{
return nullptr;
}
SeventvAPI *getSeventvAPI() override
{
return nullptr;
}
};
} // namespace chatterino::mock