Various UI fixes. Block refactoring and adding touch and color blocks.

This commit is contained in:
Sam El-Husseini
2017-10-03 02:28:44 -04:00
parent 4977358718
commit 84d80131d4
17 changed files with 165 additions and 41 deletions

View File

@ -29,14 +29,14 @@
"Sounds.Siren|block": "siren",
"Sounds.Wawawawaa|block": "wawawawaa",
"music.beat|block": "%fraction|beat",
"music.changeTempoBy|block": "change tempo by (bpm)|%value",
"music.changeTempoBy|block": "change tempo by %value|(bpm)",
"music.noteFrequency|block": "%note",
"music.playSoundUntilDone|block": "play sound %sound=music_sounds|until done",
"music.playSound|block": "play sound %sound=music_sounds",
"music.playTone|block": "play tone|at %note=device_note|for %duration=device_beat",
"music.rest|block": "rest|for %duration=device_beat",
"music.ringTone|block": "ring tone|at %note=device_note",
"music.setTempo|block": "set tempo to (bpm)|%value",
"music.setTempo|block": "set tempo to %value|(bpm)",
"music.setVolume|block": "set volume %volume",
"music.sounds|block": "%name",
"music.stopAllSounds|block": "stop all sounds",

View File

@ -67,10 +67,11 @@ static void _playTone(uint16_t frequency, uint16_t duration, uint8_t volume)
* @param frequency pitch of the tone to play in Hertz (Hz)
* @param ms tone duration in milliseconds (ms)
*/
//% help=music/play-tone weight=90
//% help=music/play-tone
//% blockId=music_play_note block="play tone|at %note=device_note|for %duration=device_beat"
//% parts="headphone" async blockGap=8
//% parts="headphone" async
//% blockNamespace=music
//% weight=76 blockGap=8
void playTone(int frequency, int ms) {
if (frequency <= 0) {
_stopSound();

View File

@ -18,10 +18,11 @@ declare namespace music {
* @param frequency pitch of the tone to play in Hertz (Hz)
* @param ms tone duration in milliseconds (ms)
*/
//% help=music/play-tone weight=90
//% help=music/play-tone
//% blockId=music_play_note block="play tone|at %note=device_note|for %duration=device_beat"
//% parts="headphone" async blockGap=8
//% blockNamespace=music shim=music::playTone
//% parts="headphone" async
//% blockNamespace=music
//% weight=76 blockGap=8 shim=music::playTone
function playTone(frequency: int32, ms: int32): void;
}