Jump to content

How to use progress to _soundseek() a file song


FroVN
 Share

Recommended Posts

Hi, i'm code software listen music on GUI, it's show time playing, hotkey pause/play music, and the last i missing that's the progress to seek the video to hour::ss:( i can't describe exactly, it's like a progress with red color we can backward or fast forward on youtube, i want do the same like that on my gui) i used to use guicreate slider, but it's not good, any idea give me, Tks(sorry for my bad english)

 

12333.png

Link to comment
Share on other sites

What im using in my player:

$CustomSeek = GUICtrlCreateButton('', 20, 272, 7, 20)

GUICtrlSetPos($CustomSeek, 15 + (450 * ($PosSlider)) / 100, 272)

;=============================================================================
        ;Seek Slider
        If $CursorInfo[2] = 1 And $CursorInfo[4] = $SeekGroup Then
            While _IsPressed("01", $hDLL)
                $WinCoords = WinGetPos($GUI)
                $CursorInfo = GUIGetCursorInfo($GUI)
                _MouseTrap($WinCoords[0] + 20, $WinCoords[1] + 325, $WinCoords[0] + 472, $WinCoords[1] + 328)
                $SeekB2Secs = (100 * (($CursorInfo[0] + 20) - 37) / (488 - 37))
                GUICtrlSetPos($CustomSeek, $CursorInfo[0] - 3, 272)
                $SeekB2Secs = $SeekB2Secs * $Lenght / 100
                $ConvP = _BASS_ChannelBytes2Seconds($MusicHandle, $SeekB2Secs)
                $pHour = Int($ConvP / 3600)
                $pMin = Int(($ConvP - $pHour * 3600) / 60)
                $pSec = $ConvP - $pHour * 3600 - $pMin * 60
                ToolTip(StringFormat('%02d:%02d:%02d', $pHour, $pMin, $pSec))
            WEnd
            ToolTip('')
            _MouseTrap()
            _BASS_ChannelSetPosition($MusicHandle, $SeekB2Secs, $BASS_POS_BYTE)
        EndIf
        ;=============================================================================

Hope you can make some sense out of this. The general ideia is that while left mouse is pressed the cursor is confined to a portion of the gui, and there's calculation going on for that, and what it does is move a button inside a group.

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

can u give me an example, i don't understand must ,here is my test and result not good

#include <GUIConstantsEx.au3>
#include <Misc.au3>
#include <ColorConstants.au3>

$hGUI = GUICreate("Test", 500, 200)
$CustomSeek = GUICtrlCreateButton('', 20, 272, 7, 20)
$PosSlider = GUICtrlCreateSlider( 20, 272, 7, 2)
GUISetState()

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        case $CustomSeek
            GUICtrlSetPos($CustomSeek, 15 + (450 * ($PosSlider)) / 100, 272)

;=============================================================================
        ;Seek Slider
        If $CursorInfo[2] = 1 And $CursorInfo[4] = $SeekGroup Then
            While _IsPressed("01", $hDLL)
                $WinCoords = WinGetPos($GUI)
                $CursorInfo = GUIGetCursorInfo($GUI)
                _MouseTrap($WinCoords[0] + 20, $WinCoords[1] + 325, $WinCoords[0] + 472, $WinCoords[1] + 328)
                $SeekB2Secs = (100 * (($CursorInfo[0] + 20) - 37) / (488 - 37))
                GUICtrlSetPos($CustomSeek, $CursorInfo[0] - 3, 272)
                $SeekB2Secs = $SeekB2Secs * $Lenght / 100
                MsgBox(0,'',$SeekB2Secs)
            WEnd
        EndIf
        ;=============================================================================
        EndSwitch

WEnd

 

Link to comment
Share on other sites

You can't just grab what i posted and use it as is.

It was to give a general idea of how to do the calculations.

You'll need the values for the current song position and total lenght, aka _SoundPos and _SoundLenght

Then you get the percentage on that, and move the slider the same percentage within its own coordinates.

Must do a check, If the slider moves, calculate the percentage (within slider's own coordinates) and with that the time, to then seek the song.

I feel im overwelming you, hope you understand.

 

Edited by careca
Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

Tks, finally i can do it, but another way however same like you
case $Slider1
             $w=GUICtrlRead($Slider1)
    SoundSetWaveVolume($w)
    GUICtrlSetTip($Slider1,GUICtrlRead($Slider1)&'%')
             Case $cLabel
            $aMpos = GUIGetCursorInfo($Form1)
            $iPercent = 100 * ($aMpos[0] - 290) / 140
            _Metro_SetProgress($cProgress, $iPercent)
            $timethanhmax=_SoundLength($s,2)
            $seek=$iPercent/100
            $truelinh=$seek*$timethanhmax
                $truelinh=Int($truelinh)
            $toseek=mili($truelinh)
            $time = StringSplit($toseek,':')
            _SoundSeek($s,$time[1],$time[2],$time[3])
            _SoundPlay($s)
that      ($iPercent = 100 * ($aMpos[0] - 290) / 140)     290,174 is left and width of progess, and i have an 2 hours to know this lol

Link to comment
Share on other sites

Im glad it's solved. :D

 

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...