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 next message
Oblivion is currently offline  Oblivion
Messages: 1091
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


Re: [Request] Add gst-play-1.0 to Linux notification sound players list. [message #55384 is a reply to message #55382] Wed, 04 November 2020 21:24 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 1075
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello Oblvion,

I can congrim I am on arch based Manjaro distribution and by default (or I do not remembered I installed it) I have "gst-play-1.0". What if they decide to change the name to something different, I do not like the idea to name tool binary with the version.

Klugier


U++ - one framework to rule them all.
Re: [Request] Add gst-play-1.0 to Linux notification sound players list. [message #55386 is a reply to message #55384] Wed, 04 November 2020 21:42 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1091
Registered: August 2007
Senior Contributor
Hello Klugier,


Quote:
What if they decide to change the name to something different, I do not like the idea to name tool binary with the version


Well, nothing bad will happen, and it will be ignored I guess. After all, none of the other tools that are already in the players list are installed on my machines. Smile

Besides, the tool is at v1.18.1, not v1.0. (and backed by a more vibrant and bigger community)

Best regards,
Oblivion


Re: [Request] Add gst-play-1.0 to Linux notification sound players list. [message #55388 is a reply to message #55386] Wed, 04 November 2020 22:06 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Makes sense, thanks.
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: Fri Mar 29 08:58:53 CET 2024

Total time taken to generate the page: 0.01861 seconds