2019-08-18 02:27:58

So, I want to make a  music player, witch in theory, doesn't sound too hard. But there are two problems.
I want this to just play by going to the next in the selected folder, because my tracks aren't just music1.asdfghjkl, music2.asdfghjkl, I use the actual music's name. So there's one thing.
The second thing is, this will be part of a larger scale game, witch you can unlock the music tracks in game, via some thing or another.
So, first, how would I make a music player, using a music sound object, so that I can manipulate volume and stuffages, but also make it go by file via folder layout, instead of by number? And also make it so that they will only show up in the menu if they are unlocked?
I don't want to make a bool for every damn file lol.

----------
“Yes, sir. I am attempting to fill a silent moment with non-relevant conversation.”
“You don’t tell me how to behave; you’re not my mother!”
“Could you please continue the petty bickering? I find it most intriguing.” – Data (Star Trek: The Next Generation)

2019-08-18 03:10:50

An array of sounds that are unlocked. If unlocked_sounds.find(string_trim_right(name,4))>-1) //play the sound.

Ivan M. Soto.
Feel free to check out my work and services.
http://ims-productions.com

2019-08-18 03:22:08 (edited by bgt lover 2019-08-18 03:24:17)

You can do this in two diferent ways
1: You could make it  accept as input a folder name, finding the files that match *.wav, iterate over them loading the sound object with each file name.
2: In explorer, windows sends each file you select as a separate command line argument to the program associated with that file extension, so you might take that in account while building the thing.
Regarding the unlocking, ,... too implementation specific. Please come back to us when more of the project is readyso you can explain more contextual details.

2019-08-18 05:57:33

Ok, thank you for the replies, I will try these responses.

----------
“Yes, sir. I am attempting to fill a silent moment with non-relevant conversation.”
“You don’t tell me how to behave; you’re not my mother!”
“Could you please continue the petty bickering? I find it most intriguing.” – Data (Star Trek: The Next Generation)

2019-08-18 11:05:45

Re: bool for every file, that's what arrays or bitwise operators are for. You don't have to make a bool for every one, when you can just say bool[] unlockedtracks (tracks.length()); Assuming you have an array of filenames, which you probably do. Then you just have an int for which track is playing.

看過來!
"If you want utopia but reality gives you Lovecraft, you don't give up, you carve your utopia out of the corpses of dead gods."
MaxAngor wrote:
    George... Don't do that.