Jump to content

WINMM.DLL Media Player


CYCho
 Share

Recommended Posts

I have some more small suggestions for the GUI when using HiDpi scaling.

$idPrevious = GUICtrlCreateLabel(ChrW(9664), 96, 52, 15, 15, BitOR($SS_SIMPLE, $SS_GRAYFRAME))              ; Previous file â—€
$idNext = GUICtrlCreateLabel(ChrW(9654), 125, 52, 15, 15, BitOR($SS_SIMPLE, $SS_GRAYFRAME))  

;2x . . .
$idPrevious2 = GUICtrlCreateLabel(ChrW(9664), 146, 23, 15, 15, BitOR($SS_SIMPLE, $SS_GRAYFRAME))
$idNext2 = GUICtrlCreateLabel(ChrW(9654), 173, 23, 15, 15, BitOR($SS_SIMPLE, $SS_GRAYFRAME))

GUICtrlSetPos($idPrevious2, $vcWidth/2-14, 23, 15, 15)
GUICtrlSetPos($idNext2, $vcWidth/2+13, 23, 15, 15)
Edited by Shark007
Link to comment
Share on other sites

@Shark007 In my setup, your recommended changes produced irregular spacing between the affected icons, so I changed flags for all the icons to $SS_CENTER. Please test with the version marked as Updated at 01:20 of June 13, 2023 UTC and see if it works in HiDpi scaling. I hope I can do the test myself, but I don't know how.

Edited by CYCho
Link to comment
Share on other sites

Excellent work. There are no more visual descrepencies in either GUI. 

One other aspect to touch on. When clicking the upper right red X on the player window GUI, currently the player reloads and restarts. Could you make that X exit the player window? This would be the behavior a user would expect.

Edited by Shark007
Link to comment
Share on other sites

2 hours ago, Shark007 said:

When clicking the upper right red X on the player window GUI, currently the player reloads and restarts.

The player is designed to loop the playlist endlessly. The Close box is meant to exit the current file. If there is only one file in the playlist, that file will be reloaded over and over again. If multiple files have been loaded, clicking the Close box will make the player move on to the next file. That is why I have a separate X icon to exit the program.

Edited by CYCho
Link to comment
Share on other sites

Through  this project I learned many aspects of not only winmm.dll but also of how a video image created by it interacts with a GUI window when it is resized, maximized or stretched to full screen. I have implemented most of the basic functionalities of winmm.dll as regards to a digital media player and my update of the code will not be as frequent as has been. Now I am awed by the power of AutoIt, which, with less than 1000 lines of code and without any third party dependency, made this media player possible. I must thank @TheXman, @ioa747, @Skeletor, @ptrex and @Shark007 for their kind words and/or help in this project.

Edited by CYCho
Link to comment
Share on other sites

I found that the change of video size does not take effect while the video is  in paused state. I inserted the following code to alleviate this phenomenon.
 

If $iPaused = 1 Then ; Change video size while in "paused" mode
    $iAudioIsOn = 0
    If mciSendString("status myMedia audio") = "on" Then
        $iAudioIsOn = 1
        mciSendString("set myMedia audio all off")
    EndIf
    _Pause()
    Sleep(10)
    _Pause()
    If $iAudioIsOn = 1 Then
        mciSendString("set myMedia audio all on")
    EndIf
EndIf

Edit: Inserted Sleep(10) between 2 _Pause() functions.

Edited by CYCho
Link to comment
Share on other sites

I adopted some of the features available in my zPlayer, such as a context menu in the playlist window and playing a file by doubleclicking an item in the playlist. I still kept the main GUI at a bare minimum size, and I had to assign multiple functions to some of the controls to make it possible.  I foresee that this player will ultimately be the future version of my  zPlayer. I had a lot of fun working on this.

Note: The code got a little long, so I attached a zip file to my first post instead of inserting the code. The zip file contains an icon file, too.

Edited by CYCho
Link to comment
Share on other sites

This player has the functionality of repeating the current file as a whole in loop, but is unable to repeat certain portion of a file in loop. I think I can implement it. The problem I have is that the GUI is small and is already jampacked with essential buttons. I am pretty much concerned with keeping the GUI to the minimum and I wonder if this function is worth enlarging the GUI. Please let me know if you have any suggestion.

Link to comment
Share on other sites

I implemented A-B repeat function without increasing the size of main GUI. If I click the total media length label, a small GUI appears where I can set up start and end positions. The corresponding portion of the slider changes color to purple. This set-up is effective only for the current file.

Link to comment
Share on other sites

  

8 hours ago, Shark007 said:

No matter the file loaded, it seems to be missing 40 minutes

 

image.png.e4e47da5b706763c7d5a0da50f0c01eb.png

I don't seem to be able to reproduce what you are saying. Please bear in mind that the total media length in main GUI displays in mmm:ss format instead of hh:mm:ss format.

Edited by CYCho
Link to comment
Share on other sites

10 hours ago, CYCho said:

 Please bear in mind that the total media length in main GUI displays in mmm:ss format instead of hh:mm:ss format.

Thats what I'm seeing. I didnt realize they were displaing different time formats. Sorry to bother you.

Link to comment
Share on other sites

Do I need an audio fade-in and, if yes, how do I implement it? Audio fade-in is a gradual increase of audio volume from 0 to a set volume, in about 5 seconds. When I play a file from position 0, I don't need it. I thought I would need it when I start playback from the middle of a file, especially when resuming the playback from the last streamed position. I thought I could initially set the volume to 0 and increase the volume by 5% points of a set volume at an interval of 250 milliseconds. First I used Sleep(250) between volume set commands. It worked, but there was a problem: it interrupted the flow of program for 5 seconds immediately after loading the first file of a folder if that file were subject to "Resume playback" option. So I added an adlib function to call the volume set command every 250 milliseconds and unregister the adlib upon attaining the set volume level. It is a small piece of code but I am satisfied with it.

Edited by CYCho
Link to comment
Share on other sites

A video window has the file name as its title. When the video stretches to fullscreen, the title bar disappears and there is no file name on the screen. To solve this problem, I put file name in the progress bar when the screen stretches to fullscreen. The video control, including the progress bar, appears when the mouse moves to the lower part of the screen.

Edited by CYCho
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...