Results 1 to 19 of 19

Thread: Remake of my MP3 Player using Windows Media Player

  1. #1

    Thread Starter
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Remake of my MP3 Player using Windows Media Player

    Hi,

    Here is the remake of a mini media player which, I made back in 2002.

    Check post #14 for latest project/s.

    frmMain code:
    vb Code:
    1. 'How to use the Windows Media Player
    2. 'control (version 11.0) in Visual Basic 6.0 to play music
    3. 'Date: 15/04/2011
    4. 'Author: Aaron Spehr
    5. 'Alias: Nightwalker83
    6. 'Website: http://aaronspehr.net/
    7.  
    8. Private Sub Form_Load()
    9.  Me.Caption = "Mini MP3 Player"
    10. 'Integer index of the song to be played
    11.  s = 0
    12. 'Disable the song duration timer
    13.  tmrDuration.Enabled = False
    14.  frmSetup.Songopt(0).Value = True
    15.  mnuStop.Checked = True
    16.  frmSetup.Caption = "Setup"
    17. End Sub
    18.  
    19.  
    20. Private Function play(s)
    21.  frmSetup.Lstsongs.Selected(s) = True
    22.  MediaPlayer1.URL = frmSetup.Lstsongs.Text
    23. End Function
    24.  
    25. Private Sub mnuExit_Click()
    26.  'Close the player
    27. MediaPlayer1.Close
    28.  Unload Me
    29. End Sub
    30.  
    31. Private Sub mnuForward_Click()
    32. MediaPlayer1.Controls.fastForward
    33. mnuForward.Checked = True
    34. mnuRewind.Checked = False
    35. mnuPlay.Checked = False
    36. End Sub
    37.  
    38. Private Sub mnuPause_Click()
    39. 'Pause the current song
    40.  mnuPause.Checked = Not mnuPause.Checked
    41.  pause
    42. End Sub
    43.  
    44. Private Sub mnuPlay_Click()
    45. 'If cancel then close the program
    46. 'Else choose and play a song
    47. Music1.ShowOpen
    48. frmSetup.Lstsongs.AddItem Music1.FileName
    49. Repeat:
    50.  x = MsgBox("Do you want to add more songs?", vbYesNo)
    51. If x = vbYes Then
    52. Music1.ShowOpen
    53. frmSetup.Songopt(1).Value = True
    54. frmSetup.Lstsongs.AddItem Music1.FileName
    55. GoTo Repeat
    56. ElseIf x = vbNo Then
    57. play (s)
    58. mnuPlay.Checked = True
    59. mnuStop.Checked = False
    60. tmrDuration.Enabled = True
    61. End If
    62. If x = vbNo And frmSetup.Lstsongs.Text = "" Or Err.Number = "32755" Then
    63. 'Stop the player
    64. MediaPlayer1.Close
    65. x = vbNo
    66. Unload Me
    67. End If
    68. End Sub
    69.  
    70. Private Sub mnuRewind_Click()
    71. 'Rewind the song after pausing
    72.  pause
    73. 'MediaPlayer1.Controls.fastReverse
    74. mnuRewind.Checked = True
    75. mnuForward.Checked = False
    76. mnuPlay.Checked = False
    77. End Sub
    78.  
    79. Private Sub pause()
    80.  'If mnuPause is not checked continue playing the song
    81.  If mnuPause.Checked = False Then
    82.  MediaPlayer1.Controls.play
    83.  Else
    84.  'If mnuPause is checked pause the song
    85.  mnuPause.Checked = True
    86.  MediaPlayer1.Controls.pause
    87. End If
    88. End Sub
    89.  
    90. Private Sub mnuSettings_Click()
    91. frmSetup.Show vbModal, Me
    92. End Sub
    93.  
    94. Private Sub mnuStop_Click()
    95. 'Stop the player
    96. mnuStop.Checked = True
    97. mnuRewind.Checked = False
    98. mnuForward.Checked = False
    99. mnuPlay.Checked = False
    100. 'Disable the song duration timer
    101. tmrDuration.Enabled = False
    102. MediaPlayer1.Controls.stop
    103. frmSetup.Lstsongs.Clear
    104. Me.Caption = "Mini MP3 Player"
    105. End Sub
    106.  
    107. Private Sub tmrDuration_Timer()
    108. 'Displays the current position and the total duration of the current song.
    109. Me.Caption = MediaPlayer1.Controls.currentPositionString + " \ " + MediaPlayer1.currentMedia.durationString + " " + MediaPlayer1.currentMedia.Name
    110. If MediaPlayer1.playState = wmppsStopped And frmSetup.Songopt(1).Value = True And Not s > frmSetup.Lstsongs.ListCount Then
    111. 'Play the next song in the list
    112.  s = s + 1
    113. play (s)
    114. End If
    115. End Sub

    frmSetup code:
    vb Code:
    1. Private Sub cmdBack_Click()
    2. hideme
    3. End Sub
    4.  
    5. Private Sub hideme()
    6. Me.Hide
    7. frmMain.Show
    8. End Sub

    Comments or ideas on how I can improve the project are welcome. I might create a great project if I get enough ideas.


    Nightwalker
    Attached Files Attached Files
    Last edited by Nightwalker83; May 27th, 2012 at 11:37 PM. Reason: Adding new project!
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  2. #2
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Remake of my MP3 Player using Windows Media Player

    You could improve that code a bit.

    Try adding an Option Explicit at the very top of code and see the magic.

    Also, you could avoid using labels to loop the code. Why not use a loop instead ?


    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  3. #3
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Remake of my MP3 Player using Windows Media Player

    Here's an example for avoiding the label in your code:
    vb Code:
    1. Option Explicit
    2.  
    3. Private Sub Command1_Click()
    4.     Dim myMsgResult As VbMsgBoxResult
    5.    
    6.     Do
    7.         myMsgResult = MsgBox("Do you want to continue reading my post ?", vbQuestion + vbYesNo, "Do you wanna risk yourself ?")
    8.         If myMsgResult = vbYes Then
    9.             'do some blah..blah here...
    10.         Else
    11.             Exit Do     '~~~ This will exit the loop
    12.         End If
    13.     Loop
    14. End Sub
    Also, try indenting your code next time, which makes it easy for reading.
    Good luck


    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  4. #4

    Thread Starter
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: Remake of my MP3 Player using Windows Media Player

    Quote Originally Posted by akhileshbc View Post
    Here's an example for avoiding the label in your code:
    Where did I use labels?
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  5. #5
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Remake of my MP3 Player using Windows Media Player

    Quote Originally Posted by Nightwalker83 View Post
    Where did I use labels?
    Code:
    Private Sub mnuPlay_Click()
    'If cancel then close the program
    'Else choose and play a song
    Music1.ShowOpen
    frmSetup.Lstsongs.AddItem Music1.FileName
    Repeat:
     x = MsgBox("Do you want to add more songs?", vbYesNo)
    If x = vbYes Then
    Music1.ShowOpen
    frmSetup.Songopt(1).Value = True
    frmSetup.Lstsongs.AddItem Music1.FileName
    GoTo Repeat
    ElseIf x = vbNo Then
    play (s)
    mnuPlay.Checked = True
    mnuStop.Checked = False
    tmrDuration.Enabled = True
    End If
    If x = vbNo And frmSetup.Lstsongs.Text = "" Or Err.Number = "32755" Then
    'Stop the player
    MediaPlayer1.Close
    x = vbNo
    Unload Me
    End If
    End Sub

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  6. #6
    Fanatic Member stlaural's Avatar
    Join Date
    Sep 2007
    Location
    Quebec, Canada
    Posts
    683

    Re: Remake of my MP3 Player using Windows Media Player

    Edit: Woops, I was typing at the same time I guess :P

    I believe akhileshbc is talking about the 'goto' you are using.

    vb.net Code:
    1. Repeat:
    2. x = MsgBox("Do you want to add more songs?", vbYesNo)
    3. If x = vbYes Then
    4. Music1.ShowOpen
    5. frmSetup.Songopt(1).Value = True
    6. frmSetup.Lstsongs.AddItem Music1.FileName
    7. GoTo Repeat

    Its just not considered a good practice anymore. Using loops makes your code more easily readable.
    Alex
    .NET developer
    "No. Not even in the face of Armageddon. Never compromise." (Walter Kovacs/Rorschach)

    Things to consider before posting.
    Don't forget to rate the posts if they helped and mark thread as resolved when they are.


    .Net Regex Syntax (Scripting) | .Net Regex Language Element | .Net Regex Class | DateTime format | Framework 4.0: what's new
    My fresh new blog : writingthecode, even if I don't post much.

    System: Intel i7 920, Kingston SSDNow V100 64gig, HDD WD Caviar Black 1TB, External WD "My Book" 500GB, XFX Radeon 4890 XT 1GB, 12 GBs Tri-Channel RAM, 1x27" and 1x23" LCDs, Windows 10 x64, ]VS2015, Framework 3.5 and 4.0

  7. #7
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Remake of my MP3 Player using Windows Media Player

    Quote Originally Posted by stlaural View Post
    I believe akhileshbc is talking about the 'goto' you are using.
    Yes

    Quote Originally Posted by stlaural View Post
    Edit: Woops, I was typing at the same time I guess :P



    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  8. #8

    Thread Starter
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: Remake of my MP3 Player using Windows Media Player

    Here is the new code.

    vb Code:
    1. Option Explicit
    2. Dim s As Integer, x  As VbMsgBoxResult, r As Integer
    3.  
    4. Private Sub Form_Load()
    5.  Me.Caption = "Mini MP3 Player"
    6. 'Integer index of the song to be played
    7.  s = 0
    8. 'Disable the song duration timer
    9.  tmrDuration.Enabled = False
    10.  frmSetup.Songopt(0).Value = True
    11.  mnuStop.Checked = True
    12.  frmSetup.Caption = "Setup"
    13. End Sub
    14.  
    15.  
    16. Private Function play(s)
    17.  frmSetup.Lstsongs.Selected(s) = True
    18.  MediaPlayer1.URL = frmSetup.Lstsongs.Text
    19. End Function
    20.  
    21. Private Sub mnuExit_Click()
    22.  'Close the player
    23.  MediaPlayer1.Close
    24.  Unload Me
    25. End Sub
    26.  
    27. Private Sub mnuForward_Click()
    28.   MediaPlayer1.Controls.fastForward
    29.  mnuForward.Checked = True
    30.  mnuRewind.Checked = False
    31.  mnuPlay.Checked = False
    32. End Sub
    33.  
    34. Private Sub mnuPause_Click()
    35. 'Pause the current song
    36.   mnuPause.Checked = Not mnuPause.Checked
    37.   pause
    38. End Sub
    39.  
    40. Private Sub mnuPlay_Click()
    41. 'If cancel then close the program
    42. 'Else choose and play a song
    43.  
    44. Music1.ShowOpen
    45.  frmSetup.Lstsongs.AddItem Music1.FileName
    46.  Do
    47.  x = MsgBox("Do you want to add more songs?", vbYesNo)
    48. If x = vbYes Then
    49.  Music1.ShowOpen
    50.  frmSetup.Songopt(1).Value = True
    51.  frmSetup.Lstsongs.AddItem Music1.FileName
    52. ElseIf x = vbNo Then
    53.  play (s)
    54.  mnuPlay.Checked = True
    55.  mnuStop.Checked = False
    56.  tmrDuration.Enabled = True
    57.  Exit Do
    58. End If
    59. Loop
    60. If x = vbNo And frmSetup.Lstsongs.Text = "" Or Err.Number = "32755" Then
    61. 'Stop the player
    62.  MediaPlayer1.Close
    63.  x = vbNo
    64.  Unload Me
    65. End If
    66. End Sub
    67.  
    68.  
    69. Private Sub pause()
    70.  'If mnuPause is not checked continue playing the song
    71.  If mnuPause.Checked = False Then
    72.   MediaPlayer1.Controls.play
    73.  Else
    74.  'If mnuPause is checked pause the song
    75.   mnuPause.Checked = True
    76.   MediaPlayer1.Controls.pause
    77. End If
    78. End Sub
    79.  
    80. Private Sub mnuRewind_Click()
    81.   mnuRewind.Checked = True
    82.   mnuForward.Checked = False
    83.    mnuPlay.Checked = False
    84. End Sub
    85.  
    86. Private Sub mnuSettings_Click()
    87.  frmSetup.Show vbModal, Me
    88. End Sub
    89.  
    90. Private Sub mnuStop_Click()
    91.  'Stop the player
    92.  mnuStop.Checked = True
    93.  mnuRewind.Checked = False
    94.  mnuForward.Checked = False
    95.  mnuPlay.Checked = False
    96.  'Disable the song duration timer
    97.  tmrDuration.Enabled = False
    98.  MediaPlayer1.Controls.stop
    99.  frmSetup.Lstsongs.Clear
    100.  Me.Caption = "Mini MP3 Player"
    101. End Sub
    102.  
    103. Private Sub tmrDuration_Timer()
    104.  If MediaPlayer1.playState = wmppsStopped And frmSetup.Songopt(1).Value = True And Not s > frmSetup.Lstsongs.ListCount Then
    105. 'Play the next song in the list
    106.  s = s + 1
    107.  play (s)
    108.  End If
    109. 'Displays the current position and the total duration of the current song.
    110. If Not mnuRewind.Checked = True Then
    111.  Me.Caption = MediaPlayer1.Controls.currentPositionString + " \ " + MediaPlayer1.currentMedia.durationString + " " + MediaPlayer1.currentMedia.Name
    112.  Else
    113.  MediaPlayer1.Controls.currentPosition = MediaPlayer1.Controls.currentPosition - 1
    114.  Me.Caption = CStr(MediaPlayer1.currentMedia.duration) + " \ " + CStr(MediaPlayer1.Controls.currentPosition)
    115.  End If
    116. End Sub

    I have uploaded the new project to the first post.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  9. #9
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Remake of my MP3 Player using Windows Media Player

    I think, you should check on the Fast Forward option. You haven't provided a way to switch back to normal play mode from FastFroward.

    Also, you could display some information on the main form. Because it is empty at the moment. You could place the album/song name, duration, etc.

    Even you could include some graphic images to provide a feel like Winamp.(No need to do the advanced coding)


    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  10. #10

    Thread Starter
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: Remake of my MP3 Player using Windows Media Player

    'How to use the Windows Media Player
    'control (version 11.0) in Visual Basic 6.0 to play music
    'Date: 15/04/2011
    'Update: 16/04/2011: Moved all the methods to a module, fixed the fastforward and fastrewind options.
    'Also added to hide/show the mp3 payer to/from the system tray
    'Update: 17/04/2011: Changed the background colour of all the forms and controls
    'Update: 18/04/2011: Allowed user to change the colour of the program via the change colour api.
    'Update: 19/04/2011: Added the Common Dialog api by Ellis Dee instead of using the common dialog control
    'Update: 21/04/2011: Added ability to retrieve current song information from the song tags and display it on the main form.
    'Update: 24/04/2011: Added Randy Birch's code to disable the x button of frmSetup incase the user sets the form's toolbox to true
    'Swapped the no result code for the add more songs option so that if the user chooses not to add any song when
    'the list is empty the result causes the program exit the sub normally instead of causing an error.
    'Update: 26/04/2011:'Made minor adjustment to the sLoad code because of a bug, also added code to cler the song details of the current song
    'displayed on the form ready for the next songs details.
    'If the index of the song being is played less than the total count of the song list
    'Play the next song if not stop the player
    'Added filters to the common dialog box
    'Author: Aaron Spehr
    'Alias: Nightwalker83
    'Website: http://aaronspehr.net/
    Edit:

    I made a minor adjustment to the load to stop the above error from occurring. This code is slightly different to the code that is in the project.

    vb Code:
    1. Public Sub sLoad()
    2. 'If cancel then close the program
    3. 'Else choose and play a song
    4. frmMain.mnuPlay.Checked = True
    5. frmMain.mnutrayPlay.Checked = True
    6. frmMain.mnuStop.Checked = False
    7. frmMain.mnutraystop.Checked = False
    8.  frmSetup.Lstsongs.AddItem ShowOpenDialog(App.Path, "All Files|*.*", "*.*")
    9.  Do
    10.  X = MsgBox("Do you want to add more songs?", vbYesNo)
    11.  If X = vbYes Then
    12.  frmSetup.Songopt(1).Value = True
    13.  frmSetup.Lstsongs.AddItem ShowOpenDialog(App.Path, "All Files|*.*", "*.*")
    14.  End If
    15. If X = vbNo Then
    16.  DoEvents
    17.  play (s)
    18.  songinfo (s)
    19.  frmMain.tmrDuration.Enabled = True
    20.  Exit Do
    21. End If
    22. Loop
    23.  If X = vbNo And frmSetup.Lstsongs.Text = "" Or Err.Number = "32755" Then
    24. 'Stop the player
    25.  frmMain.tmrDuration.Enabled = False
    26. Exit Sub
    27. End If
    28. End Sub

    Edit:

    See first post for attachments.
    Last edited by Nightwalker83; May 30th, 2011 at 07:07 PM. Reason: Fixed spelling!
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  11. #11

    Thread Starter
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: Remake of my MP3 Player using Windows Media Player

    'How to use the Windows Media Player
    'control (version 11.0) in Visual Basic 6.0 to play music
    'Date: 15/04/2011
    'Update: 16/04/2011: Moved all the methods to a module, fixed the fastforward and fastrewind options.
    'Also added to hide/show the mp3 payer to/from the system tray
    'Update: 17/04/2011: Changed the background colour of all the forms and controls
    'Update: 18/04/2011: Allowed user to change the colour of the program via the change colour api.
    'Update: 19/04/2011: Added the Common Dialog api by Ellis Dee instead of using the common dialog control
    'Update: 21/04/2011: Added ability to retrieve current song information from the song tags and display it on the main form.
    'Update: 24/04/2011: Added Randy Birch's code to disable the x button of frmSetup incase the user sets the form's toolbox to true
    'Swapped the no result code for the add more songs option so that if the user chooses not to add any song when
    'the list is empty the result causes the program exit the sub normally instead of causing an error.
    'Update: 26/04/2011: Made minor adjustment to the sLoad code because of a bug, also added code to cler the song details of the current song
    'displayed on the form ready for the next songs details.
    'If the index of the song being played is less than the total count of the song list
    'Play the next song if not stop the player
    'Added filters to the common dialog box
    'Update: 30/5/2011: Added code so if the user want to add more songs after the inital selection
    'the player will go back the directory when the stored the last selected song
    'Author: Aaron Spehr
    'Alias: Nightwalker83
    'Website: http://aaronspehr.net/

    Edit:

    See first post for attachment!
    Last edited by Nightwalker83; May 30th, 2011 at 07:08 PM. Reason: Adding more!
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  12. #12
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Remake of my MP3 Player using Windows Media Player

    Maybe you could try removing the attachment in first post and re-uploading it there. Some might not scroll to the bottom to get the latest version


    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  13. #13

    Thread Starter
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: Remake of my MP3 Player using Windows Media Player

    Quote Originally Posted by akhileshbc View Post
    Maybe you could try removing the attachment in first post and re-uploading it there. Some might not scroll to the bottom to get the latest version

    I have followed your advice.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  14. #14

    Thread Starter
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: Remake of my MP3 Player using Windows Media Player

    'How to use the Windows Media Player
    'control (version 11.0) in Visual Basic 6.0 to play music
    'Date: 15/04/2011
    'Update: 16/04/2011: Moved all the methods to a module, fixed the fastforward and fastrewind options.
    'Also added to hide/show the mp3 payer to/from the system tray
    'Update: 17/04/2011: Changed the background colour of all the forms and controls
    'Update: 18/04/2011: Allowed user to change the colour of the program via the change colour api.
    'Update: 19/04/2011: Added the Common Dialog api by Ellis Dee instead of using the common dialog control
    'Update: 21/04/2011: Added ability to retrieve current song information from the song tags and display it on the main form.
    'Update: 24/04/2011: Added Randy Birch's code to disable the x button of frmSetup incase the user sets the form's toolbox to true
    'Swapped the no result code for the add more songs option so that if the user chooses not to add any song when
    'the list is empty the result causes the program exit the sub normally instead of causing an error.
    'Update: 26/04/2011: Made minor adjustment to the sLoad code because of a bug, also added code to cler the song details of the current song
    'displayed on the form ready for the next songs details.
    'If the index of the song being played is less than the total count of the song list
    'Play the next song if not stop the player
    'Added filters to the common dialog box
    'Update: 30/05/2011: Added code so if the user want to add more songs after the inital selection
    'the player will go back to the directory where the last selected song was stored
    'Update: 21/08/2011:'Added code to display the Windows login screen if the user if idle for 5 minutes,
    'thanks to Young Buck for the code to detect if the user is idle:
    'http://www.vbforums.com/showthread.php?p=193692#post193692
    'Added music icon to the player to replace the default Visual Basic icon
    'Update: 27/05/2012 'Minor adjustments allowing the user to configure whether or no the program
    'locks the work station after 5 minutes
    'copied the call to close everything into unload_form event of the main form
    'ensuring that the programs quits without staying an active process
    'Author: Aaron Spehr
    'Alias: Nightwalker83
    'Website: http://aaronspehr.net/
    Attached Files Attached Files
    Last edited by Nightwalker83; Oct 9th, 2012 at 02:39 AM.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  15. #15
    Fanatic Member BenJones's Avatar
    Join Date
    Mar 2010
    Location
    Wales UK
    Posts
    629

    Re: Remake of my MP3 Player using Windows Media Player

    Looks useful I started a player my self in VB6 Years back and never finished it, I like the little home grown projects, anyway some ideas.

    Add skins you could use the old win amp 2x ones, Using bitblt it be easy to implant
    Add a play list
    Add feature to play Audio CDs
    How about adding feature for volume.

    Well that some things to keep you busy I post more if I think of any.
    Keep up the good work.

  16. #16

    Thread Starter
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: Remake of my MP3 Player using Windows Media Player

    I think the thing to do next is to get it to work without using Windows Media Player. I'm tried converting it before but I had not idea how the non Media Player would fit in to the project.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  17. #17
    Fanatic Member BenJones's Avatar
    Join Date
    Mar 2010
    Location
    Wales UK
    Posts
    629

    Re: Remake of my MP3 Player using Windows Media Player

    Quote Originally Posted by Nightwalker83 View Post
    I think the thing to do next is to get it to work without using Windows Media Player. I'm tried converting it before but I had not idea how the non Media Player would fit in to the project.
    How I did mine years ago was using mciSendString there is a lot of things that you can do that already in your player and more. I did write a class in C# so I may convert it to VB6 if I have time, or I can send you it as it is just pm me.

  18. #18

    Thread Starter
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: Remake of my MP3 Player using Windows Media Player

    I have uploaded the new version which includes repeat as well as load/save the playlist, see post #14 for the download.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  19. #19

    Thread Starter
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: Remake of my MP3 Player using Windows Media Player

    I changed the save code in the latest version so that it won't save if lstSongs is empty.

    vb Code:
    1. Private Sub mnuSave_Click()
    2. If FileExists(App.Path & "/PlayList.txt") Then mnuLoad.Visible = True
    3. If Lstsongs.ListCount = 0 Then Exit Sub
    4.  saveList
    5. End Sub
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

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