Skip to content

Remove some codes and plug in xbox controller to make it work under macOS after a decade #10

Description

@kwccoin

Tbh, great.

I do not much master the meta-table under LUA and hence cannot understand what you try to do about a decade ago and what buy you are trying to fix. Still to make the code work in my Mac M2 I need to do the followings:


-- This is a workaround for an infrequent but annoying audio bug where clips
-- simply stop playing and need to be recreated as new objects.
function PacSource:play()
  --[[ kwc
  if self.src:isPaused() or self.src:isStopped() then
    self.src:play()
  end
  if self.src:isPaused() then
    -- Here is the workaround. Theoretically, this block should never happen.
    -- But it does.
    local is_looping = self.src:isLooping()
    self.src = love.audio.newSource(self.filename, 'static')
    self.src:setLooping(is_looping)
    self.src:play()
  end
  --]]
  self.src:play() -- kwc called itself and loop book ???
end

function PacSource:pause()
  --[[ kwc
  if not self.src:isPaused() and not self.src:isStopped() then
    self.src:pause()
  end
  --]]
  return false --kwc
end

function PacSource:setLooping(should_loop) self.src:setLooping(should_loop) end
function PacSource:isPaused() 
  return false -- self.src:paused() -- kwc isPaused()  -- call itself and loop back ???
end

and after plugin my bluetooth based xbox controller, I was eaten alive by the ghosts :-))))

Great!!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions