Original Post
Hey guys,
I am busy with a small audio engine, playing .wav files and although everything works fine, I'm having some second thoughts about a certain part where I need to break out of 2 loops at certain points.
The way I do it now is as following:
it does the job, but I think this looks very ugly. The other option I had in mind was to use a goto: but I don't like using goto.. Does anyone have an idea of how I can do this in a more proper/cleaner way? If there is any at all?
Much appreciated!
I am busy with a small audio engine, playing .wav files and although everything works fine, I'm having some second thoughts about a certain part where I need to break out of 2 loops at certain points.
The way I do it now is as following:
static bool earlyout = false;
for(iterate through sounds)
{
// gather some relevant data
for(iterate through buffer)
{
if(something)
{
earlyout = true;
break;
}
}
if(earlyout)
{
earlyout = false;
break;
}
}
it does the job, but I think this looks very ugly. The other option I had in mind was to use a goto: but I don't like using goto.. Does anyone have an idea of how I can do this in a more proper/cleaner way? If there is any at all?
Much appreciated!