mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-18 05:45:45 -04:00
HostInterface: Add keyed OSD messages
This commit is contained in:
@ -229,11 +229,6 @@ bool HostInterface::ConfirmFormattedMessage(const char* format, ...)
|
||||
return ConfirmMessage(message.c_str());
|
||||
}
|
||||
|
||||
void HostInterface::AddOSDMessage(std::string message, float duration /* = 2.0f */)
|
||||
{
|
||||
Log_InfoPrintf("OSD: %s", message.c_str());
|
||||
}
|
||||
|
||||
void HostInterface::AddFormattedOSDMessage(float duration, const char* format, ...)
|
||||
{
|
||||
std::va_list ap;
|
||||
@ -244,6 +239,16 @@ void HostInterface::AddFormattedOSDMessage(float duration, const char* format, .
|
||||
AddOSDMessage(std::move(message), duration);
|
||||
}
|
||||
|
||||
void HostInterface::AddKeyedFormattedOSDMessage(std::string key, float duration, const char* format, ...)
|
||||
{
|
||||
std::va_list ap;
|
||||
va_start(ap, format);
|
||||
std::string message = StringUtil::StdStringFromFormatV(format, ap);
|
||||
va_end(ap);
|
||||
|
||||
AddKeyedOSDMessage(std::move(key), std::move(message), duration);
|
||||
}
|
||||
|
||||
std::string HostInterface::GetBIOSDirectory()
|
||||
{
|
||||
std::string dir = GetStringSettingValue("BIOS", "SearchDirectory", "");
|
||||
|
@ -70,8 +70,11 @@ public:
|
||||
bool ConfirmFormattedMessage(const char* format, ...) printflike(2, 3);
|
||||
|
||||
/// Adds OSD messages, duration is in seconds.
|
||||
virtual void AddOSDMessage(std::string message, float duration = 2.0f);
|
||||
virtual void AddOSDMessage(std::string message, float duration = 2.0f) = 0;
|
||||
virtual void AddKeyedOSDMessage(std::string key, std::string message, float duration = 2.0f) = 0;
|
||||
virtual void RemoveKeyedOSDMessage(std::string key) = 0;
|
||||
void AddFormattedOSDMessage(float duration, const char* format, ...) printflike(3, 4);
|
||||
void AddKeyedFormattedOSDMessage(std::string key, float duration, const char* format, ...) printflike(3, 4);
|
||||
|
||||
/// Returns the base user directory path.
|
||||
ALWAYS_INLINE const std::string& GetUserDirectory() const { return m_user_directory; }
|
||||
|
Reference in New Issue
Block a user