Page 1 of 1
[0.3.1] music doesn't loop, question about issue tracker
Posted: Sat Jun 28, 2008 3:16 am
by qubodup
love.audio.play(muzik, 0) is supposed to loop the music, right? It does not for me. It plays only once.
Debian Sid, LÖVE 0.3.1
Will there be an
issue tracker? Or are we supposed to use
this?
Re: [0.3.1] music doesn't loop, question about issue tracker
Posted: Sat Jun 28, 2008 12:04 pm
by rude
Yeah, we
really need to take a closer look at love.audio. It lacks lots of features and was hacked together way too quickly.
As for bug tracking, I suppose we could use
that, yes.
Thanks for pointing out the bug! When fixed, we'll most likely change it to
love.audio.play(muzak, love.loop_forever) or something similar.
Re: [0.3.1] music doesn't loop, question about issue tracker
Posted: Sun Jun 29, 2008 7:47 pm
by cag
It appears changing this:
Code: Select all
(Music.cpp)
void Music::play(int loop)
{
Mix_PlayMusic(music, 0);
}
to this:
Code: Select all
void Music::play(int loop)
{
if(loop) Mix_PlayMusic(music, 1);
else Mix_PlayMusic(music, -1);
}
should work according to your current docs.
Then, you could define love.loop_forever in lua as the value false, and the love.loop_once as true.
Of course, it appears that you guys aren't too worried about backwards compatibility, so I would actually change it to this:
Code: Select all
void Music::play(int loop)
{
Mix_PlayMusic(music, loop);
}
and define loop as a number where -1 is loop infinitely, and positive numbers are a finite number of times to loop, as per the SDL_mixer docs.
Of course, this is a relatively simple fix, so I imagine it's probably just waiting on the next minor numbered release, but... I really really
really would love to have functional audio, as this means I don't have to go and actually write my own 2d lua-based game engine that I've been wanting to have.
Regards, hi, first post, yadayada.
Re: [0.3.1] music doesn't loop, question about issue tracker
Posted: Mon Jun 30, 2008 1:59 am
by rude
cag wrote:Of course, it appears that you guys aren't too worried about backwards compatibility
That's true. Not yet anyway.
cag wrote:I really really really would love to have functional audio, as this means I don't have to go and actually write my own 2d lua-based game engine that I've been wanting to have.
I can probably have 0.3.2 out in a few days with that fix if you
really need it. Not sure if that qualifies for "functional audio" though. Bigger improvements to love.audio are planned too ... but will take longer.
cag wrote:Regards, hi, first post, yadayada.
lal.
Re: [0.3.1] music doesn't loop, question about issue tracker
Posted: Wed Jul 02, 2008 11:35 pm
by Green_Hell
I have the same problem. I'm not sure that I get the point.
Is there any solution in 0.3.1 or should we wait for the next version?
Re: [0.3.1] music doesn't loop, question about issue tracker
Posted: Thu Jul 03, 2008 12:22 am
by qubodup
Green_Hell wrote:I have the same problem. I'm not sure that I get the point.
Is there any solution in 0.3.1 or should we wait for the next version?
In My Humble Opinion©, there is no clean solution, and one should be using the function the way it was meant to be used and wait for 0.3.1.
Re: [0.3.1] music doesn't loop, question about issue tracker
Posted: Fri Jul 04, 2008 8:52 pm
by rude
In fact, there was no workaround for 0.3.1, since the loop variable was never sent to SDL_mixer. 0 was always passed for Music objects.
Re: [0.3.1] music doesn't loop, question about issue tracker
Posted: Fri Jul 04, 2008 9:40 pm
by qubodup
the workaround was to make it a sound :p