I'm trying to decide how I want to implement sound effects in my program. I've debating between 2 options.
1) Create an abstract interface SoundEffect
and have every sound effect derive from that. Each sound effect is its own class. Upon construction, it opens the sound file and plays, and upon destruction it closes the file. The main drawback I see to this approach is that I'll have a lot of very small objects which would greatly increase the number of files. I could put multiple sound effects in a single header (ones that are related), but I'm not sure.
2) Since the playing of any sound effect calls the same stuff, with the only difference being the file it opens, I could create a single SoundEffect class, with its constructor being an enumerator that contains the names of the sound effects. The class would use a switch to play the appropriate sound.
Obviously I'm debating over an OOP approach vs a more "traditional" approach, and I'm wondering what the best design choice is here. I am heavily leaning towards the OOP approach, but I'm not sure how I want to structure the files. If you have any other recommendations, I'd be glad to hear them.