View previous topic :: View next topic |
Author |
Message |
CodeScript Moderator Team
Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Wed Jul 16, 2003 3:03 pm Post subject: MCI AVI Player/Add AVI to your dialogs VDS 4.x/5.x |
|
|
MCI AVI Player VDS 4.x/5.x
This is an example to show how to play AVI files using @MCI function built into VDS.
You can play any AVI file in the standard format but it wont work with compressed AVI files like DiVx. You can :
1.Play the files.
2.Pause and resume playing.
3.Resize the AVI to whatever size within limits of visibilty and quality of the file.
(Use lot many other functions i have not illustrated here like cue,seek etc.
Refer to Microsoft Multimedia SDK if U want.)
You can add the movie to a line element or others to give it a border/different look if u want.
Note that it somehow doesn't work with the bitmap dialog element.
To loop the movie in this example use the command :
%P = @MCI(seek AVIFILE to start)
%P = @MCI(Play AVIFILE)
in the timer loop as shown in the example.
Uses:
1.Play simple movie files.
2.Add animations to your program.
3.Animated spalsh screens.
4.Other thing U can imagine !!
I believe that since this option is available in VDS 4 few if not many people might have been using it. I am interested to know more things from them
If U have any suggestions please let me know
So Enjoy !!!.
PLEASE NOTE THAT THE BELOW EXAMPLE NEEDS A CLOCK.AVI FILE IN THE APP DIRECTORY.
(Win2k/NT users can find this in their windows/WinNT directory).
You can download the dsc file and the avi from here !
http://www.vdsworld.com/index.php?page=download&fileid=300
Code: |
#Code: MCI AVI Player by CodeScript------------------------------------------#
# #
#Author: CodeScript---------------------------------------------------------#
# #
#Copyright:You can remove this info while(if) Using this code in your app.---#
#----------U may add a word to your documentation if U wish------------------#
TITLE MCI AVI Player by CodeScript
DIALOG CREATE,MCI AVI Player by CodeScript,-1,0,376,365,CLASS AVIWIN
DIALOG ADD,BUTTON,BUTTON1,318,90,90,36,Play !
DIALOG ADD,BUTTON,BUTTON2,318,90,90,36,Stop/Refresh
DIALOG ADD,BUTTON,BUTTON3,318,184,90,36,Pause
DIALOG ADD,BUTTON,BUTTON4,318,184,90,36,Resume
DIALOG SHOW
DIALOG DISABLE,BUTTON2
DIALOG HIDE,BUTTON2
DIALOG HIDE,BUTTON4
REM IF U WANT A FRAME AROUND YOUR AVI USE LINE DIALOG ELEMENT
REM TO GET THE HANDLE OF A DIALOG ELEMENT PREFIX TILDE TO IT'S NAME
REM EXAMPLE @strdel(@WINEXISTS(~LINE1),1,1) FOR LINE1
REM NOTE THAT BITMAP DIALOG ELEMENT DOESNOT WORK WITH THIS
%%Hwnd = @strdel(@WINEXISTS(#AVIWIN),1,1)
:EVLOOP
wait event,0.08
goto @event()
:TIMER
REM HERE I AM CHECKING FOR THE LAST FRAME TO BE PLAYED TO STOP THE AVI
REM IF U DONT WANT THIS U CAN USE OTHER PARAMETERS EG.
REM U CAN USE NOTIFY FLAG WITH PLAY IN VDS 5
REM TO STOP THE AVI WHEN DONE.
%Q = @MCI(status AVIFile position)
IF @EQUAL(%Q,12)
rem %P = @MCI(seek AVIFILE to start)
rem %P = @MCI(Play AVIFILE)
REM FOR CONTINOUS PLAY REMOVE THE REM FROM ABOVE 2 LINES
REM AND REM THE LINE BELOW THIS
%P = @MCI(Close AVIFile)
DIALOG DISABLE,BUTTON2
DIALOG HIDE,BUTTON2
DIALOG ENABLE,BUTTON1
DIALOG SHOW,BUTTON1
goto EVLOOP
ELSE
goto evloop
:BUTTON1button
DIALOG DISABLE,BUTTON1
DIALOG HIDE,BUTTON1
DIALOG ENABLE,BUTTON2
DIALOG SHOW,BUTTON2
%%WS_CHILD = 1073741824
%%AVI = @shortname(@CURDIR()\clock.avi)
%A = @MCI(Open %%AVI type AVIVideo alias AVIFile parent %%Hwnd style %%WS_CHILD)
IF @NOT(@equal(%A,1))
warn The device returned the following error:@CR()@CR()%A@cr()This may also mean that the
specified avi file doesnot exist !@CR()OR is not in a proper format !
end
%P = @MCI(put AVIFile window at 40 10 300 300)
REM YOU CAN CHANGE THESE VALUES FOR POSITIONING AND RESIZING THE AVI
REM IT'S IN THE FORAMT X,Y,WIDTH,HEIGHT
%P = @MCI(Play AVIFile )
REM YOU CAN SPECIFY THE WAIT COMMAND SO THAT THE WINDOW WILL NOT RESPOND
REM UNTIL THE AVI HAS FINISHED PLAYING AND THEN GIVE THE CLOSE COMMAND
REM EXAMPLE :
rem %P = @MCI(Play AVIFile WAIT)
rem %P = @MCI(Close AVIFile)
goto evloop
:BUTTON2button
DIALOG DISABLE,BUTTON2
DIALOG HIDE,BUTTON2
DIALOG ENABLE,BUTTON1
DIALOG SHOW,BUTTON1
%P = @MCI(Close AVIFile)
goto EVLOOP
:BUTTON3button
DIALOG HIDE,BUTTON3
DIALOG SHOW,BUTTON4
%P = @MCI(pause AVIFile )
goto EVLOOP
:BUTTON4button
DIALOG HIDE,BUTTON4
DIALOG SHOW,BUTTON3
%P = @MCI(resume AVIFile )
goto EVLOOP
:close
REM THIS IS TO ENSURE THAT THE DEVICE IS FREED TO PREVENT PROBLEMS
%P = @MCI(Close AVIFile)
Exit
|
____________________________________________________________________________________________ _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension
Last edited by CodeScript on Thu Jul 31, 2003 6:16 pm; edited 4 times in total |
|
Back to top |
|
|
CodeScript Moderator Team
Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Wed Jul 16, 2003 3:05 pm Post subject: |
|
|
edited off by me ! _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension
Last edited by CodeScript on Thu Jul 17, 2003 1:53 am; edited 1 time in total |
|
Back to top |
|
|
FreezingFire Admin Team
Joined: 23 Jun 2002 Posts: 3508
|
Posted: Wed Jul 16, 2003 9:30 pm Post subject: |
|
|
Hi CodeScript,
Please don't take offense, but I think it would be good to sign up for an
author account at http://www.vdsworld.com/index.php?page=signup
I would rather download a ZIP file with your script and additional files
rather than decode these postings. Just would make it easier.
I really like your scripts and I hope you continue to develop them, but
I think it would be better to upload these to your author account.
An author account is completely free and is easy to use, and you can
upload your files directly to VDSWORLD, you don't need any webspace
somewhere else. _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
Back to top |
|
|
CodeScript Moderator Team
Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Thu Jul 17, 2003 1:14 am Post subject: |
|
|
FF thanx for the reply.
Even I was very much uncomfortable posting the file this way. It decreases visibilty and is also annoying . many people dont even understand what to do with it. Besides I fear that it may interfere with site search engine. _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension |
|
Back to top |
|
|
CodeScript Moderator Team
Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Thu Jul 17, 2003 4:46 am Post subject: |
|
|
Additional Info:
You can play DiVx avi's too.
Install DiVx 4 codec that's all.
Brightness of the movie may not be satisfactory sometimes.
If so U can configure the codec from a third party video player U have or a configuration utility may be added to the AVI palyer itself if U want.
Enjoy your favorite movie on your VDS player _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension |
|
Back to top |
|
|
Skit3000 Admin Team
Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|