From bb60d8654627f7c5d06b46fd8a779054e7323fbc Mon Sep 17 00:00:00 2001 From: babaq Date: Sat, 20 Jun 2009 00:41:25 +0800 Subject: [PATCH] StiLib_1.0.6.5 --- ...mework.Content.Pipeline.VideoImporters.dll | Bin 0 -> 9216 bytes Release/RF_Center_1.fsx | 132 +++++++++ Release/RF_Center_2.fsx | 143 ++++++++++ StiLib/StiLib/Vision/SLVideo.cs | 254 ++++++++++++++++++ StiLibTest_01/Content/Butterfly.wmv | Bin 0 -> 2797732 bytes StiLibTest_01/Content/desktop.ini | 2 + 6 files changed, 531 insertions(+) create mode 100644 Release/Microsoft.Xna.Framework.Content.Pipeline.VideoImporters.dll create mode 100644 Release/RF_Center_1.fsx create mode 100644 Release/RF_Center_2.fsx create mode 100644 StiLib/StiLib/Vision/SLVideo.cs create mode 100644 StiLibTest_01/Content/Butterfly.wmv create mode 100644 StiLibTest_01/Content/desktop.ini diff --git a/Release/Microsoft.Xna.Framework.Content.Pipeline.VideoImporters.dll b/Release/Microsoft.Xna.Framework.Content.Pipeline.VideoImporters.dll new file mode 100644 index 0000000000000000000000000000000000000000..0b31c12d85d4a9b311c2686cc5a2860d93c72667 GIT binary patch literal 9216 zcmeHN4Rlr2mEQN}y_e(#UP<`TKoTxNOF;5WAjqFe{s_d9pXP-GOa^#AH_0XM-TS!r zzL20`DixuYe`>+X%v7Ncj=1cgQ>07$Y0Ib#oeqK{16G;QB}}1UYtd2{&Uenc_vM8k z%XVhjwYqx4{qEWO?6c1~`|NYhKIc($_a;gqA_v~jJ|o(XFMCQkULSgq?HPT*L(irk z8M9xQcVtXshhj)kU2E6<5h>_bRn3$FvZTjUNl~TBI-eBLLb7-8VE0Xy>iXG4^Mn*i zDa^aeuI*j&jL8tvh(>~g4|}}R021C(ybL6K#CW@r;_YW&>ctCw<8KN5Ds>VK;s5%+ z7RhAs9Ggni%o3$Un;<>lSwb`j%yYL9r(ZKWl6nXY`iNlz(Jc@oK!LzrFhu(pZh zq)#z07c+@6I2UQ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mW#q&;Rk{cd8%zRpRAelNOcQdu}G@rcF1{S6k@E?nr~cr8!{6nTq_rc9dZ#UfxOuMbsWcF_D4z@>IJLR5M94F=&&5G(Z)J|OJ z3D!>pd8~A!IHFniN3pOc_LasCwv=*1Vkqq28APOC$D4+`o;2LFHux%iQ-Al<;ycmdLs%f8bTJ50OXzh2} zxr)*POWRtz(c^@H|H!jbG!#IaKjrsVNZ`q{e>aJf{m{Pq@5iLY7}LsdxW=!j@#Bsx z$Gr$*pWRGSX@Bv*Qhz}fU^ip9OOF4FmeemkF$uG^H;IX4d{(g=iUp;(vt$>S)>GnS zH<(Sh{a6f~jUC^I8>u>~1zioSLYh4-n7@-Xj1$%Ddr5br;q9V><*V!gw4|eMvf1Yt{gJJ<~G9ksHlJ;w8igKAE z^gI4nLIGw2+C;abEQ@j?{DPd_rLzm+|Nl6t32h4@KGI;b{x|OiqNosh#_p)+;Ud{? zPZWJslP>RBe+RZp;;q-MyZmJ9{5|iRZPiL1o3YrBMR3VB9H{gE8WVo8zD~n0oI+x( zn$SKSw(lF;$*@Z?e~V}eO`@qtvoYJw`^CJ3{qCXT%YF^9f8w~7jlP`zJc@fp0V9a( z72YD|RZ)x|vv@mhr4fJgvFgv0aJw0#@g)5bW9x;qL}lD(q$K?YxH=zaW|uCcLa-To z;=WL4$+B6(Y-algqu9?we?Hr_QXXtqkM?P3a|{+SlScGf?UHbAsf7(Bnq#$I;%h(* z<(Usjxcg=PgKJFgXZ>|w?QNguYts;s2&l!tp9~uXV6`6T{=D) float this.ex.Expara.durT + float this.ex.Expara.srestT then + this.ex.Flow.IsStiOn <- true + this.ex.Flow.IsPred <- false + this.ex.Flow.IsRested <- false + this.ex.Flow.SCount <- this.ex.Flow.SCount + 1 + else + if this.ex.Flow.TCount - this.ex.Expara.trial < -1 then + if this.ex.PPort.timer.ElapsedSeconds > float this.ex.Expara.durT + float this.ex.Expara.trestT then + this.ex.Rand.RandomizeSequence(this.ex.Expara.stimuli.[0]) + this.ex.Flow.IsStiOn <- true + this.ex.Flow.IsPred <- false + this.ex.Flow.IsRested <- false + this.ex.Flow.TCount <- this.ex.Flow.TCount + 1 + this.ex.Flow.SCount <- 0 + else + this.GO_OVER <- false + +end + +let MyExperiment = new MyEx(Text = "F# Scripting RF_Center_2") +Application.Run(MyExperiment) \ No newline at end of file diff --git a/StiLib/StiLib/Vision/SLVideo.cs b/StiLib/StiLib/Vision/SLVideo.cs new file mode 100644 index 0000000..8eb46ba --- /dev/null +++ b/StiLib/StiLib/Vision/SLVideo.cs @@ -0,0 +1,254 @@ +#region File Description +//----------------------------------------------------------------------------- +// SLVideo.cs +// +// StiLib Video +// Copyright (c) Zhang Li. 2009-06-19. +//----------------------------------------------------------------------------- +#endregion + +#region Using Statements +using System; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Content; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Media; +using System.Windows.Forms; +#endregion + +namespace StiLib.Vision +{ + /// + /// StiLib Video + /// + public class SLVideo : VisionStimulus + { + /// + /// Sprite Batch + /// + public SpriteBatch SpriteBatch; + /// + /// Basic Parameters + /// + public BasePara BasePara; + /// + /// Content Manager + /// + public ContentManager ContentManager; + /// + /// Video Texture + /// + public Texture2D Texture; + Video video; + VideoPlayer vplayer; + /// + /// Get the Video Player + /// + public VideoPlayer Player + { + get { return vplayer; } + } + + + /// + /// Set Video parameters to default, + /// before LoadContent() and Init() + /// + public SLVideo() + { + BasePara = BasePara.Default; + } + + /// + /// Init to default + /// + /// + /// + /// + /// + public SLVideo(GraphicsDevice gd, IServiceProvider service, string path, string videoname) + : this() + { + LoadContent(service, path, videoname); + Init(gd); + } + + /// + /// Init to custom base parameters + /// + /// + /// + /// + /// + /// + public SLVideo(GraphicsDevice gd, IServiceProvider service, string path, string videoname, BasePara bpara) + : base(gd) + { + LoadContent(service, path, videoname); + Init(gd, bpara); + } + + + /// + /// Load Compiled Video.xnb File using Content Manager + /// + /// + /// + /// + public void LoadContent(IServiceProvider service, string path, string videoname) + { + ContentManager = new ContentManager(service, path); + try + { + video = ContentManager.Load