CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 3 of 7 FirstFirst 123456 ... LastLast
Results 31 to 45 of 91
  1. #31
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Looking to develope skills

    Dude, if you want help, you'll need to ask specific questions.

    How far along are you in your media player project?

    What would you like to do, but are having trouble with?

  2. #32
    Join Date
    Dec 2009
    Posts
    109

    Re: Looking to develope skills

    Oh. My apologies. I wish to create a Media Player from scratch (meaning basically, everything has to be built). I can design the interface. But I have no idea about how to start the coding. Any suggestions???

  3. #33
    Join Date
    Dec 2009
    Posts
    109

    Re: Looking to develope skills

    Any suggestions at all???

  4. #34
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Looking to develope skills

    What do you mean "design the interface"?

    Does that mean you can design it on paper or in code with the Winforms editor?

  5. #35
    Join Date
    Apr 2007
    Location
    Florida
    Posts
    403

    Re: Looking to develope skills

    I gave you pretty good advice before.

    Start with just designing the UI in the WinForm designer view. Put _BASIC_ controls on your form (Play, Stop). Add event handlers for those buttons. Make the click event for Play start a hard coded song. Make the Stop event stop the song.

    Create the UI, and hook up the backend behind it.

  6. #36
    Join Date
    Dec 2009
    Posts
    109

    Re: Looking to develope skills

    Quote Originally Posted by Arjay View Post
    What do you mean "design the interface"?

    Does that mean you can design it on paper or in code with the Winforms editor?
    I meant I can "design" the interface with the WinForms editor.....

  7. #37
    Join Date
    Dec 2009
    Posts
    109

    Re: Looking to develope skills

    Quote Originally Posted by mariocatch View Post
    I gave you pretty good advice before.

    Start with just designing the UI in the WinForm designer view. Put _BASIC_ controls on your form (Play, Stop). Add event handlers for those buttons. Make the click event for Play start a hard coded song. Make the Stop event stop the song.

    Create the UI, and hook up the backend behind it.
    Yes, I know. I can prepare the interface with the events and stuff within no time. But I dont know what to write in the code! Do I need to create an object of System.Media.SoundPlayer??? or do i need to create some kind of file reader??? and then how will I Play, Pause or Stop a particular file??? I have no idea!!!
    Thats why I wanted some help with the code. In the code I don't know what to start with!! :P

  8. #38
    Join Date
    Dec 2009
    Posts
    23

    Re: Looking to develope skills

    This page might help you: http://www.daniweb.com/code/snippet217151.html#

    You could just copy the PlayMP3(string Location) function from that page. Then you can have your "Play"-button call that function.

    Code:
    public partial class Form1 : Form
        {
            public static void PlayMP3(String Location)
            {
                music = new Microsoft.DirectX.AudioVideoPlayback.Audio(Location);
                music.Play();
            }
    
            private void btnPLAY_Click(object sender, EventArgs e)
            {
                // This is where you are taken if you double click the button in the WinForm editor.
                PlayMP3("C:\\my_music_folder\\a_great_song.mp3");
            }
        }
    That'd be an app that lets you play a certain song. Which is pretty useless but gets you started. (I hope)

  9. #39
    Join Date
    Apr 2007
    Location
    Florida
    Posts
    403

    Re: Looking to develope skills

    Some advice:

    1) When you're referring to a user interface, don't use the term "interface" in conversations. "interface" in software development refers to a contract that classes can choose to abide by, and implement. Use the term "user interface", or "UI" instead.

    2) There are a plethora of web pages out there describing how to build media players in C#. The question to YOU is, do you want to create one from scratch or do you want to use a bare bone control that gives you all the necessities needed to start making one.

    You need to answer that question first, then we can guide you further. I personally suggest creating your own from scratch... There's really only a couple of buttons in a basic media player, and a list of songs to choose, or a file browser dialog... Like I said before... Create the UI! Then, once you have basic buttons on there, research each one and how you would hook it up to do what it should. IE: How to make the Play button start playing a song...

  10. #40
    Join Date
    Dec 2009
    Posts
    109

    Re: Looking to develope skills

    Quote Originally Posted by mariocatch View Post
    Some advice:

    1) When you're referring to a user interface, don't use the term "interface" in conversations. "interface" in software development refers to a contract that classes can choose to abide by, and implement. Use the term "user interface", or "UI" instead.

    2) There are a plethora of web pages out there describing how to build media players in C#. The question to YOU is, do you want to create one from scratch or do you want to use a bare bone control that gives you all the necessities needed to start making one.

    You need to answer that question first, then we can guide you further. I personally suggest creating your own from scratch... There's really only a couple of buttons in a basic media player, and a list of songs to choose, or a file browser dialog... Like I said before... Create the UI! Then, once you have basic buttons on there, research each one and how you would hook it up to do what it should. IE: How to make the Play button start playing a song...
    Ohk, thanks for the advice!
    As for the answer to your question, like I said before, I wish to build it from scratch.... All I need to know is, how to construct the code for each button, ie., what code is to be written for each button???

  11. #41
    Join Date
    Dec 2009
    Posts
    109

    Re: Looking to develope skills

    Quote Originally Posted by TryingToC# View Post
    This page might help you: http://www.daniweb.com/code/snippet217151.html#

    You could just copy the PlayMP3(string Location) function from that page. Then you can have your "Play"-button call that function.

    Code:
    public partial class Form1 : Form
        {
            public static void PlayMP3(String Location)
            {
                music = new Microsoft.DirectX.AudioVideoPlayback.Audio(Location);
                music.Play();
            }
    
            private void btnPLAY_Click(object sender, EventArgs e)
            {
                // This is where you are taken if you double click the button in the WinForm editor.
                PlayMP3("C:\\my_music_folder\\a_great_song.mp3");
            }
        }
    That'd be an app that lets you play a certain song. Which is pretty useless but gets you started. (I hope)
    Thanks dude!!
    Actually, your explanation helped me better in understanding, rather than the explanation in the link that you gave.
    And I have a small problem. VC# 2008 shows error in "Microsoft.DirectX.AudioVideoPlayback.Audio(Location)"
    by saying that there's no reference. I tried searching for the reference but all I could find was "
    "DirectX 7 for Visual Studio Library" & "DirectX 8 for Visual Studio Library". And neither of them have helped. Where can I find the reference???

  12. #42
    Join Date
    Apr 2007
    Location
    Florida
    Posts
    403

    Re: Looking to develope skills

    Did you install DirectX SDK? It's included in the binaries with that I'm assuming.

  13. #43
    Join Date
    Dec 2009
    Posts
    109

    Re: Looking to develope skills

    Quote Originally Posted by mariocatch View Post
    Did you install DirectX SDK? It's included in the binaries with that I'm assuming.
    Well, if it gets installed during an online install, then yes I have installed it...

  14. #44
    Join Date
    Apr 2007
    Location
    Florida
    Posts
    403

    Re: Looking to develope skills

    what online install lol?. you should google this, i did and found a lot of solutions.

  15. #45
    Join Date
    Dec 2009
    Posts
    109

    Re: Looking to develope skills

    Quote Originally Posted by mariocatch View Post
    what online install lol?. you should google this, i did and found a lot of solutions.
    http://www.microsoft.com/express/vcsharp/#webInstall

    visit this link. this is what you call an online install.

Page 3 of 7 FirstFirst 123456 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured