English
Forum

End of a AVI-File intercepting

 
The untenstehende code runs, but I would like to terminate the Abspielens whom "Play"-Button enable. unfortunately I get the without Waitinput not there. it but should no Waitinput vorkommen ?
CompileMarkSeparation
PROC ABSPIEL_BEFEHL

    mcisend$("CLOSE MOVIE")
    PARAMETERS avi_datei$
    Enablewindow play%,0
    Enablewindow stop%,1
    mcisend$("OPEN "+shortname$(avi_datei$)+" TYPE AVIVIDEO ALIAS MOVIE")
    mcisend$("WINDOW MOVIE HANDLE "+str$(win&))
    mcisend$("PUT MOVIE DESTINATION AT 8 5 260 210")
    mcisend$("PLAY MOVIE")
    Nach Beenden der AVI-Datei soll jetzt hier der Button
    play% aktiv und der Button stop% deaktiv geschaltet werden.
    Klappt aber nicht :(   - da PLAY MOVIE nicht wartet - WaitInput will ich nicht
    EnableWindow stop%,0
    EnableWindow play%,1

ENDPROC

########################################################
declare avi_datei$,win&
DECLARE play_EE%,play%,stop%,back%,tipp%
play_EE%=0
WINDOW (%MaxX+10),0-0,0
WindowStyle 84
win&=CREATE("WINDOW",%HWND,"",50,50,280,250)
play%=CREATE("BUTTON",win&,">",5,220,20,20)
tipp%=CREATE("TOOLTIP",win&,play%,"Abspielen wiederholen...")
stop%=CREATE("BUTTON",win&,"II",50,220,20,20)
tipp%=CREATE("TOOLTIP",win&,stop%,"Abspielen stoppen...")
back%=CREATE("BUTTON",win&,"ESC Abbrechen",148,220,120,20)
tipp%=CREATE("TOOLTIP",win&,back%,"Anzeige schließen")
--------------------------------------------------
avi_datei$=loadfile$("AVI - Datei auswählen...","*.avi")
avi_datei$="geburtstag.avi" Testdatei auf meiner Festplatte
--------------------------------------------------
ABSPIEL_BEFEHL avi_datei$

WHILENOT play_EE%

    WAITINPUT

    IF CLICKED(stop%)

        mcisend$("CLOSE MOVIE")
        EnableWindow stop%,0
        EnableWindow play%,1

    ENDIF

    CASE CLICKED(play%):ABSPIEL_BEFEHL avi_datei$

    IF IsKey(27) | CLICKED(back%)

        mcisend$("CLOSE MOVIE")
        DesTroyWindow(win&)
        play_EE%=1
        END vorläufiges Ende - normal Rücksprung zum Hauptfenster

    ENDIF

ENDWHILE

4 href='./../../function-references/XProfan/end/'>END

Who a Tipp for me ? - thanks in the ahead
 
08/04/08  
 




Thomas
Freier
@Horst, Why want You it deaktivieren? Überlasse the Viewer, whether it whom film once more launch.
in the filing found I yet:
CompileMarkSeparation
Def w32_CreateMenu(0) !"USER32","CreateMenu"
Def w32_AppendMenu(4) !"USER32","AppendMenuA"
Def SetMenu(2) !"USER32","SetMenu"
Def DrawMenuBar(1) !"USER32","DrawMenuBar"
Def MenuItemEx(1) If(Equ(%umessage,$0111),Equ(LoWord(&uwparam),&(1)),0)
Def DestroyMenu(1) !"USER32","DestroyMenu"
Def @Movewindow(6) !"USER32", "MoveWindow"
Declare hmenu&,hmenu2&,txt$,format%
hmenu&=w32_CreateMenu()
txt$="Beenden"
w32_AppendMenu(hmenu&,0,3000,Addr(txt$))
txt$="Start"
w32_AppendMenu(hmenu&,16,3001,Addr(txt$))
txt$="Stop"
w32_AppendMenu(hmenu&,16,3002,Addr(txt$))
txt$="100%"
w32_AppendMenu(hmenu&,16,3003,Addr(txt$))
txt$="200%"
w32_AppendMenu(hmenu&,16,3004,Addr(txt$))
txt$="Neu"
w32_AppendMenu(hmenu&,16,3005,Addr(txt$))
declare Label_m&, dat$, Funct%,Stop%
WINDOWSTYLE 512
WINDOW 1,1-600,400
SETTRUECOLOR 1
dat$ = ShortName$(LoadFile$("Film laden...","AVI-Film (*.avi)|*.avi"))
case (dat$ = "") : end
Label_m&=create("Window",%hwnd,"",100,50, 340,304)
SetMenu(Label_m&,hmenu&)
DrawMenuBar(Label_m&)
UserMessages $0111
MCISend$("open " + dat$ + " type avivideo alias film")
MCISend$("window film handle " + str$(Label_m&))
MCISend$("put film destination at 8 5 320 240")
MCISend$("play film")
Format%=0
Stop%=0
SetFocus(%hWnd)
EnableMenu 3001, 1

While 1

    WaitInput

    If MenuItemEx(3000)

        Break

    ElseIf MenuItemEx(3001)

        case Format%=0: @Movewindow(Label_m&,100,50, 340,304,1)
        case Format%=1: @Movewindow(Label_m&,100,50, 660,544,1)
        MCISend$("close film")
        MCISend$("open " + dat$ + " type avivideo alias film")
        MCISend$("window film handle " + str$(Label_m&))
        case Format%=0: MCISend$("put film destination at 8 5 320 240")
        case Format%=1: MCISend$("put film destination at 8 5 640 480")
        MCISend$("play film")

    ElseIf MenuItemEx(3002)

        IF stop%=0

            MCISend$("Stop film")
            stop%=1

        Else

            MCISend$("play film")
            stop%=0

        EndIf

    ElseIf MenuItemEx(3003)

        Format%=0
        @Movewindow(Label_m&,100,50, 340,304,1)
        MCISend$("window film handle " + str$(Label_m&))
        MCISend$("put film destination at 8 5 320 240")
        MCISend$("play film")

    ElseIf MenuItemEx(3004)

        Format%=1
        @Movewindow(Label_m&,100,50, 660,544,1)
        MCISend$("window film handle " + str$(Label_m&))
        MCISend$("put film destination at 8 5 640 480")
        MCISend$("play film")

    ElseIf MenuItemEx(3005)

        Stop%=0
        MCISend$("close film")
        dat$ = ShortName$(LoadFile$("Film laden...","AVI-Film (*.avi)|*.avi"))
        case (dat$ = "") : end
        MCISend$("open " + dat$ + " type avivideo alias film")
        MCISend$("window film handle " + str$(Label_m&))
        case Format%=0: MCISend$("put film destination at 8 5 320 240")
        case Format%=1: MCISend$("put film destination at 8 5 640 480")
        MCISend$("play film")

    EndIf

Wend

DestroyMenu(hmenu&)
DestroyWindow(Label_m&)
MCISend$("close 
uot;) end
 
Gruß Thomas
Windows XP SP2, XProfan X2
08/04/08  
 




Dieter
Zornow
Hello Horst

so GEHTS
CompileMarkSeparation
PROC ABSPIEL_BEFEHL

    mcisend$("CLOSE MOVIE")
    PARAMETERS avi_datei$
    Declare stop$
    Enablewindow play%,0
    Enablewindow stop%,1
    mcisend$("OPEN "+shortname$(avi_datei$)+" TYPE AVIVIDEO ALIAS MOVIE")
    mcisend$("WINDOW MOVIE HANDLE "+str$(win&))
    mcisend$("PUT MOVIE DESTINATION AT 8 5 260 210")
    mcisend$("PLAY MOVIE")

    whilenot stop$ = "stopped"

        stop$=MCISend$("STATUS MOVIE MODE")zeigt den Zustand (stopped, playing, paused, not ready)

    endwhile

    enablewindow play%,1
    enablewindow stop%,0
    Nach Beenden der AVI-Datei soll jetzt hier der Button
    play% aktiv und der Button stop% deaktiv geschaltet werden.
    Klappt aber nicht :(   - da PLAY MOVIE nicht wartet - WaitInput will ich nicht
    EnableWindow stop%,0
    EnableWindow play%,1

ENDPROC

########################################################
declare avi_datei$,win&
DECLARE play_EE%,play%,stop%,back%,tipp%
play_EE%=0
WINDOW (%MaxX+10),0-0,0
WindowStyle 84
win&=CREATE("WINDOW",%HWND,"",50,50,280,250)
play%=CREATE("BUTTON",win&,">",5,220,20,20)
tipp%=CREATE("TOOLTIP",win&,play%,"Abspielen wiederholen...")
stop%=CREATE("BUTTON",win&,"II",50,220,20,20)
tipp%=CREATE("TOOLTIP",win&,stop%,"Abspielen stoppen...")
back%=CREATE("BUTTON",win&,"ESC Abbrechen",148,220,120,20)
tipp%=CREATE("TOOLTIP",win&,back%,"Anzeige schließen")
--------------------------------------------------
avi_datei$=loadfile$("AVI - Datei auswählen...","*.avi")
avi_datei$="geburtstag.avi" Testdatei auf meiner Festplatte
--------------------------------------------------
ABSPIEL_BEFEHL avi_datei$

WHILENOT play_EE%

    IF Getfocus(stop%)

        mcisend$("CLOSE MOVIE")
        EnableWindow stop%,0
        EnableWindow play%,1

    ENDIF

    CASE getfocus(play%):ABSPIEL_BEFEHL avi_datei$

    IF IsKey(27) | getfocus(back%)

        mcisend$("CLOSE MOVIE")
        DesTroyWindow(win&)
        play_EE%=1
        ENDvorläufiges Ende - normal Rücksprung zum Hauptfenster

    ENDIF

ENDWHILE class=s4 href='./../../function-references/XProfan/end/'>END

You can simply whom status inquire, without Waitinput verzichte on Clicked, the goes schief.

Greeting

Dieter
 
Er ist ein Mann wie ein Baum. Sie nennen ihn Bonsai., Win 7 32 bit und Win 7 64 bit, mit XProfan X2
08/04/08  
 



@Thomas
i will whom "play%"-Button not deaktivieren separate to Play the AVI-File enable - the Button becomes Yes at Start the Filmes gray - EnableWindow play%,0 - i want now, if The AVI-File end is, that the Button again active displayed becomes. - EnableWindow play%,1 - Schreib I the into Procedur, becomes immediate activate. The MCIPLAY-Command makes no interval separate "rutscht" immediate through. its Yes not very good important, but I find it hold optisch rather, if the Button first to Spielende active becomes. - your suggestion Although very beautiful but for my tack need I the Windowstil 84 and the is the Menuzeile in Your code you don't say so.
 
08/04/08  
 




Jac
de
Lad
@Thomas: rather another "Sleep x" into Loop mere, otherwise runs itself the Prog broken.
 
Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE)
Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP
08/04/08  
 




E.T.
Hello Horst,

here time quick an example, How I the resolved have (Although on The speedy only for MP3, but the principle ought to funzen):
CompileMarkSeparation
,

Proc EB_Play_MP3

    declare Play_Ende%, 1$, 3$, 4$, 5$
    Clear Play_Ende%

    WhileNot Play_Ende%

        @MCISend$("OPEN "+@Chr$(34)+HelpStr$+@Chr$(34)+" TYPE MPEGVIDEO ALIAS MP3_play")
        @MCISend$("set MP3_play time format ms")
        @MCISend$("set MP3_play video off")
        SetFocus(%HWnd)
        SetText Sound_PlayBtn&, "WIEDERGABE
        S T O P P E N"
        EnableWindow Titel_Box&,0
        EnableWindow Sound_Btn1&,0
        EnableWindow Sound_Btn2&,0
        EnableWindow Sound_ErBtn& ,0
        @MCISend$("PLAY MP3_play")
        4$ = MP3_length()
        1$ = PosMP3()
        3$ = MP3_position()
        5$ = @str$( @Val(4$) - @Val(3$) )

        WhileNot @GetFocus(Sound_PlayBtn&) OR (@Val(5$)=0)

            sleep 100
            1$ = PosMP3()
            3$ = MP3_position()
            5$ = @str$( @Val(4$) - @Val(3$) )
            SetText Play_Time1&, 1$
            SetText Play_Time2&, 3$
            SetText Play_Ret1&, PosRet(5$)
            SetText Play_Ret2&, 5$

        EndWhile

        @MCISend$("STOP MP3_play")
        @MCISend$("CLOSE MP3_play")
        SetText Sound_PlayBtn&, "Sound-Datei
        abspielen"
        EnableWindow Titel_Box&,1
        EnableWindow Sound_Btn1&,1
        EnableWindow Sound_Btn2&,1
        EnableWindow Sound_ErBtn& ,1
        Play_Ende% = 1

    EndWhile

    EB_Sound_Laden

ENDPROC


Have the quick time a of my Progs rausgenommen:
I benenne of course my Start-Button During low the Abspielens in Stopp-Button circa, have but too a couple others things deaktiviert and then again activate.
the functions by me so really free from problems.

I question simply in the mittleren WhileNot / Endwhile - Loop whom Button to that stop and the remainder-Spielzeit ex.

hope, the helps first a little bit moreover...

Mario
 
Grüße aus Sachsen... Mario
WinXP, Win7 (64 Bit),Win8(.1),Win10, Win 11, Profan 6 - X4, XPSE, und 'nen schwarzes, blinkendes Dingens, wo ich das alles reinschütte...
08/04/08  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

782 Views

Untitledvor 0 min.
H.Hackl11/20/13

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie