Greetings, List.
I would like to create and automatically control (start and stop) an MPEG in a TWindow; the first part of this is a snap. After several hours of exploring Croquet's TEmbeddedApp, TMorphicWorld, PasteUpMorph, and other classes, I'm rather confused about how to handle the second part. Basically, I wish to start, stop, and rewind the MPEG without user interaction. Per the MPEG Demo, I create a TEmbeddedApp object and add it to a TWindow: . . . movie := TEmbeddedApp name: #TMorphicWorld extent: extentSize data: { #makeMovie: . uri }. win := TWindow new. win contents3D: movie. space addChild: win. . . . No surprises there! However, I'm at a loss about how to access the underlying TMpegDisplayMorph object. I'm sure there is a simple answer--I'm just not seeing it. Thanks in advance for any help! -RC |
I'd use the video code in Wisconsin-Movie category.
TMpegDisplayMorph is an early demo hack that isn't suitable for many common use cases. For example, it assumes that you have an MPEG file at the correct path, but doesn't provide a way for peers who don't already have the movie to get a copy. If all you need is to play, pause, and rewind the MPEG to the start, the Wisconsin code already does what you need. If you need to seek through the movie, I'd take a look at KMoviePlayer's 'time' instance variable. When the movie is playing, this value is continually updated (see how KMoviePlayer>>playLoop updates the time, and uses #movieTime: to update the position within the movie). By manipulating this value with your code, you should be able to figure out how to implement seeking. Cheers, Josh On Oct 31, 2007, at 1:39 PM, RC wrote: > > Greetings, List. > > I would like to create and automatically control (start and stop) > an MPEG in > a TWindow; the first part of this is a snap. After several hours of > exploring Croquet's TEmbeddedApp, TMorphicWorld, PasteUpMorph, and > other > classes, I'm rather confused about how to handle the second part. > > Basically, I wish to start, stop, and rewind the MPEG without user > interaction. Per the MPEG Demo, I create a TEmbeddedApp object and > add it > to a TWindow: > > . > . > . > movie := TEmbeddedApp name: #TMorphicWorld extent: extentSize > data: { > #makeMovie: . uri }. > win := TWindow new. > win contents3D: movie. > space addChild: win. > . > . > . > > No surprises there! However, I'm at a loss about how to access the > underlying TMpegDisplayMorph object. I'm sure there is a simple > answer--I'm > just not seeing it. > > Thanks in advance for any help! > > -RC > -- > View this message in context: http://www.nabble.com/Question-about- > access-to-embedded-MPEG-display-app.-tf4727737.html#a13518220 > Sent from the Croquet - Dev mailing list archive at Nabble.com. > |
Josh (or anyone who might be in the know on this...): could you please post a snippet of code demonstrating how to load and play an MPEG with the Wisconsin-Movie classes?
I've been attempting to cobble something together, but to no avail. Thanks much, -RC
|
From outside the island (e.g., from the harness, driven by, say, a
menu command), see KStandardHarness>>dropFile:. Note that the file- dropping code and the "import from file" stuff (e.g., KMenuBar>>actionNewFromFile) all goes through here. There's a lot of hooks here to make things very flexible and customizable. Probably too many, making the card a bit obscure. It's very much in the OpenImplementation/AOP/MOP school of thought, rather than the "here, copy these 47 lines of code into the 120 places you want to use it and customize" school of thought. Alas, the OI approach isn't the easiest to follow. (Particularly if not so well done, as in the case of the stuff I wrote. KMedia>>mediaClassFor:...) Exploratory technique: First drag in a movie and make sure it works, so that you know you're not wasting your time with, e.g., the wrong movie format or something. Then, find the place you know things go through. In this case I think it's KMPEGMovie>>newOn:from: from inspection, but I haven't verified. Stick self halt. at the beginning of it (e.g., just after the variable declarations). Drag in the same movie and examine the stack. It will show you exactly how stuff gets created. The reason that you're starting outside the island in this case is learn about how the distribution of off-island media is handled (which there's been some general discussion of lately on this list). On Nov 8, 2007, at 11:13 PM, RC wrote: > > Josh (or anyone who might be in the know on this...): could you > please post > a snippet of code demonstrating how to load and play an MPEG with the > Wisconsin-Movie classes? > > I've been attempting to cobble something together, but to no avail. > > Thanks much, > > -RC > > > Joshua Gargus-2 wrote: >> >> I'd use the video code in Wisconsin-Movie category. >> TMpegDisplayMorph is an early demo hack that isn't suitable for many >> common use cases. For example, it assumes that you have an MPEG file >> at the correct path, but doesn't provide a way for peers who don't >> already have the movie to get a copy. >> >> If all you need is to play, pause, and rewind the MPEG to the start, >> the Wisconsin code already does what you need. If you need to seek >> through the movie, I'd take a look at KMoviePlayer's 'time' instance >> variable. When the movie is playing, this value is continually >> updated (see how KMoviePlayer>>playLoop updates the time, and uses >> #movieTime: to update the position within the movie). By >> manipulating this value with your code, you should be able to figure >> out how to implement seeking. >> >> Cheers, >> Josh >> >> >> On Oct 31, 2007, at 1:39 PM, RC wrote: >> >>> >>> Greetings, List. >>> >>> I would like to create and automatically control (start and stop) >>> an MPEG in >>> a TWindow; the first part of this is a snap. After several hours of >>> exploring Croquet's TEmbeddedApp, TMorphicWorld, PasteUpMorph, and >>> other >>> classes, I'm rather confused about how to handle the second part. >>> >>> Basically, I wish to start, stop, and rewind the MPEG without user >>> interaction. Per the MPEG Demo, I create a TEmbeddedApp object and >>> add it >>> to a TWindow: >>> >>> . >>> . >>> . >>> movie := TEmbeddedApp name: #TMorphicWorld extent: extentSize >>> data: { >>> #makeMovie: . uri }. >>> win := TWindow new. >>> win contents3D: movie. >>> space addChild: win. >>> . >>> . >>> . >>> >>> No surprises there! However, I'm at a loss about how to access the >>> underlying TMpegDisplayMorph object. I'm sure there is a simple >>> answer--I'm >>> just not seeing it. >>> >>> Thanks in advance for any help! >>> >>> -RC >>> -- >>> View this message in context: http://www.nabble.com/Question-about- >>> access-to-embedded-MPEG-display-app.-tf4727737.html#a13518220 >>> Sent from the Croquet - Dev mailing list archive at Nabble.com. >>> >> >> >> > > -- > View this message in context: http://www.nabble.com/Question-about- > access-to-embedded-MPEG-display-app.-tf4727737.html#a13661746 > Sent from the Croquet - Dev mailing list archive at Nabble.com. > |
Free forum by Nabble | Edit this page |