From 4747db163dcc1a60eaf337798f2b4e8d2ca913c4 Mon Sep 17 00:00:00 2001 From: Paul Liverman Date: Wed, 26 Nov 2014 12:40:43 -0800 Subject: [PATCH] Unclobbered love.audio stuff, moved into slam.audio I don't know if this will actually work or if I have broken it. --- slam.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/slam.lua b/slam.lua index 79c4879..6aa8b93 100644 --- a/slam.lua +++ b/slam.lua @@ -1,4 +1,4 @@ --- Simple LÖVE Audio Manager +-- Simple LÖVE Audio Manager -- -- Copyright (c) 2011 Matthias Richter -- Permission is hereby granted, free of charge, to any person obtaining a copy @@ -104,13 +104,13 @@ end function Source:addTags(tag, ...) if not tag then return end - love.audio.tags[tag][self] = self + slam.audio.tags[tag][self] = self return Source.addTags(self, ...) end function Source:removeTags(tag, ...) if not tag then return end - love.audio.tags[tag][self] = nil + slam.audio.tags[tag][self] = nil return Source.removeTags(self, ...) end @@ -137,7 +137,7 @@ Source.isLooping = Source.getLooping -------------------------- -- love.audio interface -- -------------------------- -function love.audio.newSource(target, how) +function slam.audio.newSource(target, how) local s = { _paused = false, target = target, @@ -150,16 +150,16 @@ function love.audio.newSource(target, how) if how == 'static' and type(target) == 'string' then s.target = love.sound.newSoundData(target) end - love.audio.tags.all[s] = s + slam.audio.tags.all[s] = s return setmetatable(s, Source) end -function love.audio.play(source) +function slam.audio.play(source) assert(source and source.instances, "Can only play source objects.") return source:play() end -function love.audio.stop(source) +function slam.audio.stop(source) if source and source.stop then return source:stop() end stop() end @@ -178,7 +178,7 @@ function Tag:__index(func) end end -love.audio.tags = setmetatable({}, { +slam.audio.tags = setmetatable({}, { __newindex = error, __index = function(t,k) local tag = setmetatable({}, Tag)