Redo, new team and Soundmanager

So I will start this blog-post of by saying the following. I failed a class and have to redo it. But don’t worry I got an awesome new team and great team members.

So this is what I have worked on on the course since I started it again.

To the game I offered to code a Maploader (a program that handles objects on the map and draws the map). However after the group talked the hard working labor and hours put down on the loader got canceled. Instead I got to change and do something else.

so here comes the Important bit. I did a SoundManager
Per request of the team members this is what the SoundManager would do.
1. Load and handle sounds
2. Play the sounds

So that was what I got started on. The last time I did this class and type of project I had done a similar class before so I started from looking into that.

To make this a little easier I decided to have the SoundManager read in the Sound effects  and Music from a .txt file.
each one had a different file so that there could be no mix up.

after that I decided to use std::map to save 2 variables
The std::map for sfx saved down a sound effect name and the path to the sound effect.
The std::map for music did the same but track number and the path to the music.

Soundmanager_h

This however after getting help from a better programmer he told me that the std::map for the song_list was redundant. The problem with is what that the persons have no control over it so why have the numbers?
It would only take up more space and have no real purpose.

So the std::map turned to a std::vector instead and space was saved! Yay!

So then how does this Finished SoundManager work? here is a diagram:

SoundManager

1. The engine creates a new SoundManager pointer. It then start the initilize process.
2. The intilize reads in the strings from sfx.txt and music.txt and loads them as into a std::map for each of them.
3. Then the SoundManager saves a buffer for each part of the std::map’s
4. Now the SoundManager can take the sounds and play them back as the engine sends in for example m_sound->play(”SFX”. ”Fnap”) in order to play the sound ”Fnap”.
You can also just as simple send in m_sound->play(”music”, ”next”) in order to change to the next part of the song list.

There you have it the first post for the redo of the course and a soundmanager

If you have any questions please ask them bellow and I will try to answer them for the greatest part of my knowledge.