toOptionsJSON method

  1. @override
void toOptionsJSON(
  1. StringBuffer buffer
)
override

Implementation

@override
void toOptionsJSON(StringBuffer buffer) {
  super.toOptionsJSON(buffer);

  if (activeWhen != null) {
    buffer.writeAll(['"activeWhen":', activeWhen?.toJSON(), ','], '');
  }
  if (instrument != null) {
    buffer.write('"instrument":{');
    for (var item in instrument!.entries) {
      buffer.writeAll(['"', item.key, '":', jsonEncode(item.value), ','], '');
    }
    buffer.write('},');
  }
  if (mapping != null) {
    buffer.writeAll(['"mapping":', mapping?.toJSON(), ','], '');
  }
  if (midiName != null) {
    buffer.writeAll(['"midiName":', jsonEncode(midiName), ','], '');
  }
  if (pointGrouping != null) {
    buffer.writeAll(['"pointGrouping":', pointGrouping?.toJSON(), ','], '');
  }
  if (roundToMusicalNotes != null) {
    buffer.writeAll(['"roundToMusicalNotes":', roundToMusicalNotes, ','], '');
  }
  if (showPlayMarker != null) {
    buffer.writeAll(['"showPlayMarker":', showPlayMarker, ','], '');
  }
  if (type != null) {
    buffer.writeAll(['"type":', jsonEncode(type), ','], '');
  }
}