Announcement

Collapse
No announcement yet.

Volume control

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Volume control

    As far as i understand FW uses the winamp volume control. But is there any way to control the FW/Winamp volume from another app? Say, if I want the computer to return from hibernation with the volume turned up to 5% or something like that...
    My carputer

    Old one

  • #2
    yes

    http://forums.winamp.com/showthread.php?threadid=180297
    Offical Freeway Subforum
    Official Freeway Website

    Comment


    • #3
      but that is just for plugins/programs, and as far as i can see there is no way to actually set the volume, just to adjust it up or down?

      EDIT: In winamp.ini (in the winamp folder) there is a line that says "volume=xx". This is for winamp to remember the volume level from the last time the program was used. Mybe FW can be enabled to change that line to a choosen number on launch/hibernation return?
      My carputer

      Old one

      Comment


      • #4
        You can make a program that will launch when it returns from hibernation to set the line in the INI file and to relaunch Winamp.

        And yes, you can use API calls to set the volume in Winamp.

        Code:
        WM_USER 122 Sets the volume to 'data', which can be between
        0 (silent) and 255 (maximum).
        Offical Freeway Subforum
        Official Freeway Website

        Comment


        • #5
          well, I've never written anything in vb before, so don't blame me if its just some noobish crap I've forgotten. Anyway, this compiles without errors, but it just doesnt work =/ Can anybody tell me why? =/

          EDIT: This program is supposed to set Winamps volume to 122...

          EDIT2: Via debug I can see that FindWindow returns "327790" to hwndWinamp. Seems good? SendMessage returns 0, as I guess it is supposed to if everything is fine?

          Code:
          'Declare SendMessage
          Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
              (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _
              lParam As Long) As Long
              
          'Declare FindWindow
          Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" ( _
              ByVal lpClassName As String, ByVal lpWindowName As String) As Long
          
          Private Sub Command1_Click()
          
              Dim hwndWinamp As Long
              Dim tmp As Long
          
              hwndWinamp = FindWindow("Winamp v1.x", vbNullString)
              
              tmp = SendMessage(hwndWinamp, WM_USER, 122, 122)
              
          End Sub
          My carputer

          Old one

          Comment


          • #6
            Code:
            'Declare SendMessage
            Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
                (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _
                lParam As Long) As Long
                
            'Declare FindWindow
            Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" ( _
                ByVal lpClassName As String, ByVal lpWindowName As String) As Long
            
            Private Sub Command1_Click()
            
                Dim hwndWinamp As Long
                Dim tmp As Long
            
                hwndWinamp = FindWindow("Winamp v1.x", vbNullString)
                
                tmp = SendMessage(hwndWinamp, WM_USER, byval 122, byval 122)
                
            End Sub
            Try adding "ByVal" before the 122's.
            Offical Freeway Subforum
            Official Freeway Website

            Comment


            • #7
              makes no difference...

              The number returned by FindWindow seems right? I saw a few guys talking about winamp hwnd on another forum, and their hwnd:s where a lot longer, like 10 - 20 digits or something...
              My carputer

              Old one

              Comment


              • #8
                Are you sure that it's not working? It only changes the Winamp volume, not your computer's mixer volume.
                Offical Freeway Subforum
                Official Freeway Website

                Comment


                • #9
                  Case closed: http://www.mp3car.com/vbulletin/showthread.php?t=85582
                  My carputer

                  Old one

                  Comment

                  Working...
                  X