Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2002:
[Freeciv-Dev] Re: [Patch] Sound8
Home

[Freeciv-Dev] Re: [Patch] Sound8

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Freeciv-Dev <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: [Patch] Sound8
From: "Per I. Mathisen" <Per.Inge.Mathisen@xxxxxxxxxxx>
Date: Fri, 15 Feb 2002 11:28:39 +0100 (MET)

On Tue, 12 Feb 2002, Jason Short wrote:
> Unfortunately, the code never actually resets the elements when the
> sound sample it corresponds to is freed, so once the buffer is full this
> will happen every time a sample is played.

I don't understand what you are referring to.

> Assuming ESD doesn't have a "maximum channels" limit, one solution would
> be to just start the sample and not track it at all thereafter.  Then it
> can end at its own time...the problem being that on shutodwn() there is
> no way for us to stop it.  Obviously the music sample ID must be
> tracked, since only one music should be playing at a time - but with
> music we can be pretty sure that it won't stop until we tell it to.

This is not a problem. Since we track music in a separate "channel"
anyway, and only one music can play at a time, we can stop it at program
exit separatedly of what is done to sound effects. Since the other sound
smaples don't loop, they will stop when they are done, irrespective of
whether the program has quit or not (unlike with SDL, where sound will
terminate at program exit).

So we did I use sample buffering and not just a play&forget function?
Because I wanted to add some cacheing to reduce file loads. As of now it
only does a single cacheing check, but this could be much improved. It
isn't any better simply because I forgot all about it once I had the basic
structure in place and I started coding the more fun parts...

Of course, if there are actual structural problems with the way the ESD
code is written now, I'll rewrite it. I just don't see the problem with
it as it is now.

> And SDL has similar (though not identical) problems...

Please explain.

Yours,
Per

"What we anticipate seldom occurs: but what we least expect generally
happens." -- Benjamin Disraeli



[Prev in Thread] Current Thread [Next in Thread]