Companion custom functions sound playback fixes (#6000)
* [CompanionIcon] Can now add multiple image files to icon for representing different UI states (checked/active/etc). * [Companion][CustomFunctionsPanel] Fix sound file locked after playback (fixes #5222, fixes #5997); Refactor play button (fixes #4929); Create new QMediaPlayer on each play and load in "LowLatency" mode instead of stream.
This commit is contained in:
committed by
Bertrand Songis
parent
cb19949a82
commit
2eec091ac0
@@ -97,12 +97,17 @@ static QString iconThemeFolder(int theme_set)
|
||||
}
|
||||
|
||||
CompanionIcon::CompanionIcon(const QString &baseimage)
|
||||
{
|
||||
addImage(baseimage);
|
||||
}
|
||||
|
||||
void CompanionIcon::addImage(const QString & baseimage, Mode mode, State state)
|
||||
{
|
||||
const QString theme = iconThemeFolder(g.theme());
|
||||
addFile(":/themes/"+theme+"/16/"+baseimage, QSize(16,16));
|
||||
addFile(":/themes/"+theme+"/24/"+baseimage, QSize(24,24));
|
||||
addFile(":/themes/"+theme+"/32/"+baseimage, QSize(32,32));
|
||||
addFile(":/themes/"+theme+"/48/"+baseimage, QSize(48,48));
|
||||
addFile(":/themes/"+theme+"/16/"+baseimage, QSize(16,16), mode, state);
|
||||
addFile(":/themes/"+theme+"/24/"+baseimage, QSize(24,24), mode, state);
|
||||
addFile(":/themes/"+theme+"/32/"+baseimage, QSize(32,32), mode, state);
|
||||
addFile(":/themes/"+theme+"/48/"+baseimage, QSize(48,48), mode, state);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user