dualB / Melody

Melody offers a simple an powerful music text notation called MELO.
MIT License
14 stars 2 forks source link

Remove deprecated WString and ensure members initialised #6

Closed lglina closed 2 years ago

lglina commented 2 years ago

Melody doesn't compile under PlatformIO for the Arduino Nano Every.

A declaration/definition of the Arduino String type is not includeed in Melody.h and SequenceParser.h, and the include of WString.h in Streamer.h doesn't seem to work, likely because including WString.h is deprecated (see https://github.com/arduino/ArduinoCore-API/blob/master/api/deprecated/WString.h)

This PR includes Arduino.h where required, which provides a definition of String.

Similar to dualB/Musician/pull/3, for neatness/correctness, this PR also ensures that all member variables are initialised to sensible default values at construction time, regardless of the validity of caller arguments (i.e. in Melody, ensuring _tempo and _base_duration are always initialised even if tempo == 0).

dualB commented 2 years ago

Thank you Lauren for your contribution! I have to test those changes on some Arduino boards, just to be sure.

lglina commented 2 years ago

A pleasure! Thanks for writing and sharing your libraries - I've used them in a couple of projects so far and they're really useful :)