|
I don't know of any sites right off, but there should by any number of sites that have sample code. You should really start with a pencil and paper first though.
For example, suppose I do tech support on a forum where I gat asked the same questions over and over again. Since I want to save time, I create my own canned responses and store them in a text file, but after awhile it gets so big that it is hard to find the ones I want. I decide to create my own app that alphabetizes responses in their own little seperate file. So now I am ready to determine what I need my program to do.
******
-open files
-save files
-edit files
-display a user interface
-find files
-display files
Now it comes down to making a few decisions. First of all, I have two related processes -Opening files and saving files. I also have two more that are sort of related. Editing files and finding files. So maybe the first decision needs to be, what kind of format do we want to use for saving files? Text files are simple. Do we need to maybe encrypt the files so that nobody sees our canned responses? Do we want to store them as individual files? Do we want to store them in one big text file and just load the entire range of responses into memory each time we use the program? How do we want to arrange them? Alphabetically? By use?
Then we need to make some decisions about the user interface. It should be quite obvious that a command line program probably won't be too efficient for this type of application. So we need to decide.. how do we want to be able to search for the responses that we want? Typing in a keyword would be nice. I would also like a drop downlist that once I choose a letter, I get another dropdown that lists the saved speeches within that category. I am also going to want a text area that displays the speech so that I can edit it. I would also like it to be able to save any changes I make.
Now we need to figure out what we need to do to make all the little parts that will do what we want. So starting out simply, we need to be able to open and save files. What library functions will help us do that? What happens if we try to load a file that doesn't exist? What do we want our application to do? Once we research that, we should be able to find some examples of what we want to do, and modify the code so that it fits our exact needs.
I decide that the easiest way to store all my responses is in one big text file. Since I need a way to distinguish between different responses, I decide that I will put a row of asterisks between each response. That means when I load my list of responses, somehow my application will have to sort them properly, as well as distinguish where the rows of asterisks are. Now my next test would be to see if I can read in a file of text and recognize when there is a row of asterisks. After I can do that, I would further modify it to somehow sort those responses.
Finally we can consider the gui. We know we want at least one dropdown menu, a text area, and some buttons that do different things, so our next step would be to see if we can create a window and add parts little by little until we get some sort of interface we can work with.
Once we get all of the seperate pieces doing what we want them to do, then we can start putting them together, little bit by little bit. That's where you need to start. Programming is more than just slapping some code together. It is almost always a series of steps, starting with defining each individual problem, and then solving each little problem. Then once your little problems are solved, they can all be put together to solve your bigger problem. In your case, your problem is "How do I create my own media player".
EDIT: I didn't mean to get long winded, I just wanted to point out that in you need some sort of a game plan before you even start. It doesn't do much good to say "Use the WIN32 API" if you don't even know why you need them. Once you know what you need, then you can go about finding it, or asking questions of people so that they can help you find what you need.
|