diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1c91c487..76ef9f42 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,6 +16,9 @@ env: CCACHE_DIR: /ccache FLUTTER_VERSION: '3.16.9' FLUTTER_CHANNEL: 'stable' + MELOS_VERSION: '^6.1.0' + COVERDE_VERSION: '^0.2.0+2' + COVERAGE_VERSION: '^1.8.0' jobs: build-firmware: @@ -192,7 +195,7 @@ jobs: defaults: run: working-directory: - frontend + dart steps: - uses: actions/checkout@v2 with: @@ -205,10 +208,11 @@ jobs: channel: ${{ env.FLUTTER_CHANNEL }} cache: true - - run: flutter pub get + - run: dart pub global activate melos ${{ env.MELOS_VERSION }} + - run: dart run melos bootstrap - name: Generate code - run: flutter pub run build_runner build + run: dart run melos run generate_code - name: Analyze run: flutter analyze @@ -218,7 +222,7 @@ jobs: defaults: run: working-directory: - frontend + dart steps: - uses: actions/checkout@v2 with: @@ -231,17 +235,18 @@ jobs: channel: ${{ env.FLUTTER_CHANNEL }} cache: true - - run: flutter pub get + - run: dart pub global activate melos ${{ env.MELOS_VERSION }} + - run: dart run melos bootstrap - name: Format - run: dart format -o none --set-exit-if-changed lib test + run: dart format -o none --set-exit-if-changed . flutter-test: runs-on: ubuntu-latest defaults: run: working-directory: - frontend + dart steps: - uses: actions/checkout@v2 with: @@ -254,25 +259,27 @@ jobs: channel: ${{ env.FLUTTER_CHANNEL }} cache: true - - run: flutter pub get + - run: dart pub global activate melos ${{ env.MELOS_VERSION }} + - run: dart pub global activate coverde ${{ env.COVERDE_VERSION }} + - run: dart pub global activate coverage ${{ env.COVERAGE_VERSION }} + - run: melos bootstrap - name: Generate code - run: flutter pub run build_runner build + run: melos run generate_code - name: Test - run: flutter test --coverage --exclude-tags=api + run: | + dart run melos run test + dart run melos run test-dart - name: Coverage clean-up - run: > - flutter pub run - remove_from_coverage --remove="\.g\.dart$" - --file=coverage/lcov.info + run: dart run melos run coverage - name: Coveralls uses: coverallsapp/github-action@master with: - path-to-lcov: frontend/coverage/lcov.info - base-path: frontend + path-to-lcov: dart/coverage/filtered.lcov.info + base-path: dart github-token: ${{ secrets.GITHUB_TOKEN }} parallel: true flag-name: "flutter" diff --git a/.github/workflows/strictdoc.yml b/.github/workflows/strictdoc.yml index 58052351..25ac0ebb 100644 --- a/.github/workflows/strictdoc.yml +++ b/.github/workflows/strictdoc.yml @@ -6,7 +6,7 @@ on: branches: [ master ] env: - FLUTTER_VERSION: '3.16.0' + FLUTTER_VERSION: '3.16.9' FLUTTER_CHANNEL: 'stable' jobs: @@ -54,7 +54,7 @@ jobs: defaults: run: working-directory: - frontend + dart/frontend steps: - uses: actions/checkout@v3 @@ -79,7 +79,7 @@ jobs: - uses: actions/upload-artifact@v3 with: name: frontend-docs - path: frontend/doc/api + path: dart/frontend/doc/api retention-days: 5 deploy: diff --git a/.licenserc.yaml b/.licenserc.yaml index 6e1b6ecc..ca56fe57 100644 --- a/.licenserc.yaml +++ b/.licenserc.yaml @@ -38,8 +38,8 @@ header: - '**/*.pbserver.dart' - '**/*.pb-c.c' - '**/*.pb-c.h' - - 'frontend/.dart_tool/**' - - 'frontend/linux/flutter/**' + - '**/.dart_tool/**' + - '**/linux/flutter/**' # Test support files are usually derivatives of third-party library code, # which is licensed under some other license. - 'test/support/**' diff --git a/dart/.gitignore b/dart/.gitignore new file mode 100644 index 00000000..3f92df8a --- /dev/null +++ b/dart/.gitignore @@ -0,0 +1,11 @@ +# https://dart.dev/guides/libraries/private-files +# Created by `dart pub` +.dart_tool/ + +.idea +*.iml + +# https://melos.invertase.dev/getting-started#configure-the-workspace +pubspec_overrides.yaml + +coverage diff --git a/frontend/.gitignore b/dart/frontend/.gitignore similarity index 100% rename from frontend/.gitignore rename to dart/frontend/.gitignore diff --git a/frontend/.metadata b/dart/frontend/.metadata similarity index 100% rename from frontend/.metadata rename to dart/frontend/.metadata diff --git a/frontend/.run/All tests.run.xml b/dart/frontend/.run/All tests.run.xml similarity index 100% rename from frontend/.run/All tests.run.xml rename to dart/frontend/.run/All tests.run.xml diff --git a/frontend/.run/main.dart (Debug).run.xml b/dart/frontend/.run/main.dart (Debug).run.xml similarity index 100% rename from frontend/.run/main.dart (Debug).run.xml rename to dart/frontend/.run/main.dart (Debug).run.xml diff --git a/frontend/.run/main.dart (Profile).run.xml b/dart/frontend/.run/main.dart (Profile).run.xml similarity index 100% rename from frontend/.run/main.dart (Profile).run.xml rename to dart/frontend/.run/main.dart (Profile).run.xml diff --git a/frontend/all_lint_rules.yaml b/dart/frontend/all_lint_rules.yaml similarity index 100% rename from frontend/all_lint_rules.yaml rename to dart/frontend/all_lint_rules.yaml diff --git a/frontend/analysis_options.yaml b/dart/frontend/analysis_options.yaml similarity index 100% rename from frontend/analysis_options.yaml rename to dart/frontend/analysis_options.yaml diff --git a/frontend/dart_test.yaml b/dart/frontend/dart_test.yaml similarity index 100% rename from frontend/dart_test.yaml rename to dart/frontend/dart_test.yaml diff --git a/frontend/devtools_options.yaml b/dart/frontend/devtools_options.yaml similarity index 100% rename from frontend/devtools_options.yaml rename to dart/frontend/devtools_options.yaml diff --git a/frontend/google_fonts/NotoSans-Black.ttf b/dart/frontend/google_fonts/NotoSans-Black.ttf similarity index 100% rename from frontend/google_fonts/NotoSans-Black.ttf rename to dart/frontend/google_fonts/NotoSans-Black.ttf diff --git a/frontend/google_fonts/NotoSans-BlackItalic.ttf b/dart/frontend/google_fonts/NotoSans-BlackItalic.ttf similarity index 100% rename from frontend/google_fonts/NotoSans-BlackItalic.ttf rename to dart/frontend/google_fonts/NotoSans-BlackItalic.ttf diff --git a/frontend/google_fonts/NotoSans-Bold.ttf b/dart/frontend/google_fonts/NotoSans-Bold.ttf similarity index 100% rename from frontend/google_fonts/NotoSans-Bold.ttf rename to dart/frontend/google_fonts/NotoSans-Bold.ttf diff --git a/frontend/google_fonts/NotoSans-BoldItalic.ttf b/dart/frontend/google_fonts/NotoSans-BoldItalic.ttf similarity index 100% rename from frontend/google_fonts/NotoSans-BoldItalic.ttf rename to dart/frontend/google_fonts/NotoSans-BoldItalic.ttf diff --git a/frontend/google_fonts/NotoSans-ExtraBold.ttf b/dart/frontend/google_fonts/NotoSans-ExtraBold.ttf similarity index 100% rename from frontend/google_fonts/NotoSans-ExtraBold.ttf rename to dart/frontend/google_fonts/NotoSans-ExtraBold.ttf diff --git a/frontend/google_fonts/NotoSans-ExtraBoldItalic.ttf b/dart/frontend/google_fonts/NotoSans-ExtraBoldItalic.ttf similarity index 100% rename from frontend/google_fonts/NotoSans-ExtraBoldItalic.ttf rename to dart/frontend/google_fonts/NotoSans-ExtraBoldItalic.ttf diff --git a/frontend/google_fonts/NotoSans-ExtraLight.ttf b/dart/frontend/google_fonts/NotoSans-ExtraLight.ttf similarity index 100% rename from frontend/google_fonts/NotoSans-ExtraLight.ttf rename to dart/frontend/google_fonts/NotoSans-ExtraLight.ttf diff --git a/frontend/google_fonts/NotoSans-ExtraLightItalic.ttf b/dart/frontend/google_fonts/NotoSans-ExtraLightItalic.ttf similarity index 100% rename from frontend/google_fonts/NotoSans-ExtraLightItalic.ttf rename to dart/frontend/google_fonts/NotoSans-ExtraLightItalic.ttf diff --git a/frontend/google_fonts/NotoSans-Italic.ttf b/dart/frontend/google_fonts/NotoSans-Italic.ttf similarity index 100% rename from frontend/google_fonts/NotoSans-Italic.ttf rename to dart/frontend/google_fonts/NotoSans-Italic.ttf diff --git a/frontend/google_fonts/NotoSans-Light.ttf b/dart/frontend/google_fonts/NotoSans-Light.ttf similarity index 100% rename from frontend/google_fonts/NotoSans-Light.ttf rename to dart/frontend/google_fonts/NotoSans-Light.ttf diff --git a/frontend/google_fonts/NotoSans-LightItalic.ttf b/dart/frontend/google_fonts/NotoSans-LightItalic.ttf similarity index 100% rename from frontend/google_fonts/NotoSans-LightItalic.ttf rename to dart/frontend/google_fonts/NotoSans-LightItalic.ttf diff --git a/frontend/google_fonts/NotoSans-Medium.ttf b/dart/frontend/google_fonts/NotoSans-Medium.ttf similarity index 100% rename from frontend/google_fonts/NotoSans-Medium.ttf rename to dart/frontend/google_fonts/NotoSans-Medium.ttf diff --git a/frontend/google_fonts/NotoSans-MediumItalic.ttf b/dart/frontend/google_fonts/NotoSans-MediumItalic.ttf similarity index 100% rename from frontend/google_fonts/NotoSans-MediumItalic.ttf rename to dart/frontend/google_fonts/NotoSans-MediumItalic.ttf diff --git a/frontend/google_fonts/NotoSans-Regular.ttf b/dart/frontend/google_fonts/NotoSans-Regular.ttf similarity index 100% rename from frontend/google_fonts/NotoSans-Regular.ttf rename to dart/frontend/google_fonts/NotoSans-Regular.ttf diff --git a/frontend/google_fonts/NotoSans-SemiBold.ttf b/dart/frontend/google_fonts/NotoSans-SemiBold.ttf similarity index 100% rename from frontend/google_fonts/NotoSans-SemiBold.ttf rename to dart/frontend/google_fonts/NotoSans-SemiBold.ttf diff --git a/frontend/google_fonts/NotoSans-SemiBoldItalic.ttf b/dart/frontend/google_fonts/NotoSans-SemiBoldItalic.ttf similarity index 100% rename from frontend/google_fonts/NotoSans-SemiBoldItalic.ttf rename to dart/frontend/google_fonts/NotoSans-SemiBoldItalic.ttf diff --git a/frontend/google_fonts/NotoSans-Thin.ttf b/dart/frontend/google_fonts/NotoSans-Thin.ttf similarity index 100% rename from frontend/google_fonts/NotoSans-Thin.ttf rename to dart/frontend/google_fonts/NotoSans-Thin.ttf diff --git a/frontend/google_fonts/NotoSans-ThinItalic.ttf b/dart/frontend/google_fonts/NotoSans-ThinItalic.ttf similarity index 100% rename from frontend/google_fonts/NotoSans-ThinItalic.ttf rename to dart/frontend/google_fonts/NotoSans-ThinItalic.ttf diff --git a/frontend/google_fonts/OFL.txt b/dart/frontend/google_fonts/OFL.txt similarity index 100% rename from frontend/google_fonts/OFL.txt rename to dart/frontend/google_fonts/OFL.txt diff --git a/frontend/integration_test/simple_test.dart b/dart/frontend/integration_test/simple_test.dart similarity index 98% rename from frontend/integration_test/simple_test.dart rename to dart/frontend/integration_test/simple_test.dart index 14ea0d64..9906bc56 100644 --- a/frontend/integration_test/simple_test.dart +++ b/dart/frontend/integration_test/simple_test.dart @@ -25,9 +25,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:logging/logging.dart'; import 'package:shrapnel/main.dart'; -import 'package:shrapnel/midi_mapping/model/models.dart'; +import 'package:shrapnel_common/api_data/midi_api_message.dart'; +import 'package:shrapnel_test_lib/shrapnel_test_lib.dart'; -import '../test/firmware_api_test/util.dart'; import '../test/home_page_object.dart'; import '../test/util.dart'; diff --git a/frontend/lib/amplifier.dart b/dart/frontend/lib/amplifier.dart similarity index 100% rename from frontend/lib/amplifier.dart rename to dart/frontend/lib/amplifier.dart diff --git a/frontend/lib/api/api_websocket.dart b/dart/frontend/lib/api/api_websocket.dart similarity index 65% rename from frontend/lib/api/api_websocket.dart rename to dart/frontend/lib/api/api_websocket.dart index 2e2b0dea..b020d8ac 100644 --- a/frontend/lib/api/api_websocket.dart +++ b/dart/frontend/lib/api/api_websocket.dart @@ -20,49 +20,19 @@ import 'dart:async'; import 'package:async/async.dart'; -import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:logging/logging.dart'; import 'package:rxdart/rxdart.dart'; -import '../audio_events.dart'; +import 'package:shrapnel_common/api_data/api_message.dart'; +import 'package:shrapnel_common/api_data/generated/shrapnel.pb.dart' + as shrapnel_pb; +import 'package:shrapnel_common/api_data/proto_extension.dart'; import '../core/message_transport.dart'; import '../core/stream_extensions.dart'; -import '../midi_mapping/model/models.dart'; -import '../parameter.dart'; -import '../presets/model/presets_client.dart'; -import '../presets/model/selected_preset_client.dart'; import '../robust_websocket.dart'; -import 'generated/shrapnel.pb.dart' as shrapnel_pb; -import 'proto_extension.dart'; - -part 'api_websocket.freezed.dart'; final _log = Logger('api_websocket'); -@freezed -sealed class ApiMessage with _$ApiMessage { - const factory ApiMessage.audioEvent({required AudioEventMessage message}) = - ApiMessageAudioEvent; - - const factory ApiMessage.parameterInput({ - required ParameterServiceInputMessage message, - }) = ApiMessageParameterInput; - - const factory ApiMessage.parameterOutput({ - required ParameterServiceOutputMessage message, - }) = ApiMessageParameterOutput; - - const factory ApiMessage.midiMapping({required MidiApiMessage message}) = - ApiMessageMidiMapping; - - const factory ApiMessage.presets({required PresetsMessage message}) = - ApiMessagePresets; - - const factory ApiMessage.selectedPreset({ - required SelectedPresetMessage message, - }) = ApiMessageSelectedPreset; -} - class ApiWebsocket implements ReconnectingMessageTransport { ApiWebsocket({ diff --git a/frontend/lib/audio_events.dart b/dart/frontend/lib/audio_events.dart similarity index 86% rename from frontend/lib/audio_events.dart rename to dart/frontend/lib/audio_events.dart index f4dd3ad3..9e40bb7e 100644 --- a/frontend/lib/audio_events.dart +++ b/dart/frontend/lib/audio_events.dart @@ -18,21 +18,13 @@ */ import 'package:flutter/material.dart'; -import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:logging/logging.dart'; import 'package:pausable_timer/pausable_timer.dart'; -part 'audio_events.freezed.dart'; +import 'package:shrapnel_common/api_data/audio_event_message.dart'; final _log = Logger('shrapnel.audio_events'); -@freezed -sealed class AudioEventMessage with _$AudioEventMessage { - factory AudioEventMessage.inputClipped() = AudioEventMessageInputClipped; - - factory AudioEventMessage.outputClipped() = AudioEventMessageOutputClipped; -} - class AudioClippingService extends ChangeNotifier { AudioClippingService({required Stream stream}) { _outputClippingTimer = PausableTimer( diff --git a/frontend/lib/chorus.dart b/dart/frontend/lib/chorus.dart similarity index 100% rename from frontend/lib/chorus.dart rename to dart/frontend/lib/chorus.dart diff --git a/frontend/lib/core/message_transport.dart b/dart/frontend/lib/core/message_transport.dart similarity index 100% rename from frontend/lib/core/message_transport.dart rename to dart/frontend/lib/core/message_transport.dart diff --git a/frontend/lib/core/stream_extensions.dart b/dart/frontend/lib/core/stream_extensions.dart similarity index 100% rename from frontend/lib/core/stream_extensions.dart rename to dart/frontend/lib/core/stream_extensions.dart diff --git a/frontend/lib/fake_provisioning.dart b/dart/frontend/lib/fake_provisioning.dart similarity index 100% rename from frontend/lib/fake_provisioning.dart rename to dart/frontend/lib/fake_provisioning.dart diff --git a/frontend/lib/heavy_metal.dart b/dart/frontend/lib/heavy_metal.dart similarity index 100% rename from frontend/lib/heavy_metal.dart rename to dart/frontend/lib/heavy_metal.dart diff --git a/frontend/lib/knob.dart b/dart/frontend/lib/knob.dart similarity index 100% rename from frontend/lib/knob.dart rename to dart/frontend/lib/knob.dart diff --git a/frontend/lib/knob_with_label.dart b/dart/frontend/lib/knob_with_label.dart similarity index 100% rename from frontend/lib/knob_with_label.dart rename to dart/frontend/lib/knob_with_label.dart diff --git a/frontend/lib/main.dart b/dart/frontend/lib/main.dart similarity index 99% rename from frontend/lib/main.dart rename to dart/frontend/lib/main.dart index 9ddbccbc..6baf38da 100644 --- a/frontend/lib/main.dart +++ b/dart/frontend/lib/main.dart @@ -26,6 +26,8 @@ import 'package:google_fonts/google_fonts.dart'; import 'package:logging/logging.dart'; import 'package:provider/provider.dart'; import 'package:rxdart/rxdart.dart'; +import 'package:shrapnel_common/api_data/api_message.dart'; +import 'package:shrapnel_common/api_data/parameter_message.dart'; import 'api/api_websocket.dart'; import 'audio_events.dart'; diff --git a/frontend/lib/midi_mapping/model/midi_learn.dart b/dart/frontend/lib/midi_mapping/model/midi_learn.dart similarity index 98% rename from frontend/lib/midi_mapping/model/midi_learn.dart rename to dart/frontend/lib/midi_mapping/model/midi_learn.dart index 8a45e81c..69c04f42 100644 --- a/frontend/lib/midi_mapping/model/midi_learn.dart +++ b/dart/frontend/lib/midi_mapping/model/midi_learn.dart @@ -20,10 +20,10 @@ import 'dart:async'; import 'package:logging/logging.dart'; +import 'package:shrapnel_common/api_data/midi_api_message.dart'; import 'package:state_notifier/state_notifier.dart'; import 'midi_learn_state.dart'; -import 'models.dart'; import 'service.dart'; final _log = Logger('shrapnel.midi_mapping.model.midi_learn'); diff --git a/frontend/lib/midi_mapping/model/midi_learn_state.dart b/dart/frontend/lib/midi_mapping/model/midi_learn_state.dart similarity index 94% rename from frontend/lib/midi_mapping/model/midi_learn_state.dart rename to dart/frontend/lib/midi_mapping/model/midi_learn_state.dart index 53d6195b..9792c214 100644 --- a/frontend/lib/midi_mapping/model/midi_learn_state.dart +++ b/dart/frontend/lib/midi_mapping/model/midi_learn_state.dart @@ -19,7 +19,7 @@ import 'package:freezed_annotation/freezed_annotation.dart'; -import 'models.dart'; +import 'package:shrapnel_common/api_data/midi_api_message.dart'; part 'midi_learn_state.freezed.dart'; diff --git a/frontend/lib/midi_mapping/model/service.dart b/dart/frontend/lib/midi_mapping/model/service.dart similarity index 97% rename from frontend/lib/midi_mapping/model/service.dart rename to dart/frontend/lib/midi_mapping/model/service.dart index f72e1f0f..d84ea6bb 100644 --- a/frontend/lib/midi_mapping/model/service.dart +++ b/dart/frontend/lib/midi_mapping/model/service.dart @@ -23,11 +23,12 @@ import 'dart:collection'; import 'package:flutter/material.dart'; import 'package:logging/logging.dart'; import 'package:rxdart/rxdart.dart'; +import 'package:shrapnel_common/api_data/api_message.dart'; +import 'package:shrapnel_common/api_data/midi_api_message.dart'; import '../../api/api_websocket.dart'; import '../../core/message_transport.dart'; import '../../core/stream_extensions.dart'; -import '../model/models.dart'; final _log = Logger('midi_mapping_service'); diff --git a/frontend/lib/midi_mapping/view/midi_learn.dart b/dart/frontend/lib/midi_mapping/view/midi_learn.dart similarity index 100% rename from frontend/lib/midi_mapping/view/midi_learn.dart rename to dart/frontend/lib/midi_mapping/view/midi_learn.dart diff --git a/frontend/lib/midi_mapping/view/midi_mapping.dart b/dart/frontend/lib/midi_mapping/view/midi_mapping.dart similarity index 99% rename from frontend/lib/midi_mapping/view/midi_mapping.dart rename to dart/frontend/lib/midi_mapping/view/midi_mapping.dart index d1cf404c..04b3354c 100644 --- a/frontend/lib/midi_mapping/view/midi_mapping.dart +++ b/dart/frontend/lib/midi_mapping/view/midi_mapping.dart @@ -22,9 +22,9 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import 'package:shrapnel_common/api_data/midi_api_message.dart'; import '../../parameter.dart'; import '../../presets/model/presets.dart'; -import '../model/models.dart'; import '../model/service.dart'; const _requiredValueString = 'A value must be selected'; diff --git a/frontend/lib/noise_gate.dart b/dart/frontend/lib/noise_gate.dart similarity index 100% rename from frontend/lib/noise_gate.dart rename to dart/frontend/lib/noise_gate.dart diff --git a/frontend/lib/parameter.dart b/dart/frontend/lib/parameter.dart similarity index 89% rename from frontend/lib/parameter.dart rename to dart/frontend/lib/parameter.dart index e2168185..ea4ee366 100644 --- a/frontend/lib/parameter.dart +++ b/dart/frontend/lib/parameter.dart @@ -23,6 +23,8 @@ import 'package:flutter/widgets.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:logging/logging.dart'; import 'package:rxdart/rxdart.dart'; +import 'package:shrapnel_common/api_data/api_message.dart'; +import 'package:shrapnel_common/api_data/parameter_message.dart'; import 'api/api_websocket.dart'; import 'core/message_transport.dart'; @@ -70,26 +72,6 @@ class AudioParameterDoubleModel { ValueStream get value => _controller; } -@freezed -sealed class ParameterServiceOutputMessage - with _$ParameterServiceOutputMessage { - factory ParameterServiceOutputMessage.requestInitialisation() = - ParameterServiceOutputMessageRequestInitialisation; - - factory ParameterServiceOutputMessage.parameterUpdate({ - required String id, - required double value, - }) = ParameterServiceOutputMessageParameterUpdate; -} - -@freezed -sealed class ParameterServiceInputMessage with _$ParameterServiceInputMessage { - factory ParameterServiceInputMessage.parameterUpdate({ - required String id, - required double value, - }) = ParameterServiceInputMessageParameterUpdate; -} - class ParameterTransport implements ReconnectingMessageTransport { PresetsTransport({required this.websocket}) { @@ -205,7 +157,7 @@ class PresetsClient { Future create(presets.PresetState preset) async { _transport.sink - .add(PresetsMessage.create(PresetData.fromPresetState(preset))); + .add(PresetsMessage.create(PresetDataEx.fromPresetState(preset))); } Future delete(int id) async { @@ -216,7 +168,7 @@ class PresetsClient { _transport.sink.add( PresetsMessage.update( preset.id, - PresetData.fromPresetState(preset.preset), + PresetDataEx.fromPresetState(preset.preset), ), ); } diff --git a/frontend/lib/presets/model/presets_repository.dart b/dart/frontend/lib/presets/model/presets_repository.dart similarity index 100% rename from frontend/lib/presets/model/presets_repository.dart rename to dart/frontend/lib/presets/model/presets_repository.dart diff --git a/frontend/lib/presets/model/presets_service.dart b/dart/frontend/lib/presets/model/presets_service.dart similarity index 100% rename from frontend/lib/presets/model/presets_service.dart rename to dart/frontend/lib/presets/model/presets_service.dart diff --git a/frontend/lib/presets/model/selected_preset_client.dart b/dart/frontend/lib/presets/model/selected_preset_client.dart similarity index 85% rename from frontend/lib/presets/model/selected_preset_client.dart rename to dart/frontend/lib/presets/model/selected_preset_client.dart index 26befccc..8d9911e5 100644 --- a/frontend/lib/presets/model/selected_preset_client.dart +++ b/dart/frontend/lib/presets/model/selected_preset_client.dart @@ -19,29 +19,17 @@ import 'dart:async'; -import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:logging/logging.dart'; import 'package:rxdart/rxdart.dart'; +import 'package:shrapnel_common/api_data/api_message.dart'; +import 'package:shrapnel_common/api_data/selected_preset_data.dart'; import '../../api/api_websocket.dart'; import '../../core/message_transport.dart'; import '../../core/stream_extensions.dart'; -part 'selected_preset_client.freezed.dart'; - final _log = Logger('selected_preset_client'); -@freezed -sealed class SelectedPresetMessage with _$SelectedPresetMessage { - factory SelectedPresetMessage.read() = ReadSelectedPresetMessage; - - factory SelectedPresetMessage.notify({required int selectedPreset}) = - NotifySelectedPresetMessage; - - factory SelectedPresetMessage.write({required int selectedPreset}) = - WriteSelectedPresetMessage; -} - class SelectedPresetTransport implements ReconnectingMessageTransport pollStatus(Duration timeout) async { - var keepGoing = true; - final timer = Timer(timeout, () { - _log.warning('Connection to provisioned access point timed out'); - keepGoing = false; - }); - ConnectionStatus? status; - - while (keepGoing) { - status = await getStatus(); - - if (status.isTerminal()) { - timer.cancel(); - return status; - } - await Future.delayed(const Duration(seconds: 1)); - } - - return status; - } -} diff --git a/frontend/lint.sh b/dart/frontend/lint.sh similarity index 100% rename from frontend/lint.sh rename to dart/frontend/lint.sh diff --git a/frontend/linux/.gitignore b/dart/frontend/linux/.gitignore similarity index 100% rename from frontend/linux/.gitignore rename to dart/frontend/linux/.gitignore diff --git a/frontend/linux/CMakeLists.txt b/dart/frontend/linux/CMakeLists.txt similarity index 100% rename from frontend/linux/CMakeLists.txt rename to dart/frontend/linux/CMakeLists.txt diff --git a/frontend/linux/flutter/CMakeLists.txt b/dart/frontend/linux/flutter/CMakeLists.txt similarity index 100% rename from frontend/linux/flutter/CMakeLists.txt rename to dart/frontend/linux/flutter/CMakeLists.txt diff --git a/dart/frontend/linux/flutter/generated_plugin_registrant.cc b/dart/frontend/linux/flutter/generated_plugin_registrant.cc new file mode 100644 index 00000000..e71a16d2 --- /dev/null +++ b/dart/frontend/linux/flutter/generated_plugin_registrant.cc @@ -0,0 +1,11 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#include "generated_plugin_registrant.h" + + +void fl_register_plugins(FlPluginRegistry* registry) { +} diff --git a/frontend/linux/flutter/generated_plugin_registrant.h b/dart/frontend/linux/flutter/generated_plugin_registrant.h similarity index 100% rename from frontend/linux/flutter/generated_plugin_registrant.h rename to dart/frontend/linux/flutter/generated_plugin_registrant.h diff --git a/frontend/linux/flutter/generated_plugins.cmake b/dart/frontend/linux/flutter/generated_plugins.cmake similarity index 96% rename from frontend/linux/flutter/generated_plugins.cmake rename to dart/frontend/linux/flutter/generated_plugins.cmake index ed2dd966..2e1de87a 100644 --- a/frontend/linux/flutter/generated_plugins.cmake +++ b/dart/frontend/linux/flutter/generated_plugins.cmake @@ -3,7 +3,6 @@ # list(APPEND FLUTTER_PLUGIN_LIST - flutter_libserialport ) list(APPEND FLUTTER_FFI_PLUGIN_LIST diff --git a/frontend/linux/main.cc b/dart/frontend/linux/main.cc similarity index 100% rename from frontend/linux/main.cc rename to dart/frontend/linux/main.cc diff --git a/frontend/linux/my_application.cc b/dart/frontend/linux/my_application.cc similarity index 100% rename from frontend/linux/my_application.cc rename to dart/frontend/linux/my_application.cc diff --git a/frontend/linux/my_application.h b/dart/frontend/linux/my_application.h similarity index 100% rename from frontend/linux/my_application.h rename to dart/frontend/linux/my_application.h diff --git a/frontend/pubspec.lock b/dart/frontend/pubspec.lock similarity index 97% rename from frontend/pubspec.lock rename to dart/frontend/pubspec.lock index b070e291..98e1ed10 100644 --- a/frontend/pubspec.lock +++ b/dart/frontend/pubspec.lock @@ -236,14 +236,6 @@ packages: description: flutter source: sdk version: "0.0.0" - flutter_libserialport: - dependency: "direct dev" - description: - name: flutter_libserialport - sha256: "20c320dcde8592a16f9badc0cacad61b1fb283dbec647b6ebfc1020f8274c67b" - url: "https://pub.dev" - source: hosted - version: "0.4.0" flutter_state_notifier: dependency: "direct main" description: @@ -269,10 +261,10 @@ packages: dependency: "direct main" description: name: freezed_annotation - sha256: c3fd9336eb55a38cc1bbd79ab17573113a8deccd0ecbbf926cca3c62803b5c2d + sha256: c2e2d632dd9b8a2b7751117abcfc2b4888ecfe181bd9fca7170d9ef02e595fe2 url: "https://pub.dev" source: hosted - version: "2.4.1" + version: "2.4.4" frontend_server_client: dependency: transitive description: @@ -364,7 +356,7 @@ packages: source: hosted version: "4.8.1" libserialport: - dependency: "direct dev" + dependency: transitive description: name: libserialport sha256: "392e1592def65282429832ec66fa25e9e163d3b37716b97691482e2406720727" @@ -571,14 +563,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.3" - remove_from_coverage: - dependency: "direct main" - description: - name: remove_from_coverage - sha256: "5b5745f6b692c80e3d7903fb83f9e789dc4575e6db5443a1b391ca25c10bad06" - url: "https://pub.dev" - source: hosted - version: "2.0.0" rxdart: dependency: "direct main" description: @@ -603,6 +587,20 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.4" + shrapnel_common: + dependency: "direct main" + description: + path: "../shrapnel_common" + relative: true + source: path + version: "1.0.0" + shrapnel_test_lib: + dependency: "direct dev" + description: + path: "../shrapnel_test_lib" + relative: true + source: path + version: "1.0.0" sky_engine: dependency: transitive description: flutter diff --git a/frontend/pubspec.yaml b/dart/frontend/pubspec.yaml similarity index 88% rename from frontend/pubspec.yaml rename to dart/frontend/pubspec.yaml index 4b4f2279..e6fd8eaf 100644 --- a/frontend/pubspec.yaml +++ b/dart/frontend/pubspec.yaml @@ -24,22 +24,23 @@ dependencies: pausable_timer: ^3.1.0+3 protobuf: ^3.1.0 provider: ^6.0.0 - remove_from_coverage: ^2.0.0 rxdart: ^0.27.7 + shrapnel_common: + path: ../shrapnel_common state_notifier: ^1.0.0 vector_math: ^2.0.0 web_socket_channel: ^2.1.0 dev_dependencies: build_runner: ^2.1.7 - flutter_libserialport: ^0.4.0 flutter_test: sdk: flutter freezed: ^2.2.1 integration_test: sdk: flutter - libserialport: ^0.3.0+1 mockito: ^5.1.0 + shrapnel_test_lib: + path: ../shrapnel_test_lib flutter: uses-material-design: true diff --git a/frontend/run_api_test.sh b/dart/frontend/run_api_test.sh similarity index 100% rename from frontend/run_api_test.sh rename to dart/frontend/run_api_test.sh diff --git a/frontend/run_integration_test.sh b/dart/frontend/run_integration_test.sh similarity index 100% rename from frontend/run_integration_test.sh rename to dart/frontend/run_integration_test.sh diff --git a/frontend/test/all_test.dart b/dart/frontend/test/all_test.dart similarity index 97% rename from frontend/test/all_test.dart rename to dart/frontend/test/all_test.dart index 646aa980..0fa9fdb4 100644 --- a/frontend/test/all_test.dart +++ b/dart/frontend/test/all_test.dart @@ -33,7 +33,6 @@ import 'package:shrapnel/knob_with_label.dart'; import 'package:shrapnel/main.dart'; import 'package:shrapnel/midi_mapping/model/midi_learn.dart'; import 'package:shrapnel/midi_mapping/model/midi_learn_state.dart'; -import 'package:shrapnel/midi_mapping/model/models.dart'; import 'package:shrapnel/midi_mapping/model/service.dart'; import 'package:shrapnel/midi_mapping/view/midi_learn.dart'; import 'package:shrapnel/midi_mapping/view/midi_mapping.dart'; diff --git a/frontend/test/core/button_page_object.dart b/dart/frontend/test/core/button_page_object.dart similarity index 100% rename from frontend/test/core/button_page_object.dart rename to dart/frontend/test/core/button_page_object.dart diff --git a/frontend/test/firmware_api_test/firmware_api_test.dart b/dart/frontend/test/firmware_api_test/firmware_api_test.dart similarity index 98% rename from frontend/test/firmware_api_test/firmware_api_test.dart rename to dart/frontend/test/firmware_api_test/firmware_api_test.dart index 2b8e14fc..09a3f86c 100644 --- a/frontend/test/firmware_api_test/firmware_api_test.dart +++ b/dart/frontend/test/firmware_api_test/firmware_api_test.dart @@ -31,7 +31,7 @@ import 'package:shrapnel/main.dart'; import 'package:shrapnel/parameter.dart'; import 'package:shrapnel/robust_websocket.dart'; -import 'util.dart'; +import 'package:shrapnel_test_lib/shrapnel_test_lib.dart'; // audio parameter basic test // factory reset diff --git a/frontend/test/home_page_object.dart b/dart/frontend/test/home_page_object.dart similarity index 100% rename from frontend/test/home_page_object.dart rename to dart/frontend/test/home_page_object.dart diff --git a/frontend/test/midi_mapping/midi_mapping_page_object.dart b/dart/frontend/test/midi_mapping/midi_mapping_page_object.dart similarity index 98% rename from frontend/test/midi_mapping/midi_mapping_page_object.dart rename to dart/frontend/test/midi_mapping/midi_mapping_page_object.dart index 18de8af2..144df003 100644 --- a/frontend/test/midi_mapping/midi_mapping_page_object.dart +++ b/dart/frontend/test/midi_mapping/midi_mapping_page_object.dart @@ -19,8 +19,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:shrapnel/midi_mapping/model/models.dart'; import 'package:shrapnel/midi_mapping/view/midi_mapping.dart'; +import 'package:shrapnel_common/api_data/midi_api_message.dart'; class MidiMappingPageObject { const MidiMappingPageObject(this.tester); diff --git a/frontend/test/midi_mapping/model/service_test.dart b/dart/frontend/test/midi_mapping/model/service_test.dart similarity index 98% rename from frontend/test/midi_mapping/model/service_test.dart rename to dart/frontend/test/midi_mapping/model/service_test.dart index e77c5250..989372f8 100644 --- a/frontend/test/midi_mapping/model/service_test.dart +++ b/dart/frontend/test/midi_mapping/model/service_test.dart @@ -24,8 +24,9 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; import 'package:shrapnel/core/message_transport.dart'; -import 'package:shrapnel/midi_mapping/model/models.dart'; import 'package:shrapnel/midi_mapping/model/service.dart'; +import 'package:shrapnel_common/api_data/midi_api_message.dart'; + import 'service_test.mocks.dart'; @GenerateMocks([ReconnectingMessageTransport]) diff --git a/frontend/test/midi_mapping/view/midi_mapping_test.dart b/dart/frontend/test/midi_mapping/view/midi_mapping_test.dart similarity index 99% rename from frontend/test/midi_mapping/view/midi_mapping_test.dart rename to dart/frontend/test/midi_mapping/view/midi_mapping_test.dart index 88207655..38d28df7 100644 --- a/frontend/test/midi_mapping/view/midi_mapping_test.dart +++ b/dart/frontend/test/midi_mapping/view/midi_mapping_test.dart @@ -26,8 +26,9 @@ import 'package:mockito/mockito.dart'; import 'package:shrapnel/api/api_websocket.dart'; import 'package:shrapnel/audio_events.dart'; import 'package:shrapnel/main.dart'; -import 'package:shrapnel/midi_mapping/model/models.dart'; import 'package:shrapnel/robust_websocket.dart'; +import 'package:shrapnel_common/api_data/api_message.dart'; +import 'package:shrapnel_common/api_data/midi_api_message.dart'; import '../../home_page_object.dart'; import 'midi_mapping_test.mocks.dart'; diff --git a/frontend/test/parameter_test.dart b/dart/frontend/test/parameter_test.dart similarity index 100% rename from frontend/test/parameter_test.dart rename to dart/frontend/test/parameter_test.dart diff --git a/frontend/test/presets/presets_page_object.dart b/dart/frontend/test/presets/presets_page_object.dart similarity index 100% rename from frontend/test/presets/presets_page_object.dart rename to dart/frontend/test/presets/presets_page_object.dart diff --git a/frontend/test/presets/presets_test.dart b/dart/frontend/test/presets/presets_test.dart similarity index 98% rename from frontend/test/presets/presets_test.dart rename to dart/frontend/test/presets/presets_test.dart index c6a7f3ed..3bbb24ee 100644 --- a/frontend/test/presets/presets_test.dart +++ b/dart/frontend/test/presets/presets_test.dart @@ -33,6 +33,8 @@ import 'package:shrapnel/parameter.dart'; import 'package:shrapnel/presets/model/presets.dart'; import 'package:shrapnel/presets/model/presets_service.dart'; import 'package:shrapnel/robust_websocket.dart'; +import 'package:shrapnel_common/api_data/api_message.dart'; +import 'package:shrapnel_common/api_data/parameter_message.dart'; import '../home_page_object.dart'; import 'presets_test.mocks.dart'; diff --git a/frontend/test/util.dart b/dart/frontend/test/util.dart similarity index 100% rename from frontend/test/util.dart rename to dart/frontend/test/util.dart diff --git a/frontend/test/wifi_provisioning_page_object.dart b/dart/frontend/test/wifi_provisioning_page_object.dart similarity index 100% rename from frontend/test/wifi_provisioning_page_object.dart rename to dart/frontend/test/wifi_provisioning_page_object.dart diff --git a/frontend/test/wifi_provisioning_test.dart b/dart/frontend/test/wifi_provisioning_test.dart similarity index 100% rename from frontend/test/wifi_provisioning_test.dart rename to dart/frontend/test/wifi_provisioning_test.dart diff --git a/frontend/web/favicon.png b/dart/frontend/web/favicon.png similarity index 100% rename from frontend/web/favicon.png rename to dart/frontend/web/favicon.png diff --git a/frontend/web/icons/Icon-192.png b/dart/frontend/web/icons/Icon-192.png similarity index 100% rename from frontend/web/icons/Icon-192.png rename to dart/frontend/web/icons/Icon-192.png diff --git a/frontend/web/icons/Icon-512.png b/dart/frontend/web/icons/Icon-512.png similarity index 100% rename from frontend/web/icons/Icon-512.png rename to dart/frontend/web/icons/Icon-512.png diff --git a/frontend/web/icons/Icon-maskable-192.png b/dart/frontend/web/icons/Icon-maskable-192.png similarity index 100% rename from frontend/web/icons/Icon-maskable-192.png rename to dart/frontend/web/icons/Icon-maskable-192.png diff --git a/frontend/web/icons/Icon-maskable-512.png b/dart/frontend/web/icons/Icon-maskable-512.png similarity index 100% rename from frontend/web/icons/Icon-maskable-512.png rename to dart/frontend/web/icons/Icon-maskable-512.png diff --git a/frontend/web/index.html b/dart/frontend/web/index.html similarity index 100% rename from frontend/web/index.html rename to dart/frontend/web/index.html diff --git a/frontend/web/manifest.json b/dart/frontend/web/manifest.json similarity index 100% rename from frontend/web/manifest.json rename to dart/frontend/web/manifest.json diff --git a/dart/melos.yaml b/dart/melos.yaml new file mode 100644 index 00000000..f92c904d --- /dev/null +++ b/dart/melos.yaml @@ -0,0 +1,23 @@ +name: shrapnel + +packages: + - frontend + - shrapnel_common + - shrapnel_test_lib + - shrapnel_test_tool + +scripts: + generate_code: + run: melos exec --depends-on=build_runner -- "dart run build_runner build -d" + + test: + run: melos exec -c 1 --depends-on=flutter_test -- "flutter test --coverage --exclude-tags=api" + + test-dart: + run: melos exec -c 1 --depends-on=test -- "dart run coverage:test_with_coverage" + + coverage: + description: Merge all packages coverage trace files ignoring data related to generated files. + run: > + coverde rm MELOS_ROOT_PATH/coverage/filtered.lcov.info && + melos exec --file-exists=coverage/lcov.info -- "coverde filter --input ./coverage/lcov.info --output MELOS_ROOT_PATH/coverage/filtered.lcov.info --paths-parent MELOS_PACKAGE_PATH --filters '\.g\.dart'" \ No newline at end of file diff --git a/dart/pubspec.lock b/dart/pubspec.lock new file mode 100644 index 00000000..1d2ace9c --- /dev/null +++ b/dart/pubspec.lock @@ -0,0 +1,341 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + ansi_styles: + dependency: transitive + description: + name: ansi_styles + sha256: "9c656cc12b3c27b17dd982b2cc5c0cfdfbdabd7bc8f3ae5e8542d9867b47ce8a" + url: "https://pub.dev" + source: hosted + version: "0.3.2+1" + args: + dependency: transitive + description: + name: args + sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a" + url: "https://pub.dev" + source: hosted + version: "2.5.0" + async: + dependency: transitive + description: + name: async + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" + source: hosted + version: "2.11.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + charcode: + dependency: transitive + description: + name: charcode + sha256: fb98c0f6d12c920a02ee2d998da788bca066ca5f148492b7085ee23372b12306 + url: "https://pub.dev" + source: hosted + version: "1.3.1" + cli_launcher: + dependency: transitive + description: + name: cli_launcher + sha256: "5e7e0282b79e8642edd6510ee468ae2976d847a0a29b3916e85f5fa1bfe24005" + url: "https://pub.dev" + source: hosted + version: "0.3.1" + cli_util: + dependency: transitive + description: + name: cli_util + sha256: c05b7406fdabc7a49a3929d4af76bcaccbbffcbcdcf185b082e1ae07da323d19 + url: "https://pub.dev" + source: hosted + version: "0.4.1" + clock: + dependency: transitive + description: + name: clock + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" + source: hosted + version: "1.1.1" + collection: + dependency: transitive + description: + name: collection + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + url: "https://pub.dev" + source: hosted + version: "1.18.0" + conventional_commit: + dependency: transitive + description: + name: conventional_commit + sha256: dec15ad1118f029c618651a4359eb9135d8b88f761aa24e4016d061cd45948f2 + url: "https://pub.dev" + source: hosted + version: "0.6.0+1" + file: + dependency: transitive + description: + name: file + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + url: "https://pub.dev" + source: hosted + version: "7.0.0" + glob: + dependency: transitive + description: + name: glob + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + graphs: + dependency: transitive + description: + name: graphs + sha256: aedc5a15e78fc65a6e23bcd927f24c64dd995062bcd1ca6eda65a3cff92a4d19 + url: "https://pub.dev" + source: hosted + version: "2.3.1" + http: + dependency: transitive + description: + name: http + sha256: a2bbf9d017fcced29139daa8ed2bba4ece450ab222871df93ca9eec6f80c34ba + url: "https://pub.dev" + source: hosted + version: "1.2.0" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" + source: hosted + version: "4.0.2" + intl: + dependency: transitive + description: + name: intl + sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf + url: "https://pub.dev" + source: hosted + version: "0.19.0" + io: + dependency: transitive + description: + name: io + sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" + url: "https://pub.dev" + source: hosted + version: "1.0.4" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" + url: "https://pub.dev" + source: hosted + version: "4.9.0" + matcher: + dependency: transitive + description: + name: matcher + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + url: "https://pub.dev" + source: hosted + version: "0.12.16+1" + melos: + dependency: "direct dev" + description: + name: melos + sha256: a3f06ed871e0348cb99909ad5ddf5f8b53cc61d894c302b5417d2db1ee7ec381 + url: "https://pub.dev" + source: hosted + version: "6.1.0" + meta: + dependency: transitive + description: + name: meta + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 + url: "https://pub.dev" + source: hosted + version: "1.15.0" + mustache_template: + dependency: transitive + description: + name: mustache_template + sha256: a46e26f91445bfb0b60519be280555b06792460b27b19e2b19ad5b9740df5d1c + url: "https://pub.dev" + source: hosted + version: "2.0.0" + path: + dependency: transitive + description: + name: path + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + url: "https://pub.dev" + source: hosted + version: "1.9.0" + platform: + dependency: transitive + description: + name: platform + sha256: "9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65" + url: "https://pub.dev" + source: hosted + version: "3.1.5" + pool: + dependency: transitive + description: + name: pool + sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + url: "https://pub.dev" + source: hosted + version: "1.5.1" + process: + dependency: transitive + description: + name: process + sha256: "21e54fd2faf1b5bdd5102afd25012184a6793927648ea81eea80552ac9405b32" + url: "https://pub.dev" + source: hosted + version: "5.0.2" + prompts: + dependency: transitive + description: + name: prompts + sha256: "3773b845e85a849f01e793c4fc18a45d52d7783b4cb6c0569fad19f9d0a774a1" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + pub_updater: + dependency: transitive + description: + name: pub_updater + sha256: "54e8dc865349059ebe7f163d6acce7c89eb958b8047e6d6e80ce93b13d7c9e60" + url: "https://pub.dev" + source: hosted + version: "0.4.0" + pubspec: + dependency: transitive + description: + name: pubspec + sha256: f534a50a2b4d48dc3bc0ec147c8bd7c304280fff23b153f3f11803c4d49d927e + url: "https://pub.dev" + source: hosted + version: "2.3.0" + quiver: + dependency: transitive + description: + name: quiver + sha256: b1c1ac5ce6688d77f65f3375a9abb9319b3cb32486bdc7a1e0fdf004d7ba4e47 + url: "https://pub.dev" + source: hosted + version: "3.2.1" + source_span: + dependency: transitive + description: + name: source_span + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" + source: hosted + version: "1.10.0" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + url: "https://pub.dev" + source: hosted + version: "1.11.1" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.dev" + source: hosted + version: "2.1.2" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + test_api: + dependency: transitive + description: + name: test_api + sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" + url: "https://pub.dev" + source: hosted + version: "0.7.2" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" + source: hosted + version: "1.3.2" + uri: + dependency: transitive + description: + name: uri + sha256: "889eea21e953187c6099802b7b4cf5219ba8f3518f604a1033064d45b1b8268a" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + web: + dependency: transitive + description: + name: web + sha256: "4188706108906f002b3a293509234588823c8c979dc83304e229ff400c996b05" + url: "https://pub.dev" + source: hosted + version: "0.4.2" + yaml: + dependency: transitive + description: + name: yaml + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + url: "https://pub.dev" + source: hosted + version: "3.1.2" + yaml_edit: + dependency: transitive + description: + name: yaml_edit + sha256: e9c1a3543d2da0db3e90270dbb1e4eebc985ee5e3ffe468d83224472b2194a5f + url: "https://pub.dev" + source: hosted + version: "2.2.1" +sdks: + dart: ">=3.2.0 <4.0.0" diff --git a/dart/pubspec.yaml b/dart/pubspec.yaml new file mode 100644 index 00000000..e7aefd14 --- /dev/null +++ b/dart/pubspec.yaml @@ -0,0 +1,6 @@ +name: shrapnel + +environment: + sdk: '>=3.0.0 <4.0.0' +dev_dependencies: + melos: ^6.1.0 diff --git a/dart/shrapnel_common/.gitignore b/dart/shrapnel_common/.gitignore new file mode 100644 index 00000000..9daf4fef --- /dev/null +++ b/dart/shrapnel_common/.gitignore @@ -0,0 +1,11 @@ +# https://dart.dev/guides/libraries/private-files +# Created by `dart pub` +.dart_tool/ + +# Avoid committing pubspec.lock for library packages; see +# https://dart.dev/guides/libraries/private-files#pubspeclock. +pubspec.lock + +*.g.dart +*.mocks.dart +*.freezed.dart diff --git a/dart/shrapnel_common/CHANGELOG.md b/dart/shrapnel_common/CHANGELOG.md new file mode 100644 index 00000000..effe43c8 --- /dev/null +++ b/dart/shrapnel_common/CHANGELOG.md @@ -0,0 +1,3 @@ +## 1.0.0 + +- Initial version. diff --git a/dart/shrapnel_common/README.md b/dart/shrapnel_common/README.md new file mode 100644 index 00000000..8b55e735 --- /dev/null +++ b/dart/shrapnel_common/README.md @@ -0,0 +1,39 @@ + + +TODO: Put a short description of the package here that helps potential users +know whether this package might be useful for them. + +## Features + +TODO: List what your package can do. Maybe include images, gifs, or videos. + +## Getting started + +TODO: List prerequisites and provide or point to information on how to +start using the package. + +## Usage + +TODO: Include short and useful examples for package users. Add longer examples +to `/example` folder. + +```dart +const like = 'sample'; +``` + +## Additional information + +TODO: Tell users more about the package: where to find more information, how to +contribute to the package, how to file issues, what response they can expect +from the package authors, and more. diff --git a/dart/shrapnel_common/analysis_options.yaml b/dart/shrapnel_common/analysis_options.yaml new file mode 100644 index 00000000..dee8927a --- /dev/null +++ b/dart/shrapnel_common/analysis_options.yaml @@ -0,0 +1,30 @@ +# This file configures the static analysis results for your project (errors, +# warnings, and lints). +# +# This enables the 'recommended' set of lints from `package:lints`. +# This set helps identify many issues that may lead to problems when running +# or consuming Dart code, and enforces writing Dart using a single, idiomatic +# style and format. +# +# If you want a smaller set of lints you can change this to specify +# 'package:lints/core.yaml'. These are just the most critical lints +# (the recommended set includes the core lints). +# The core lints are also what is used by pub.dev for scoring packages. + +include: package:lints/recommended.yaml + +# Uncomment the following section to specify additional rules. + +# linter: +# rules: +# - camel_case_types + +# analyzer: +# exclude: +# - path/to/excluded/files/** + +# For more information about the core and recommended set of lints, see +# https://dart.dev/go/core-lints + +# For additional information about configuring this file, see +# https://dart.dev/guides/language/analysis-options diff --git a/dart/shrapnel_common/lib/api_data/api_message.dart b/dart/shrapnel_common/lib/api_data/api_message.dart new file mode 100644 index 00000000..68543885 --- /dev/null +++ b/dart/shrapnel_common/lib/api_data/api_message.dart @@ -0,0 +1,52 @@ +/* + * Copyright 2022 Barabas Raffai + * + * This file is part of ShrapnelDSP. + * + * ShrapnelDSP is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free + * Software Foundation, either version 3 of the License, or (at your option) + * any later version. + * + * ShrapnelDSP is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * ShrapnelDSP. If not, see . + */ + +import 'package:freezed_annotation/freezed_annotation.dart'; + +import 'audio_event_message.dart'; +import 'midi_api_message.dart'; +import 'parameter_message.dart'; +import 'presets_message.dart'; +import 'selected_preset_data.dart'; + +part 'api_message.freezed.dart'; + +@freezed +sealed class ApiMessage with _$ApiMessage { + const factory ApiMessage.audioEvent({required AudioEventMessage message}) = + ApiMessageAudioEvent; + + const factory ApiMessage.parameterInput({ + required ParameterServiceInputMessage message, + }) = ApiMessageParameterInput; + + const factory ApiMessage.parameterOutput({ + required ParameterServiceOutputMessage message, + }) = ApiMessageParameterOutput; + + const factory ApiMessage.midiMapping({required MidiApiMessage message}) = + ApiMessageMidiMapping; + + const factory ApiMessage.presets({required PresetsMessage message}) = + ApiMessagePresets; + + const factory ApiMessage.selectedPreset({ + required SelectedPresetMessage message, + }) = ApiMessageSelectedPreset; +} diff --git a/dart/shrapnel_common/lib/api_data/audio_event_message.dart b/dart/shrapnel_common/lib/api_data/audio_event_message.dart new file mode 100644 index 00000000..6c50a223 --- /dev/null +++ b/dart/shrapnel_common/lib/api_data/audio_event_message.dart @@ -0,0 +1,29 @@ +/* + * Copyright 2022 Barabas Raffai + * + * This file is part of ShrapnelDSP. + * + * ShrapnelDSP is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free + * Software Foundation, either version 3 of the License, or (at your option) + * any later version. + * + * ShrapnelDSP is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * ShrapnelDSP. If not, see . + */ + +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'audio_event_message.freezed.dart'; + +@freezed +sealed class AudioEventMessage with _$AudioEventMessage { + factory AudioEventMessage.inputClipped() = AudioEventMessageInputClipped; + + factory AudioEventMessage.outputClipped() = AudioEventMessageOutputClipped; +} diff --git a/frontend/lib/api/generate.sh b/dart/shrapnel_common/lib/api_data/generate.sh similarity index 80% rename from frontend/lib/api/generate.sh rename to dart/shrapnel_common/lib/api_data/generate.sh index 00908212..6b63d5c2 100644 --- a/frontend/lib/api/generate.sh +++ b/dart/shrapnel_common/lib/api_data/generate.sh @@ -3,7 +3,7 @@ set -eo pipefail proto_dir=$(pwd) -cd ../../../proto +cd ../../../../proto protoc --dart_out="$proto_dir/generated" \ audio_events.proto \ cmd_handling.proto \ @@ -11,3 +11,4 @@ protoc --dart_out="$proto_dir/generated" \ presets.proto \ selected_preset.proto \ shrapnel.proto +dart format "$proto_dir/generated" \ No newline at end of file diff --git a/frontend/lib/api/generated/analysis_options.yaml b/dart/shrapnel_common/lib/api_data/generated/analysis_options.yaml similarity index 100% rename from frontend/lib/api/generated/analysis_options.yaml rename to dart/shrapnel_common/lib/api_data/generated/analysis_options.yaml diff --git a/frontend/lib/api/generated/audio_events.pb.dart b/dart/shrapnel_common/lib/api_data/generated/audio_events.pb.dart similarity index 100% rename from frontend/lib/api/generated/audio_events.pb.dart rename to dart/shrapnel_common/lib/api_data/generated/audio_events.pb.dart diff --git a/frontend/lib/api/generated/audio_events.pbenum.dart b/dart/shrapnel_common/lib/api_data/generated/audio_events.pbenum.dart similarity index 100% rename from frontend/lib/api/generated/audio_events.pbenum.dart rename to dart/shrapnel_common/lib/api_data/generated/audio_events.pbenum.dart diff --git a/frontend/lib/api/generated/audio_events.pbjson.dart b/dart/shrapnel_common/lib/api_data/generated/audio_events.pbjson.dart similarity index 100% rename from frontend/lib/api/generated/audio_events.pbjson.dart rename to dart/shrapnel_common/lib/api_data/generated/audio_events.pbjson.dart diff --git a/frontend/lib/api/generated/audio_events.pbserver.dart b/dart/shrapnel_common/lib/api_data/generated/audio_events.pbserver.dart similarity index 100% rename from frontend/lib/api/generated/audio_events.pbserver.dart rename to dart/shrapnel_common/lib/api_data/generated/audio_events.pbserver.dart diff --git a/frontend/lib/api/generated/cmd_handling.pb.dart b/dart/shrapnel_common/lib/api_data/generated/cmd_handling.pb.dart similarity index 100% rename from frontend/lib/api/generated/cmd_handling.pb.dart rename to dart/shrapnel_common/lib/api_data/generated/cmd_handling.pb.dart diff --git a/frontend/lib/api/generated/cmd_handling.pbenum.dart b/dart/shrapnel_common/lib/api_data/generated/cmd_handling.pbenum.dart similarity index 100% rename from frontend/lib/api/generated/cmd_handling.pbenum.dart rename to dart/shrapnel_common/lib/api_data/generated/cmd_handling.pbenum.dart diff --git a/frontend/lib/api/generated/cmd_handling.pbjson.dart b/dart/shrapnel_common/lib/api_data/generated/cmd_handling.pbjson.dart similarity index 100% rename from frontend/lib/api/generated/cmd_handling.pbjson.dart rename to dart/shrapnel_common/lib/api_data/generated/cmd_handling.pbjson.dart diff --git a/frontend/lib/api/generated/cmd_handling.pbserver.dart b/dart/shrapnel_common/lib/api_data/generated/cmd_handling.pbserver.dart similarity index 100% rename from frontend/lib/api/generated/cmd_handling.pbserver.dart rename to dart/shrapnel_common/lib/api_data/generated/cmd_handling.pbserver.dart diff --git a/frontend/lib/api/generated/midi_mapping.pb.dart b/dart/shrapnel_common/lib/api_data/generated/midi_mapping.pb.dart similarity index 100% rename from frontend/lib/api/generated/midi_mapping.pb.dart rename to dart/shrapnel_common/lib/api_data/generated/midi_mapping.pb.dart diff --git a/frontend/lib/api/generated/midi_mapping.pbenum.dart b/dart/shrapnel_common/lib/api_data/generated/midi_mapping.pbenum.dart similarity index 100% rename from frontend/lib/api/generated/midi_mapping.pbenum.dart rename to dart/shrapnel_common/lib/api_data/generated/midi_mapping.pbenum.dart diff --git a/frontend/lib/api/generated/midi_mapping.pbjson.dart b/dart/shrapnel_common/lib/api_data/generated/midi_mapping.pbjson.dart similarity index 100% rename from frontend/lib/api/generated/midi_mapping.pbjson.dart rename to dart/shrapnel_common/lib/api_data/generated/midi_mapping.pbjson.dart diff --git a/frontend/lib/api/generated/midi_mapping.pbserver.dart b/dart/shrapnel_common/lib/api_data/generated/midi_mapping.pbserver.dart similarity index 100% rename from frontend/lib/api/generated/midi_mapping.pbserver.dart rename to dart/shrapnel_common/lib/api_data/generated/midi_mapping.pbserver.dart diff --git a/frontend/lib/api/generated/presets.pb.dart b/dart/shrapnel_common/lib/api_data/generated/presets.pb.dart similarity index 100% rename from frontend/lib/api/generated/presets.pb.dart rename to dart/shrapnel_common/lib/api_data/generated/presets.pb.dart diff --git a/frontend/lib/api/generated/presets.pbenum.dart b/dart/shrapnel_common/lib/api_data/generated/presets.pbenum.dart similarity index 100% rename from frontend/lib/api/generated/presets.pbenum.dart rename to dart/shrapnel_common/lib/api_data/generated/presets.pbenum.dart diff --git a/frontend/lib/api/generated/presets.pbjson.dart b/dart/shrapnel_common/lib/api_data/generated/presets.pbjson.dart similarity index 100% rename from frontend/lib/api/generated/presets.pbjson.dart rename to dart/shrapnel_common/lib/api_data/generated/presets.pbjson.dart diff --git a/frontend/lib/api/generated/presets.pbserver.dart b/dart/shrapnel_common/lib/api_data/generated/presets.pbserver.dart similarity index 100% rename from frontend/lib/api/generated/presets.pbserver.dart rename to dart/shrapnel_common/lib/api_data/generated/presets.pbserver.dart diff --git a/frontend/lib/api/generated/selected_preset.pb.dart b/dart/shrapnel_common/lib/api_data/generated/selected_preset.pb.dart similarity index 100% rename from frontend/lib/api/generated/selected_preset.pb.dart rename to dart/shrapnel_common/lib/api_data/generated/selected_preset.pb.dart diff --git a/frontend/lib/api/generated/selected_preset.pbenum.dart b/dart/shrapnel_common/lib/api_data/generated/selected_preset.pbenum.dart similarity index 100% rename from frontend/lib/api/generated/selected_preset.pbenum.dart rename to dart/shrapnel_common/lib/api_data/generated/selected_preset.pbenum.dart diff --git a/frontend/lib/api/generated/selected_preset.pbjson.dart b/dart/shrapnel_common/lib/api_data/generated/selected_preset.pbjson.dart similarity index 100% rename from frontend/lib/api/generated/selected_preset.pbjson.dart rename to dart/shrapnel_common/lib/api_data/generated/selected_preset.pbjson.dart diff --git a/frontend/lib/api/generated/selected_preset.pbserver.dart b/dart/shrapnel_common/lib/api_data/generated/selected_preset.pbserver.dart similarity index 100% rename from frontend/lib/api/generated/selected_preset.pbserver.dart rename to dart/shrapnel_common/lib/api_data/generated/selected_preset.pbserver.dart diff --git a/frontend/lib/api/generated/shrapnel.pb.dart b/dart/shrapnel_common/lib/api_data/generated/shrapnel.pb.dart similarity index 100% rename from frontend/lib/api/generated/shrapnel.pb.dart rename to dart/shrapnel_common/lib/api_data/generated/shrapnel.pb.dart diff --git a/frontend/lib/api/generated/shrapnel.pbenum.dart b/dart/shrapnel_common/lib/api_data/generated/shrapnel.pbenum.dart similarity index 100% rename from frontend/lib/api/generated/shrapnel.pbenum.dart rename to dart/shrapnel_common/lib/api_data/generated/shrapnel.pbenum.dart diff --git a/frontend/lib/api/generated/shrapnel.pbjson.dart b/dart/shrapnel_common/lib/api_data/generated/shrapnel.pbjson.dart similarity index 100% rename from frontend/lib/api/generated/shrapnel.pbjson.dart rename to dart/shrapnel_common/lib/api_data/generated/shrapnel.pbjson.dart diff --git a/frontend/lib/api/generated/shrapnel.pbserver.dart b/dart/shrapnel_common/lib/api_data/generated/shrapnel.pbserver.dart similarity index 100% rename from frontend/lib/api/generated/shrapnel.pbserver.dart rename to dart/shrapnel_common/lib/api_data/generated/shrapnel.pbserver.dart diff --git a/frontend/lib/midi_mapping/model/models.dart b/dart/shrapnel_common/lib/api_data/midi_api_message.dart similarity index 98% rename from frontend/lib/midi_mapping/model/models.dart rename to dart/shrapnel_common/lib/api_data/midi_api_message.dart index 13a94614..8aafcb85 100644 --- a/frontend/lib/midi_mapping/model/models.dart +++ b/dart/shrapnel_common/lib/api_data/midi_api_message.dart @@ -19,7 +19,7 @@ import 'package:freezed_annotation/freezed_annotation.dart'; -part 'models.freezed.dart'; +part 'midi_api_message.freezed.dart'; typedef MidiMappingId = int; diff --git a/dart/shrapnel_common/lib/api_data/parameter_message.dart b/dart/shrapnel_common/lib/api_data/parameter_message.dart new file mode 100644 index 00000000..ff1fa209 --- /dev/null +++ b/dart/shrapnel_common/lib/api_data/parameter_message.dart @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Barabas Raffai + * + * This file is part of ShrapnelDSP. + * + * ShrapnelDSP is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free + * Software Foundation, either version 3 of the License, or (at your option) + * any later version. + * + * ShrapnelDSP is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * ShrapnelDSP. If not, see . + */ + +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'parameter_message.freezed.dart'; + +@freezed +sealed class ParameterServiceOutputMessage + with _$ParameterServiceOutputMessage { + factory ParameterServiceOutputMessage.requestInitialisation() = + ParameterServiceOutputMessageRequestInitialisation; + + factory ParameterServiceOutputMessage.parameterUpdate({ + required String id, + required double value, + }) = ParameterServiceOutputMessageParameterUpdate; +} + +@freezed +sealed class ParameterServiceInputMessage with _$ParameterServiceInputMessage { + factory ParameterServiceInputMessage.parameterUpdate({ + required String id, + required double value, + }) = ParameterServiceInputMessageParameterUpdate; +} diff --git a/dart/shrapnel_common/lib/api_data/presets_message.dart b/dart/shrapnel_common/lib/api_data/presets_message.dart new file mode 100644 index 00000000..4ab8ecf5 --- /dev/null +++ b/dart/shrapnel_common/lib/api_data/presets_message.dart @@ -0,0 +1,71 @@ +/* + * Copyright 2022 Barabas Raffai + * + * This file is part of ShrapnelDSP. + * + * ShrapnelDSP is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free + * Software Foundation, either version 3 of the License, or (at your option) + * any later version. + * + * ShrapnelDSP is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * ShrapnelDSP. If not, see . + */ + +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'presets_message.freezed.dart'; + +@freezed +class PresetParametersData with _$PresetParametersData { + factory PresetParametersData({ + required double ampGain, + required double ampChannel, + required double bass, + required double middle, + required double treble, + required double contour, + required double volume, + required double noiseGateThreshold, + required double noiseGateHysteresis, + required double noiseGateAttack, + required double noiseGateHold, + required double noiseGateRelease, + required double noiseGateBypass, + required double chorusRate, + required double chorusDepth, + required double chorusMix, + required double chorusBypass, + required double wahPosition, + required double wahVocal, + required double wahBypass, + }) = _PresetParametersData; +} + +@freezed +sealed class PresetsMessage with _$PresetsMessage { + factory PresetsMessage.initialise() = PresetsMessageInitialise; + + factory PresetsMessage.notify(int id, PresetData preset) = + PresetsMessageNotify; + + factory PresetsMessage.create(PresetData preset) = PresetsMessageCreate; + + factory PresetsMessage.update(int id, PresetData preset) = + PresetsMessageUpdate; + + factory PresetsMessage.delete(int id) = PresetsMessageDelete; +} + +@freezed +class PresetData with _$PresetData { + factory PresetData({ + required String name, + required PresetParametersData parameters, + }) = _PresetData; +} diff --git a/frontend/lib/api/proto_extension.dart b/dart/shrapnel_common/lib/api_data/proto_extension.dart similarity index 98% rename from frontend/lib/api/proto_extension.dart rename to dart/shrapnel_common/lib/api_data/proto_extension.dart index 333a6a19..40bae170 100644 --- a/frontend/lib/api/proto_extension.dart +++ b/dart/shrapnel_common/lib/api_data/proto_extension.dart @@ -17,18 +17,18 @@ * ShrapnelDSP. If not, see . */ -import '../audio_events.dart'; -import '../midi_mapping/model/models.dart'; -import '../parameter.dart'; -import '../presets/model/presets_client.dart'; -import '../presets/model/selected_preset_client.dart'; -import 'api_websocket.dart'; +import 'api_message.dart'; +import 'audio_event_message.dart'; import 'generated/audio_events.pb.dart' as audio_events_pb; import 'generated/cmd_handling.pb.dart' as cmd_handling_pb; import 'generated/midi_mapping.pb.dart' as midi_mapping_pb; import 'generated/presets.pb.dart' as presets_pb; import 'generated/selected_preset.pb.dart' as selected_preset_pb; import 'generated/shrapnel.pb.dart' as shrapnel_pb; +import 'midi_api_message.dart'; +import 'parameter_message.dart'; +import 'presets_message.dart'; +import 'selected_preset_data.dart'; class ProtoException implements Exception {} diff --git a/dart/shrapnel_common/lib/api_data/selected_preset_data.dart b/dart/shrapnel_common/lib/api_data/selected_preset_data.dart new file mode 100644 index 00000000..838c754d --- /dev/null +++ b/dart/shrapnel_common/lib/api_data/selected_preset_data.dart @@ -0,0 +1,33 @@ +/* + * Copyright 2022 Barabas Raffai + * + * This file is part of ShrapnelDSP. + * + * ShrapnelDSP is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free + * Software Foundation, either version 3 of the License, or (at your option) + * any later version. + * + * ShrapnelDSP is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * ShrapnelDSP. If not, see . + */ + +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'selected_preset_data.freezed.dart'; + +@freezed +sealed class SelectedPresetMessage with _$SelectedPresetMessage { + factory SelectedPresetMessage.read() = ReadSelectedPresetMessage; + + factory SelectedPresetMessage.notify({required int selectedPreset}) = + NotifySelectedPresetMessage; + + factory SelectedPresetMessage.write({required int selectedPreset}) = + WriteSelectedPresetMessage; +} diff --git a/dart/shrapnel_common/lib/shrapnel_common.dart b/dart/shrapnel_common/lib/shrapnel_common.dart new file mode 100644 index 00000000..e5dcf0ae --- /dev/null +++ b/dart/shrapnel_common/lib/shrapnel_common.dart @@ -0,0 +1,20 @@ +/* + * Copyright 2022 Barabas Raffai + * + * This file is part of ShrapnelDSP. + * + * ShrapnelDSP is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free + * Software Foundation, either version 3 of the License, or (at your option) + * any later version. + * + * ShrapnelDSP is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * ShrapnelDSP. If not, see . + */ + +export 'src/shrapnel_common_base.dart'; diff --git a/dart/shrapnel_common/lib/src/shrapnel_common_base.dart b/dart/shrapnel_common/lib/src/shrapnel_common_base.dart new file mode 100644 index 00000000..128ec61d --- /dev/null +++ b/dart/shrapnel_common/lib/src/shrapnel_common_base.dart @@ -0,0 +1,72 @@ +/* + * Copyright 2022 Barabas Raffai + * + * This file is part of ShrapnelDSP. + * + * ShrapnelDSP is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free + * Software Foundation, either version 3 of the License, or (at your option) + * any later version. + * + * ShrapnelDSP is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * ShrapnelDSP. If not, see . + */ + +import 'dart:async'; + +import 'package:esp_softap_provisioning/esp_softap_provisioning.dart'; +// ignore: implementation_imports +import 'package:esp_softap_provisioning/src/connection_models.dart'; +import 'package:logging/logging.dart'; + +final _log = Logger('shrapnel.common'); + +extension StatusPollEx on Provisioning { + Future pollStatus(Duration timeout) async { + var keepGoing = true; + final timer = Timer(timeout, () { + _log.warning('Connection to provisioned access point timed out'); + keepGoing = false; + }); + ConnectionStatus? status; + + while (keepGoing) { + status = await getStatus(); + + if (status.isTerminal()) { + timer.cancel(); + return status; + } + await Future.delayed(const Duration(seconds: 1)); + } + + return status; + } +} + +extension ShrapnelAdditions on ConnectionStatus? { + bool isTerminal() { + if (this == null) { + return true; + } + + final state = this!.state; + + return state == WifiConnectionState.Connected || + state == WifiConnectionState.Disconnected || + state == WifiConnectionState.ConnectionFailed; + } + + bool isSuccess() { + if (this == null) { + return false; + } + + return this!.state == WifiConnectionState.Connected; + } +} diff --git a/dart/shrapnel_common/pubspec.yaml b/dart/shrapnel_common/pubspec.yaml new file mode 100644 index 00000000..2209c902 --- /dev/null +++ b/dart/shrapnel_common/pubspec.yaml @@ -0,0 +1,21 @@ +name: shrapnel_common +description: A starting point for Dart libraries or applications. +version: 1.0.0 +publish_to: 'none' + +environment: + sdk: ^3.2.6 + +dependencies: + esp_softap_provisioning: + git: + url: https://github.com/ShrapnelDSP/esp_softap_provisioning.git + ref: shrapnel + freezed_annotation: ^2.4.4 + logging: ^1.2.0 + +dev_dependencies: + build_runner: ^2.4.9 + freezed: ^2.5.2 + lints: ^2.1.0 + test: ^1.24.0 diff --git a/dart/shrapnel_common/test/shrapnel_common_test.dart b/dart/shrapnel_common/test/shrapnel_common_test.dart new file mode 100644 index 00000000..ccf1b445 --- /dev/null +++ b/dart/shrapnel_common/test/shrapnel_common_test.dart @@ -0,0 +1,24 @@ +/* + * Copyright 2022 Barabas Raffai + * + * This file is part of ShrapnelDSP. + * + * ShrapnelDSP is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free + * Software Foundation, either version 3 of the License, or (at your option) + * any later version. + * + * ShrapnelDSP is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * ShrapnelDSP. If not, see . + */ + +import 'package:test/test.dart'; + +void main() { + test('dummy', () {}); +} diff --git a/dart/shrapnel_test_lib/.gitignore b/dart/shrapnel_test_lib/.gitignore new file mode 100644 index 00000000..3cceda55 --- /dev/null +++ b/dart/shrapnel_test_lib/.gitignore @@ -0,0 +1,7 @@ +# https://dart.dev/guides/libraries/private-files +# Created by `dart pub` +.dart_tool/ + +# Avoid committing pubspec.lock for library packages; see +# https://dart.dev/guides/libraries/private-files#pubspeclock. +pubspec.lock diff --git a/dart/shrapnel_test_lib/CHANGELOG.md b/dart/shrapnel_test_lib/CHANGELOG.md new file mode 100644 index 00000000..effe43c8 --- /dev/null +++ b/dart/shrapnel_test_lib/CHANGELOG.md @@ -0,0 +1,3 @@ +## 1.0.0 + +- Initial version. diff --git a/dart/shrapnel_test_lib/README.md b/dart/shrapnel_test_lib/README.md new file mode 100644 index 00000000..8b55e735 --- /dev/null +++ b/dart/shrapnel_test_lib/README.md @@ -0,0 +1,39 @@ + + +TODO: Put a short description of the package here that helps potential users +know whether this package might be useful for them. + +## Features + +TODO: List what your package can do. Maybe include images, gifs, or videos. + +## Getting started + +TODO: List prerequisites and provide or point to information on how to +start using the package. + +## Usage + +TODO: Include short and useful examples for package users. Add longer examples +to `/example` folder. + +```dart +const like = 'sample'; +``` + +## Additional information + +TODO: Tell users more about the package: where to find more information, how to +contribute to the package, how to file issues, what response they can expect +from the package authors, and more. diff --git a/dart/shrapnel_test_lib/analysis_options.yaml b/dart/shrapnel_test_lib/analysis_options.yaml new file mode 100644 index 00000000..dee8927a --- /dev/null +++ b/dart/shrapnel_test_lib/analysis_options.yaml @@ -0,0 +1,30 @@ +# This file configures the static analysis results for your project (errors, +# warnings, and lints). +# +# This enables the 'recommended' set of lints from `package:lints`. +# This set helps identify many issues that may lead to problems when running +# or consuming Dart code, and enforces writing Dart using a single, idiomatic +# style and format. +# +# If you want a smaller set of lints you can change this to specify +# 'package:lints/core.yaml'. These are just the most critical lints +# (the recommended set includes the core lints). +# The core lints are also what is used by pub.dev for scoring packages. + +include: package:lints/recommended.yaml + +# Uncomment the following section to specify additional rules. + +# linter: +# rules: +# - camel_case_types + +# analyzer: +# exclude: +# - path/to/excluded/files/** + +# For more information about the core and recommended set of lints, see +# https://dart.dev/go/core-lints + +# For additional information about configuring this file, see +# https://dart.dev/guides/language/analysis-options diff --git a/dart/shrapnel_test_lib/lib/shrapnel_test_lib.dart b/dart/shrapnel_test_lib/lib/shrapnel_test_lib.dart new file mode 100644 index 00000000..0bf388f6 --- /dev/null +++ b/dart/shrapnel_test_lib/lib/shrapnel_test_lib.dart @@ -0,0 +1,23 @@ +/* + * Copyright 2022 Barabas Raffai + * + * This file is part of ShrapnelDSP. + * + * ShrapnelDSP is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free + * Software Foundation, either version 3 of the License, or (at your option) + * any later version. + * + * ShrapnelDSP is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * ShrapnelDSP. If not, see . + */ + +/// Testing utilities. +library; + +export 'src/shrapnel_test_lib_base.dart'; diff --git a/frontend/test/firmware_api_test/util.dart b/dart/shrapnel_test_lib/lib/src/shrapnel_test_lib_base.dart similarity index 92% rename from frontend/test/firmware_api_test/util.dart rename to dart/shrapnel_test_lib/lib/src/shrapnel_test_lib_base.dart index 7f8c7833..eac0b116 100644 --- a/frontend/test/firmware_api_test/util.dart +++ b/dart/shrapnel_test_lib/lib/src/shrapnel_test_lib_base.dart @@ -22,12 +22,12 @@ import 'dart:convert'; import 'dart:io'; import 'package:esp_softap_provisioning/esp_softap_provisioning.dart'; -import 'package:flutter_libserialport/flutter_libserialport.dart'; +import 'package:libserialport/libserialport.dart'; import 'package:logging/logging.dart'; import 'package:path/path.dart' as p; -import 'package:shrapnel/api/proto_extension.dart'; -import 'package:shrapnel/midi_mapping/model/models.dart'; -import 'package:shrapnel/wifi_provisioning.dart'; +import 'package:shrapnel_common/api_data/midi_api_message.dart'; +import 'package:shrapnel_common/api_data/proto_extension.dart'; +import 'package:shrapnel_common/shrapnel_common.dart'; typedef MacAddress = List; @@ -266,6 +266,28 @@ Future nvsLoad(String binaryPath, {required String port}) async { _log.info(result.stdout); } +Future nvsSave(String binaryPath, {required String port}) async { + _log.info('Saving NVS partition'); + + // pip can be used to install esptool into the global environment: + // https://docs.espressif.com/projects/esptool/en/latest/esp32/#quick-start + const command = 'esptool.py'; + final args = '-p $port ' + '-b 2000000 ' + '--before default_reset --after hard_reset ' + '--chip esp32 ' + 'read_flash ' + '0x9000 0x6000 $binaryPath' + .split(' '); + + final result = await Process.run(command, args); + + _log.info(result.exitCode); + _log.info(result.pid); + _log.info(result.stderr); + _log.info(result.stdout); +} + /// UART driver class ShrapnelUart { ShrapnelUart._(this.port, this.reader) { diff --git a/dart/shrapnel_test_lib/pubspec.yaml b/dart/shrapnel_test_lib/pubspec.yaml new file mode 100644 index 00000000..1cb072f5 --- /dev/null +++ b/dart/shrapnel_test_lib/pubspec.yaml @@ -0,0 +1,23 @@ +name: shrapnel_test_lib +description: A starting point for Dart libraries or applications. +version: 1.0.0 + +publish_to: 'none' + +environment: + sdk: ^3.2.6 + +dependencies: + esp_softap_provisioning: + git: + url: https://github.com/ShrapnelDSP/esp_softap_provisioning.git + ref: shrapnel + libserialport: ^0.3.0 + logging: ^1.2.0 + path: ^1.8.0 + shrapnel_common: + path: ../shrapnel_common + +dev_dependencies: + lints: ^2.1.0 + test: ^1.24.0 diff --git a/frontend/test/firmware_api_test/util_test.dart b/dart/shrapnel_test_lib/test/shrapnel_test_lib_test.dart similarity index 93% rename from frontend/test/firmware_api_test/util_test.dart rename to dart/shrapnel_test_lib/test/shrapnel_test_lib_test.dart index bede4aae..ef8b2458 100644 --- a/frontend/test/firmware_api_test/util_test.dart +++ b/dart/shrapnel_test_lib/test/shrapnel_test_lib_test.dart @@ -19,9 +19,8 @@ // ignore_for_file: unnecessary_raw_strings -import 'package:flutter_test/flutter_test.dart'; - -import 'util.dart'; +import 'package:shrapnel_test_lib/shrapnel_test_lib.dart'; +import 'package:test/test.dart'; void main() { test('escape spaces', () { diff --git a/dart/shrapnel_test_tool/.gitignore b/dart/shrapnel_test_tool/.gitignore new file mode 100644 index 00000000..b56e2838 --- /dev/null +++ b/dart/shrapnel_test_tool/.gitignore @@ -0,0 +1,7 @@ +# https://dart.dev/guides/libraries/private-files +# Created by `dart pub` +.dart_tool/ + +*.g.dart +*.mocks.dart +*.freezed.dart diff --git a/dart/shrapnel_test_tool/CHANGELOG.md b/dart/shrapnel_test_tool/CHANGELOG.md new file mode 100644 index 00000000..effe43c8 --- /dev/null +++ b/dart/shrapnel_test_tool/CHANGELOG.md @@ -0,0 +1,3 @@ +## 1.0.0 + +- Initial version. diff --git a/dart/shrapnel_test_tool/README.md b/dart/shrapnel_test_tool/README.md new file mode 100644 index 00000000..3816eca3 --- /dev/null +++ b/dart/shrapnel_test_tool/README.md @@ -0,0 +1,2 @@ +A sample command-line application with an entrypoint in `bin/`, library code +in `lib/`, and example unit test in `test/`. diff --git a/dart/shrapnel_test_tool/analysis_options.yaml b/dart/shrapnel_test_tool/analysis_options.yaml new file mode 100644 index 00000000..dee8927a --- /dev/null +++ b/dart/shrapnel_test_tool/analysis_options.yaml @@ -0,0 +1,30 @@ +# This file configures the static analysis results for your project (errors, +# warnings, and lints). +# +# This enables the 'recommended' set of lints from `package:lints`. +# This set helps identify many issues that may lead to problems when running +# or consuming Dart code, and enforces writing Dart using a single, idiomatic +# style and format. +# +# If you want a smaller set of lints you can change this to specify +# 'package:lints/core.yaml'. These are just the most critical lints +# (the recommended set includes the core lints). +# The core lints are also what is used by pub.dev for scoring packages. + +include: package:lints/recommended.yaml + +# Uncomment the following section to specify additional rules. + +# linter: +# rules: +# - camel_case_types + +# analyzer: +# exclude: +# - path/to/excluded/files/** + +# For more information about the core and recommended set of lints, see +# https://dart.dev/go/core-lints + +# For additional information about configuring this file, see +# https://dart.dev/guides/language/analysis-options diff --git a/dart/shrapnel_test_tool/bin/shrapnel_test_tool.dart b/dart/shrapnel_test_tool/bin/shrapnel_test_tool.dart new file mode 100644 index 00000000..e88c5dba --- /dev/null +++ b/dart/shrapnel_test_tool/bin/shrapnel_test_tool.dart @@ -0,0 +1,25 @@ +/* + * Copyright 2022 Barabas Raffai + * + * This file is part of ShrapnelDSP. + * + * ShrapnelDSP is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free + * Software Foundation, either version 3 of the License, or (at your option) + * any later version. + * + * ShrapnelDSP is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * ShrapnelDSP. If not, see . + */ + +import 'package:shrapnel_test_tool/shrapnel_test_tool.dart' + as shrapnel_test_tool; + +void main(List arguments) { + shrapnel_test_tool.main(arguments); +} diff --git a/dart/shrapnel_test_tool/lib/shrapnel_test_tool.dart b/dart/shrapnel_test_tool/lib/shrapnel_test_tool.dart new file mode 100644 index 00000000..3c257194 --- /dev/null +++ b/dart/shrapnel_test_tool/lib/shrapnel_test_tool.dart @@ -0,0 +1,33 @@ +/* + * Copyright 2022 Barabas Raffai + * + * This file is part of ShrapnelDSP. + * + * ShrapnelDSP is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free + * Software Foundation, either version 3 of the License, or (at your option) + * any later version. + * + * ShrapnelDSP is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * ShrapnelDSP. If not, see . + */ + +import 'package:logging/logging.dart'; +import 'package:shrapnel_test_lib/shrapnel_test_lib.dart'; + +final _log = Logger('shrapnel.test_tool'); + +void main(List arguments) { + hierarchicalLoggingEnabled = true; + Logger.root.onRecord.listen(print); + + _log.info('hello $arguments'); + nvsSave('nvs_${DateTime.now().toIso8601String()}.bin', port: '/dev/ttyUSB0'); + + // TODO Add command to reload from file +} diff --git a/dart/shrapnel_test_tool/pubspec.lock b/dart/shrapnel_test_tool/pubspec.lock new file mode 100644 index 00000000..c70511cb --- /dev/null +++ b/dart/shrapnel_test_tool/pubspec.lock @@ -0,0 +1,500 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: eb376e9acf6938204f90eb3b1f00b578640d3188b4c8a8ec054f9f479af8d051 + url: "https://pub.dev" + source: hosted + version: "64.0.0" + analyzer: + dependency: transitive + description: + name: analyzer + sha256: "69f54f967773f6c26c7dcb13e93d7ccee8b17a641689da39e878d5cf13b06893" + url: "https://pub.dev" + source: hosted + version: "6.2.0" + args: + dependency: transitive + description: + name: args + sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a" + url: "https://pub.dev" + source: hosted + version: "2.5.0" + async: + dependency: transitive + description: + name: async + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" + source: hosted + version: "2.11.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + collection: + dependency: transitive + description: + name: collection + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + url: "https://pub.dev" + source: hosted + version: "1.18.0" + convert: + dependency: transitive + description: + name: convert + sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + url: "https://pub.dev" + source: hosted + version: "3.1.1" + coverage: + dependency: transitive + description: + name: coverage + sha256: "3945034e86ea203af7a056d98e98e42a5518fff200d6e8e6647e1886b07e936e" + url: "https://pub.dev" + source: hosted + version: "1.8.0" + crypto: + dependency: transitive + description: + name: crypto + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + url: "https://pub.dev" + source: hosted + version: "3.0.3" + cryptography: + dependency: transitive + description: + name: cryptography + sha256: d146b76d33d94548cf035233fbc2f4338c1242fa119013bead807d033fc4ae05 + url: "https://pub.dev" + source: hosted + version: "2.7.0" + dylib: + dependency: transitive + description: + name: dylib + sha256: bf609b3eb6492a3309b3d1dbe8f83a4031de5535dd7686be33487051cc760bb0 + url: "https://pub.dev" + source: hosted + version: "0.3.3" + esp_softap_provisioning: + dependency: transitive + description: + path: "." + ref: shrapnel + resolved-ref: "8ea4d4b87d31f19a6a14d10193df2b8d44204cf2" + url: "https://github.com/ShrapnelDSP/esp_softap_provisioning.git" + source: git + version: "1.0.1" + ffi: + dependency: transitive + description: + name: ffi + sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + file: + dependency: transitive + description: + name: file + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + url: "https://pub.dev" + source: hosted + version: "7.0.0" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + freezed_annotation: + dependency: transitive + description: + name: freezed_annotation + sha256: c2e2d632dd9b8a2b7751117abcfc2b4888ecfe181bd9fca7170d9ef02e595fe2 + url: "https://pub.dev" + source: hosted + version: "2.4.4" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694 + url: "https://pub.dev" + source: hosted + version: "4.0.0" + glob: + dependency: transitive + description: + name: glob + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + http: + dependency: transitive + description: + name: http + sha256: a2bbf9d017fcced29139daa8ed2bba4ece450ab222871df93ca9eec6f80c34ba + url: "https://pub.dev" + source: hosted + version: "1.2.0" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" + url: "https://pub.dev" + source: hosted + version: "3.2.1" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" + source: hosted + version: "4.0.2" + io: + dependency: transitive + description: + name: io + sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" + url: "https://pub.dev" + source: hosted + version: "1.0.4" + js: + dependency: transitive + description: + name: js + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" + source: hosted + version: "0.6.7" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" + url: "https://pub.dev" + source: hosted + version: "4.9.0" + libserialport: + dependency: transitive + description: + name: libserialport + sha256: "392e1592def65282429832ec66fa25e9e163d3b37716b97691482e2406720727" + url: "https://pub.dev" + source: hosted + version: "0.3.0+1" + lints: + dependency: "direct dev" + description: + name: lints + sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + logger: + dependency: transitive + description: + name: logger + sha256: "697d067c60c20999686a0add96cf6aba723b3aa1f83ecf806a8097231529ec32" + url: "https://pub.dev" + source: hosted + version: "2.4.0" + logging: + dependency: "direct main" + description: + name: logging + sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + matcher: + dependency: transitive + description: + name: matcher + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + url: "https://pub.dev" + source: hosted + version: "0.12.16+1" + meta: + dependency: transitive + description: + name: meta + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e + url: "https://pub.dev" + source: hosted + version: "1.10.0" + mime: + dependency: transitive + description: + name: mime + sha256: "2e123074287cc9fd6c09de8336dae606d1ddb88d9ac47358826db698c176a1f2" + url: "https://pub.dev" + source: hosted + version: "1.0.5" + node_preamble: + dependency: transitive + description: + name: node_preamble + sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db" + url: "https://pub.dev" + source: hosted + version: "2.0.2" + package_config: + dependency: transitive + description: + name: package_config + sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + path: + dependency: transitive + description: + name: path + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + url: "https://pub.dev" + source: hosted + version: "1.9.0" + platform: + dependency: transitive + description: + name: platform + sha256: "9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65" + url: "https://pub.dev" + source: hosted + version: "3.1.5" + pool: + dependency: transitive + description: + name: pool + sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + url: "https://pub.dev" + source: hosted + version: "1.5.1" + protobuf: + dependency: transitive + description: + name: protobuf + sha256: "68645b24e0716782e58948f8467fd42a880f255096a821f9e7d0ec625b00c84d" + url: "https://pub.dev" + source: hosted + version: "3.1.0" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + shelf: + dependency: transitive + description: + name: shelf + sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 + url: "https://pub.dev" + source: hosted + version: "1.4.1" + shelf_packages_handler: + dependency: transitive + description: + name: shelf_packages_handler + sha256: "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e" + url: "https://pub.dev" + source: hosted + version: "3.0.2" + shelf_static: + dependency: transitive + description: + name: shelf_static + sha256: a41d3f53c4adf0f57480578c1d61d90342cd617de7fc8077b1304643c2d85c1e + url: "https://pub.dev" + source: hosted + version: "1.1.2" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" + url: "https://pub.dev" + source: hosted + version: "1.0.4" + shrapnel_common: + dependency: "direct overridden" + description: + path: "../shrapnel_common" + relative: true + source: path + version: "1.0.0" + shrapnel_test_lib: + dependency: "direct main" + description: + path: "../shrapnel_test_lib" + relative: true + source: path + version: "1.0.0" + source_map_stack_trace: + dependency: transitive + description: + name: source_map_stack_trace + sha256: "84cf769ad83aa6bb61e0aa5a18e53aea683395f196a6f39c4c881fb90ed4f7ae" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + source_maps: + dependency: transitive + description: + name: source_maps + sha256: "708b3f6b97248e5781f493b765c3337db11c5d2c81c3094f10904bfa8004c703" + url: "https://pub.dev" + source: hosted + version: "0.10.12" + source_span: + dependency: transitive + description: + name: source_span + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" + source: hosted + version: "1.10.0" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + url: "https://pub.dev" + source: hosted + version: "1.11.1" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.dev" + source: hosted + version: "2.1.2" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + string_validator: + dependency: transitive + description: + name: string_validator + sha256: a278d038104aa2df15d0e09c47cb39a49f907260732067d0034dc2f2e4e2ac94 + url: "https://pub.dev" + source: hosted + version: "1.1.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + test: + dependency: "direct dev" + description: + name: test + sha256: "7ee446762c2c50b3bd4ea96fe13ffac69919352bd3b4b17bac3f3465edc58073" + url: "https://pub.dev" + source: hosted + version: "1.25.2" + test_api: + dependency: transitive + description: + name: test_api + sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" + url: "https://pub.dev" + source: hosted + version: "0.7.0" + test_core: + dependency: transitive + description: + name: test_core + sha256: "2bc4b4ecddd75309300d8096f781c0e3280ca1ef85beda558d33fcbedc2eead4" + url: "https://pub.dev" + source: hosted + version: "0.6.0" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" + source: hosted + version: "1.3.2" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: a2662fb1f114f4296cf3f5a50786a2d888268d7776cf681aa17d660ffa23b246 + url: "https://pub.dev" + source: hosted + version: "14.0.0" + watcher: + dependency: transitive + description: + name: watcher + sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + web: + dependency: transitive + description: + name: web + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 + url: "https://pub.dev" + source: hosted + version: "0.3.0" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b + url: "https://pub.dev" + source: hosted + version: "2.4.0" + webkit_inspection_protocol: + dependency: transitive + description: + name: webkit_inspection_protocol + sha256: "87d3f2333bb240704cd3f1c6b5b7acd8a10e7f0bc28c28dcf14e782014f4a572" + url: "https://pub.dev" + source: hosted + version: "1.2.1" + yaml: + dependency: transitive + description: + name: yaml + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + url: "https://pub.dev" + source: hosted + version: "3.1.2" +sdks: + dart: ">=3.2.6 <4.0.0" diff --git a/dart/shrapnel_test_tool/pubspec.yaml b/dart/shrapnel_test_tool/pubspec.yaml new file mode 100644 index 00000000..86c532a3 --- /dev/null +++ b/dart/shrapnel_test_tool/pubspec.yaml @@ -0,0 +1,17 @@ +name: shrapnel_test_tool +description: A sample command-line application. +version: 1.0.0 + +publish_to: 'none' + +environment: + sdk: ^3.2.6 + +dependencies: + logging: ^1.2.0 + shrapnel_test_lib: + path: ../shrapnel_test_lib + +dev_dependencies: + lints: ^2.1.0 + test: ^1.24.0 diff --git a/dart/shrapnel_test_tool/test/shrapnel_test_tool_test.dart b/dart/shrapnel_test_tool/test/shrapnel_test_tool_test.dart new file mode 100644 index 00000000..ccf1b445 --- /dev/null +++ b/dart/shrapnel_test_tool/test/shrapnel_test_tool_test.dart @@ -0,0 +1,24 @@ +/* + * Copyright 2022 Barabas Raffai + * + * This file is part of ShrapnelDSP. + * + * ShrapnelDSP is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free + * Software Foundation, either version 3 of the License, or (at your option) + * any later version. + * + * ShrapnelDSP is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * ShrapnelDSP. If not, see . + */ + +import 'package:test/test.dart'; + +void main() { + test('dummy', () {}); +} diff --git a/frontend/linux/flutter/generated_plugin_registrant.cc b/frontend/linux/flutter/generated_plugin_registrant.cc deleted file mode 100644 index 103991d0..00000000 --- a/frontend/linux/flutter/generated_plugin_registrant.cc +++ /dev/null @@ -1,15 +0,0 @@ -// -// Generated file. Do not edit. -// - -// clang-format off - -#include "generated_plugin_registrant.h" - -#include - -void fl_register_plugins(FlPluginRegistry* registry) { - g_autoptr(FlPluginRegistrar) flutter_libserialport_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterLibserialportPlugin"); - flutter_libserialport_plugin_register_with_registrar(flutter_libserialport_registrar); -}