You might be doing this already (4000 lines of code is too much to dig through) but the usual way is to keep track if something is done; below just as an example.
if(localtimeinfo.tm_hour == 12 && localtimeinfo.tm_min == 45)
{
if(wavPlayed == false)
{
wavPlayed = true;
playwav(test, 6);
}
else
{
wavPlayed = false;
}
}
Notes:
- It's highly advisable to start splitting your code over more functions. A function should basically fit on a sheet of A4. And in the next step split your code over multiple files.
- This basically indicates a design flaw; it will also make your code very difficult to follow; again, more functions.
}
}
}
}
}
}
}