[etoys-dev] Etoys: Movies-kfr.2.mcz

commits at source.squeak.org commits at source.squeak.org
Fri May 20 15:30:49 EDT 2011


Karl Ramberg uploaded a new version of Movies to project Etoys:
http://source.squeak.org/etoys/Movies-kfr.2.mcz

==================== Summary ====================

Name: Movies-kfr.2
Author: kfr
Time: 20 May 2011, 9:30:31 pm
UUID: 63c9530b-1468-6543-9dc4-41875e662331
Ancestors: Movies-bf.1

Fix file dialog if movie file is missing in movie player

=============== Diff against Movies-bf.1 ===============

Item was changed:
  ----- Method: MPEGDisplayMorph>>startPlaying (in category 'commands') -----
  startPlaying
  	"Start playing the movie at the current position."
  
  	| frameIndex |
  	self stopPlaying.
  	stopFrame _ nil.
  	self mpegFileIsOpen ifFalse: [^ self].
  
+ 	(FileStream isAFileNamed: mpegFile fileName) ifFalse: [
- 	(FileStream isAFileNamed: mpegFile fileName) ifFalse: [ | newFileResult newFileName |
  		self inform: 'Path changed. Enter new one for: ' translated, (FileDirectory localNameFor: mpegFile fileName).
+ 		self openMPEGFile.
+ 		(self openFileNamed: (mpegFile fileName)) ifFalse:[ ^self inform:'No valid file selected' translated]
+ 		].
- 		newFileResult _ StandardFileMenu oldFile.
- 		newFileName _ newFileResult directory fullNameFor: newFileResult name.	
- 		mpegFile openFile: newFileName].
  	
  	mpegFile hasAudio
  		ifTrue:
  			[mpegFile hasVideo ifTrue:
  				["set movie frame position from soundTrack position"
  				soundTrack reset.  "ensure file is open before positioning"
  				soundTrack soundPosition: (mpegFile videoGetFrame: 0) asFloat / (mpegFile videoFrames: 0).
  				"now set frame index from the soundtrack position for best sync"
  				frameIndex _ ((soundTrack millisecondsSinceStart * desiredFrameRate) // 1000).
  				frameIndex _ (frameIndex max: 0) min: ((mpegFile videoFrames: 0) - 3).
  				mpegFile videoSetFrame: frameIndex stream: 0].
  
  			SoundPlayer stopReverb.
  			soundTrack volume: volume.
  			soundTrack repeat: repeat.
  			soundTrack resumePlaying.
  			startFrame _ startMSecs _ 0]
  		ifFalse:
  			[soundTrack _ nil.
  			startFrame _ mpegFile videoGetFrame: 0.
  			startMSecs _ Time millisecondClockValue].
+ 	running _  true!
- 	running _ true!



More information about the etoys-dev mailing list