Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/29/2024 in all areas

  1. Version 6.1.3.1

    3,444 downloads

    This file is the source code for zPlayer, which is a stand-alone, simple, intuitive and easy-to-use, yet fully functional media player. I made this to suit my purpose and you can tweak it to your taste. zPlayer is powered by winmm.dll which is an integral part of Windows. This player has the following features: - No 3rd party dependencies. This player is made with Windows components and standard AutoIt UDFs only - Play back all formats of digital media files as far as proper codecs are installed in the computer - Video window is independent of other windows. Minimal GUI for music - Can load files, folders or an audio CD for playback - Playlists are automatically generated in sorted and shuffled orders and saved in the folder - Playlist is hidden by default, availbable when desired - Context menus available: Play this file, File properties, Search internet, Go to this folder, Remove from playlist - A double-click on any item plays that item - Search strings in the playlist - Forward, backward, pause, change folder - A-B repeat, current file repeat and multiple-file repeat functions - Increase/decrease/mute program sound volume. Synchronized with Windows Volume Mixer - Save play-back environment when terminating a session and resume that environment in the next session - 'Resume playback' option for a file left off in the middle of playback. Audio fade-in when playback is resumed - Hotkeys available for most of the functions - Very small footprint: very low CPU and memory usage The script is set to run or compile in x64 mode. You can change this setting by commenting out #AutoIt3Wrapper_UseX64=Y. zPlayer.exe, attached hereto, was compiled in x64 mode and is not flagged by Windows Defender as malicious. If you compile the script to an x86 file, the resulting zPlayer.exe will most probably be falsely flagged by Windows Defender as malicious. If you find an error, please download the latest version as most probably the error may have been corrected already. Otherwise I would appreciate it very much if you could kindly let me know. The download section includes zPlayer-NoUI.au3. This is an abbreviated version of zPlayer, which is a music player controlled by hotkeys only, without a GUI. Note: zPlayer is the name I used when I introduced the early version of this player in my blog in 2009 and has nothing to do with the mobile media player of the same name which started marketing in 2015.
    1 point
  2. Numeric1

    Drag-Adjust

    Hi, I imagine that if the user interface were to contain more controls, your code could quickly become difficult to manage, even though it is well-written. I suggest leaving everything to the message handler to optimize the code a bit. Additionally, you are making too many unnecessary calls to the control movement function, especially within a loop, which is not recommended. You could specifically target the events you need in order to handle them correctly. Here is a proposal to optimize your code. ;---------------------------------------------------------------------------------------- ; Title...........: DragAdjust.au3 ; Description.....: Resize and reposition the GUI controls when the user drags the DragBar. ; AutoIt Version..: 3.3.16.1 Author: ioa747 ; Note............: Tested in Win10 22H2 ;---------------------------------------------------------------------------------------- #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <ComboConstants.au3> #include <WinAPIGdi.au3> #include <Math.au3> ; Global constants Global Const $GUI_WIDTH = 600 Global Const $GUI_HEIGHT = 315 Global Const $MARGIN = 4 Global Const $DRAGBAR_WIDTH = $MARGIN ; GUI creation Global $hGUI = GUICreate("Resizable GUI", $GUI_WIDTH, $GUI_HEIGHT, 205, 130) Global $Combo1 = GUICtrlCreateCombo("Combo1", $MARGIN, $MARGIN, 196, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) Global $List1 = GUICtrlCreateList("", $MARGIN, 30, 196, 285) Global $Edit1 = GUICtrlCreateEdit("Edit1", 204, $MARGIN, 392, 305) Global $DragBar = GUICtrlCreateLabel("", 200, 0, $DRAGBAR_WIDTH, $GUI_HEIGHT, $SS_CENTERIMAGE, $WS_EX_LAYERED) ; Set drag bar cursor GUICtrlSetCursor($DragBar, 13) GUISetState(@SW_SHOW) ; Variables to track mouse movement Global $iPrevMousePos = -1 ; Main loop While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $GUI_EVENT_PRIMARYDOWN AdjustGUIControls() EndSwitch WEnd GUIDelete() ; Function to adjust GUI controls when the drag bar is moved Func AdjustGUIControls() Local Static $iOffset = $MARGIN / 2 If Not WinActive($hGUI) Then Return SetError(1, 0, False) Local $aCursorInfo = GUIGetCursorInfo($hGUI) Local $iActiveCtrl = IsArray($aCursorInfo) ? $aCursorInfo[4] : 0 Local $iPrimaryDown = 0 If $iActiveCtrl = $DragBar Then Opt("MouseCoordMode", 2) ; 1=absolute, 0=relative, 2=client Do $aCursorInfo = GUIGetCursorInfo($hGUI) $iPrimaryDown = $aCursorInfo[2] Local $iMousePos = MouseGetPos(0) $iMousePos = _Clamp($iMousePos, $MARGIN, $GUI_WIDTH - $MARGIN) ; Only update positions if the mouse has moved If $iMousePos <> $iPrevMousePos Then GUICtrlSetPos($DragBar, $iMousePos - $iOffset) GUICtrlSetPos($Combo1, $MARGIN, Default, $iMousePos - $MARGIN - $iOffset) GUICtrlSetPos($List1, $MARGIN, Default, $iMousePos - $MARGIN - $iOffset) GUICtrlSetPos($Edit1, $iMousePos + $iOffset, Default, $GUI_WIDTH - $iMousePos - $MARGIN - $iOffset) $iPrevMousePos = $iMousePos _WinAPI_RedrawWindow($hGUI) EndIf Sleep(10) Until Not $iPrimaryDown Opt("MouseCoordMode", 1) ; 1=absolute, 0=relative, 2=client EndIf EndFunc ;==>AdjustGUIControls ; Helper function to clamp a value between a minimum and maximum Func _Clamp($value, $min, $max) Return _Max($min, _Min($value, $max)) EndFunc
    1 point
×
×
  • Create New...