Home » Developing U++ » U++ Developers corner » Sound in linux (Lack of standards in Linux is a problem but there are some near-standards)
Re: Sound in linux [message #44105 is a reply to message #44103] |
Thu, 25 December 2014 13:56 |
|
Klugier
Messages: 1076 Registered: September 2012 Location: Poland, Kraków
|
Senior Contributor |
|
|
Hello Mirek,
I think you should also protect the situation when player string is empty. It can leads to meaningless system call, that cost more resources than normal function call. The system needs to detect that invoking command is wrong.
Code:
if (!player.IsEmpty()) {
String fn = "/usr/share/sounds/" + CurrentSoundTheme + "/stereo/dialog-" + name;
// Call only if player is detected!!!
IGNORE_RESULT(system(player + " -q " + fn +
(FileExists(fn + ".ogg") ? ".ogg" :
FileExists(fn + ".oga") ? ".oga" :
FileExists(fn + ".wav") ? ".wav" :
".*")
+ " >/dev/null 2>/dev/null&"));
}
Sincerely,
Klugier
U++ - one framework to rule them all.
[Updated on: Thu, 25 December 2014 13:57] Report message to a moderator
|
|
|
|
|
Sound in linux
|
|
|
Re: Sound in linux
By: mirek on Wed, 17 December 2014 11:30
|
|
|
Re: Sound in linux
|
|
|
Re: Sound in linux
By: mirek on Wed, 17 December 2014 19:56
|
|
|
Re: Sound in linux (& generic launchers)
|
|
|
Re: Sound in linux (& generic launchers)
|
|
|
Re: Sound in linux
|
|
|
Re: Sound in linux
|
|
|
Re: Sound in linux
|
|
|
Re: Sound in linux
|
|
|
Re: Sound in linux
|
|
|
Re: Sound in linux
|
|
|
Re: Sound in linux
By: Klugier on Tue, 23 December 2014 14:49
|
|
|
Re: Sound in linux
|
|
|
Re: Sound in linux
By: mirek on Wed, 24 December 2014 12:27
|
|
|
Re: Sound in linux
By: Klugier on Wed, 24 December 2014 13:18
|
|
|
Re: Sound in linux
By: mirek on Wed, 24 December 2014 15:46
|
|
|
Re: Sound in linux
By: Klugier on Wed, 24 December 2014 16:30
|
|
|
Re: Sound in linux
By: mirek on Thu, 25 December 2014 10:48
|
|
|
Re: Sound in linux
By: Klugier on Thu, 25 December 2014 13:56
|
|
|
Re: Sound in linux
By: mirek on Thu, 25 December 2014 21:01
|
|
|
Re: Sound in linux
|
|
|
Re: Sound in linux
By: Klugier on Thu, 25 December 2014 14:23
|
Goto Forum:
Current Time: Sat May 11 21:00:21 CEST 2024
Total time taken to generate the page: 0.03115 seconds
|