Block layout fixes. Fixes to screen blocks. Adding print line API.
This commit is contained in:
@ -2,8 +2,6 @@
|
||||
"Sound.buffer": "Returns the underlaying Buffer object.",
|
||||
"Sound.play": "Play sound.",
|
||||
"music": "Generation of music tones.",
|
||||
"music._soundPicker": "A sound",
|
||||
"music._soundPicker|param|sound": "the sound",
|
||||
"music.beat": "Return the duration of a beat in milliseconds (the beat fraction).",
|
||||
"music.beat|param|fraction": "the fraction of the current whole note, eg: BeatFraction.Half",
|
||||
"music.changeTempoBy": "Change the tempo up or down by some amount of beats per minute (bpm).",
|
||||
|
@ -20,7 +20,6 @@
|
||||
"Note.GSharp|block": "G#",
|
||||
"SoundOutputDestination.Pin|block": "pin",
|
||||
"SoundOutputDestination.Speaker|block": "speaker",
|
||||
"music._soundPicker|block": "%sound",
|
||||
"music.beat|block": "%fraction|beat",
|
||||
"music.changeTempoBy|block": "change tempo by %value|(bpm)",
|
||||
"music.noteFrequency|block": "%note",
|
||||
|
@ -170,7 +170,7 @@ void playTone(int frequency, int ms) {
|
||||
//% blockId=music_stop_all_sounds block="stop all sounds"
|
||||
//% parts="headphone"
|
||||
//% blockNamespace=music
|
||||
//% weight=76 blockGap=8
|
||||
//% weight=97
|
||||
void stopAllSounds() {
|
||||
if (currentSample) {
|
||||
samplePtr = currentSample->length;
|
||||
|
2
libs/music/shims.d.ts
vendored
2
libs/music/shims.d.ts
vendored
@ -32,7 +32,7 @@ declare namespace music {
|
||||
//% blockId=music_stop_all_sounds block="stop all sounds"
|
||||
//% parts="headphone"
|
||||
//% blockNamespace=music
|
||||
//% weight=76 blockGap=8 shim=music::stopAllSounds
|
||||
//% weight=97 shim=music::stopAllSounds
|
||||
function stopAllSounds(): void;
|
||||
|
||||
/** Makes a sound bound to a buffer in WAV format. */
|
||||
|
@ -264,7 +264,7 @@ namespace music {
|
||||
* @param sound the sound to play
|
||||
*/
|
||||
//% blockId=music_play_sound_effect_until_done block="play sound effect %sound|until done"
|
||||
//% weight=98
|
||||
//% weight=98 blockGap=8
|
||||
export function playSoundEffectUntilDone(sound: Sound) {
|
||||
if (!sound) return;
|
||||
sound.play();
|
||||
@ -276,7 +276,7 @@ namespace music {
|
||||
*/
|
||||
//% blockId=music_sound_picker block="%sound" shim=TD_ID
|
||||
//% weight=0 blockHidden=1
|
||||
export function _soundPicker(sound: Sound): Sound {
|
||||
export function __soundPicker(sound: Sound): Sound {
|
||||
return sound;
|
||||
}
|
||||
|
||||
@ -285,7 +285,7 @@ namespace music {
|
||||
* @param sound the sound to play
|
||||
*/
|
||||
//% blockId=music_play_sound_effect block="play sound effect %sound"
|
||||
//% weight=99
|
||||
//% weight=99 blockGap=8
|
||||
export function playSoundEffect(sound: Sound) {
|
||||
if (!sound || numSoundsPlaying >= soundsLimit) return;
|
||||
numSoundsPlaying++;
|
||||
|
Reference in New Issue
Block a user