diff options
author | Marc-Andre Lureau <marcandre.lureau@gmail.com> | 2008-06-03 18:38:48 +0300 |
---|---|---|
committer | Marc-Andre Lureau <marcandre.lureau@gmail.com> | 2008-06-03 18:39:35 +0300 |
commit | b09703eb12132edc03bf3c5ed504c907f86ea375 (patch) | |
tree | 81b3f5c291ee3d8f0572ccdfaa291801ff4c1613 | |
parent | 0554fa9de7ed08ef7d730b06bee1d7c9f06eb72c (diff) |
Add subnames lookup: truncatesuffix for soundname
-rw-r--r-- | spec/sound-naming-spec.xml | 8 | ||||
-rw-r--r-- | spec/sound-theme-spec.xml | 22 |
2 files changed, 16 insertions, 14 deletions
diff --git a/spec/sound-naming-spec.xml b/spec/sound-naming-spec.xml index df83421..be8a025 100644 --- a/spec/sound-naming-spec.xml +++ b/spec/sound-naming-spec.xml @@ -68,7 +68,7 @@ usage. <title>Context</title> <para> - The list of default Contexts for the sound theme are: + The list of default contexts for the sound theme are: </para> <table> @@ -132,8 +132,8 @@ usage. <listitem> <para> Sound names are in the en_US.US_ASCII locale. This means - that the allowable characters in the sound names, must - fall withing the US-ASCII character set. As a further + that the characters allowed in the sound names must + fall within the US-ASCII character set. As a further restriction, all sound names may only contain lowercase letters, numbers, underscore, dash, or period characters. Spaces, colons, slashes, and backslashes are @@ -178,7 +178,7 @@ usage. <title>Alerts</title> <para> This is to notify the user of an action or event which may - have a major imact on the system or their current use case. + have a major impact on the system or their current use case. </para> <table id="alerts-table"> diff --git a/spec/sound-theme-spec.xml b/spec/sound-theme-spec.xml index 3da8e75..5b5f282 100644 --- a/spec/sound-theme-spec.xml +++ b/spec/sound-theme-spec.xml @@ -453,18 +453,20 @@ FindSoundHelper(sound, locale, outputprofile, theme) { With the following helper functions: <programlisting> -LookupSound (sound, locale, requestedoutputprofile, requestedtheme) { +LookupSound (soundname, locale, requestedoutputprofile, requestedtheme) { // lookup localized version for theme in (requestedtheme, "freedesktop", "") { - for each locale in ($locale, truncate($locale, "@"), truncate($locale, "_"), "C", "") - for profile in (requestedoutputprofile, "stereo", "") { - for each subdir in $(theme subdir list) { - if DirectoryMatchesOutputProfile(subdir, profile) { - for each directory in $(basename list) { - for extension in ("wav", "ogg") { - filename = directory/$theme/subdir/locale/sound.extension - if exist filename - return filename + for each locale in ($locale, truncateprefix($locale, "@"), truncateprefix($locale, "_"), "C", "") + for each subname in (soundname, truncatesuffix(soundname), truncatesuffix(truncatesuffix(soundname)), ...) + for profile in (requestedoutputprofile, "stereo", "") { + for each subdir in $(theme subdir list) { + if DirectoryMatchesOutputProfile(subdir, profile) { + for each directory in $(basename list) { + for extension in ("wav", "ogg") { + filename = directory/$theme/subdir/locale/subname.extension + if exist filename + return filename + } } } } |