Forum | | | | ![: 04.08.2008](.././../../i/a/noavatar.gif) | qui untenstehende Code fonctionne, mais je voudrais pour finissons des Abspielens den "Play"-Button aktivieren. malheureusement bekomme je cela sans Waitinput pas hin. Es mais devrait ne...aucune Waitinput vorkommen ? KompilierenMarqueSéparation
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/'>FIN
qui hat une Tipp pour mich ? - merci im Voraus ![](.././../../i/s/__upl_ext_1111498557.gif) |
| | | | |
| | ![Thomas Freier: 04.08.2008](.././../../i/a/722278123487bd8c272307.gif) Thomas Freier | @Horst, pourquoi veux du ihn désactiver? Überlasse dem Betrachter, si il den film encore einmal startet. dans qui Ablage fand je encore: KompilierenMarqueSéparationDef 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
|
| | | | |
| | ![Dieter Zornow: 04.08.2008](.././../../i/a/101212027948ca98cf1d74c.jpg) Dieter Zornow | allô Horst
so gehts KompilierenMarqueSéparation
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/'>FIN
tu peux simple den Status abfragen, sans Waitinput verzichte sur Clicked, cela allez de travers.
Salut
Dieter |
| | | Er ist ein Mann wie ein Baum. Sie nennen ihn Bonsai., Win 7 32 bit und Win 7 64 bit, mit XProfan X2 | 04.08.2008 ▲ |
| |
| | ![: 04.08.2008](.././../../i/a/noavatar.gif) | @Thomas je veux den "play%"-Button pas désactiver mais pour Abspielen qui AVI-Dossier aktivieren - qui Button wird oui beim Start des Filmes gris - EnableWindow play%,0 - je voudrais maintenant, si le AVI-Dossier am Ende ist, dass qui Button wieder aktiv dargestellt wird. - EnableWindow play%,1 - Schreib je cela dans qui Procedur, wird tout de suite aktiviert. qui MCIPLAY-Befehl pouvoir aucun récréation mais "rutscht" tout de suite par. c'est oui pas besonders important, mais je trouve es arrêt optique besser, si qui Button seulement pour Spielende aktiv wird. - Dein Vorschlag ist zwar très joli mais pour mon Zwecke brauche Je l' Windowstil 84 et qui ist avec qui Menuzeile dans Deinem Code pas possible. |
| | | | |
| | ![Jac de Lad: 04.08.2008](.././../../i/a/137932442848a87713b50bf.gif) Jac de Lad | @Thomas: Lieber encore un "Sleep x" dans qui Boucle rein, sonst rennt sich cela Prog abîmé. |
| | | 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 | 04.08.2008 ▲ |
| |
| | ![E.T.: 04.08.2008](.././../../i/a/1302115833493860557608e.png) E.T. | allô Horst,
ici la fois vite un Beispiel, comment je cela gelöst habe (ist zwar sur qui schnelle seulement pour MP3, mais cela Prinzip sollte funzen): KompilierenMarqueSéparation,
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
Hab cela vite la fois aus einem meiner Progs rausgenommen: je benenne zwar meinen Start-Button wärend des Abspielens dans Stopp-Button um, habe mais aussi un paire autre Sachen deaktiviert et ensuite wieder aktiviert. cela funktioniert chez mir so eigentlich reibungslos.
je frage simple dans qui mittleren WhileNot / Endwhile - Boucle den Button zum stoppen et qui reste-Spielzeit ab.
Hoffe, cela hilft erstmal un peu plus...
Mario ![](.././../../i/s/irre.gif) |
| | | 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... | 04.08.2008 ▲ |
| |
|
répondreOptions du sujet | 799 Views |
Themeninformationencet Thema hat 5 participant: |