Results 1 to 12 of 12

Thread: [RESOLVED] Volume

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2006
    Posts
    112

    Resolved [RESOLVED] Volume

    i want to know how to make my slider change the volume for my media player, i have set the min to 0 and the max to 100.

    i also wnat to know how to make my custom browser that i added (dir1, file1 and drive1) show only the files it can play (.wav, .mp3, .mid)

    how can i do that?
    Last edited by Hack; Feb 14th, 2006 at 07:37 AM. Reason: Added [RESOLVED] to thread title and green "resolved" checkmark

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Jan 2006
    Posts
    112

    Re: Volume

    i guess u cant?

  3. #3
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: Volume

    i want to know how to make my slider change the volume for my media player, i have set the min to 0 and the max to 100.
    that depends on how you're playing the files, if you're using Windows Media Player Control then check out this FAQ

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jan 2006
    Posts
    112

    Re: Volume

    I am using the MMControl though...

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jan 2006
    Posts
    112

    Re: Volume

    is there a way to do this with MMControl?

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Jan 2006
    Posts
    112

    Re: Volume

    Here is a link to what happens to my program when i use it:
    (might have to turn up volume....)
    Volume doesn't work
    ( http://www.zippyvideos.com/798271520..._does_nothing/ )

    Here is my code:

    VB Code:
    1. Private Sub cmdexit_Click()
    2. mmcon1.Command = "Stop"
    3. mmcon1.Command = "Close"
    4. End
    5. End Sub
    6.  
    7. Private Sub cmdplay_Click()
    8. Dim CurrentlyPlaying
    9. CurrentlyPlaying = "Currently Playing:" & vbNewLine
    10.  
    11. On Error GoTo openerror
    12.  
    13. mmcon1.Command = "Close"
    14. mmcon1.FileName = File1.Path & "\" & File1.FileName
    15. mmcon1.Command = "Open"
    16.  
    17. Select Case File1.FileName
    18.     Case 1
    19.         mmcon1.DeviceType = "Other"
    20.     Case 2
    21.         mmcon1.DeviceType = "Sequencer"
    22.     Case 3
    23.         mmcon1.DeviceType = "MP3Audio"
    24.     Case 4
    25.         mmcon1.DeviceType = "WaveAudio"
    26. End Select
    27.  
    28. If mmcon1.Error > 0 Then
    29.     cmdplay.Enabled = False
    30.     cmdstop.Enabled = False
    31.     frm1.Caption = "Jordan Media Player ( No file is loaded )"
    32.     MsgBox "Cannot open " & File1.Path & "\" & File1.FileName, vbCritical, "Error"
    33. Else
    34.     cmdplay.Enabled = True
    35.     cmdstop.Enabled = True
    36.     frm1.Caption = "Jordan Media Player ( " & File1.FileName & " )"
    37.    
    38.     mmcon1.Command = "Play"
    39.    
    40.     lbltrack.Caption = CurrentlyPlaying & File1.FileName
    41.  
    42.     picprogress.ScaleWidth = mmcon1.Length
    43.     picprogress.Enabled = True
    44. End If
    45. Exit Sub
    46.  
    47. openerror:
    48.     Exit Sub
    49. End Sub
    50.  
    51. Private Sub cmdstop_Click()
    52. Dim CurrentlyPlaying
    53. CurrentlyPlaying = "Currently Playing:" & vbNewLine
    54. mmcon1.Command = "Stop"
    55. mmcon1.Command = "Close"
    56. picprogress.Refresh
    57. lbltrack.Caption = CurrentlyPlaying & "None"
    58. End Sub
    59.  
    60. Private Sub Dir1_Change()
    61. File1.Path = Dir1.Path
    62. End Sub
    63.  
    64. Private Sub Drive1_Change()
    65. Dir1.Path = Drive1.Drive
    66. End Sub
    67.  
    68. Private Sub File1_DblClick()
    69. Dim CurrentlyPlaying
    70. CurrentlyPlaying = "Currently Playing:" & vbNewLine
    71.  
    72. On Error GoTo openerror
    73.  
    74. mmcon1.Command = "Close"
    75. mmcon1.FileName = File1.Path & "\" & File1.FileName
    76. mmcon1.Command = "Open"
    77.  
    78. Select Case File1.FileName
    79.     Case 1
    80.         mmcon1.DeviceType = "Other"
    81.     Case 2
    82.         mmcon1.DeviceType = "Sequencer"
    83.     Case 3
    84.         mmcon1.DeviceType = "MP3Audio"
    85.     Case 4
    86.         mmcon1.DeviceType = "WaveAudio"
    87. End Select
    88.  
    89. If mmcon1.Error > 0 Then
    90.     cmdplay.Enabled = False
    91.     cmdstop.Enabled = False
    92.     frm1.Caption = "Jordan Media Player ( No file is loaded )"
    93.     MsgBox "Cannot open " & File1.Path & "\" & File1.FileName, vbCritical, "Error"
    94. Else
    95.     cmdplay.Enabled = True
    96.     cmdstop.Enabled = True
    97.     frm1.Caption = "Jordan Media Player ( " & File1.FileName & " )"
    98.    
    99.     mmcon1.Command = "Play"
    100.    
    101.     lbltrack.Caption = CurrentlyPlaying & File1.FileName
    102.  
    103.     picprogress.ScaleWidth = mmcon1.Length
    104.     picprogress.Enabled = True
    105. End If
    106. Exit Sub
    107.  
    108. openerror:
    109.     Exit Sub
    110. End Sub
    111.  
    112. Private Sub Form_Load()
    113. Dim CurrentlyPlaying
    114. CurrentlyPlaying = "Currently Playing:" & vbNewLine
    115.  
    116. mmcon1.UpdateInterval = 250
    117. lbltrack.Caption = CurrentlyPlaying & "None"
    118. End Sub
    119.  
    120. Private Sub Form_Unload(Cancel As Integer)
    121. mmcon1.Command = "Close"
    122. End Sub
    123. Private Sub mmcon1_Done(NotifyCode As Integer)
    124. Dim CurrentlyPlaying
    125. CurrentlyPlaying = "Currently Playing:" & vbNewLine
    126.  
    127. If mmcon1.Position = mmcon1.Length Then
    128.     mmcon1.Command = "Stop"
    129.     picprogress.Refresh
    130.     lbltrack.Caption = CurrentlyPlaying & "None"
    131. End If
    132. End Sub
    133.  
    134. Private Sub mmcon1_StatusUpdate()
    135. On Error Resume Next
    136. picprogress.ScaleWidth = mmcon1.Length
    137. picprogress.Cls
    138. picprogress.Line (0, 0)-(mmcon1.Position, picprogress.ScaleHeight), , BF
    139. End Sub
    140.  
    141. Private Sub mnuexit_Click()
    142. cmdexit_Click
    143. End Sub
    144.  
    145. Private Sub picprogress_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
    146. If Button = 1 Then
    147.     mmcon1.To = x
    148.     mmcon1.Command = "Seek"
    149.     mmcon1.Command = "Play"
    150. End If
    151. End Sub
    152.  
    153. Private Sub picprogress_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
    154. If Button = 1 Then
    155.     mmcon1.To = x
    156.     mmcon1.Command = "Seek"
    157.     mmcon1.Command = "Play"
    158. End If
    159. End Sub
    160.  
    161. Private Sub sldvol_DragOver(Source As Control, x As Single, y As Single, State As Integer)
    162. Dim Vol
    163. Vol = sldvol.Value
    164. mmcon1.Volume = Vol
    165. End Sub
    166.  
    167. Private Sub sldvol_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
    168. sldvol.MousePointer = ccSizeEW
    169. End Sub
    170.  
    171. Private Sub sldvol_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
    172. sldvol.MousePointer = ccArrow
    173. End Sub
    Last edited by joscpe; Feb 11th, 2006 at 11:30 PM. Reason: redbull doesnt give you wings

  7. #7
    Frenzied Member Andrew G's Avatar
    Join Date
    Nov 2005
    Location
    Sydney
    Posts
    1,587

    Re: Volume

    Maybe this may help. Its changes the system volume

    http://www.vbforums.com/showthread.p...=change+volume

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Jan 2006
    Posts
    112

    Re: Volume

    wow, thats alot of code! But I am using a scroller not a scroll bar...

  9. #9
    Frenzied Member Andrew G's Avatar
    Join Date
    Nov 2005
    Location
    Sydney
    Posts
    1,587

    Re: Volume

    I'm not exactly sure which control the scroller is but if it has max, min and value (or similar) poperties then it should be fine, you'll just need to alter the code a bit.

  10. #10

    Thread Starter
    Lively Member
    Join Date
    Jan 2006
    Posts
    112

    Re: Volume

    I ment Slider in the Common Controls 6.0 componant.

  11. #11
    Frenzied Member Andrew G's Avatar
    Join Date
    Nov 2005
    Location
    Sydney
    Posts
    1,587

    Re: Volume

    Try this. I modified Manavo11's code so it works with a slider control, plus i made it look a bit better by moving most of the code into a module.
    Attached Files Attached Files

  12. #12

    Thread Starter
    Lively Member
    Join Date
    Jan 2006
    Posts
    112

    Re: Volume

    Thank you, it works perfectly!

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