Champak Posted March 11, 2008 Posted March 11, 2008 (edited) I'm trying to make a seek bar for my wmp object app. I came across setPosition in msdn, but can't seem to get it to work thus far and I'm wondering if setPosition is a VB function or is it specific to wmp object. I've seen examples of seek bar around, but all of them are for the "sound" udf and use soundseek. Any help? Edited March 11, 2008 by Champak
Champak Posted March 12, 2008 Author Posted March 12, 2008 (edited) OK, I figured the following out, however, I can't get the slider to "follow" the position of the song. When I try to do that, I can't get the slider to seek...so it is basically one or the other. Can I get some help? #include <GUIConstants.au3> $oWMP = ObjCreate("WMPlayer.OCX") GUICreate("Player", 400, 100, 100, 100) $Play = GUICtrlCreateButton("Play", 10, 10, 50, 30) $Stop = GUICtrlCreateButton("Stop", 80, 10, 50, 30) $Position = GUICtrlCreateSlider( 5, 50, 330, 25 ) $oWMP.URL = @DesktopDir & "\Song.mp3" GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $Play $oWMP.controls.play() Case $msg = $Stop $oWMP.controls.stop() Case $msg = $Position $oWMP.controls.currentPosition = GUICtrlRead($Position) EndSelect GUICtrlSetLimit($Position,$oWMP.currentMedia.duration,0) WEnd Edited March 12, 2008 by Champak
AdmiralAlkex Posted March 12, 2008 Posted March 12, 2008 add the following code at an appropriate place in your loop GUICtrlSetData($Position, $oWMP.controls.currentPosition) .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
Champak Posted March 12, 2008 Author Posted March 12, 2008 That is what I did already. That is causing a fight between the actual/current position and trying to seek the new position...and the actual/current position is winning(Once the song starts and I try to drag the slider, it refuses to drag to where I want). That is why I said I'm only getting one or the other; I was putting that in the loop right under getting the duration. Any other solutions?
LIMITER Posted March 18, 2008 Posted March 18, 2008 You should look at this :WMP.au3It's an UDF with some WMP functions ...
FreeFry Posted March 19, 2008 Posted March 19, 2008 That is what I did already. That is causing a fight between the actual/current position and trying to seek the new position...and the actual/current position is winning(Once the song starts and I try to drag the slider, it refuses to drag to where I want). That is why I said I'm only getting one or the other; I was putting that in the loop right under getting the duration.Any other solutions?You'll need to determine whenever the slider is clicked, and if it is do the 'seeking', otherwise let it set current location...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now