Jump to content

zPlayer - My own little audio/video player

Recommended Posts

  • Replies 119
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

zPlayer is the name I used when I introduced the early version of this player in my blog back in early 2009 and, therefore, has nothing to do with the mobile media player of the same name which starte

It's great to see that you did it. I enjoyed helping you help your dad. Cheers to you and your daddy! GUICtrlSetFont(-1, $vcWidth/8, 900) I like this. Good job!

I have my "final" version!  (yes, I know what a joke that is . . .) It works and my dad can Play-Paus easily with the giant button filling most of the 10.1" display on his tablet.  Here is the cu

Posted Images

  • 5 months later...

Hi CYCho :)
In page 1 of this thread, Xandy indicated the issue he had while zPlayer is running, because he couldn't use anymore combinations of keys in his own windows (ctrl + right key for example) as they are used by HotKeySet in your script.

I just experienced the same problem and could have written what he said :

On 3/14/2019 at 3:36 AM, Xandy said:

[...] it is eating my CTRL+ARROWS.  I like to use these shortcuts to navigate words in a text. There are several solutions to this problem [...]

In the past, I already experienced 2 working solutions when facing this problem :

1) The use of Accelerator keys (just look at the help file, topic GUISetAccelerators)
I have to paste here the beginning of what is written in the help file, as it's so well explained !

Accelerator keys are similar to HotKeys, but there are 2 important differences:

    - 1. They are only active when the GUI specified in the function is active which means that, unlike HotKeys, Accelerator keys will not interfere with other running applications.
    - 2. ...

But as you got 4 different Gui's (main, playlist, video...) then I'm not really sure it's a solution adapted to your script (though I may be mistaken)

2) The second solution seems simpler. Here is your actual MyNext() function, triggered by ctrl + right arrow

Func MyNext() ; Ctrl+Right Arrow to play the next file
    If $lPaused = True Then
        $lPaused = False
        GUICtrlSetImage($picPause, $picFolder & "Pause.jpg")
    $move = 1
EndFunc     ;==>MyNext

If you change this function to what follows, then the function will still be triggered by ctrl + right arrow when main or playlist are active... but now the user can also use ctrl + right arrow in his own windows (I just checked it again) because the function itself will send the hotkey when zPlayer (main or playlist) hasn't got the focus.

As this solution often ends with bad sticky keys (it just happened to me several times) then _SendEx() instead of Send() solves totally the sticky keys problem. _SendEx() can be found on wiki AutoIt FAQ, but I paste it here too, below your function.

Func MyNext() ; Ctrl+Right Arrow to play the next file
    HotKeySet("^{RIGHT}") ; deactivate the hotkey immediately

    $hWinActive = WinActive("[ACTIVE]")
    If $hWinActive = $winMain Or $hWinActive = $winListView Then
        If $lPaused = True Then
            $lPaused = False
            GUICtrlSetImage($picPause, $picFolder & "Pause.jpg")
        $move = 1
        ; Send("^{RIGHT}") ; will often end with sticky keys

    HotKeySet("^{RIGHT}", "MyNext") ; reactivate the hotkey at the very end of the function
EndFunc     ;==>MyNext

Func _SendEx($ss, $warn = "")
    Local $iT = TimerInit()

    While _IsPressed("10") Or _IsPressed("11") Or _IsPressed("12")
        If $warn <> "" And TimerDiff($iT) > 1000 Then
            MsgBox($MB_TOPMOST, "Warning", $warn)

I guess you'll have to add also the handle of the video window to the If $hWinActive... line (I didn't check on videos, only checked while main or playlist window were active and it worked fine)

If you're ready to try this, I suggest you do it first on 1 function only (ctrl + right key for example) to test it well, then extend it to the 4 functions which use 2 keys only (ctrl + right, ctrl + left, ctrl + up, ctrl + down) . As you got plenty of others ctrl+alt+key (3 keys involved), then maybe it's not useful to include the "3 keys involved functions" in the change and you could let them as they are now.

Hope it helps and good luck :)

Link to post
Share on other sites

@pixelsearch, Thanks a lot. As I said in my first post, this was conceived to run with hotkeys only, because I didn't like the overwhelming guis offered by existing players. Now it is clad with some guis, but I would like to keep it runnable with with all the windows hidden, except for video window for an obvious reason. I believe persons like Xandy can tweak my code to suit their particular environment. Initially, all my hotkeys, including those combined with arrows, had Ctrl+Alt. But my first Windows 10 used Ctrl+Alt+Arrows to change screen orientation, so I changed them to Ctrl+Arrows. Now that Windows 10 does not seem to use them any more, I can go back to Ctrl+Alt+Arrows.

Edited by CYCho
Link to post
Share on other sites
On 3/15/2021 at 11:37 PM, CYCho said:

I can go back to Ctrl+Alt+Arrows.

Your solution is great and simpler too, because it will interfere much less with other applications.
If you do that, then you will "free" Ctrl+Arrows for all your users who need Ctrl+Arrows in their other windows apps, while listening to music in zPlayer. Ctrl+Arrows are often required in Apps, much more than Ctrl+Alt+Arrows.

So I think your idea is fine, please revert to the 4 Ctrl+Alt+Arrows instead of Ctrl+Arrows whenever you can, especially your patch will only take a few seconds to be active :

HotKeySet("^!{RIGHT}", "MyNext")      ; play next file
HotKeySet("^!{LEFT}", "MyPrevious")   ; play previous file
HotKeySet("^!{UP}", "VolumeUp")       ; increase system volume level
HotKeySet("^!{DOWN}", "VolumeDown")   ; decrease system volume level

instead of the actual

HotKeySet("^{RIGHT}", "MyNext")       ; play next file
HotKeySet("^{LEFT}", "MyPrevious")    ; play previous file
HotKeySet("^{UP}", "VolumeUp")        ; increase system volume level
HotKeySet("^{DOWN}", "VolumeDown")    ; decrease system volume level

Not forgetting the 4 labels in main menu and elsewhere if required, for example :

Global $label1a = GUICtrlCreateLabel("Ctrl+Alt+Right Arrow", ...
Global $label2a = GUICtrlCreateLabel("Ctrl+Alt+Left Arrow", ...
Global $label3a = GUICtrlCreateLabel("Ctrl+Alt+Up Arrow", ...
Global $label4a = GUICtrlCreateLabel("Ctrl+Alt+Down Arrow", ...
Func MyNext()      ; Ctrl+Alt+Right Arrow to play the next file
Func MyPrevious()  ; Ctrl+Alt+Left Arrow to play the previous file
Func VolumeUp()    ; Ctrl+Alt+Up arrow
Func VolumeDown()  ; Ctrl+Alt+Down arrow

Also your solution will harmonize your hotkeys, which will all need Ctrl+Alt+key to be triggered. Well done CYCho... I just patched my version of zPlayer :)

Edit: I had to modify one line in the script ( Global $menuWidth = 150 ) because 2 labels were cropped on my computer (probably not same fonts). Modifying it from 150 to 154 solved it (153 wasn't enough) . In case someone else got the same minor issue...

; Global $menuWidth = 150 ; original line
Global $menuWidth = 154   ; 150 to 153 not enough for me (2 labels were cropped)


What I like is that all labels in the pic above are clickable (both columns) : you don't have to remember what combination of keys to type, a click will be enough when main gui is visible

Edited by pixelsearch
shortened pasted code, to keep only the relevant part matching the comment
Link to post
Share on other sites
  • 1 month later...
  • 1 month later...

Hello CYCho,
Hope you don't mind me asking. Your script, like a few of mine, makes use of embedded ie for the WM Player. Have just been reading that Microsoft plan to drop 
ie from releases of Windows after June 2022. Sorry for being a bit thick, but, what are the alternatives to embedded ie, if any?

Link to post
Share on other sites

@kalavo, I don't know the extent of IE functions to be dropped from Windows. I hope the ActiveX control of IE will continue to function even after the IE browser is dropped. I would appreciate any input from those who know. Please let me know if you find any relevant information.

If Microsoft Edge Webview2 is fully developed, it will hopefully replace IE.au3 UDF.

Edited by CYCho
Link to post
Share on other sites
  • 2 weeks later...

I found that one of my laptops had an Intel CPU with Intel HD Graphics Control Panel installed, and Ctrl+Alt+Arrows rotate the screen orientation. This overrides my hotkeys for changing volume and moving to previous or next file. I never had a need to change screen orientaion, so I diabled the screen rotation shortcuts. The following article explains in detail how to do it.

Edit: My laptop is a Windows 10 PC.

How To Disable Screen Rotation Keyboard Shortcut in Windows 10

Edited by CYCho
Link to post
Share on other sites
  • 4 weeks later...

Hare Krsna

i just want to give suggestion, why i can choose any music in playlist to be play specifically, if i choose any music listed in playlist and double click it, its not played, and i dont know ,how to select any music from play list to play as i desire..

isnt playlist should allow me to select any music i want and play?

i hope you understand what i meant

i attach one image, i double click that song, but nothing happen..

i really love your player, even though i have vlc or other, your minimize interface and very nice hotkey feature, and every single stuff working perfect, so convenient to use..

i just give suggestion..thanks Hare Krsna


Link to post
Share on other sites
7 hours ago, subuddhi said:

if i choose any music listed in playlist and double click it, its not played

I don't know why you cannot play a selected file by double-clicking it. In my Windows 10, it works fine. I didn't test it in earlier versions of Windows, but I don't think WM_NOTIFY function would work differently in earlier Windows. Maybe @pixelsearch could comment on this, as I think he is a real guru and must have tested this in Windows 7.

8 hours ago, subuddhi said:

isnt playlist should allow me to select any music i want and play?

Yes, it does. Did you try context menu of the playlist? Right-click on any playlist item will invoke a context menu.

I hope your problem will be resolved soon.

Link to post
Share on other sites

so my laptop is using windows 7

1 hour ago, CYCho said:

Right-click on any playlist item will invoke a context menu.

i am even can't right click or left click on the playlist window
and i just test that 

from the option in playlist, "Find", "Next", "Revert", is not working, nothing happen when i press them
and "Rescan", "Reshuffle" its work.

Link to post
Share on other sites
58 minutes ago, subuddhi said:

"Find", "Next", "Revert", is not working, nothing happen when i press them

"Find" and "Next" buttons are for searching a character string in the playlist. You should enter some characters in the input box in front of them to do a search.

1 hour ago, subuddhi said:

even can't right click or left click on the playlist window

Again this behaviour is beyond my comprehension. I'm also curious to know the reason behind this. It may have something to do with your AutoIt and/or SciTE versions. Can you please try the compiled version which you can download HERE?

Link to post
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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By CYCho
      This file includes 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. The source code is only about 1600 lines and only standard #include files were used. Also included in the source code file are some image files which are used for drawing the graphical media controls in the main window.
      As of its release date, the compiled exe file of this player, as attached hereto, is not flagged by Windows Defender with latest Security Intelligence Update.
      This player has the following features:
      - Play back all formats of media files which can be played back by the Windows Media Player in your computer
      - Depending on the file types specified by the user in zPlayer.ini file this player can be either audio only, video only or both.
      - Video window is independent of other windows and, when maximized, increases the immersion of the user
      - Graphical media controls similar to embedded Windows Media Player
      - Forward, backward, pause, repeat, shuffle function
      - Increase/decrease/mute sound volume
      - Change folders and create playlist for all media files in that folder and its subfolders, and support for manually-made playlists
      - Save play-back environment when terminating and resume that environment when restarting
      - 'Continue playback' option for a file you left off in the middle of playback
      - With one click, you can see internet search results for the file selected in playlist
      - With a double-click, you can play back an item in the playlist
      - Search strings in the playlist
      - Option to see long file names including folder names
      - View file properties for any file in the playlist and copy their values
      - Resize the playlist and video windows, and restore them to their default positions
      - Very small footprint: very low CPU and memory usage, with only about 1MB when compiled
      - You can even hide all the windows and manipulate the player with hotkeys only
      Note: zPlayer is the name I used when I introduced the early version of this player in my blog back in early 2009 and, therefore, has nothing to do with the mobile media player of the same name which started marketing in 2015.
    • By PeterVerbeek
      In this post I take the opportunity to show the awesome capabilities of AutoIt and its libraries. My open source project Peace is a long running AutoIt based app located on SourceForge. It provides users with a system-wide equalizer and effects machine. It's an interface using the power of Equalizer APO, an audio processing object software. Peace has been download over 2,600,000 times by various kind of users. Amongst others it gives them possibilities like these:
      Hearing impaired - Amplify the gain of frequencies which are impaired. Home Theatre - Create Equalizer presets for watching movies and listening to music. Music lovers & audiophiles - Create presets for listening to music on their high quality speakers and headphones. Gamers - Enhance frequencies to get an edge over other gamers. Headphones - Improve the sound quality of cheap headphones and get the max out of expensive ones. Bass lovers - Boost low frequencies for extra bass. Voice - Make a microphone sound better and improve the voice, for instance for YouTube usage. Low audio - Boost low audio of an input source to a comfortable level. This list covers the main needs of the Peace user. Many people have contacted me over the years asking for new features and telling me how they use Peace for their (sometimes specific) needs.  I was able to use AutoIt and its libraries for all of their needs. So what are the main features of Peace?
      Equalize your computer audio by using up to 31 sliders. Support of equalizing 9 speakers : left/right, center, subwoofer, left/right rear, left/right side. Per slider a filter can be chosen such as peak, low/high pass, shelving. The graph windows shows your equalization so you see exactly what you're doing. Apply an effect such as crossfeed simple/Jan Meier/Chu Moy, stereo balance, bass/treble, upmix/downmix, channel routing. Save presets (called configurations) and activate by mouse click, hotkey, desktop shortcut or Peace system tray. Select a target device to equalize, microphone as input can also be equalized. Automate: you can let Peace automatically activate presets on a switch to another device and another process. Peace is available in these languages: English, Czech, Deutsch, Français, Italiano, Nederlands, Pусский, Українська So who am I? I'm a Dutch programmer who happens the stumble upon AutoIt 5 years ago and created a small Equalizer interface app of less than 400 program lines with it. Nowadays Peace has grown to more than 18,000 lines as many features were added. Although Peace is open source, the program code isn't of the best possible quality. The reason being that I didn't expect it to become so popular. It caught me by supprise. I've created a Library of functions called Pal (link to forum post) which quality is up to the AutoIt community standard as counterpart to the Peace program code.
      I want to state here that AutoIt is a mature program language as Peace obviously shows. I wish it to be used more extensively for professional or semi-professional apps. In my view AutoIt deserves a place amongst the major programming languages for Windows computers.
      Peter Verbeek

    • By nacerbaaziz
      hello autoit team
      please i need your help
      i found that the youtube provide a way to get any video informations with this link
      but it incoded i can not read it
      can any one tell me how to decode that please?
    • By nacerbaaziz
      goodmorning; autoit team
      please their are any youtube search way working?
      because i was using the get source and split it to get the result but know it does not working any way.
      is the youtube disabled that? and is their any other simple way to do that?
      i tested all examples found in this post but also it don't work
      and here is the example that i use to and it don't work any more
      local $hSearchOpenHNDL, $hSearchConnect, $sSearchGet local $a_UrlsArray[1][5] local $b_ButtonsDisabled = false, $b_SearchBTNFocus = false, $b_SearchListFocus, $h_SearchFocusHND local $Return = "0" local $s_OpenStringY = "/feed/trending" local $ChannelUrl = "", $channelName = "" if Not ($a_YoutubeSearchArray[0][0] = 0) then GUICtrlSetData($searchInp, $s_youtubeSearchLastSearch) $s_OpenStringY = "/results?search_query=" & StringReplace(GUICtrlRead($searchInp), " ", "+") $a_UrlsArray = $a_YoutubeSearchArray for $i = 1 to $a_UrlsArray[0][0] _GUICtrlListBox_AddString($SearchList, $a_UrlsArray[$i][0] & $a_UrlsArray[$i][2] & $a_UrlsArray[$i][3]) next _GUICtrlListBox_SetCurSel($SearchList, $I_youtubeSearchLastIndex-1) GUICtrlSetState($SearchList, $GUI_focus) else if Ping("youtube.com", 1000) > 1 then $hSearchOpenHNDL = _WinHttpOpen('') if not (@Error) then $hSearchConnect = _WinHttpConnect($hSearchOpenHNDL, "youtube.com") if Not (@Error) then $sSearchGet = _WinHttpSimpleRequest($hSearchConnect, "get", $s_OpenStringY) if not (@Error) then local $a_strings = _StringBetween($sSearchGet, '<a href="/watch', "<ul") local $title = "" local $url = "" local $length = "" local $result = "" GUICtrlSetData($SearchList, "") ReDim $a_UrlsArray[1][5] for $i = 0 to UBound($a_strings)-1 $url = _StringBetween($a_strings[$i], "?", '"') if @error then ContinueLoop $url = "https://www.youtube.com/watch?" & $url[0] $title = _StringBetween($a_strings[$i], 'dir="', '</a>') if @error then ContinueLoop $title = $title[0] $title = StringRegExpReplace($title, '(.*\"\>)', "") if StringRegExp($a_strings[$i], '[0-9]{1,2}\:[0-9]{1,2}\:[0-9]{1,2}', 0) = 1 then $length = StringRegExp($a_strings[$i], '[0-9]{1,2}\:[0-9]{1,2}\:[0-9]{1,2}', 2) elseIf StringRegExp($a_strings[$i], '[0-9]{1,2}\:[0-9]{1,2}', 0) = 1 then $length = StringRegExp($a_strings[$i], '[0-9]{1,2}\:[0-9]{1,2}', 2) else $length = "" endIf if IsArray($length) then $length = ": (" & $length[0] & ")" else $length = "" endIf $ChannelUrl = stringRegexpReplace($a_strings[$i], '(^.*?<a.*?\"(\/user|\/channel))+', "$2") $channelName = stringRegexpReplace($ChannelUrl, '(.*?\".*?>)(.*</a>)+', "$2") $ChannelUrl = stringRegexpReplace($ChannelUrl, '(\".*)+', "") $channelName = stringRegexpReplace($channelName, '(</a>.*)+', "") $result &= $title & @crlf & $url & @crlf ReDim $a_UrlsArray[UBound($a_UrlsArray)+1][5] $a_UrlsArray[UBound($a_UrlsArray)-1][0] = $title $a_UrlsArray[UBound($a_UrlsArray)-1][1] = $url $a_UrlsArray[UBound($a_UrlsArray)-1][2] = $length if not ($channelName = "") then $a_UrlsArray[UBound($a_UrlsArray)-1][3] = ", (" & $channelName & ")" if not ($channelUrl = "") then $a_UrlsArray[UBound($a_UrlsArray)-1][4] = "https://www.youtube.com" & $channelUrl $a_UrlsArray[0][0] = UBound($a_UrlsArray)-1 _GUICtrlListBox_AddString($SearchList, $a_UrlsArray[UBound($a_UrlsArray)-1][0] & $length & $a_UrlsArray[UBound($a_UrlsArray)-1][3]) next endIf endIf endIf endIf endIf  
      i hope any one can help me
      thanks in advance
    • By ripdad
      This is a project that I have been working on for several months off and on.
      It's a simple "What You Hear" MP3 @ 320Kbps and WAV audio recorder.
      - LoudMax, a Gain Controller and Look-Ahead Limiter
      - Auto Shut-Off after one minute of silence
      - Side-by-Side Simulated LED Meter
      - Running Time Counter
      It started off being a large project, but I eventually stripped it down to its
      bare essentials because I came to realize that it would be very difficult to
      deal with every sound card and every way a PC is set up for audio. It would
      have been a nightmare that I was not willing to go through.
      This project contains the most up-to-date BASS.dll v. - December 17, 2019.
      All BASS Dll's are 32bit. Those and the needed UDF's are included in the zip file.
      I will try to explain how it works in the next post.

      BASS VST Recorder v1.1.zip
  • Create New...