Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kwccoin opened this issue Jun 19, 2024 · 0 comments

Comments

@kwccoin
Copy link

kwccoin commented Jun 19, 2024

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!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant