Results 1 to 2 of 2

Thread: MMControl help...(please)

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2002
    Posts
    17

    MMControl help...(please)

    My problem is this:
    I've written a simple music lessons program where I play an "lesson.mpg" in VB6. I'm using the Multimedia control and sometimes It doesn't seem to respond. When I load a lesson the control will play it back but when it comes to the end it won't atomaticaly go back to the begining. I have to depress the back button. And I would also like to be able to loop the "lesson.mpg".

    Here is what I have:

    Private sub Form_Load()
    MMControl1.Filename = (App.Path & "\Lesson1.mpg")
    MMControl1.hWndDisplay = Picture1.hWnd
    MMControl1.Command = "Open"
    End Sub

    Sorry for the simplicity, but I'm a musician first and a beginner programmer second and would appreciate any help I can get.

    I have The Visual Basic 6 Reference Library and quite a few other books.
    Can an *.mpg file play looped using the multimedia control?
    This is really necessary. If not then is there another way to loop an *.mpg file?

    Thanks again...Ron Lukawitski

  2. #2

    Thread Starter
    Junior Member
    Join Date
    Jul 2002
    Posts
    17

    Here is what I have so far!

    I can loop my "lesson.mpg". The problem that I'm now having is this:
    When I prees the stop button the file is reloaded and continues to play (it won't stop)
    There is delay when the file is reloaded (can I get it to play continuosly witout delay)

    Here is the code:

    Private Sub Command1_Click()
    MMControl1.FileName = (App.Path & "\lesson.mpg")
    MMControl1.hWndDisplay = Picture1.hWnd
    1 MMControl1.Command = "Open"
    MMControl1.Command = "play"
    DoEvents
    Do
    DoEvents
    Loop Until MMControl1.Mode = mciModeStop
    MMControl1.Command = "close"
    GoTo 1
    End Sub

    Private Sub MMControl1_StatusUpdate()
    Dim strMode As String
    strMode = ""

    Select Case MMControl1.Mode


    Case mciModeReady
    strMode = "Ready"


    Case mciModeStop
    strMode = "Stopped"

    Case mciModeSeek
    strMode = "Seeking"


    Case mciModePlay
    strMode = "Playing"


    Case mciModePause
    strMode = "Paused"


    End Select

    Label1.Caption = strMode


    End Sub

    Private Sub Form_Unload(Cancel As Integer)
    MMControl1.Command = "Stop"
    MMControl1.Command = "Close"
    End Sub

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