Home » U++ Library support » U++ Library : Other (not classified elsewhere) » [Request] Add gst-play-1.0 to Linux notification sound players list.
[Request] Add gst-play-1.0 to Linux notification sound players list. [message #55382] |
Wed, 04 November 2020 21:20  |
Oblivion
Messages: 1202 Registered: August 2007
|
Senior Contributor |
|
|
Hi,
Currently the Linux notification sounds (bells) are played using "play", "ogg123", and "gst123" utilities. However, these CLI utilities are not always in the official repos (e.g. not in Arch Linux). OTOH, gst-play-1.0 is a part of the widely used GStreamer utilities. So it should be included in the default players list:
static void LinuxBeep(const char *name)
{
static String player;
ONCELOCK {
const char *players[] = { "play", "ogg123", "gst123", "gst-play-1.0" };
for(int i = 0; i < __countof(players); i++)
if(Sys("which " + String(players[i])).GetCount()) {
player = players[i];
break;
}
}
if(player.GetCount()) {
String fn = "/usr/share/sounds/" + CurrentSoundTheme + "/stereo/dialog-" + name;
IGNORE_RESULT(system(player + " -q " + fn +
(FileExists(fn + ".ogg") ? ".ogg" :
FileExists(fn + ".oga") ? ".oga" :
FileExists(fn + ".wav") ? ".wav" :
".*")
+ " >/dev/null 2>/dev/null&"));
}
}
Best regards,
Oblivion
Github page: https://github.com/ismail-yilmaz
upp-components: https://github.com/ismail-yilmaz/upp-components
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
|
|
|
|
|
|
Goto Forum:
Current Time: Fri Apr 25 12:06:57 CEST 2025
Total time taken to generate the page: 0.00811 seconds
|