Description:
A library to handle whisper/say/yell/comm communicated shared sounds and facilitate sound management.
This respects category-based sound filters using an include-exclude scheme. For example, sounds from the "Leeroy" mod can be ignored in raid instances, but sounds from "RaidMod" will still be played.
Can be used to filter & replace text to create pseudo-emotes or create RP group emotes (at the user's option they will join in).
Uses either self (bulk priority) or given user addon as the AceComm instance to drive communications.
Designed to support pre-translated cross-faction text via say/yell.
Still in development, but suggestions/critique welcome.
API Example:
local SoundLib = AceLibrary("SharedSounds-1.0")
-- create and register 2 sounds with the comm mechanism
local quack, squeak = SoundLib:newSound(
{file = "quack", dir = "AddOns\MyAddon", text = "QUACK! QUACK!"},
{file = "squeak", dir = "AddOns\MyAddon"})
-- emit a sound: yells "QUACK! QUACK!" and clients with
-- quack registered (and not filtered) hear the sound
quack:Emit("YELL")
-- send a sound to another client (using SharedSounds for comm)
local target = UnitName("target")
squeak:Transmit("WHISPER",target)
-- create but *do not* register sound
local alarm = SoundLib:newSound(
{file = "alarm", dir = "AddOns\MyAddon"},false)
-- play locally
alarm:Play()
Filter API:
local filter = {
dist = {"SAY","WHISPER"}, -- list of dist methods to be OR'd
action = "PLAY", -- filter affects playing the sound
function = SoundLib.Filter.Function.IN_RAIDINSTANCE, -- filter matches if player in raid instance
}
SoundLib:AddFilter("deny",filter) -- globally deny sounds playing in raid instance
SoundLib:AddFilter(MyAddon,"allow",filter) -- except for sounds from my addon
Filters apply in ALLOW, DENY order and will be sorted to match the most-specific first (dist, then action, then functions which will all be evaluated). Internally they may be merged to eliminate redundancies.
TODO:
impl register and deregister filters
impl comm
test
commit
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
A library to handle whisper/say/yell/comm communicated shared sounds and facilitate sound management.
This respects category-based sound filters using an include-exclude scheme. For example, sounds from the "Leeroy" mod can be ignored in raid instances, but sounds from "RaidMod" will still be played.
Can be used to filter & replace text to create pseudo-emotes or create RP group emotes (at the user's option they will join in).
Uses either self (bulk priority) or given user addon as the AceComm instance to drive communications.
Designed to support pre-translated cross-faction text via say/yell.
Still in development, but suggestions/critique welcome.
API Example:
Filter API:
Filters apply in ALLOW, DENY order and will be sorted to match the most-specific first (dist, then action, then functions which will all be evaluated). Internally they may be merged to eliminate redundancies.
TODO: