Do methods of multiple instances of a class share the same resources?
Posted on 2006-05-16
OK! Weird question.
I'm working on a program that is like a little music player. You press the keys, it makes instrument sounds. It's my first windows application, and my first attempt at OOP.
I've integrated a little looping feature that allows you to record what you're playing, loop it, and play over it. I have a looper class that captures which sounds are being played, and when, and then plays it back. Right now there are four loopers registered in the form1 class, and they all work just like they're supposed to... that is until you try to play back more than one at the same time. You turn one on, it works fine. You turn a second one on, and the first one turns off, and the second one plays. And, weirdly, if you turn the second one off, the first one comes back on. It's like they're masking each other in the order they're being played.
Anyway, I've been over the code over and over, and the only thing I can imagine is that one instance of the Looper.Play method is somehow stepping on the others, making them pause until it's done doing its thing. It that possible?