Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous message
Oblivion is currently offline  Oblivion
Messages: 1093
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


 
Read Message
Read Message
Read Message
Read Message
Previous Topic: plugin/Eigen updated to stable release 3.3.8
Next Topic: Last SVN update added too mutch Logs on my application
Goto Forum:
  


Current Time: Sun May 05 14:53:26 CEST 2024

Total time taken to generate the page: 0.26111 seconds