Phonon Sample Cache

Colin Guthrie gmane at colin.guthr.ie
Sat Aug 27 13:40:03 BST 2011


'Twas brillig, and Harald Sitter at 27/08/11 09:27 did gyre and gimble:
> On Fri, Aug 26, 2011 at 6:37 PM, Trever Fischer
> <tdfischer at fedoraproject.org> wrote:
>> Personally, I think theming game sounds is silly and would hardly ever be
>> used; I'm looking for input from those who disagree with me because I
>> don't think I'd be able to make a solution that satisfies that audience.
> 
> No reason to not allow them though :P
> BUT Qt is not FDO aware(*), Phonon is not FDO aware, nothing we depend
> on is FDO aware, so simply finding the right folder for sound lookups
> would probably be rather a lot of code ... in Phonon.

The suggestion I had here was to implement an incredibly dumb and
lightweight version of the lookup code.

Any games or apps that have their own custom sound-events (i.e. not
standard sound names) will install these files into
/usr/share/sounds/freedesktop/stereo/ as e.g. kgoldrunner-wibble-foo.ogm
(or just symlink them).

If we use libcanberra, and trigger the sound "kgoldrunner-wibble-foo"
then this file will always be used, regardless of the current sound
theme the user has chosen[1] (this is because "freedesktop" is the
fallback theme name (much like "hicolor" is to icons)).

So this Just Works™

Now if libcanberra is not present, all we need to do is look in the
folder /usr/share/sounds/freedesktop/stereo/ for the sound file (likely
supporting ogm or wav files only).

Sure there would be no theme support but the sounds would work as the
author intended, so it covers the non-canberra case sufficiently IMO.


On non-linux sustems the folder "/usr/share/sounds/freedesktop/stereo/"
could be replaced with "$APP_FOLDER\sounds\" or similar.

Thus authors of apps could just install all files into a sounds folder
(on linux this would be /usr/share/data/$APP/sounds/) and then a
standard CMAKE install rule could symlink them into
"/usr/share/sounds/freedesktop/stereo/" automatically.

Thus very little effort is needed by app developers and our fallback
code is pretty damn simple, we don't reinvent the wheel and everyone is
happy.

> I think that FDO compliant theme support should not be implemented in
> Phonon but in a KDELibs wrapper ontop of a Phonon sample cache
> implementation. So that the wrapper (which as part of KDE is FDO aware
> and has all capabilities necessary to implement sound theme support
> sensibly) actually resolves the full path of the sound to use and then
> passes it to our FDO unaware Phonon class.

I really don't think this is wise. libcanberra does this already. I
certainly have very little motivation to reimplement things when they
are already there.

> That is not to say that simple theme support could not be provided
> from within Phonon for Qt only API consumers. However for that I
> question the use as well.
> 
> Scenario:
> - Qt only API consumer
> - Only targeting windows and mac
> - Does not care about some random FDO specs
> - Wants to have a boring and a pirate theme for his application (theme
> = graphics and sounds)
> - Consumer implements simple theme engine which searches in ./themes
> (relative from executable) for folders, each folder is assumed to be a
> theme, within each folder is /graphics/ and /sounds/ -> consumer can
> resolve full path to audio samples without any help from Phonon
> 
> To summarize. IMHO name resolving against a theme is a high-level
> action that Phonon should allow but not implement.

Well it's up to you but I'm not sure I'd want to expend quite that much
energy supporting the relatively rare case outlined above.

But everyone's opinions are different. I personally don't care massively
about this use case (linux is the primary target for me), but obviously
others will.

Col



-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mageia Contributor [http://www.mageia.org/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]

_______________________________________________
kde-multimedia mailing list
kde-multimedia at kde.org
https://mail.kde.org/mailman/listinfo/kde-multimedia


More information about the kde-multimedia mailing list