Results 1 to 9 of 9

Thread: Volume control

  1. #1
    Maximum Bitrate Maņana's Avatar
    Join Date
    Jul 2004
    Location
    Sweden
    Posts
    761

    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...

  2. #2
    Freeway Creator oeri's Avatar
    Join Date
    Jul 2005
    Location
    Pittsburgh, PA
    Posts
    522

  3. #3
    Maximum Bitrate Maņana's Avatar
    Join Date
    Jul 2004
    Location
    Sweden
    Posts
    761
    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?

  4. #4
    Freeway Creator oeri's Avatar
    Join Date
    Jul 2005
    Location
    Pittsburgh, PA
    Posts
    522
    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).

  5. #5
    Maximum Bitrate Maņana's Avatar
    Join Date
    Jul 2004
    Location
    Sweden
    Posts
    761
    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

  6. #6
    Freeway Creator oeri's Avatar
    Join Date
    Jul 2005
    Location
    Pittsburgh, PA
    Posts
    522
    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.

  7. #7
    Maximum Bitrate Maņana's Avatar
    Join Date
    Jul 2004
    Location
    Sweden
    Posts
    761
    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...

  8. #8
    Freeway Creator oeri's Avatar
    Join Date
    Jul 2005
    Location
    Pittsburgh, PA
    Posts
    522
    Are you sure that it's not working? It only changes the Winamp volume, not your computer's mixer volume.

  9. #9
    Maximum Bitrate Maņana's Avatar
    Join Date
    Jul 2004
    Location
    Sweden
    Posts
    761

Similar Threads

  1. Change behaviour Volume control
    By DbXL in forum Centrafuse
    Replies: 0
    Last Post: 07-09-2006, 11:09 AM
  2. Roadie Volume Control
    By tjp12100 in forum FrodoPlayer
    Replies: 0
    Last Post: 06-21-2006, 03:30 PM
  3. Replies: 3
    Last Post: 12-10-2005, 01:12 AM
  4. Volume control in Xenarc 700TSV
    By BMW-7 in forum LCD/Display
    Replies: 3
    Last Post: 04-06-2005, 11:08 PM
  5. hardware volume control
    By ODYSSEY in forum General Hardware Discussion
    Replies: 18
    Last Post: 04-20-2001, 10:43 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •