From c040de61340300550791f1d43ef5ccf1425d4599 Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Wed, 23 Aug 2017 11:38:47 -0700 Subject: [PATCH] Fixed begin melody API so it doesn't complain about a compiler error, and uses the default value. (#515) --- libs/core/_locales/core-jsdoc-strings.json | 1 + libs/core/music.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/core/_locales/core-jsdoc-strings.json b/libs/core/_locales/core-jsdoc-strings.json index 55dd2f34..1ce40457 100644 --- a/libs/core/_locales/core-jsdoc-strings.json +++ b/libs/core/_locales/core-jsdoc-strings.json @@ -181,6 +181,7 @@ "music": "Generation of music tones.", "music.beat": "Returns the duration of a beat in milli-seconds", "music.beginMelody": "Starts playing a melody.\nNotes are expressed as a string of characters with this format: NOTE[octave][:duration]", + "music.beginMelody|param|melodyArray": "the melody array to play, eg: ['g5:1']", "music.beginMelody|param|options": "melody options, once / forever, in the foreground / background", "music.builtInMelody": "Gets the melody array of a built-in melody.", "music.changeTempoBy": "Change the tempo by the specified amount", diff --git a/libs/core/music.ts b/libs/core/music.ts index 01b8b20a..f0a16fc8 100644 --- a/libs/core/music.ts +++ b/libs/core/music.ts @@ -307,13 +307,13 @@ namespace music { /** * Starts playing a melody. * Notes are expressed as a string of characters with this format: NOTE[octave][:duration] - * @param melody the melody array to play, eg: ['g5:1'] + * @param melodyArray the melody array to play, eg: ['g5:1'] * @param options melody options, once / forever, in the foreground / background */ //% help=music/begin-melody weight=60 blockGap=8 //% blockId=device_start_melody block="start melody %melody=device_builtin_melody| repeating %options" //% parts="headphone" - export function beginMelody(melodyArray: string[], options: MelodyOptions = MelodyOptions.Once) { + export function beginMelody(melodyArray: string[], options: MelodyOptions = 1) { init(); if (currentMelody != undefined) { if (((options & MelodyOptions.OnceInBackground) == 0)