Results 1 to 7 of 7

Thread: [RESOLVED] MMControl Question

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2007
    Posts
    73

    Resolved [RESOLVED] MMControl Question

    I am using a mmControl named mmcWav. It works fine using a command button mouse down event, "I want it to play as long as the mouse button is down". How can I make it loop and to restart each time the command1 button is clicked. This is how I start the wav playing.
    Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    mmcWav.Command = "Open"
    mmcWav.Command = "Play"
    End Sub
    Thanks!!!!!

  2. #2

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Apr 2007
    Posts
    73

    Re: MMControl Question

    Thanks RhinoBull, that makes the wave play each time command1 is pressed, but I also need it to loop to keep playing as long as command1 is pressed. What I mean by this is, think of command1 as a key on an organ. Thanks for any help.

  4. #4
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: MMControl Question

    Would this work for you?
    Code:
    Option Explicit
    
    Dim blnPlay As Boolean
    
    Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
        blnPlay = True
        With MMControl1
            .FileName = "C:\WINDOWS\Media\ding.wav"
            .Wait = True
            .Notify = False
            .Shareable = False
            .Command = "Open"
            .Command = "PLay"
        End With
    End Sub
    
    Private Sub Command1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
        blnPlay = False
    End Sub
    
    Private Sub MMControl1_Done(NotifyCode As Integer)
        With MMControl1
            .Command = "Close"
            If blnPlay Then
                .FileName = "C:\WINDOWS\Media\ding.wav"
                .Wait = True
                .Notify = False
                .Shareable = False
                .Command = "Open"
                .Command = "Play"
            End If
        End With
    End Sub

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Apr 2007
    Posts
    73

    Re: MMControl Question

    Thanks I will give it a try.

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Apr 2007
    Posts
    73

    Re: MMControl Question

    Thanks RhinoBull for all the help, I got it working.

  7. #7

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