-
Notifications
You must be signed in to change notification settings - Fork 16
Add the Sound library #53
base: master
Are you sure you want to change the base?
Conversation
Adds the basic structure for the Sound library, and populates it with the first couple (not yet implemented) methods.
Implemented Sound.PlayClick and manually verified that it works!
Adds the documentation for PlayClick.
Adds the strings for the rest of the Sound APIs, as copied from SmallBasic.Web\Content\js\json\generated-output.json
Copy better strings into Sound.Play and Sound.Play.FilePath, per the actual documentation headers in the original code.
Implement the structure of the rest of the Sound APIs, + actually implement the three easy ones (playing sound files like what was already implemented for Click)
Refactor the Sound library to make it more unit testable, and add some basic tests.
Notes:
|
|
||
public readonly methods: { readonly [name: string]: LibraryMethodInstance } = { | ||
PlayClick: { execute: this.executePlayStockSound.bind(this, Sound.Click) }, | ||
PlayClickAndWait: { execute: () => { throw new Error("Not Implemented yet."); } }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest not adding the NYI methods until they're actually functional. No need to show it in the UI and crash afterwards if they're not implemented yet.
@@ -0,0 +1,12 @@ | |||
import { ISoundLibraryPlugin } from "../../../compiler/runtime/libraries/sound"; | |||
|
|||
export class SoundLibraryPlugin implements ISoundLibraryPlugin { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you document where did we get the sound files from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sound files come from the Desktop copy of the code -- do you know where that got it from? I don't recall seeing any comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a few comments. Please let me know if you need a second pair of eyes on the sound files that are not playing.
Adds an initial implementation of the Sound library. Contains: