[etoys-dev] Etoys: Sound-kfr.27.mcz

commits at source.squeak.org commits at source.squeak.org
Sat Jun 15 18:25:32 EDT 2013

Karl Ramberg uploaded a new version of Sound to project Etoys:

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

Name: Sound-kfr.27
Author: kfr
Time: 16 June 2013, 12:25:11 am
UUID: 66331c11-465d-1d42-b358-e7e5031f3436
Ancestors: Sound-kfr.26

Fix a age old bug in 

Offset is now working

=============== Diff against Sound-kfr.26 ===============

Item was changed:
  ----- Method: AnonymousSoundMorph>>defaultColor (in category 'initialization') -----
  	"answer the default color/fill style for the receiver"
  	^ Color lightGreen!

Item was changed:
  ----- Method: AnonymousSoundMorph>>encounteredAtTime:inScorePlayer:atIndex:inEventTrack:secsPerTick: (in category 'piano roll') -----
  encounteredAtTime: ticks inScorePlayer: scorePlayer atIndex: index inEventTrack: track secsPerTick: secsPerTick
  	"hack... since we are called from within the SoundPlayer loop, the Semaphore will
  	block attempts to play directly from here"
  	WorldState addDeferredUIMessage: [sound play].!

Item was changed:
  ----- Method: AnonymousSoundMorph>>playSound (in category 'menu') -----
  	"Play the receiver's sound."
  	sound play!

Item was changed:
  ----- Method: AnonymousSoundMorph>>putEventsOnto: (in category 'event roll') -----
  putEventsOnto: aStream
  	"Write all of the events represented by the receiver in its current state onto the given stream."
  	| aNewEvent |
  	aNewEvent :=  MediaPlayEvent new.
  	aNewEvent setType: #startSound argument: self sound hand: nil stamp: (self eventRoll timeStampForCurrentPositionOf: self).
  	aStream nextPut: aNewEvent!

Item was changed:
  ----- Method: AnonymousSoundMorph>>sound (in category 'accessing') -----
  	"Answer the sound."
  	^ sound!

Item was changed:
  ----- Method: AnonymousSoundMorph>>suitableForDroppingIntoEventRoll (in category 'event roll') -----
  	"Answer whether the receiver is suitable for dropping into an Event Roll."
  	^ true!

Item was changed:
  ----- Method: PianoRollNoteMorph>>mouseMove: (in category 'event handling') -----
  mouseMove: evt 
  	| delta offsetEvt |
  	editMode isNil 
  			["First movement determines edit mode"
  			((delta := evt cursorPoint - hitLoc) dist: 0 @ 0) <= 2 
  				ifTrue: [^self	"No significant movement yet."].
  			delta x abs > delta y abs 
  					[delta x > 0 
  							["Horizontal drag"
  							editMode := #selectNotes]
  							[self playSound: nil.
+ 							offsetEvt := evt copy translateBy: (20 @ 0).
- 							offsetEvt := evt copy setCursorPoint: evt cursorPoint + (20 @ 0).
  							self invokeNoteMenu: offsetEvt]]
  				ifFalse: [editMode := #editPitch	"Vertical drag"]].
  	editMode == #editPitch ifTrue: [self editPitch: evt].
  	editMode == #selectNotes ifTrue: [self selectNotes: evt]!

Item was changed:
  ----- Method: RecordingControls class>>unload (in category 'class initialization') -----
  	"Unload the receiver from global registries"
  	self environment at: #Flaps ifPresent: [:cl |
  	cl unregisterQuadsWithReceiver: self] !

Item was changed:
  ----- Method: RecordingControls>>buttonWithSelector: (in category 'private') -----
  buttonWithSelector: aSelector
  	"Answer the button in my button pane that bears the given selector."
  	^ submorphs first submorphs detect:
  		[:m | (m isKindOf: SimpleButtonMorph) and:
  			[m actionSelector = aSelector]]!

Item was changed:
  ----- Method: RecordingControls>>playButtonHit (in category 'button commands') -----
  	"The user hit the play button."
  	recorder verifyExistenceOfRecordedSound ifFalse: [^ self].  "will have put up informer"
  	(self buttonWithSelector: #stopButtonHit) setAppearanceForEnablement: true.
  	(self buttonWithSelector: #playButtonHit) setAppearanceForEnablement: true.
  	(self buttonWithSelector: #saveButtonHit) setAppearanceForEnablement: true.
  	self playback!

Item was changed:
  ----- Method: RecordingControls>>playback (in category 'private') -----
  	"The user hit the playback button"
  	recorder verifyExistenceOfRecordedSound ifFalse: [^ self].
  	recorder pause.
  	recorder playback.

Item was changed:
  ----- Method: RecordingControls>>recordButtonHit (in category 'button commands') -----
  	"The user hit the record button."
  	(self buttonWithSelector: #stopButtonHit) setAppearanceForEnablement: true.
  	self record.!

Item was changed:
  ----- Method: RecordingControls>>startStepping (in category 'stepping') -----
  	"Make the level meter active when dropped into the world. Do nothing if already recording. Note that this will cause other recorders to stop recording..."
  	super startStepping.
  	recorder isPaused ifTrue: [
  		SoundRecorder allSubInstancesDo: [:r | r stopRecording].  "stop all other sound recorders"
  		recorder pause].  "meter is updated while paused"

Item was changed:
  ----- Method: RecordingControls>>stopStepping (in category 'stepping') -----
  	"Turn off recording."
  	super stopStepping.
  	recorder stopRecording.

Item was changed:
  ----- Method: RecordingControls>>updateReferencesUsing: (in category 'copying') -----
  updateReferencesUsing: aDictionary
  	"Copy my recorder."
  	super updateReferencesUsing: aDictionary.
  	recorder _ SoundRecorder new.

More information about the etoys-dev mailing list